{"openapi":"3.0.3","info":{"title":"BizKitHub API","description":"Public HTTP surface of the BizKitHub platform. This document combines **two independent surfaces** — read the distinction below carefully before integrating.\n\n## Two surfaces\n\n### `/api/v1/*` — Public API\nVersioned endpoints intended for **calls from public websites, marketing pages, partner integrations and other external clients**. Every request must carry a valid API key. Obtain and manage keys per [https://docs.bizkithub.com/en/api-key](https://docs.bizkithub.com/en/api-key).\n\n### `/bff/*` — Internal BFF (Backend-for-Frontend)\nEndpoints intended **only for internal use** — the `admin.bizkithub.com` UI and AI agents operating on behalf of a signed-in user. Requires a valid session cookie (`brj-auth-id`) obtained by signing in through admin. External clients must not call `/bff/*`; the contract may change without notice to match admin's needs.\n\n## Authentication\n\n- **API key** — pass as a query parameter: `?apiKey=YOUR_KEY`. The key is bound to exactly one organisation; every read and write is automatically scoped to that tenant. Key management and details: [https://docs.bizkithub.com/en/api-key](https://docs.bizkithub.com/en/api-key).\n- **Session cookie** — `brj-auth-id`, issued by admin sign-in. Identifies both the user and (via the currently-selected organisation) the tenant.\n\n## Multi-tenancy\n\nEvery authenticated request is scoped to a single organisation, derived from the credential (API key → its owning organisation; session cookie → the user's currently-selected organisation). You do **not** pass an `organisation_id` — results are automatically filtered and writes are automatically attributed. There is no way to read or write another tenant's data from a single credential.\n\n## Identifiers\n\nWire-level identifiers are 16-character opaque strings (`external_id`). Internal numeric primary keys are never exposed and must not be inferred. Treat every id as an opaque string.\n\n## Date and time\n\nAll timestamps are ISO 8601 in UTC (e.g. `2026-08-03T12:00:00.000Z`). Send them the same way on input.\n\n## Full documentation\n\nHuman-readable reference, guides and integration walkthroughs: [https://docs.bizkithub.com/](https://docs.bizkithub.com/).\n\n## Snapshot\n\n- **Generated at:** `2026-12-04T13:03:37.472Z`\n- **Valid until:** `2026-12-11T00:00:00.000Z` — after this date the document may be out of date; re-fetch from `/swagger`.\n\nFor questions or partnership inquiries: info@bizkithub.com.","version":"1.0.0","contact":{"name":"Jan Barášek","url":"https://bizkithub.com","email":"info@bizkithub.com"}},"servers":[{"url":"https://api.bizkithub.com","description":"Production"}],"externalDocs":{"description":"Full BizKitHub documentation","url":"https://docs.bizkithub.com/"},"tags":[{"name":"external","description":"Public API endpoints under /api/v1/*. Versioned, API key required (see https://docs.bizkithub.com/en/api-key). Intended for public websites and external clients."},{"name":"cron-run","description":"Cron monitor: report runs of your scheduled jobs (start → log / heartbeat → finish, or one `record` call for short runs) and watch them in admin → System → Cron. Missing finishes become `timeout`, missing starts of jobs with a `schedule` raise a missed-run alert. Own hourly quota per API key (`X-RateLimit-*` headers); a key with the `public.cron-run` scope is limited to these endpoints. Send your own `User-Agent` (e.g. `acme-cron/1.4`): default library agents such as `Python-urllib/*` can be blocked by the edge firewall with a plain-text 403."},{"name":"bff","description":"Internal Backend-for-Frontend endpoints under /bff/*. Requires a valid brj-auth-id session cookie from admin.bizkithub.com. Intended for the admin UI and AI agents operating on behalf of a signed-in user. Contract may change without notice — do not call from external clients."}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"query","name":"apiKey","description":"Public API key passed as a query parameter (?apiKey=…). Bound to one organisation; every read and write is scoped to that tenant. Manage keys at https://docs.bizkithub.com/en/api-key."},"sessionCookie":{"type":"apiKey","in":"cookie","name":"brj-auth-id","description":"Session cookie issued by admin.bizkithub.com sign-in. Required for all /bff/* endpoints. Identifies the user and the currently-selected organisation."}},"schemas":{}},"paths":{"/api/v1/address/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true}],"responses":{"200":{"description":"List of customer addresses.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of address objects.","type":"array","items":{"type":"object","allOf":[{"type":"object","required":["id"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}},{"type":"object","required":["defaultAddress"],"properties":{"defaultAddress":{"description":"True if this is the default address for the contact.","type":"boolean"}}}]}},"itemCount":{"description":"Total number of addresses.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of address objects.","type":"array","items":{"type":"object","allOf":[{"type":"object","required":["id"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}},{"type":"object","required":["defaultAddress"],"properties":{"defaultAddress":{"description":"True if this is the default address for the contact.","type":"boolean"}}}]}},"itemCount":{"description":"Total number of addresses.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of address objects.","type":"array","items":{"type":"object","allOf":[{"type":"object","required":["id"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}},{"type":"object","required":["defaultAddress"],"properties":{"defaultAddress":{"description":"True if this is the default address for the contact.","type":"boolean"}}}]}},"itemCount":{"description":"Total number of addresses.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getApiV1AddressList","tags":["Address"],"summary":"List customer addresses","description":"Returns all addresses associated with a specific contact/customer. Each address includes type (delivery/billing/contact), personal/company details, and geographic information. The default address for the contact is marked with defaultAddress: true."}},"/api/v1/address/create":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}},"required":["id"]}}}}},"operationId":"postApiV1AddressCreate","tags":["Address"],"summary":"Create new address","description":"Creates a new address for the specified contact. Address is automatically validated and normalized (street names, postal codes, etc.). If country is not provided, it defaults to the organisation default country. Returns the created address object with the generated ID.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}}}}}}},"/api/v1/address/update":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ, similar in other countries).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}},"required":["id"]}}}}},"operationId":"postApiV1AddressUpdate","tags":["Address"],"summary":"Update existing address","description":"Updates an existing address identified by ID. Only provided fields will be updated, omitted fields remain unchanged. Address is automatically validated and normalized. Requires identityId to verify the address belongs to the contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityId","id"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityId","id"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityId","id"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Address external identifier (core__address.external_id).","type":"string"},"type":{"examples":["delivery","billing","contact"],"description":"Address type code. Common values: delivery, billing, contact, invoice.","type":"string"},"firstName":{"description":"First name of the person.","type":"string"},"lastName":{"description":"Last name of the person.","type":"string"},"companyName":{"description":"Company name (for business addresses).","type":"string"},"streetAddress":{"description":"Street name and house number.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"city":{"description":"City name.","type":"string"},"cityPart":{"description":"City district or part.","type":"string"},"stateRegion":{"description":"State or region name.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO in CZ).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ in CZ, VAT ID in EU).","type":"string"},"notice":{"description":"Additional notes or delivery instructions.","type":"string"}}}}}}}},"/api/v1/address/load-address-by-company-registration-number":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":false},{"description":"Company registration number (IČO in CZ, similar in other countries).","examples":["12345678"],"schema":{"type":"string"},"in":"query","name":"companyRegistrationNumber","required":true},{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ","SK","US"],"schema":{"type":"string"},"in":"query","name":"country","required":false}],"responses":{"200":{"anyOf":[{"type":"object","properties":{"companyName":{"description":"Registered company name.","type":"string"},"streetAddress":{"description":"Registered street address.","type":"string"},"city":{"description":"Registered city.","type":"string"},"postalCode":{"description":"Registered postal code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number.","type":"string"}}},{"type":"object","required":["error"],"properties":{"error":{"description":"Error message if company was not found or registry unavailable.","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"companyName":{"description":"Registered company name.","type":"string"},"streetAddress":{"description":"Registered street address.","type":"string"},"city":{"description":"Registered city.","type":"string"},"postalCode":{"description":"Registered postal code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number.","type":"string"}}},{"type":"object","required":["error"],"properties":{"error":{"description":"Error message if company was not found or registry unavailable.","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","properties":{"companyName":{"description":"Registered company name.","type":"string"},"streetAddress":{"description":"Registered street address.","type":"string"},"city":{"description":"Registered city.","type":"string"},"postalCode":{"description":"Registered postal code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number.","type":"string"}}},{"type":"object","required":["error"],"properties":{"error":{"description":"Error message if company was not found or registry unavailable.","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","properties":{"companyName":{"description":"Registered company name.","type":"string"},"streetAddress":{"description":"Registered street address.","type":"string"},"city":{"description":"Registered city.","type":"string"},"postalCode":{"description":"Registered postal code.","type":"string"},"country":{"examples":["CZ","SK","US"],"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number.","type":"string"}}},{"type":"object","required":["error"],"properties":{"error":{"description":"Error message if company was not found or registry unavailable.","type":"string"}}}]}}}}},"operationId":"getApiV1AddressLoad-address-by-company-registration-number","tags":["Address"],"summary":"Load address from business registry","description":"Fetches company details from official business registries based on company registration number. Returns company name, address, tax ID, and other registered information. Supports multiple countries (CZ, SK, and others). apiKey is optional for public access, but rate-limited."}},"/api/v1/backup/install":{"post":{"parameters":[],"operationId":"backupInstall","tags":["backup"],"summary":"One-command machine setup (installer)","description":"Used by the command shown in the administration: `curl -sSL https://api.bizkithub.com/api/v1/backup/install -d token=… -d host=\"$(hostname)\" | sudo bash`. Checks the one-time token (valid 24 h) without using it up and returns a bash installer. The installer first checks the machine (tools, database login, Docker daemon, path), then exchanges the token for a backup-only API key via `/backup/install/claim`, stores the key (root only), writes the backup job for the chosen profile, schedules it (systemd timer, cron fallback) and runs the first backup. Always answers with a shell script; an invalid token yields a script that prints the reason and exits non-zero. No API key needed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":16,"maxLength":64,"description":"One-time install token from \"Connect a new machine\" in the administration.","type":"string"},"host":{"maxLength":255,"description":"Hostname of the machine, recorded with the created API key.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":16,"maxLength":64,"description":"One-time install token from \"Connect a new machine\" in the administration.","type":"string"},"host":{"maxLength":255,"description":"Hostname of the machine, recorded with the created API key.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":16,"maxLength":64,"description":"One-time install token from \"Connect a new machine\" in the administration.","type":"string"},"host":{"maxLength":255,"description":"Hostname of the machine, recorded with the created API key.","type":"string"}}}}}},"responses":{"200":{}}}},"/api/v1/backup/install/claim":{"post":{"parameters":[],"operationId":"backupInstallClaim","tags":["backup"],"summary":"Installer step 2: exchange the install token for a backup-only API key","description":"Called by the installer after every check on the machine passed. Uses the token up (exactly once), creates a PROD API key limited to the backup service and returns it as plain text. A previous installation of the same series is replaced: its installer key is deactivated (the organisation admins are notified; it can be reactivated under API keys).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":16,"maxLength":64,"description":"One-time install token.","type":"string"},"host":{"maxLength":255,"description":"Hostname of the machine.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":16,"maxLength":64,"description":"One-time install token.","type":"string"},"host":{"maxLength":255,"description":"Hostname of the machine.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":16,"maxLength":64,"description":"One-time install token.","type":"string"},"host":{"maxLength":255,"description":"Hostname of the machine.","type":"string"}}}}}},"responses":{"200":{}}}},"/api/v1/backup/start":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"blobPath":{"description":"Storage path, e.g. `backup/2026-11/prod-db_aB3dE5fG7hJ9kL1m.sql.zst`.","type":"string"},"partSize":{"description":"Bytes per part (every part except the last).","type":"number"},"partCount":{"type":"number"},"parts":{"type":"array","items":{"type":"object","required":["partNumber","url"],"properties":{"partNumber":{"description":"1-based part number.","type":"number"},"url":{"description":"Presigned URL. Upload the part bytes with a plain HTTP `PUT` (no extra headers) and keep the `ETag` response header.","type":"string"}}}},"urlExpiresAt":{"type":"string"}},"required":["id","filename","blobPath","partSize","partCount","parts","urlExpiresAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"blobPath":{"description":"Storage path, e.g. `backup/2026-11/prod-db_aB3dE5fG7hJ9kL1m.sql.zst`.","type":"string"},"partSize":{"description":"Bytes per part (every part except the last).","type":"number"},"partCount":{"type":"number"},"parts":{"type":"array","items":{"type":"object","required":["partNumber","url"],"properties":{"partNumber":{"description":"1-based part number.","type":"number"},"url":{"description":"Presigned URL. Upload the part bytes with a plain HTTP `PUT` (no extra headers) and keep the `ETag` response header.","type":"string"}}}},"urlExpiresAt":{"type":"string"}},"required":["id","filename","blobPath","partSize","partCount","parts","urlExpiresAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"blobPath":{"description":"Storage path, e.g. `backup/2026-11/prod-db_aB3dE5fG7hJ9kL1m.sql.zst`.","type":"string"},"partSize":{"description":"Bytes per part (every part except the last).","type":"number"},"partCount":{"type":"number"},"parts":{"type":"array","items":{"type":"object","required":["partNumber","url"],"properties":{"partNumber":{"description":"1-based part number.","type":"number"},"url":{"description":"Presigned URL. Upload the part bytes with a plain HTTP `PUT` (no extra headers) and keep the `ETag` response header.","type":"string"}}}},"urlExpiresAt":{"type":"string"}},"required":["id","filename","blobPath","partSize","partCount","parts","urlExpiresAt"]}}}}},"operationId":"backupStart","tags":["backup"],"summary":"Start a backup upload","description":"Upload flow: (1) `POST /backup/start` with the file size → `id`, `partSize`, `partCount` and presigned part URLs; (2) `PUT` each part (bytes `(n-1)*partSize` … `n*partSize-1`, the last part is the remainder) to its URL, in parallel if you like, and keep the `ETag` response header; (3) `POST /backup/complete` with all `{ partNumber, etag }`. File bytes go straight to storage, never through the API. URLs are valid 12 hours; get fresh ones via `/backup/part-urls`.\n\nRequires the Enterprise tariff (`PUBLIC_BACKUP_TARIFF_NOT_SUPPORTED` otherwise). Returns up to 100 part URLs; request the rest via `/backup/part-urls`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","size"],"properties":{"filename":{"minLength":1,"maxLength":200,"description":"Original file name. Stored normalized with a random 16-char suffix.","examples":["prod-db-2026-11-25.sql.zst"],"type":"string"},"size":{"minimum":1,"maximum":1099511627776,"description":"Exact file size in bytes (max 1 TiB).","examples":[52428800],"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":1099511627776,"description":"Exact file size in bytes (max 1 TiB).","examples":[52428800],"type":"integer"}]},"name":{"maxLength":255,"description":"Human label shown in admin.","examples":["Nightly production DB dump"],"type":"string"},"source":{"maxLength":64,"description":"Logical stream code that groups backups of one origin.","examples":["prod-db"],"type":"string"},"period":{"maxLength":16,"description":"Month folder `YYYY-MM` (storage path `backup/{period}/…`). Defaults to the current month; an invalid value is replaced by the current month. Use it when importing historical backups.","examples":["2026-11"],"type":"string"},"contentType":{"maxLength":128,"description":"MIME type. Derived from the extension when omitted.","examples":["application/zstd"],"type":"string"},"isClientEncrypted":{"description":"The file is encrypted on the client (age, gpg, …). Informational.","type":"boolean"},"createdAt":{"description":"When the data was produced (ISO 8601), e.g. the dump start.","examples":["2026-11-25T02:00:00Z"],"type":"string"},"meta":{"description":"Free-form metadata (hostname, tool, version, database, …), max 8 KB as JSON.","examples":[{"host":"db-1","tool":"pg_dump 18"}],"type":"object","patternProperties":{"^(.*)$":{}}},"type":{"maxLength":64,"description":"Backup type within the source (`full`, `incremental`, `mysqldump`, …). Source + type form a series for monitoring.","examples":["full"],"type":"string"},"nextExpectedAt":{"description":"Monitoring (optional): when the next backup of this series (source + type) is expected, ISO 8601, in the future, max 1 year. If no newer backup starts by that time + 20 % of the interval, the organisation gets an alert e-mail. The next backup ends the watch, so send `nextExpectedAt` with every backup to keep monitoring on.","examples":["2026-11-26T02:00:00Z"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["filename","size"],"properties":{"filename":{"minLength":1,"maxLength":200,"description":"Original file name. Stored normalized with a random 16-char suffix.","examples":["prod-db-2026-11-25.sql.zst"],"type":"string"},"size":{"minimum":1,"maximum":1099511627776,"description":"Exact file size in bytes (max 1 TiB).","examples":[52428800],"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":1099511627776,"description":"Exact file size in bytes (max 1 TiB).","examples":[52428800],"type":"integer"}]},"name":{"maxLength":255,"description":"Human label shown in admin.","examples":["Nightly production DB dump"],"type":"string"},"source":{"maxLength":64,"description":"Logical stream code that groups backups of one origin.","examples":["prod-db"],"type":"string"},"period":{"maxLength":16,"description":"Month folder `YYYY-MM` (storage path `backup/{period}/…`). Defaults to the current month; an invalid value is replaced by the current month. Use it when importing historical backups.","examples":["2026-11"],"type":"string"},"contentType":{"maxLength":128,"description":"MIME type. Derived from the extension when omitted.","examples":["application/zstd"],"type":"string"},"isClientEncrypted":{"description":"The file is encrypted on the client (age, gpg, …). Informational.","type":"boolean"},"createdAt":{"description":"When the data was produced (ISO 8601), e.g. the dump start.","examples":["2026-11-25T02:00:00Z"],"type":"string"},"meta":{"description":"Free-form metadata (hostname, tool, version, database, …), max 8 KB as JSON.","examples":[{"host":"db-1","tool":"pg_dump 18"}],"type":"object","patternProperties":{"^(.*)$":{}}},"type":{"maxLength":64,"description":"Backup type within the source (`full`, `incremental`, `mysqldump`, …). Source + type form a series for monitoring.","examples":["full"],"type":"string"},"nextExpectedAt":{"description":"Monitoring (optional): when the next backup of this series (source + type) is expected, ISO 8601, in the future, max 1 year. If no newer backup starts by that time + 20 % of the interval, the organisation gets an alert e-mail. The next backup ends the watch, so send `nextExpectedAt` with every backup to keep monitoring on.","examples":["2026-11-26T02:00:00Z"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["filename","size"],"properties":{"filename":{"minLength":1,"maxLength":200,"description":"Original file name. Stored normalized with a random 16-char suffix.","examples":["prod-db-2026-11-25.sql.zst"],"type":"string"},"size":{"minimum":1,"maximum":1099511627776,"description":"Exact file size in bytes (max 1 TiB).","examples":[52428800],"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":1099511627776,"description":"Exact file size in bytes (max 1 TiB).","examples":[52428800],"type":"integer"}]},"name":{"maxLength":255,"description":"Human label shown in admin.","examples":["Nightly production DB dump"],"type":"string"},"source":{"maxLength":64,"description":"Logical stream code that groups backups of one origin.","examples":["prod-db"],"type":"string"},"period":{"maxLength":16,"description":"Month folder `YYYY-MM` (storage path `backup/{period}/…`). Defaults to the current month; an invalid value is replaced by the current month. Use it when importing historical backups.","examples":["2026-11"],"type":"string"},"contentType":{"maxLength":128,"description":"MIME type. Derived from the extension when omitted.","examples":["application/zstd"],"type":"string"},"isClientEncrypted":{"description":"The file is encrypted on the client (age, gpg, …). Informational.","type":"boolean"},"createdAt":{"description":"When the data was produced (ISO 8601), e.g. the dump start.","examples":["2026-11-25T02:00:00Z"],"type":"string"},"meta":{"description":"Free-form metadata (hostname, tool, version, database, …), max 8 KB as JSON.","examples":[{"host":"db-1","tool":"pg_dump 18"}],"type":"object","patternProperties":{"^(.*)$":{}}},"type":{"maxLength":64,"description":"Backup type within the source (`full`, `incremental`, `mysqldump`, …). Source + type form a series for monitoring.","examples":["full"],"type":"string"},"nextExpectedAt":{"description":"Monitoring (optional): when the next backup of this series (source + type) is expected, ISO 8601, in the future, max 1 year. If no newer backup starts by that time + 20 % of the interval, the organisation gets an alert e-mail. The next backup ends the watch, so send `nextExpectedAt` with every backup to keep monitoring on.","examples":["2026-11-26T02:00:00Z"],"type":"string"}}}}}}}},"/api/v1/backup/part-urls":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","required":["partNumber","url"],"properties":{"partNumber":{"description":"1-based part number.","type":"number"},"url":{"description":"Presigned URL. Upload the part bytes with a plain HTTP `PUT` (no extra headers) and keep the `ETag` response header.","type":"string"}}}},"urlExpiresAt":{"type":"string"}},"required":["parts","urlExpiresAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","required":["partNumber","url"],"properties":{"partNumber":{"description":"1-based part number.","type":"number"},"url":{"description":"Presigned URL. Upload the part bytes with a plain HTTP `PUT` (no extra headers) and keep the `ETag` response header.","type":"string"}}}},"urlExpiresAt":{"type":"string"}},"required":["parts","urlExpiresAt"]}},"text/plain":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","required":["partNumber","url"],"properties":{"partNumber":{"description":"1-based part number.","type":"number"},"url":{"description":"Presigned URL. Upload the part bytes with a plain HTTP `PUT` (no extra headers) and keep the `ETag` response header.","type":"string"}}}},"urlExpiresAt":{"type":"string"}},"required":["parts","urlExpiresAt"]}}}}},"operationId":"backupPartUrls","tags":["backup"],"summary":"Get presigned part URLs","description":"Next batch of part URLs, or fresh URLs to retry failed parts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","fromPart"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"fromPart":{"minimum":1,"description":"First part number.","examples":[101],"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"First part number.","examples":[101],"type":"integer"}]},"count":{"minimum":1,"maximum":100,"description":"How many URLs (max 100).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":100,"description":"How many URLs (max 100).","type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","fromPart"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"fromPart":{"minimum":1,"description":"First part number.","examples":[101],"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"First part number.","examples":[101],"type":"integer"}]},"count":{"minimum":1,"maximum":100,"description":"How many URLs (max 100).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":100,"description":"How many URLs (max 100).","type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","fromPart"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"fromPart":{"minimum":1,"description":"First part number.","examples":[101],"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"description":"First part number.","examples":[101],"type":"integer"}]},"count":{"minimum":1,"maximum":100,"description":"How many URLs (max 100).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":100,"description":"How many URLs (max 100).","type":"integer"}]}}}}}}}},"/api/v1/backup/complete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"},"meta":{"description":"Client metadata sent on start.","type":"object","patternProperties":{"^(.*)$":{}}},"blobPath":{"description":"Storage path inside the organisation, e.g. `backup/2026-11/db_aB3dE5fG7hJ9kL1m.zip`.","type":"string"}},"required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"},"meta":{"description":"Client metadata sent on start.","type":"object","patternProperties":{"^(.*)$":{}}},"blobPath":{"description":"Storage path inside the organisation, e.g. `backup/2026-11/db_aB3dE5fG7hJ9kL1m.zip`.","type":"string"}},"required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"},"meta":{"description":"Client metadata sent on start.","type":"object","patternProperties":{"^(.*)$":{}}},"blobPath":{"description":"Storage path inside the organisation, e.g. `backup/2026-11/db_aB3dE5fG7hJ9kL1m.zip`.","type":"string"}},"required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"]}}}}},"operationId":"backupComplete","tags":["backup"],"summary":"Finish a backup upload","description":"Assembles the parts, checks the stored size against the declared size and registers the file. Idempotent: repeating the call returns the same backup. The copy to the backup datacentre follows asynchronously (`isMirrored`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","parts"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"parts":{"minItems":1,"description":"Every part `1..partCount` exactly once.","type":"array","items":{"type":"object","required":["partNumber","etag"],"properties":{"partNumber":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"etag":{"minLength":1,"description":"Value of the `ETag` header returned by the part PUT.","type":"string"}}}},"sha256":{"description":"SHA-256 of the whole file (hex), stored for later verification.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","parts"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"parts":{"minItems":1,"description":"Every part `1..partCount` exactly once.","type":"array","items":{"type":"object","required":["partNumber","etag"],"properties":{"partNumber":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"etag":{"minLength":1,"description":"Value of the `ETag` header returned by the part PUT.","type":"string"}}}},"sha256":{"description":"SHA-256 of the whole file (hex), stored for later verification.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","parts"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"parts":{"minItems":1,"description":"Every part `1..partCount` exactly once.","type":"array","items":{"type":"object","required":["partNumber","etag"],"properties":{"partNumber":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"etag":{"minLength":1,"description":"Value of the `ETag` header returned by the part PUT.","type":"string"}}}},"sha256":{"description":"SHA-256 of the whole file (hex), stored for later verification.","type":"string"}}}}}}}},"/api/v1/backup/abort":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"backupAbort","tags":["backup"],"summary":"Cancel a backup upload","description":"Only for uploads still in progress. Stored backups cannot be deleted over the API. Uploads without new data for 6 hours are closed automatically (completed when all parts arrived, otherwise failed + notification).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"reason":{"maxLength":500,"type":"string"},"failed":{"description":"True = the client gave up because of an error: the backup is marked `failed` and the organisation is notified by e-mail at once.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"reason":{"maxLength":500,"type":"string"},"failed":{"description":"True = the client gave up because of an error: the backup is marked `failed` and the organisation is notified by e-mail at once.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"type":"string"},"reason":{"maxLength":500,"type":"string"},"failed":{"description":"True = the client gave up because of an error: the backup is marked `failed` and the organisation is notified by e-mail at once.","type":"boolean"}}}}}}}},"/api/v1/backup/list":{"get":{"parameters":[{"description":"Filter by status.","examples":["completed"],"schema":{"type":"string"},"in":"query","name":"status","required":false},{"description":"Filter by source code.","examples":["prod-db"],"schema":{"type":"string"},"in":"query","name":"source","required":false},{"description":"Filter by backup type.","examples":["full"],"schema":{"type":"string"},"in":"query","name":"type","required":false},{"description":"Started at or after (ISO 8601).","schema":{"type":"string"},"in":"query","name":"from","required":false},{"description":"Started at or before (ISO 8601).","schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"type":"number"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"],"properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"}}}},"itemCount":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","itemCount","page","limit"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"],"properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"}}}},"itemCount":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","itemCount","page","limit"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"],"properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"}}}},"itemCount":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","itemCount","page","limit"]}}}}},"operationId":"backupList","tags":["backup"],"summary":"List backups","description":"Backups of the organisation, newest first. Metadata only (no download). Use it to verify from the client side that the last backup arrived and was mirrored."}},"/api/v1/backup/detail":{"get":{"parameters":[{"description":"Backup id returned by `/backup/start`.","examples":["aB3dE5fG7hJ9kL1m"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"},"meta":{"description":"Client metadata sent on start.","type":"object","patternProperties":{"^(.*)$":{}}},"blobPath":{"description":"Storage path inside the organisation, e.g. `backup/2026-11/db_aB3dE5fG7hJ9kL1m.zip`.","type":"string"}},"required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"},"meta":{"description":"Client metadata sent on start.","type":"object","patternProperties":{"^(.*)$":{}}},"blobPath":{"description":"Storage path inside the organisation, e.g. `backup/2026-11/db_aB3dE5fG7hJ9kL1m.zip`.","type":"string"}},"required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Backup id (16 chars).","type":"string"},"name":{"description":"Human label sent on start.","type":"string"},"source":{"description":"Logical stream code sent on start, e.g. `prod-db`.","type":"string"},"filename":{"description":"Normalized file name.","type":"string"},"status":{"description":"`uploading` (parts are being sent), `completed` (stored), `failed` (size mismatch / storage error), `aborted`.","anyOf":[{"const":"uploading","type":"string"},{"const":"completed","type":"string"},{"const":"failed","type":"string"},{"const":"aborted","type":"string"}]},"declaredSize":{"description":"Size in bytes declared on start.","type":"number"},"size":{"description":"Stored size in bytes (read from storage on complete).","type":"number"},"contentType":{"type":"string"},"sha256":{"description":"SHA-256 (hex) declared by the client on complete.","type":"string"},"isClientEncrypted":{"type":"boolean"},"sourceCreatedAt":{"description":"When the client produced the data (ISO 8601), as sent on start.","type":"string"},"startedAt":{"description":"ISO 8601.","type":"string"},"completedAt":{"description":"ISO 8601.","type":"string"},"durationSeconds":{"description":"Upload duration (start → complete).","type":"number"},"partSize":{"type":"number"},"partCount":{"type":"number"},"isMirrored":{"description":"True once the copy in the geographically separate backup datacentre is confirmed.","type":"boolean"},"mirroredAt":{"description":"ISO 8601 time the second copy was confirmed.","type":"string"},"mirrorRegion":{"description":"Backup datacentre region code, e.g. `nbg1` (Nuremberg, Germany).","type":"string"},"error":{"type":"string"},"type":{"description":"Backup type sent on start (`full`, `incremental`, …).","type":"string"},"nextExpectedAt":{"description":"When the next backup of this series is expected (ISO 8601), as sent on start.","type":"string"},"expectationDeadlineAt":{"description":"Monitoring threshold: `nextExpectedAt` + 20 % of the interval. No newer backup by then = alert e-mail.","type":"string"},"expectationAlertedAt":{"description":"When the \"expected backup did not arrive\" alert was sent.","type":"string"},"uploadedBytes":{"description":"Bytes already received in storage (while uploading).","type":"number"},"uploadedParts":{"type":"number"},"uploadPercent":{"description":"0–100 while uploading.","type":"number"},"lastActivityAt":{"description":"Last time upload data arrived (ISO 8601). After 6 hours without data the upload is closed.","type":"string"},"mirrorDeadlineAt":{"description":"SLA deadline for the copy in the backup datacentre: completion + 1 hour + 1 hour per 8 GiB (ISO 8601).","type":"string"},"mirrorLagSeconds":{"description":"Seconds from completion to the copy in the backup datacentre.","type":"number"},"isMirrorLate":{"description":"The copy missed (or is past) its SLA deadline.","type":"boolean"},"integrityStatus":{"description":"Integrity check done while copying to the backup datacentre: `verified` = the stored file matches the `sha256` you sent, `computed` = you sent no checksum and the platform computed it (`verifiedSha256`), `mismatch` = the stored file differs from your checksum (you get an e-mail), `unavailable` = the copy was made before checks existed.","anyOf":[{"const":"verified","type":"string"},{"const":"computed","type":"string"},{"const":"mismatch","type":"string"},{"const":"unavailable","type":"string"}]},"verifiedSha256":{"description":"SHA-256 of the stored file computed by the platform (64 hex characters).","type":"string"},"reverifiedAt":{"description":"Last periodic re-verification: the stored file was read back from one copy and hashed again (ISO 8601). About monthly, copies alternate.","type":"string"},"reverifyStatus":{"description":"Result of the last re-verification: `ok` = the copy still matches the checksum. Other values alert our operations team, the other copy stays available.","anyOf":[{"const":"ok","type":"string"},{"const":"mismatch","type":"string"},{"const":"missing","type":"string"}]},"reverifyCopy":{"description":"Copy read by the last re-verification: `primary` storage or `mirror` (second datacentre).","anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]},"previousSize":{"description":"Size of the previous completed backup of the same source and type (bytes).","type":"number"},"sizeChangePercent":{"description":"Size change against the previous backup of the series in %, e.g. `-35.2`.","type":"number"},"isSizeAnomaly":{"description":"The size changed by more than 20 % against the previous backup; a warning e-mail was sent (code BKP_SIZE_JUMP).","type":"boolean"},"meta":{"description":"Client metadata sent on start.","type":"object","patternProperties":{"^(.*)$":{}}},"blobPath":{"description":"Storage path inside the organisation, e.g. `backup/2026-11/db_aB3dE5fG7hJ9kL1m.zip`.","type":"string"}},"required":["id","filename","status","declaredSize","isClientEncrypted","startedAt","partSize","partCount","isMirrored"]}}}}},"operationId":"backupDetail","tags":["backup"],"summary":"Backup detail"}},"/api/v1/backup/usage":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"isUploadAllowed":{"description":"False when the tariff does not include the backup service.","type":"boolean"},"maxFileBytes":{"type":"number"},"backupCount":{"type":"number"},"backupBytes":{"type":"number"},"mirroredCount":{"type":"number"},"mirroredBytes":{"type":"number"},"pendingMirrorCount":{"type":"number"},"lastBackupAt":{"type":"string"},"mirrorRegion":{"type":"string"},"storage":{"description":"Shared storage of the organisation against its plan.","type":"object","required":["plan","usedBytes","pendingBytes","includedBytes","limitBytes"],"properties":{"plan":{"description":"Storage plan of the organisation. `none` = no plan, hard cap 100 GB.","anyOf":[{"const":"none","type":"string"},{"const":"basic","type":"string"},{"const":"pro","type":"string"},{"const":"enterprise","type":"string"}]},"usedBytes":{"description":"All files on the organisation Disk (uploads, attachments, images, backups).","type":"number"},"pendingBytes":{"description":"Declared size of backup uploads still in progress (counted against the cap).","type":"number"},"includedBytes":{"description":"Storage included in the plan.","type":"number"},"limitBytes":{"description":"Hard cap (included + 20 %, or 100 GB without a plan). New backups and Disk uploads are refused with HTTP 507 when used + pending + the new file would exceed it.","type":"number"}}}},"required":["isUploadAllowed","maxFileBytes","backupCount","backupBytes","mirroredCount","mirroredBytes","pendingMirrorCount","storage"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"isUploadAllowed":{"description":"False when the tariff does not include the backup service.","type":"boolean"},"maxFileBytes":{"type":"number"},"backupCount":{"type":"number"},"backupBytes":{"type":"number"},"mirroredCount":{"type":"number"},"mirroredBytes":{"type":"number"},"pendingMirrorCount":{"type":"number"},"lastBackupAt":{"type":"string"},"mirrorRegion":{"type":"string"},"storage":{"description":"Shared storage of the organisation against its plan.","type":"object","required":["plan","usedBytes","pendingBytes","includedBytes","limitBytes"],"properties":{"plan":{"description":"Storage plan of the organisation. `none` = no plan, hard cap 100 GB.","anyOf":[{"const":"none","type":"string"},{"const":"basic","type":"string"},{"const":"pro","type":"string"},{"const":"enterprise","type":"string"}]},"usedBytes":{"description":"All files on the organisation Disk (uploads, attachments, images, backups).","type":"number"},"pendingBytes":{"description":"Declared size of backup uploads still in progress (counted against the cap).","type":"number"},"includedBytes":{"description":"Storage included in the plan.","type":"number"},"limitBytes":{"description":"Hard cap (included + 20 %, or 100 GB without a plan). New backups and Disk uploads are refused with HTTP 507 when used + pending + the new file would exceed it.","type":"number"}}}},"required":["isUploadAllowed","maxFileBytes","backupCount","backupBytes","mirroredCount","mirroredBytes","pendingMirrorCount","storage"]}},"text/plain":{"schema":{"type":"object","properties":{"isUploadAllowed":{"description":"False when the tariff does not include the backup service.","type":"boolean"},"maxFileBytes":{"type":"number"},"backupCount":{"type":"number"},"backupBytes":{"type":"number"},"mirroredCount":{"type":"number"},"mirroredBytes":{"type":"number"},"pendingMirrorCount":{"type":"number"},"lastBackupAt":{"type":"string"},"mirrorRegion":{"type":"string"},"storage":{"description":"Shared storage of the organisation against its plan.","type":"object","required":["plan","usedBytes","pendingBytes","includedBytes","limitBytes"],"properties":{"plan":{"description":"Storage plan of the organisation. `none` = no plan, hard cap 100 GB.","anyOf":[{"const":"none","type":"string"},{"const":"basic","type":"string"},{"const":"pro","type":"string"},{"const":"enterprise","type":"string"}]},"usedBytes":{"description":"All files on the organisation Disk (uploads, attachments, images, backups).","type":"number"},"pendingBytes":{"description":"Declared size of backup uploads still in progress (counted against the cap).","type":"number"},"includedBytes":{"description":"Storage included in the plan.","type":"number"},"limitBytes":{"description":"Hard cap (included + 20 %, or 100 GB without a plan). New backups and Disk uploads are refused with HTTP 507 when used + pending + the new file would exceed it.","type":"number"}}}},"required":["isUploadAllowed","maxFileBytes","backupCount","backupBytes","mirroredCount","mirroredBytes","pendingMirrorCount","storage"]}}}}},"operationId":"backupUsage","tags":["backup"],"summary":"Backup storage usage","description":"Totals of stored backups and of their second copies."}},"/api/v1/bank/bank-account-status":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Bank account identifier to be validated / converted to IBAN.\n\nSupported formats:\n- **IBAN** (ISO 7064 MOD-97-10), e.g. `CZ5420100000002002770630`.\n  - Spaces and separators are allowed; they will be removed.\n  - Letters are uppercased automatically.\n  - For `CZ` IBANs with incorrect check digits, the checksum may be repaired (recomputed from BBAN).\n\n- **Czech domestic format** (national account), e.g. `2002770630/2010`.\n  - Optional prefix is supported: `000000-2002770630/2010`.\n  - The bank code must be 4 digits.\n  - Prefix max 6 digits, account number max 10 digits.\n\n- **Digits-only technical formats** (Czech accounts only):\n  - 20 digits BBAN: `BBBBPPPPPPAAAAAAAAAA` (bank 4 + prefix 6 + account 10).\n  - 22 digits: `CCBBBB...` where it represents `CZ` + check digits + BBAN without the country prefix.\n  - Without separators: `<account+optional prefix><bank>`, e.g. `20027706302010`.\n\nInvalid input: If the value contains letters but is not a valid/repairable IBAN, conversion fails and the endpoint returns `{ success: false }`.","examples":["CZ5420100000002002770630","2002770630/2010","000000-2002770630/2010","20027706302010"],"schema":{"type":"string"},"in":"query","name":"bankAccount","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","iban","domestic"],"properties":{"success":{"description":"Operation result. When `true`, fields `iban` and `domestic` are present.","examples":[true],"type":"boolean"},"iban":{"examples":["CZ5420100000002002770630"],"description":"Canonical IBAN (uppercased, without spaces or separators).","type":"string"},"domestic":{"examples":["2002770630/2010"],"description":"Domestic bank account format derived from the IBAN (Czech format).","type":"string"}}},{"type":"object","required":["success"],"properties":{"success":{"description":"Operation result. When `false`, the provided `bankAccount` could not be converted to a valid IBAN.","examples":[false],"type":"boolean"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","iban","domestic"],"properties":{"success":{"description":"Operation result. When `true`, fields `iban` and `domestic` are present.","examples":[true],"type":"boolean"},"iban":{"examples":["CZ5420100000002002770630"],"description":"Canonical IBAN (uppercased, without spaces or separators).","type":"string"},"domestic":{"examples":["2002770630/2010"],"description":"Domestic bank account format derived from the IBAN (Czech format).","type":"string"}}},{"type":"object","required":["success"],"properties":{"success":{"description":"Operation result. When `false`, the provided `bankAccount` could not be converted to a valid IBAN.","examples":[false],"type":"boolean"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","iban","domestic"],"properties":{"success":{"description":"Operation result. When `true`, fields `iban` and `domestic` are present.","examples":[true],"type":"boolean"},"iban":{"examples":["CZ5420100000002002770630"],"description":"Canonical IBAN (uppercased, without spaces or separators).","type":"string"},"domestic":{"examples":["2002770630/2010"],"description":"Domestic bank account format derived from the IBAN (Czech format).","type":"string"}}},{"type":"object","required":["success"],"properties":{"success":{"description":"Operation result. When `false`, the provided `bankAccount` could not be converted to a valid IBAN.","examples":[false],"type":"boolean"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","iban","domestic"],"properties":{"success":{"description":"Operation result. When `true`, fields `iban` and `domestic` are present.","examples":[true],"type":"boolean"},"iban":{"examples":["CZ5420100000002002770630"],"description":"Canonical IBAN (uppercased, without spaces or separators).","type":"string"},"domestic":{"examples":["2002770630/2010"],"description":"Domestic bank account format derived from the IBAN (Czech format).","type":"string"}}},{"type":"object","required":["success"],"properties":{"success":{"description":"Operation result. When `false`, the provided `bankAccount` could not be converted to a valid IBAN.","examples":[false],"type":"boolean"}}}]}}}}},"operationId":"getApiV1BankBank-account-status","tags":["bank"],"description":"Validate / normalize a bank account and return its canonical IBAN.\n\nThe endpoint accepts either an IBAN or a Czech domestic account format and tries to convert it to a valid IBAN.\n\n### Input\n- `bankAccount`: IBAN or CZ domestic account.\n- `apiKey`: standard API key.\n\n### Behavior\n- If `bankAccount` is a valid IBAN → returns it normalized (uppercased, without separators).\n- If it looks like a Czech IBAN with wrong check digits → recomputes and repairs the checksum.\n- If it is a Czech domestic account → converts it to CZ IBAN.\n- If conversion/validation fails → returns `{ success: false }`.\n\n### Output\n- `iban`: canonical IBAN (no spaces).\n- `domestic`: formatted domestic account representation (Czech format).\n\n### Notes\nThis endpoint does not verify whether the account actually exists at a bank; it only validates and normalizes the format."}},"/api/v1/branch/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Page number (starting from 1).","schema":{"type":"string","default":"1"},"in":"query","name":"page","required":false},{"description":"Reference GPS latitude. When provided together with `longitude`, branches are ordered by great-circle distance from this point (ascending) and each item carries a `distanceKm` field. Branches without GPS coordinates are placed last.","examples":[50.0755],"schema":{"type":"number","minimum":-90,"maximum":90},"in":"query","name":"latitude","required":false},{"description":"Reference GPS longitude. Must be passed together with `latitude` — providing just one of the two is rejected.","examples":[14.4378],"schema":{"type":"number","minimum":-180,"maximum":180},"in":"query","name":"longitude","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","branchType"],"properties":{"id":{"description":"Branch slug (used as identifier in /detail).","examples":["prague-central"],"type":"string"},"slug":{"description":"URL-safe unique branch slug.","examples":["prague-central"],"type":"string"},"name":{"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","examples":[50.0755],"type":"number"},"longitude":{"description":"Branch GPS longitude.","examples":[14.4378],"type":"number"},"mainPhotoUrl":{"description":"URL of the main public photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","examples":["Hlavní 1, 110 00, Praha"],"type":"string"},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","examples":["own"],"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"distanceKm":{"description":"Great-circle distance from the reference GPS point in kilometres. Present only when both `latitude` and `longitude` query parameters are provided and the branch has GPS coordinates filled in.","examples":[3.42],"type":"number"}}}},"itemCount":{"description":"Total number of active branches.","examples":[12],"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","branchType"],"properties":{"id":{"description":"Branch slug (used as identifier in /detail).","examples":["prague-central"],"type":"string"},"slug":{"description":"URL-safe unique branch slug.","examples":["prague-central"],"type":"string"},"name":{"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","examples":[50.0755],"type":"number"},"longitude":{"description":"Branch GPS longitude.","examples":[14.4378],"type":"number"},"mainPhotoUrl":{"description":"URL of the main public photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","examples":["Hlavní 1, 110 00, Praha"],"type":"string"},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","examples":["own"],"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"distanceKm":{"description":"Great-circle distance from the reference GPS point in kilometres. Present only when both `latitude` and `longitude` query parameters are provided and the branch has GPS coordinates filled in.","examples":[3.42],"type":"number"}}}},"itemCount":{"description":"Total number of active branches.","examples":[12],"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","branchType"],"properties":{"id":{"description":"Branch slug (used as identifier in /detail).","examples":["prague-central"],"type":"string"},"slug":{"description":"URL-safe unique branch slug.","examples":["prague-central"],"type":"string"},"name":{"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","examples":[50.0755],"type":"number"},"longitude":{"description":"Branch GPS longitude.","examples":[14.4378],"type":"number"},"mainPhotoUrl":{"description":"URL of the main public photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","examples":["Hlavní 1, 110 00, Praha"],"type":"string"},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","examples":["own"],"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"distanceKm":{"description":"Great-circle distance from the reference GPS point in kilometres. Present only when both `latitude` and `longitude` query parameters are provided and the branch has GPS coordinates filled in.","examples":[3.42],"type":"number"}}}},"itemCount":{"description":"Total number of active branches.","examples":[12],"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getApiV1BranchList","tags":["branch"],"summary":"List public branches","description":"Returns a paginated list of active branches (pobočky) of the organisation. Each item carries only the publicly displayable subset of branch information (name, description, GPS, public URL, main photo, summary address, branch type). Use `/branch/detail?slug=…` to fetch the full public detail of a specific branch.\n\nWhen the `latitude` and `longitude` query parameters are both supplied, the result is sorted by great-circle (haversine) distance from that reference point ascending and each item carries an additional `distanceKm` field. Branches whose GPS coordinates are missing are placed at the end of the list."}},"/api/v1/branch/my-branch-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","branchType"],"properties":{"id":{"description":"Branch slug (used as identifier in /detail).","examples":["prague-central"],"type":"string"},"slug":{"description":"URL-safe unique branch slug.","examples":["prague-central"],"type":"string"},"name":{"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","examples":[50.0755],"type":"number"},"longitude":{"description":"Branch GPS longitude.","examples":[14.4378],"type":"number"},"mainPhotoUrl":{"description":"URL of the main public photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","examples":["Hlavní 1, 110 00, Praha"],"type":"string"},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","examples":["own"],"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"distanceKm":{"description":"Great-circle distance from the reference GPS point in kilometres. Present only when both `latitude` and `longitude` query parameters are provided and the branch has GPS coordinates filled in.","examples":[3.42],"type":"number"}}}},"itemCount":{"description":"Number of branches returned.","examples":[3],"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","branchType"],"properties":{"id":{"description":"Branch slug (used as identifier in /detail).","examples":["prague-central"],"type":"string"},"slug":{"description":"URL-safe unique branch slug.","examples":["prague-central"],"type":"string"},"name":{"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","examples":[50.0755],"type":"number"},"longitude":{"description":"Branch GPS longitude.","examples":[14.4378],"type":"number"},"mainPhotoUrl":{"description":"URL of the main public photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","examples":["Hlavní 1, 110 00, Praha"],"type":"string"},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","examples":["own"],"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"distanceKm":{"description":"Great-circle distance from the reference GPS point in kilometres. Present only when both `latitude` and `longitude` query parameters are provided and the branch has GPS coordinates filled in.","examples":[3.42],"type":"number"}}}},"itemCount":{"description":"Number of branches returned.","examples":[3],"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","branchType"],"properties":{"id":{"description":"Branch slug (used as identifier in /detail).","examples":["prague-central"],"type":"string"},"slug":{"description":"URL-safe unique branch slug.","examples":["prague-central"],"type":"string"},"name":{"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","examples":[50.0755],"type":"number"},"longitude":{"description":"Branch GPS longitude.","examples":[14.4378],"type":"number"},"mainPhotoUrl":{"description":"URL of the main public photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","examples":["Hlavní 1, 110 00, Praha"],"type":"string"},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","examples":["own"],"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"distanceKm":{"description":"Great-circle distance from the reference GPS point in kilometres. Present only when both `latitude` and `longitude` query parameters are provided and the branch has GPS coordinates filled in.","examples":[3.42],"type":"number"}}}},"itemCount":{"description":"Number of branches returned.","examples":[3],"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getApiV1BranchMy-branch-list","tags":["branch"],"summary":"List branches operated by the logged-in user","description":"Returns branches (pobočky) of the organisation the currently authenticated user operates.\n\n**Resolution rule:**\n\n- If the caller's contact is linked to an organisation member holding the `root` permission (directly or via a role), the response contains every active branch in the organisation — the same set `/branch/list` would return without paging.\n- Otherwise the response contains only branches on which the caller is listed as the `technician` in `shop__branch_person`.\n\nEach item carries only the publicly displayable subset of branch information. Use `/branch/detail?slug=…` to fetch the full public detail of a specific branch."}},"/api/v1/branch/my-monthly-breakdown":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"Branch slug (from `/branch/my-branch-list`).","examples":["gymroom-vinohrady"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"How many calendar months to return (default 12, clamped to [1, 60]). The window always ends with the current month and never starts before the branch opened.","examples":["12","24"],"schema":{"type":"string"},"in":"query","name":"monthCount","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","examples":["CZK"],"type":"string"},"franchiseFeePercentage":{"description":"Franchise-fee rate in force today (percent); null when not configured.","examples":[9],"anyOf":[{"type":"number"},{"type":"null"}]},"monthCount":{"description":"Effective number of returned months (post-clamp).","type":"number"},"months":{"description":"Months in ascending order.","type":"array","items":{"type":"object","required":["month","revenue","cashInAmount","creditAmount","writeoff","franchiseFeePercentage","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","invoice"],"properties":{"month":{"description":"Month identifier in \"YYYY-MM\" format.","examples":["2026-10"],"type":"string"},"revenue":{"description":"Gross revenue (turnover) of the month, storno items excluded.","type":"number"},"cashInAmount":{"description":"Money actually received in the month (gateway payments + matched bank transfers) for orders attributed to the branch. Cash-flow figure dated by payment day, not turnover.","type":"number"},"creditAmount":{"description":"Net credit balance moved in the month (credit settlement).","type":"number"},"writeoff":{"description":"Sum of write-offs (corrections) effective in the month.","type":"number"},"franchiseFeePercentage":{"description":"Franchise-fee rate in force in this month (percent). 0 when no rule covers the month.","examples":[9],"type":"number"},"franchiseFeeAmount":{"description":"revenue × franchiseFeePercentage ÷ 100, rounded.","type":"number"},"gatewayFeeAmount":{"description":"Payment-gateway commission on the gateway-routed part of cash-in.","type":"number"},"costAmount":{"description":"Fixed branch costs (rent, energy, …) applied to the month.","type":"number"},"variableCost":{"description":"Variable cost of sold items (positive magnitude).","type":"number"},"net":{"description":"What the branch keeps: revenue − franchiseFeeAmount + writeoff − costAmount − gatewayFeeAmount − variableCost.","type":"number"},"invoice":{"description":"Settlement order (vyrovnání) of the month. null when none has been issued yet.","anyOf":[{"type":"null"},{"type":"object","required":["orderNumber","dueDate","paidDate","isStorno","documentType","pdfUrl"],"properties":{"orderNumber":{"description":"Public number of the settlement order.","examples":["2026100012"],"type":"string"},"dueDate":{"description":"ISO due date; null when not set.","anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"description":"ISO timestamp of payment; null while unpaid.","anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"description":"True when the settlement order has been cancelled (storno).","type":"boolean"},"documentType":{"description":"Type of the linked accounting document (`invoice`, `proforma`, …); null when none is issued.","examples":["invoice"],"anyOf":[{"type":"string"},{"type":"null"}]},"pdfUrl":{"description":"Direct download URL of the accounting document PDF (final invoice preferred over proforma). May be time-limited for private storage; fetch fresh from this endpoint instead of caching it. null when no document has been issued (e.g. a zero-amount statement).","anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}},"totals":{"type":"object","required":["revenue","cashInAmount","creditAmount","writeoff","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","monthlyAverageRevenue","monthlyMedianRevenue","monthlyAverageNet","monthlyMedianNet","bestMonth","worstMonth"],"properties":{"revenue":{"type":"number"},"cashInAmount":{"type":"number"},"creditAmount":{"type":"number"},"writeoff":{"type":"number"},"franchiseFeeAmount":{"type":"number"},"gatewayFeeAmount":{"type":"number"},"costAmount":{"type":"number"},"variableCost":{"type":"number"},"net":{"type":"number"},"monthlyAverageRevenue":{"type":"number"},"monthlyMedianRevenue":{"type":"number"},"monthlyAverageNet":{"type":"number"},"monthlyMedianNet":{"type":"number"},"bestMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]},"worstMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]}}}},"required":["branchSlug","branchName","currency","franchiseFeePercentage","monthCount","months","totals"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","examples":["CZK"],"type":"string"},"franchiseFeePercentage":{"description":"Franchise-fee rate in force today (percent); null when not configured.","examples":[9],"anyOf":[{"type":"number"},{"type":"null"}]},"monthCount":{"description":"Effective number of returned months (post-clamp).","type":"number"},"months":{"description":"Months in ascending order.","type":"array","items":{"type":"object","required":["month","revenue","cashInAmount","creditAmount","writeoff","franchiseFeePercentage","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","invoice"],"properties":{"month":{"description":"Month identifier in \"YYYY-MM\" format.","examples":["2026-10"],"type":"string"},"revenue":{"description":"Gross revenue (turnover) of the month, storno items excluded.","type":"number"},"cashInAmount":{"description":"Money actually received in the month (gateway payments + matched bank transfers) for orders attributed to the branch. Cash-flow figure dated by payment day, not turnover.","type":"number"},"creditAmount":{"description":"Net credit balance moved in the month (credit settlement).","type":"number"},"writeoff":{"description":"Sum of write-offs (corrections) effective in the month.","type":"number"},"franchiseFeePercentage":{"description":"Franchise-fee rate in force in this month (percent). 0 when no rule covers the month.","examples":[9],"type":"number"},"franchiseFeeAmount":{"description":"revenue × franchiseFeePercentage ÷ 100, rounded.","type":"number"},"gatewayFeeAmount":{"description":"Payment-gateway commission on the gateway-routed part of cash-in.","type":"number"},"costAmount":{"description":"Fixed branch costs (rent, energy, …) applied to the month.","type":"number"},"variableCost":{"description":"Variable cost of sold items (positive magnitude).","type":"number"},"net":{"description":"What the branch keeps: revenue − franchiseFeeAmount + writeoff − costAmount − gatewayFeeAmount − variableCost.","type":"number"},"invoice":{"description":"Settlement order (vyrovnání) of the month. null when none has been issued yet.","anyOf":[{"type":"null"},{"type":"object","required":["orderNumber","dueDate","paidDate","isStorno","documentType","pdfUrl"],"properties":{"orderNumber":{"description":"Public number of the settlement order.","examples":["2026100012"],"type":"string"},"dueDate":{"description":"ISO due date; null when not set.","anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"description":"ISO timestamp of payment; null while unpaid.","anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"description":"True when the settlement order has been cancelled (storno).","type":"boolean"},"documentType":{"description":"Type of the linked accounting document (`invoice`, `proforma`, …); null when none is issued.","examples":["invoice"],"anyOf":[{"type":"string"},{"type":"null"}]},"pdfUrl":{"description":"Direct download URL of the accounting document PDF (final invoice preferred over proforma). May be time-limited for private storage; fetch fresh from this endpoint instead of caching it. null when no document has been issued (e.g. a zero-amount statement).","anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}},"totals":{"type":"object","required":["revenue","cashInAmount","creditAmount","writeoff","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","monthlyAverageRevenue","monthlyMedianRevenue","monthlyAverageNet","monthlyMedianNet","bestMonth","worstMonth"],"properties":{"revenue":{"type":"number"},"cashInAmount":{"type":"number"},"creditAmount":{"type":"number"},"writeoff":{"type":"number"},"franchiseFeeAmount":{"type":"number"},"gatewayFeeAmount":{"type":"number"},"costAmount":{"type":"number"},"variableCost":{"type":"number"},"net":{"type":"number"},"monthlyAverageRevenue":{"type":"number"},"monthlyMedianRevenue":{"type":"number"},"monthlyAverageNet":{"type":"number"},"monthlyMedianNet":{"type":"number"},"bestMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]},"worstMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]}}}},"required":["branchSlug","branchName","currency","franchiseFeePercentage","monthCount","months","totals"]}},"text/plain":{"schema":{"type":"object","properties":{"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","examples":["CZK"],"type":"string"},"franchiseFeePercentage":{"description":"Franchise-fee rate in force today (percent); null when not configured.","examples":[9],"anyOf":[{"type":"number"},{"type":"null"}]},"monthCount":{"description":"Effective number of returned months (post-clamp).","type":"number"},"months":{"description":"Months in ascending order.","type":"array","items":{"type":"object","required":["month","revenue","cashInAmount","creditAmount","writeoff","franchiseFeePercentage","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","invoice"],"properties":{"month":{"description":"Month identifier in \"YYYY-MM\" format.","examples":["2026-10"],"type":"string"},"revenue":{"description":"Gross revenue (turnover) of the month, storno items excluded.","type":"number"},"cashInAmount":{"description":"Money actually received in the month (gateway payments + matched bank transfers) for orders attributed to the branch. Cash-flow figure dated by payment day, not turnover.","type":"number"},"creditAmount":{"description":"Net credit balance moved in the month (credit settlement).","type":"number"},"writeoff":{"description":"Sum of write-offs (corrections) effective in the month.","type":"number"},"franchiseFeePercentage":{"description":"Franchise-fee rate in force in this month (percent). 0 when no rule covers the month.","examples":[9],"type":"number"},"franchiseFeeAmount":{"description":"revenue × franchiseFeePercentage ÷ 100, rounded.","type":"number"},"gatewayFeeAmount":{"description":"Payment-gateway commission on the gateway-routed part of cash-in.","type":"number"},"costAmount":{"description":"Fixed branch costs (rent, energy, …) applied to the month.","type":"number"},"variableCost":{"description":"Variable cost of sold items (positive magnitude).","type":"number"},"net":{"description":"What the branch keeps: revenue − franchiseFeeAmount + writeoff − costAmount − gatewayFeeAmount − variableCost.","type":"number"},"invoice":{"description":"Settlement order (vyrovnání) of the month. null when none has been issued yet.","anyOf":[{"type":"null"},{"type":"object","required":["orderNumber","dueDate","paidDate","isStorno","documentType","pdfUrl"],"properties":{"orderNumber":{"description":"Public number of the settlement order.","examples":["2026100012"],"type":"string"},"dueDate":{"description":"ISO due date; null when not set.","anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"description":"ISO timestamp of payment; null while unpaid.","anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"description":"True when the settlement order has been cancelled (storno).","type":"boolean"},"documentType":{"description":"Type of the linked accounting document (`invoice`, `proforma`, …); null when none is issued.","examples":["invoice"],"anyOf":[{"type":"string"},{"type":"null"}]},"pdfUrl":{"description":"Direct download URL of the accounting document PDF (final invoice preferred over proforma). May be time-limited for private storage; fetch fresh from this endpoint instead of caching it. null when no document has been issued (e.g. a zero-amount statement).","anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}},"totals":{"type":"object","required":["revenue","cashInAmount","creditAmount","writeoff","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","monthlyAverageRevenue","monthlyMedianRevenue","monthlyAverageNet","monthlyMedianNet","bestMonth","worstMonth"],"properties":{"revenue":{"type":"number"},"cashInAmount":{"type":"number"},"creditAmount":{"type":"number"},"writeoff":{"type":"number"},"franchiseFeeAmount":{"type":"number"},"gatewayFeeAmount":{"type":"number"},"costAmount":{"type":"number"},"variableCost":{"type":"number"},"net":{"type":"number"},"monthlyAverageRevenue":{"type":"number"},"monthlyMedianRevenue":{"type":"number"},"monthlyAverageNet":{"type":"number"},"monthlyMedianNet":{"type":"number"},"bestMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]},"worstMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]}}}},"required":["branchSlug","branchName","currency","franchiseFeePercentage","monthCount","months","totals"]}}}},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"const":"BRANCH_FORBIDDEN","type":"string"},"message":{"type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"const":"BRANCH_FORBIDDEN","type":"string"},"message":{"type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"const":"BRANCH_FORBIDDEN","type":"string"},"message":{"type":"string"}},"required":["success","code","message"]}}}}},"operationId":"getApiV1BranchMy-monthly-breakdown","tags":["branch"],"summary":"Monthly financial overview of a branch for its franchisee","description":"Per-month financial roll-up of one branch for the logged-in franchisee: turnover, cash-in, credit settlement, write-offs, franchise fee, gateway fee, fixed and variable costs, the resulting net and the settlement invoice of each month (number, due date, paid date, PDF link), plus window totals and average / median / best / worst month reference values.\n\nFigures are identical to the Finance tab in the BizKitHub admin. Internal data (franchise-fee rule notes, settlement bookkeeping details, internal order identifiers, other branches) is not included.\n\n**Access rule** (same as `/branch/my-branch-list`): a caller whose contact is linked to an organisation member holding `root` (directly or via a role) may open any active branch; everyone else only active branches where their contact is the `technician` in `shop__branch_person`. Any other slug, including a non-existent one, answers **403 `BRANCH_FORBIDDEN`**."}},"/api/v1/branch/my-finance-report-pdf":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"Branch slug (from `/branch/my-branch-list`).","examples":["gymroom-vinohrady"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"Month identifier in YYYY-MM format.","examples":["2026-10"],"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"in":"query","name":"month","required":true}],"operationId":"getApiV1BranchMy-finance-report-pdf","tags":["branch"],"summary":"Monthly finance report PDF of a branch for its franchisee","description":"Returns the print-ready A4 monthly finance report (`application/pdf`, inline) of one branch: headline KPIs (turnover, cash-in, franchise fee, write-offs, costs, gateway fee, net, settlement) and the detail tables. It is the same report the franchisee receives with the settlement invoice, rendered fresh on every request, so the numbers match `/branch/my-monthly-breakdown` to the cent.\n\n**Access rule** (same as `/branch/my-branch-list`): a caller whose contact is linked to an organisation member holding `root` (directly or via a role) may open any active branch; everyone else only active branches where their contact is the `technician` in `shop__branch_person`. Any other slug, including a non-existent one, answers **403 `BRANCH_FORBIDDEN`**.","responses":{"200":{}}}},"/api/v1/branch/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Branch slug.","examples":["prague-central"],"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Preferred locale for the embedded `documents` (VOP / GDPR / provozní řád / reklamace) and the exact locale of the `seo` overrides. When the requested locale has content it is returned; otherwise the endpoint falls back to any other available translation and each doc entry surfaces `isRequestedLocale: false` so the client can render a 'translation missing' hint. Omit to accept any locale.","examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Branch slug.","examples":["prague-central"],"type":"string"},"slug":{"examples":["prague-central"],"type":"string"},"name":{"examples":["Prague Central"],"type":"string"},"description":{"type":"string"},"url":{"type":"string"},"latitude":{"examples":[50.0755],"type":"number"},"longitude":{"examples":[14.4378],"type":"number"},"branchType":{"description":"Branch kind declared by the operator. \"own\" = the organisation runs the branch directly; \"franchise\" = a third-party franchisee runs it under the organisation's brand; \"partner\" = a cooperating but independent business.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"parentBranch":{"type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the operational parent (regional flagship / HQ).","type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]}}},"operatingCompany":{"type":"object","properties":{"name":{"description":"Legal name of the entity operating this branch.","type":"string"},"companyRegistrationNumber":{"description":"Czech IČO (or local equivalent). Publicly listed in the business register.","type":"string"},"taxIdentificationNumber":{"description":"Czech DIČ / EU VAT ID (or local equivalent).","type":"string"}}},"establishedDate":{"description":"Legal incorporation / business-registry date of the entity operating this branch. Optional.","anyOf":[{"description":"Legal incorporation / business-registry date of the entity operating this branch. Optional.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"openedDate":{"description":"Date the branch actually started serving customers. Use this for \"In operation since …\" copy.","anyOf":[{"description":"Date the branch actually started serving customers. Use this for \"In operation since …\" copy.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentClosure":{"type":"object","required":["startDate","reason"],"properties":{"startDate":{"description":"When the closure began.","anyOf":[{"description":"When the closure began.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"When the closure ends. Omitted = open-ended (\"until further notice\").","anyOf":[{"description":"When the closure ends. Omitted = open-ended (\"until further notice\").","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"reason":{"description":"Operator-supplied reason (e.g. \"renovation\", \"flood\", \"temporarily closed\").","type":"string"}}},"mainPhotoUrl":{"description":"URL of the main public photo (also present in `photos` with `isMain=true`).","type":"string"},"logoUrl":{"description":"URL of the branch logo (also present in `photos` with `isLogo=true`).","type":"string"},"photos":{"description":"Full public gallery — every active, non-deleted image on the branch, ordered by `position` ascending. Each entry carries `isMain` / `isLogo` flags so the client can locate the main photo and the logo without a second lookup.","type":"array","items":{"type":"object","required":["url","position","isMain","isLogo"],"properties":{"url":{"description":"Direct URL of the photo.","type":"string"},"description":{"description":"Publicly displayable caption.","type":"string"},"position":{"description":"Gallery sort position (ascending).","type":"number"},"isMain":{"description":"Whether this is the main branch photo (matches `mainPhotoUrl`).","type":"boolean"},"isLogo":{"description":"Whether this image is used as the branch logo (matches `logoUrl`).","type":"boolean"}}}},"address":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"}}},"openingHours":{"type":"object","required":["regular","exceptions"],"properties":{"regular":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday … 6 = Sunday.","type":"number"},"definition":{"description":"Time range definition (e.g. \"08:00-17:00\").","type":"string"},"description":{"type":"string"},"validFrom":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"exceptions":{"type":"array","items":{"type":"object","required":["date","isOpen"],"properties":{"date":{"description":"Exception date (ISO YYYY-MM-DD).","examples":["2026-12-24"],"type":"string"},"isOpen":{"type":"boolean"},"reason":{"type":"string"}}}}}},"emails":{"type":"array","items":{"type":"object","required":["email"],"properties":{"email":{"examples":["info@example.com"],"type":"string"},"role":{"type":"string"}}}},"phones":{"type":"array","items":{"type":"object","required":["phone"],"properties":{"phone":{"examples":["+420 777123456"],"type":"string"},"role":{"type":"string"}}}},"people":{"type":"array","items":{"type":"object","required":["role"],"properties":{"role":{"description":"Branch person role (e.g. owner, manager, custodian).","type":"string"},"customLabel":{"description":"Free-text label that overrides the role display.","type":"string"},"name":{"description":"Person display name.","type":"string"}}}},"documents":{"description":"The 4 public legal documents attached to the branch. A slot is omitted (not returned as `null`) when the branch hasn't authored that document in any locale yet — this keeps the response small and lets the client iterate `Object.keys(documents)` to find what is available.","type":"object","properties":{"termsOfBusiness":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"reclaim":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"gdpr":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"operatingRules":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}}}},"seo":{"description":"Per-locale SEO overrides edited in the admin branch detail. Filled only for the exact `locale` query parameter, never a fallback to another language; empty object when `locale` is omitted or nothing is set.","type":"object","properties":{"title":{"description":"Custom SEO title for the branch page in the requested `locale`. When present, use it verbatim as <title> and og:title. Omitted = not filled in, keep your automatic title.","examples":["GymRoom Smíchov | Soukromá posilovna Praha 5"],"type":"string"},"description":{"description":"Custom meta description for the branch page in the requested `locale`. When present, use it as meta description and og:description. Omitted = keep your automatic description.","type":"string"}}}},"required":["id","slug","name","branchType","openedDate","photos","openingHours","emails","phones","people","documents","seo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Branch slug.","examples":["prague-central"],"type":"string"},"slug":{"examples":["prague-central"],"type":"string"},"name":{"examples":["Prague Central"],"type":"string"},"description":{"type":"string"},"url":{"type":"string"},"latitude":{"examples":[50.0755],"type":"number"},"longitude":{"examples":[14.4378],"type":"number"},"branchType":{"description":"Branch kind declared by the operator. \"own\" = the organisation runs the branch directly; \"franchise\" = a third-party franchisee runs it under the organisation's brand; \"partner\" = a cooperating but independent business.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"parentBranch":{"type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the operational parent (regional flagship / HQ).","type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]}}},"operatingCompany":{"type":"object","properties":{"name":{"description":"Legal name of the entity operating this branch.","type":"string"},"companyRegistrationNumber":{"description":"Czech IČO (or local equivalent). Publicly listed in the business register.","type":"string"},"taxIdentificationNumber":{"description":"Czech DIČ / EU VAT ID (or local equivalent).","type":"string"}}},"establishedDate":{"description":"Legal incorporation / business-registry date of the entity operating this branch. Optional.","anyOf":[{"description":"Legal incorporation / business-registry date of the entity operating this branch. Optional.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"openedDate":{"description":"Date the branch actually started serving customers. Use this for \"In operation since …\" copy.","anyOf":[{"description":"Date the branch actually started serving customers. Use this for \"In operation since …\" copy.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentClosure":{"type":"object","required":["startDate","reason"],"properties":{"startDate":{"description":"When the closure began.","anyOf":[{"description":"When the closure began.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"When the closure ends. Omitted = open-ended (\"until further notice\").","anyOf":[{"description":"When the closure ends. Omitted = open-ended (\"until further notice\").","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"reason":{"description":"Operator-supplied reason (e.g. \"renovation\", \"flood\", \"temporarily closed\").","type":"string"}}},"mainPhotoUrl":{"description":"URL of the main public photo (also present in `photos` with `isMain=true`).","type":"string"},"logoUrl":{"description":"URL of the branch logo (also present in `photos` with `isLogo=true`).","type":"string"},"photos":{"description":"Full public gallery — every active, non-deleted image on the branch, ordered by `position` ascending. Each entry carries `isMain` / `isLogo` flags so the client can locate the main photo and the logo without a second lookup.","type":"array","items":{"type":"object","required":["url","position","isMain","isLogo"],"properties":{"url":{"description":"Direct URL of the photo.","type":"string"},"description":{"description":"Publicly displayable caption.","type":"string"},"position":{"description":"Gallery sort position (ascending).","type":"number"},"isMain":{"description":"Whether this is the main branch photo (matches `mainPhotoUrl`).","type":"boolean"},"isLogo":{"description":"Whether this image is used as the branch logo (matches `logoUrl`).","type":"boolean"}}}},"address":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"}}},"openingHours":{"type":"object","required":["regular","exceptions"],"properties":{"regular":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday … 6 = Sunday.","type":"number"},"definition":{"description":"Time range definition (e.g. \"08:00-17:00\").","type":"string"},"description":{"type":"string"},"validFrom":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"exceptions":{"type":"array","items":{"type":"object","required":["date","isOpen"],"properties":{"date":{"description":"Exception date (ISO YYYY-MM-DD).","examples":["2026-12-24"],"type":"string"},"isOpen":{"type":"boolean"},"reason":{"type":"string"}}}}}},"emails":{"type":"array","items":{"type":"object","required":["email"],"properties":{"email":{"examples":["info@example.com"],"type":"string"},"role":{"type":"string"}}}},"phones":{"type":"array","items":{"type":"object","required":["phone"],"properties":{"phone":{"examples":["+420 777123456"],"type":"string"},"role":{"type":"string"}}}},"people":{"type":"array","items":{"type":"object","required":["role"],"properties":{"role":{"description":"Branch person role (e.g. owner, manager, custodian).","type":"string"},"customLabel":{"description":"Free-text label that overrides the role display.","type":"string"},"name":{"description":"Person display name.","type":"string"}}}},"documents":{"description":"The 4 public legal documents attached to the branch. A slot is omitted (not returned as `null`) when the branch hasn't authored that document in any locale yet — this keeps the response small and lets the client iterate `Object.keys(documents)` to find what is available.","type":"object","properties":{"termsOfBusiness":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"reclaim":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"gdpr":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"operatingRules":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}}}},"seo":{"description":"Per-locale SEO overrides edited in the admin branch detail. Filled only for the exact `locale` query parameter, never a fallback to another language; empty object when `locale` is omitted or nothing is set.","type":"object","properties":{"title":{"description":"Custom SEO title for the branch page in the requested `locale`. When present, use it verbatim as <title> and og:title. Omitted = not filled in, keep your automatic title.","examples":["GymRoom Smíchov | Soukromá posilovna Praha 5"],"type":"string"},"description":{"description":"Custom meta description for the branch page in the requested `locale`. When present, use it as meta description and og:description. Omitted = keep your automatic description.","type":"string"}}}},"required":["id","slug","name","branchType","openedDate","photos","openingHours","emails","phones","people","documents","seo"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Branch slug.","examples":["prague-central"],"type":"string"},"slug":{"examples":["prague-central"],"type":"string"},"name":{"examples":["Prague Central"],"type":"string"},"description":{"type":"string"},"url":{"type":"string"},"latitude":{"examples":[50.0755],"type":"number"},"longitude":{"examples":[14.4378],"type":"number"},"branchType":{"description":"Branch kind declared by the operator. \"own\" = the organisation runs the branch directly; \"franchise\" = a third-party franchisee runs it under the organisation's brand; \"partner\" = a cooperating but independent business.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"parentBranch":{"type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the operational parent (regional flagship / HQ).","type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]}}},"operatingCompany":{"type":"object","properties":{"name":{"description":"Legal name of the entity operating this branch.","type":"string"},"companyRegistrationNumber":{"description":"Czech IČO (or local equivalent). Publicly listed in the business register.","type":"string"},"taxIdentificationNumber":{"description":"Czech DIČ / EU VAT ID (or local equivalent).","type":"string"}}},"establishedDate":{"description":"Legal incorporation / business-registry date of the entity operating this branch. Optional.","anyOf":[{"description":"Legal incorporation / business-registry date of the entity operating this branch. Optional.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"openedDate":{"description":"Date the branch actually started serving customers. Use this for \"In operation since …\" copy.","anyOf":[{"description":"Date the branch actually started serving customers. Use this for \"In operation since …\" copy.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentClosure":{"type":"object","required":["startDate","reason"],"properties":{"startDate":{"description":"When the closure began.","anyOf":[{"description":"When the closure began.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"When the closure ends. Omitted = open-ended (\"until further notice\").","anyOf":[{"description":"When the closure ends. Omitted = open-ended (\"until further notice\").","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"reason":{"description":"Operator-supplied reason (e.g. \"renovation\", \"flood\", \"temporarily closed\").","type":"string"}}},"mainPhotoUrl":{"description":"URL of the main public photo (also present in `photos` with `isMain=true`).","type":"string"},"logoUrl":{"description":"URL of the branch logo (also present in `photos` with `isLogo=true`).","type":"string"},"photos":{"description":"Full public gallery — every active, non-deleted image on the branch, ordered by `position` ascending. Each entry carries `isMain` / `isLogo` flags so the client can locate the main photo and the logo without a second lookup.","type":"array","items":{"type":"object","required":["url","position","isMain","isLogo"],"properties":{"url":{"description":"Direct URL of the photo.","type":"string"},"description":{"description":"Publicly displayable caption.","type":"string"},"position":{"description":"Gallery sort position (ascending).","type":"number"},"isMain":{"description":"Whether this is the main branch photo (matches `mainPhotoUrl`).","type":"boolean"},"isLogo":{"description":"Whether this image is used as the branch logo (matches `logoUrl`).","type":"boolean"}}}},"address":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"}}},"openingHours":{"type":"object","required":["regular","exceptions"],"properties":{"regular":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday … 6 = Sunday.","type":"number"},"definition":{"description":"Time range definition (e.g. \"08:00-17:00\").","type":"string"},"description":{"type":"string"},"validFrom":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"exceptions":{"type":"array","items":{"type":"object","required":["date","isOpen"],"properties":{"date":{"description":"Exception date (ISO YYYY-MM-DD).","examples":["2026-12-24"],"type":"string"},"isOpen":{"type":"boolean"},"reason":{"type":"string"}}}}}},"emails":{"type":"array","items":{"type":"object","required":["email"],"properties":{"email":{"examples":["info@example.com"],"type":"string"},"role":{"type":"string"}}}},"phones":{"type":"array","items":{"type":"object","required":["phone"],"properties":{"phone":{"examples":["+420 777123456"],"type":"string"},"role":{"type":"string"}}}},"people":{"type":"array","items":{"type":"object","required":["role"],"properties":{"role":{"description":"Branch person role (e.g. owner, manager, custodian).","type":"string"},"customLabel":{"description":"Free-text label that overrides the role display.","type":"string"},"name":{"description":"Person display name.","type":"string"}}}},"documents":{"description":"The 4 public legal documents attached to the branch. A slot is omitted (not returned as `null`) when the branch hasn't authored that document in any locale yet — this keeps the response small and lets the client iterate `Object.keys(documents)` to find what is available.","type":"object","properties":{"termsOfBusiness":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"reclaim":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"gdpr":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}},"operatingRules":{"description":"Metadata pointer to one published branch document (VOP / GDPR / provozní řád / reklamace).","type":"object","required":["postId","title","updatedDate","locale","isRequestedLocale"],"properties":{"postId":{"examples":["58714l4gSh9jZOLU"],"description":"Public post external id (16-char string) of the document. This endpoint returns metadata only — the full document body (title, markdown content) is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>` where `<locale>` should match the `locale` field returned alongside this `postId` (e.g. `cs` when this entry reports `locale: \"cs\"`).\n\nRecipe for an AI agent / integration:\n  1. Call `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<preferred>` to obtain the `documents.<slot>.postId` for the required slot (`termsOfBusiness` / `reclaim` / `gdpr` / `operatingRules`).\n  2. Call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<documents.<slot>.locale>` to fetch the full post (`title`, `content` in markdown, `updatedDate`).\n  3. Pair with `/api/v1/post/history?apiKey=…&id=<postId>` for the revision log of that document.\n\nThis two-call pattern keeps the branch payload small (docs are big) and lets the client cache the post body independently of the branch metadata.","type":"string"},"title":{"description":"Document title in the returned locale.","type":"string"},"updatedDate":{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","anyOf":[{"description":"ISO date of the last update to the parent post (per-locale rows have no timestamp).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"examples":["cs"],"description":"Locale code the returned metadata refers to (same locale to pass on to `/api/v1/post/post`). May differ from the requested locale when the endpoint fell back to an available translation.","type":"string"},"isRequestedLocale":{"description":"True when `locale` matches the requested locale exactly; false when the endpoint fell back to another available translation. Consumers can use this to render a \"translation missing\" hint.","type":"boolean"}}}}},"seo":{"description":"Per-locale SEO overrides edited in the admin branch detail. Filled only for the exact `locale` query parameter, never a fallback to another language; empty object when `locale` is omitted or nothing is set.","type":"object","properties":{"title":{"description":"Custom SEO title for the branch page in the requested `locale`. When present, use it verbatim as <title> and og:title. Omitted = not filled in, keep your automatic title.","examples":["GymRoom Smíchov | Soukromá posilovna Praha 5"],"type":"string"},"description":{"description":"Custom meta description for the branch page in the requested `locale`. When present, use it as meta description and og:description. Omitted = keep your automatic description.","type":"string"}}}},"required":["id","slug","name","branchType","openedDate","photos","openingHours","emails","phones","people","documents","seo"]}}}}},"operationId":"getApiV1BranchDetail","tags":["branch"],"summary":"Get public branch detail","description":"Returns the full publicly displayable detail of a single active branch identified by `slug`. Includes address (without internal delivery notes), opening hours (regular + exceptions), public e-mails and phones, branch type, parent branch reference, operating company (name + IČO + DIČ — public business-register information), the full public photo gallery (logo + main photo + rest), the `openedDate` and `establishedDate` timestamps, the currently active closure (\"výluka\") when the branch is temporarily closed right now, the list of associated people (role and display name only), and pointers to the 4 public legal documents (VOP / reklamace / GDPR / provozní řád) under `documents.*`. Each `documents.*` entry carries the post's `postId` + minimal metadata (title, locale, updatedDate); the full markdown body is fetched separately via `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<locale>`. Pass `locale=…` on this endpoint to pick the language of the metadata pointers.\n\nInternal data (internal code, internal description, staff instructions, AI system prompt, internal billing contact, attached calendars / products / locks, monetary write-offs, franchise-fee percentage) is deliberately excluded from this endpoint."}},"/api/v1/calendar/event-late-cancel":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["status","cancelledAt","lockCodeDeleted"],"properties":{"status":{"const":"cancelled","type":"string"},"cancelledAt":{"examples":["2026-10-19T16:05:00+02:00"],"type":"string"},"lockCodeDeleted":{"description":"False = the lock was unreachable; deletion is retried.","type":"boolean"}}},{"type":"object","required":["status","cancelledAt"],"properties":{"status":{"const":"already_cancelled","type":"string"},"cancelledAt":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["status","cancelledAt","lockCodeDeleted"],"properties":{"status":{"const":"cancelled","type":"string"},"cancelledAt":{"examples":["2026-10-19T16:05:00+02:00"],"type":"string"},"lockCodeDeleted":{"description":"False = the lock was unreachable; deletion is retried.","type":"boolean"}}},{"type":"object","required":["status","cancelledAt"],"properties":{"status":{"const":"already_cancelled","type":"string"},"cancelledAt":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["status","cancelledAt","lockCodeDeleted"],"properties":{"status":{"const":"cancelled","type":"string"},"cancelledAt":{"examples":["2026-10-19T16:05:00+02:00"],"type":"string"},"lockCodeDeleted":{"description":"False = the lock was unreachable; deletion is retried.","type":"boolean"}}},{"type":"object","required":["status","cancelledAt"],"properties":{"status":{"const":"already_cancelled","type":"string"},"cancelledAt":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["status","cancelledAt","lockCodeDeleted"],"properties":{"status":{"const":"cancelled","type":"string"},"cancelledAt":{"examples":["2026-10-19T16:05:00+02:00"],"type":"string"},"lockCodeDeleted":{"description":"False = the lock was unreachable; deletion is retried.","type":"boolean"}}},{"type":"object","required":["status","cancelledAt"],"properties":{"status":{"const":"already_cancelled","type":"string"},"cancelledAt":{"type":"string"}}}]}}}},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"error","type":"string"},"code":{"anyOf":[{"const":"NOT_OWNER","type":"string"},{"const":"NOT_A_RESERVATION","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"const":"USE_STANDARD_STORNO","type":"string"},{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"SHARED_EVENT","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["status","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"const":"error","type":"string"},"code":{"anyOf":[{"const":"NOT_OWNER","type":"string"},{"const":"NOT_A_RESERVATION","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"const":"USE_STANDARD_STORNO","type":"string"},{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"SHARED_EVENT","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["status","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"const":"error","type":"string"},"code":{"anyOf":[{"const":"NOT_OWNER","type":"string"},{"const":"NOT_A_RESERVATION","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"const":"USE_STANDARD_STORNO","type":"string"},{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"SHARED_EVENT","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["status","code","message"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"const":"error","type":"string"},"code":{"anyOf":[{"const":"NOT_OWNER","type":"string"},{"const":"NOT_A_RESERVATION","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"const":"USE_STANDARD_STORNO","type":"string"},{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"SHARED_EVENT","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["status","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"const":"error","type":"string"},"code":{"anyOf":[{"const":"NOT_OWNER","type":"string"},{"const":"NOT_A_RESERVATION","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"const":"USE_STANDARD_STORNO","type":"string"},{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"SHARED_EVENT","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["status","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"const":"error","type":"string"},"code":{"anyOf":[{"const":"NOT_OWNER","type":"string"},{"const":"NOT_A_RESERVATION","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"const":"USE_STANDARD_STORNO","type":"string"},{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"SHARED_EVENT","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["status","code","message"]}}}}},"operationId":"postApiV1CalendarEvent-late-cancel","tags":["calendar"],"summary":"Late cancellation without refund","description":"Cancels a reservation less than `onlineChangeDeadline` before its start: the slot is released, the order stays paid, nothing is refunded and no e-mail is sent. Allowed only when the calendar has late cancellation enabled, at least `lateCancelMinBefore` before the start and before the access-code e-mail was sent. Idempotent (`already_cancelled`). 409 responses carry the current `cancellation` state.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderId","orderItemId","identityId"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderItemId":{"examples":["2d33677772eddbd4e869c6ed6bf6d9f3","sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"description":"Order line id from /customer/order-list (or `<orderId>_<internal id>`).","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderId","orderItemId","identityId"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderItemId":{"examples":["2d33677772eddbd4e869c6ed6bf6d9f3","sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"description":"Order line id from /customer/order-list (or `<orderId>_<internal id>`).","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderId","orderItemId","identityId"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderItemId":{"examples":["2d33677772eddbd4e869c6ed6bf6d9f3","sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"description":"Order line id from /customer/order-list (or `<orderId>_<internal id>`).","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"}}}}}}}},"/api/v1/calendar/add-event":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"examples":["fqdjnvzrfqjcsmvyhgjirjtvftknayzx"],"type":"string"}},"required":["eventId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"eventId":{"examples":["fqdjnvzrfqjcsmvyhgjirjtvftknayzx"],"type":"string"}},"required":["eventId"]}},"text/plain":{"schema":{"type":"object","properties":{"eventId":{"examples":["fqdjnvzrfqjcsmvyhgjirjtvftknayzx"],"type":"string"}},"required":["eventId"]}}}}},"operationId":"postApiV1CalendarAdd-event","tags":["calendar"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event"],"properties":{"event":{"type":"object","required":["calendarId","startTime","endTime","title"],"properties":{"calendarId":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"description":"Unique identifier of the calendar where the event will be created.","type":"string"},"startTime":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 timestamp marking when the event starts.","type":"string"},"endTime":{"format":"date-time","examples":["2024-05-01T12:00:00.000Z"],"description":"ISO 8601 timestamp marking when the event ends.","type":"string"},"title":{"minLength":1,"maxLength":250,"description":"Short title that clearly describes the event.","examples":["Training with Jan"],"type":"string"},"description":{"description":"Additional details that describe the event context or purpose.","examples":["Training will start in Prague – Nusle."],"type":"string"},"agenda":{"description":"List of agenda items or talking points. Other team members may edit this content.","examples":["– Warm-up\n– Deadlift technique\n– Cool down"],"type":"string"},"url":{"examples":["https://gymroom.cz/pobocky/vinohrady"],"description":"Public or internal link associated with the event.","type":"string"},"notifyBefore":{"examples":["1h 30m"],"description":"Relative time before the event when email/sms notification should be sent.","type":"string"},"blockingTo":{"format":"date-time","examples":["2024-05-01T12:00:00.000Z"],"description":"Time until which the calendar slot remains blocked. Prevents overlapping reservations in the same resource.","type":"string"},"locationTitle":{"description":"Full physical address of the event location.","examples":["Varšavská 11, 120 00, Praha 2 – Vinohrady"],"type":"string"},"isAllDay":{"default":false,"description":"If true, the event spans the entire day (00:00–23:59).","examples":[false],"type":"boolean"},"isBlocking":{"default":true,"description":"If true, the event occupies a time slot and conflicts with other events.","examples":[true],"type":"boolean"},"attendees":{"type":"array","items":{"type":"object","required":["name"],"properties":{"memberId":{"description":"Internal system identifier of a registered member.","examples":[1234],"type":"number"},"customerId":{"description":"Unique external customer identifier,","examples":["HxanU4a1n4El61zx"],"type":"number"},"name":{"examples":["Jan Barášek"],"description":"Full name of the attendee.","type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Email address of the attendee.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Phone number of the attendee in international format.","type":"string"}}}},"type":{"examples":["training","webinar"],"description":"Classification of the event, used for filtering and analytics. Unknown type will be created.","type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["event"],"properties":{"event":{"type":"object","required":["calendarId","startTime","endTime","title"],"properties":{"calendarId":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"description":"Unique identifier of the calendar where the event will be created.","type":"string"},"startTime":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 timestamp marking when the event starts.","type":"string"},"endTime":{"format":"date-time","examples":["2024-05-01T12:00:00.000Z"],"description":"ISO 8601 timestamp marking when the event ends.","type":"string"},"title":{"minLength":1,"maxLength":250,"description":"Short title that clearly describes the event.","examples":["Training with Jan"],"type":"string"},"description":{"description":"Additional details that describe the event context or purpose.","examples":["Training will start in Prague – Nusle."],"type":"string"},"agenda":{"description":"List of agenda items or talking points. Other team members may edit this content.","examples":["– Warm-up\n– Deadlift technique\n– Cool down"],"type":"string"},"url":{"examples":["https://gymroom.cz/pobocky/vinohrady"],"description":"Public or internal link associated with the event.","type":"string"},"notifyBefore":{"examples":["1h 30m"],"description":"Relative time before the event when email/sms notification should be sent.","type":"string"},"blockingTo":{"format":"date-time","examples":["2024-05-01T12:00:00.000Z"],"description":"Time until which the calendar slot remains blocked. Prevents overlapping reservations in the same resource.","type":"string"},"locationTitle":{"description":"Full physical address of the event location.","examples":["Varšavská 11, 120 00, Praha 2 – Vinohrady"],"type":"string"},"isAllDay":{"default":false,"description":"If true, the event spans the entire day (00:00–23:59).","examples":[false],"type":"boolean"},"isBlocking":{"default":true,"description":"If true, the event occupies a time slot and conflicts with other events.","examples":[true],"type":"boolean"},"attendees":{"type":"array","items":{"type":"object","required":["name"],"properties":{"memberId":{"description":"Internal system identifier of a registered member.","examples":[1234],"type":"number"},"customerId":{"description":"Unique external customer identifier,","examples":["HxanU4a1n4El61zx"],"type":"number"},"name":{"examples":["Jan Barášek"],"description":"Full name of the attendee.","type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Email address of the attendee.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Phone number of the attendee in international format.","type":"string"}}}},"type":{"examples":["training","webinar"],"description":"Classification of the event, used for filtering and analytics. Unknown type will be created.","type":"string"}}}}}},"text/plain":{"schema":{"type":"object","required":["event"],"properties":{"event":{"type":"object","required":["calendarId","startTime","endTime","title"],"properties":{"calendarId":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"description":"Unique identifier of the calendar where the event will be created.","type":"string"},"startTime":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 timestamp marking when the event starts.","type":"string"},"endTime":{"format":"date-time","examples":["2024-05-01T12:00:00.000Z"],"description":"ISO 8601 timestamp marking when the event ends.","type":"string"},"title":{"minLength":1,"maxLength":250,"description":"Short title that clearly describes the event.","examples":["Training with Jan"],"type":"string"},"description":{"description":"Additional details that describe the event context or purpose.","examples":["Training will start in Prague – Nusle."],"type":"string"},"agenda":{"description":"List of agenda items or talking points. Other team members may edit this content.","examples":["– Warm-up\n– Deadlift technique\n– Cool down"],"type":"string"},"url":{"examples":["https://gymroom.cz/pobocky/vinohrady"],"description":"Public or internal link associated with the event.","type":"string"},"notifyBefore":{"examples":["1h 30m"],"description":"Relative time before the event when email/sms notification should be sent.","type":"string"},"blockingTo":{"format":"date-time","examples":["2024-05-01T12:00:00.000Z"],"description":"Time until which the calendar slot remains blocked. Prevents overlapping reservations in the same resource.","type":"string"},"locationTitle":{"description":"Full physical address of the event location.","examples":["Varšavská 11, 120 00, Praha 2 – Vinohrady"],"type":"string"},"isAllDay":{"default":false,"description":"If true, the event spans the entire day (00:00–23:59).","examples":[false],"type":"boolean"},"isBlocking":{"default":true,"description":"If true, the event occupies a time slot and conflicts with other events.","examples":[true],"type":"boolean"},"attendees":{"type":"array","items":{"type":"object","required":["name"],"properties":{"memberId":{"description":"Internal system identifier of a registered member.","examples":[1234],"type":"number"},"customerId":{"description":"Unique external customer identifier,","examples":["HxanU4a1n4El61zx"],"type":"number"},"name":{"examples":["Jan Barášek"],"description":"Full name of the attendee.","type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Email address of the attendee.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Phone number of the attendee in international format.","type":"string"}}}},"type":{"examples":["training","webinar"],"description":"Classification of the event, used for filtering and analytics. Unknown type will be created.","type":"string"}}}}}}}}}},"/api/v1/calendar/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"examples":["Jan reservation meeting calendar"],"type":"string"},"color":{"examples":["#000000"],"type":"string"},"timezone":{"examples":["Europe/Prague"],"type":"string"},"configuration":{"type":"object","required":["onlineChangeDeadline","relatedCalendarIds","reserveFrom","reserveUntil","timeSlotInterval","lateCancelEnabled","lateCancelMinBefore"],"properties":{"description":{"examples":["Personal meetings for new clients."],"type":"string"},"onlineChangeDeadline":{"examples":["24h"],"type":"string"},"relatedCalendarIds":{"type":"array","items":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"type":"string"}},"reserveFrom":{"examples":["0m"],"type":"string"},"reserveUntil":{"examples":["14d"],"type":"string"},"timeSlotInterval":{"examples":["15m"],"type":"string"},"lateCancelEnabled":{"description":"Late cancellation without refund is allowed for this calendar.","type":"boolean"},"lateCancelMinBefore":{"examples":["2h"],"description":"Late cancellation closes this long before the start.","type":"string"}}}},"required":["name","color","timezone","configuration"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"examples":["Jan reservation meeting calendar"],"type":"string"},"color":{"examples":["#000000"],"type":"string"},"timezone":{"examples":["Europe/Prague"],"type":"string"},"configuration":{"type":"object","required":["onlineChangeDeadline","relatedCalendarIds","reserveFrom","reserveUntil","timeSlotInterval","lateCancelEnabled","lateCancelMinBefore"],"properties":{"description":{"examples":["Personal meetings for new clients."],"type":"string"},"onlineChangeDeadline":{"examples":["24h"],"type":"string"},"relatedCalendarIds":{"type":"array","items":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"type":"string"}},"reserveFrom":{"examples":["0m"],"type":"string"},"reserveUntil":{"examples":["14d"],"type":"string"},"timeSlotInterval":{"examples":["15m"],"type":"string"},"lateCancelEnabled":{"description":"Late cancellation without refund is allowed for this calendar.","type":"boolean"},"lateCancelMinBefore":{"examples":["2h"],"description":"Late cancellation closes this long before the start.","type":"string"}}}},"required":["name","color","timezone","configuration"]}},"text/plain":{"schema":{"type":"object","properties":{"name":{"examples":["Jan reservation meeting calendar"],"type":"string"},"color":{"examples":["#000000"],"type":"string"},"timezone":{"examples":["Europe/Prague"],"type":"string"},"configuration":{"type":"object","required":["onlineChangeDeadline","relatedCalendarIds","reserveFrom","reserveUntil","timeSlotInterval","lateCancelEnabled","lateCancelMinBefore"],"properties":{"description":{"examples":["Personal meetings for new clients."],"type":"string"},"onlineChangeDeadline":{"examples":["24h"],"type":"string"},"relatedCalendarIds":{"type":"array","items":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"type":"string"}},"reserveFrom":{"examples":["0m"],"type":"string"},"reserveUntil":{"examples":["14d"],"type":"string"},"timeSlotInterval":{"examples":["15m"],"type":"string"},"lateCancelEnabled":{"description":"Late cancellation without refund is allowed for this calendar.","type":"boolean"},"lateCancelMinBefore":{"examples":["2h"],"description":"Late cancellation closes this long before the start.","type":"string"}}}},"required":["name","color","timezone","configuration"]}}}}},"operationId":"getApiV1CalendarDetail","tags":["calendar"]}},"/api/v1/calendar/event-find-conflict":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"operationId":"postApiV1CalendarEvent-find-conflict","tags":["calendar"],"responses":{"200":{}}}},"/api/v1/calendar/event-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Calendar internal code.","schema":{"type":"string"},"in":"query","name":"code","required":true},{"examples":["week"],"schema":{"anyOf":[{"const":"report","type":"string"},{"const":"day","type":"string"},{"const":"week","type":"string"},{"const":"month","type":"string"},{"const":"year","type":"string"}]},"in":"query","name":"step","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"returnPlainList","required":false},{"schema":{"type":"string"},"in":"query","name":"selectorFrom","required":false},{"schema":{"type":"string"},"in":"query","name":"eventTypeCode","required":false}],"operationId":"getApiV1CalendarEvent-list","tags":["calendar"],"responses":{"200":{}}}},"/api/v1/calendar/scheduling-assistant":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"code","required":true},{"schema":{"type":"string"},"in":"query","name":"startTime","required":true},{"schema":{"type":"string"},"in":"query","name":"endTime","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"calendarName":{"type":"string"},"events":{"type":"array","items":{"type":"object","required":["startTime","endTime","isAllDay","isBlocking"],"properties":{"startTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"reservedBlockingTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"examples":[false],"type":"boolean"},"isBlocking":{"examples":[true],"type":"boolean"}}}}},"required":["calendarName","events"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"calendarName":{"type":"string"},"events":{"type":"array","items":{"type":"object","required":["startTime","endTime","isAllDay","isBlocking"],"properties":{"startTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"reservedBlockingTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"examples":[false],"type":"boolean"},"isBlocking":{"examples":[true],"type":"boolean"}}}}},"required":["calendarName","events"]}},"text/plain":{"schema":{"type":"object","properties":{"calendarName":{"type":"string"},"events":{"type":"array","items":{"type":"object","required":["startTime","endTime","isAllDay","isBlocking"],"properties":{"startTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"reservedBlockingTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"examples":[false],"type":"boolean"},"isBlocking":{"examples":[true],"type":"boolean"}}}}},"required":["calendarName","events"]}}}}},"operationId":"getApiV1CalendarScheduling-assistant","tags":["calendar"]}},"/api/v1/calendar/timezones":{"get":{"parameters":[{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientTimezone":{"examples":["Europe/Prague"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"examples":["America/New_York"],"type":"string"},"timezone":{"examples":["America/New_York"],"type":"string"},"gmt":{"examples":["-05:00"],"type":"string"},"label":{"examples":["Eastern Time - New York"],"type":"string"}}}}},"required":["clientTimezone","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"clientTimezone":{"examples":["Europe/Prague"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"examples":["America/New_York"],"type":"string"},"timezone":{"examples":["America/New_York"],"type":"string"},"gmt":{"examples":["-05:00"],"type":"string"},"label":{"examples":["Eastern Time - New York"],"type":"string"}}}}},"required":["clientTimezone","items"]}},"text/plain":{"schema":{"type":"object","properties":{"clientTimezone":{"examples":["Europe/Prague"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"examples":["America/New_York"],"type":"string"},"timezone":{"examples":["America/New_York"],"type":"string"},"gmt":{"examples":["-05:00"],"type":"string"},"label":{"examples":["Eastern Time - New York"],"type":"string"}}}}},"required":["clientTimezone","items"]}}}}},"operationId":"getApiV1CalendarTimezones","tags":["calendar"]}},"/api/v1/calendar/attendee-accept":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"accepted","type":"string"},{"const":"already-accepted","type":"string"},{"const":"event-cancelled","type":"string"},{"const":"not-found","type":"string"}]},"redirectUrl":{"format":"uri","examples":["https://merchant.example.com/booking/thank-you"],"description":"Backlink stored on the order the event was booked through. Present only when the attendee is tied to an order with a non-NULL `return_url`; frontends should navigate to it after rendering the success screen.","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"accepted","type":"string"},{"const":"already-accepted","type":"string"},{"const":"event-cancelled","type":"string"},{"const":"not-found","type":"string"}]},"redirectUrl":{"format":"uri","examples":["https://merchant.example.com/booking/thank-you"],"description":"Backlink stored on the order the event was booked through. Present only when the attendee is tied to an order with a non-NULL `return_url`; frontends should navigate to it after rendering the success screen.","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"accepted","type":"string"},{"const":"already-accepted","type":"string"},{"const":"event-cancelled","type":"string"},{"const":"not-found","type":"string"}]},"redirectUrl":{"format":"uri","examples":["https://merchant.example.com/booking/thank-you"],"description":"Backlink stored on the order the event was booked through. Present only when the attendee is tied to an order with a non-NULL `return_url`; frontends should navigate to it after rendering the success screen.","type":"string"}},"required":["state"]}}}}},"operationId":"postApiV1CalendarAttendee-accept","tags":["calendar"],"summary":"Confirm attendance to a calendar event","description":"Flips `core__calendar_attendee.accepted` to true for the attendee behind the provided confirm hash. Idempotent — returns `already-accepted` if the token was already consumed and `event-cancelled` if the underlying event has been stornoed. When the attendee was created from a paid order that carries a `return_url`, that URL is echoed back as `redirectUrl` so the confirmation page can bounce the recipient to the merchant that originated the booking.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":32,"maxLength":32,"examples":["nbbaqgyvguwazuzrxynxwnpgnditjzbc"],"description":"Attendee confirm hash from the invitation link.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":32,"maxLength":32,"examples":["nbbaqgyvguwazuzrxynxwnpgnditjzbc"],"description":"Attendee confirm hash from the invitation link.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token"],"properties":{"token":{"minLength":32,"maxLength":32,"examples":["nbbaqgyvguwazuzrxynxwnpgnditjzbc"],"description":"Attendee confirm hash from the invitation link.","type":"string"}}}}}}}},"/api/v1/cart/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Existing cart ID. If omitted or invalid, a new empty cart is returned.","examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"schema":{"type":"string"},"in":"query","name":"cartId","required":false},{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false},{"description":"ISO 4217 currency (`CZK`, `EUR`, `USD`). An existing cart is switched to it and every item is re-priced from the current product prices (manual price for that currency, otherwise converted by the organisation rate and rounding). Delivery and payment prices are converted the same way. Omitted = the cart keeps the currency it already has (set by the first `cart/buy`).","examples":["EUR"],"schema":{"type":"string"},"in":"query","name":"currency","required":false},{"description":"Language of item labels and delivery names/descriptions (falls back to the default text).","examples":["sk","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"customerId":{"examples":["HxanU4a1n4El61zx"],"type":"string"},"customerName":{"examples":["Jan Barášek"],"type":"string"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceTotal":{"examples":[12699],"type":"number"},"deliveryCode":{"examples":["packeta"],"type":"string"},"deliveryBranchId":{"type":"number"},"deliveryBranchProvider":{"type":"string"},"paymentCode":{"examples":["comgate"],"type":"string"},"deliveryList":{"type":"array","items":{"type":"object","required":["name","code","price","active"],"properties":{"name":{"examples":["Zásilkovna"],"type":"string"},"code":{"examples":["packeta"],"type":"string"},"description":{"type":"string"},"price":{"examples":[59],"type":"number"},"active":{"examples":[true],"type":"boolean"},"selected":{"examples":[false],"type":"boolean"}}}},"paymentList":{"type":"array","items":{"type":"object","required":["name","code","price","active"],"properties":{"name":{"examples":["Online platba kartou"],"type":"string"},"code":{"examples":["comgate"],"type":"string"},"description":{"examples":["Platební brána Comgate"],"type":"string"},"price":{"examples":[0],"type":"number"},"active":{"examples":[true],"type":"boolean"},"selected":{"examples":[false],"type":"boolean"}}}},"deliveryAndPaymentCombinations":{"type":"array","items":{"type":"object","required":["deliveryCode","paymentCode"],"properties":{"deliveryCode":{"examples":["packeta"],"type":"string"},"paymentCode":{"examples":["comgate"],"type":"string"}}}},"items":{"type":"array","items":{"type":"object","required":["id","label","productCode","productSlug","price","quantity"],"properties":{"id":{"examples":["v211g68VlHP98w3s"],"type":"string"},"label":{"examples":["Coca cola zero"],"type":"string"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"productCode":{"examples":["coca-cola"],"type":"string"},"productSlug":{"examples":["coca-cola"],"type":"string"},"variantCode":{"examples":["coca-cola-zero"],"type":"string"},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"quantity":{"examples":[4],"type":"number"}}}}},"required":["id","currency","priceTotal","deliveryList","paymentList","deliveryAndPaymentCombinations","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"customerId":{"examples":["HxanU4a1n4El61zx"],"type":"string"},"customerName":{"examples":["Jan Barášek"],"type":"string"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceTotal":{"examples":[12699],"type":"number"},"deliveryCode":{"examples":["packeta"],"type":"string"},"deliveryBranchId":{"type":"number"},"deliveryBranchProvider":{"type":"string"},"paymentCode":{"examples":["comgate"],"type":"string"},"deliveryList":{"type":"array","items":{"type":"object","required":["name","code","price","active"],"properties":{"name":{"examples":["Zásilkovna"],"type":"string"},"code":{"examples":["packeta"],"type":"string"},"description":{"type":"string"},"price":{"examples":[59],"type":"number"},"active":{"examples":[true],"type":"boolean"},"selected":{"examples":[false],"type":"boolean"}}}},"paymentList":{"type":"array","items":{"type":"object","required":["name","code","price","active"],"properties":{"name":{"examples":["Online platba kartou"],"type":"string"},"code":{"examples":["comgate"],"type":"string"},"description":{"examples":["Platební brána Comgate"],"type":"string"},"price":{"examples":[0],"type":"number"},"active":{"examples":[true],"type":"boolean"},"selected":{"examples":[false],"type":"boolean"}}}},"deliveryAndPaymentCombinations":{"type":"array","items":{"type":"object","required":["deliveryCode","paymentCode"],"properties":{"deliveryCode":{"examples":["packeta"],"type":"string"},"paymentCode":{"examples":["comgate"],"type":"string"}}}},"items":{"type":"array","items":{"type":"object","required":["id","label","productCode","productSlug","price","quantity"],"properties":{"id":{"examples":["v211g68VlHP98w3s"],"type":"string"},"label":{"examples":["Coca cola zero"],"type":"string"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"productCode":{"examples":["coca-cola"],"type":"string"},"productSlug":{"examples":["coca-cola"],"type":"string"},"variantCode":{"examples":["coca-cola-zero"],"type":"string"},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"quantity":{"examples":[4],"type":"number"}}}}},"required":["id","currency","priceTotal","deliveryList","paymentList","deliveryAndPaymentCombinations","items"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"customerId":{"examples":["HxanU4a1n4El61zx"],"type":"string"},"customerName":{"examples":["Jan Barášek"],"type":"string"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceTotal":{"examples":[12699],"type":"number"},"deliveryCode":{"examples":["packeta"],"type":"string"},"deliveryBranchId":{"type":"number"},"deliveryBranchProvider":{"type":"string"},"paymentCode":{"examples":["comgate"],"type":"string"},"deliveryList":{"type":"array","items":{"type":"object","required":["name","code","price","active"],"properties":{"name":{"examples":["Zásilkovna"],"type":"string"},"code":{"examples":["packeta"],"type":"string"},"description":{"type":"string"},"price":{"examples":[59],"type":"number"},"active":{"examples":[true],"type":"boolean"},"selected":{"examples":[false],"type":"boolean"}}}},"paymentList":{"type":"array","items":{"type":"object","required":["name","code","price","active"],"properties":{"name":{"examples":["Online platba kartou"],"type":"string"},"code":{"examples":["comgate"],"type":"string"},"description":{"examples":["Platební brána Comgate"],"type":"string"},"price":{"examples":[0],"type":"number"},"active":{"examples":[true],"type":"boolean"},"selected":{"examples":[false],"type":"boolean"}}}},"deliveryAndPaymentCombinations":{"type":"array","items":{"type":"object","required":["deliveryCode","paymentCode"],"properties":{"deliveryCode":{"examples":["packeta"],"type":"string"},"paymentCode":{"examples":["comgate"],"type":"string"}}}},"items":{"type":"array","items":{"type":"object","required":["id","label","productCode","productSlug","price","quantity"],"properties":{"id":{"examples":["v211g68VlHP98w3s"],"type":"string"},"label":{"examples":["Coca cola zero"],"type":"string"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"productCode":{"examples":["coca-cola"],"type":"string"},"productSlug":{"examples":["coca-cola"],"type":"string"},"variantCode":{"examples":["coca-cola-zero"],"type":"string"},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"quantity":{"examples":[4],"type":"number"}}}}},"required":["id","currency","priceTotal","deliveryList","paymentList","deliveryAndPaymentCombinations","items"]}}}}},"operationId":"getApiV1CartDetail","tags":["cart"],"summary":"Get cart detail","description":"Returns the full cart state including items, prices, available delivery/payment methods, and their valid combinations. Creates a new cart if cartId is not provided."}},"/api/v1/cart/buy":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CartBuy","tags":["cart"],"summary":"Add product to cart","description":"Adds a product (optionally a specific variant) to the cart. If the product already exists in the cart, its quantity is increased.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cartId","productCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"identityId":{"examples":["9jq49ZE1xoKI7S5ys4J0a70y3Xp2hQqc"],"description":"Use customer identity cookies value when is logged in.","type":"string"},"quantity":{"examples":[2],"type":"number"},"productCode":{"examples":["coca-cola"],"type":"string"},"productVariantCode":{"examples":["coca-cola-zero"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"currency":{"examples":["EUR"],"description":"ISO 4217 currency of the cart (`CZK`, `EUR`, `USD`). The cart remembers it; sending a different currency later switches the cart and re-prices all items. Omitted = current cart currency (organisation default for a new cart).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["cartId","productCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"identityId":{"examples":["9jq49ZE1xoKI7S5ys4J0a70y3Xp2hQqc"],"description":"Use customer identity cookies value when is logged in.","type":"string"},"quantity":{"examples":[2],"type":"number"},"productCode":{"examples":["coca-cola"],"type":"string"},"productVariantCode":{"examples":["coca-cola-zero"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"currency":{"examples":["EUR"],"description":"ISO 4217 currency of the cart (`CZK`, `EUR`, `USD`). The cart remembers it; sending a different currency later switches the cart and re-prices all items. Omitted = current cart currency (organisation default for a new cart).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["cartId","productCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"identityId":{"examples":["9jq49ZE1xoKI7S5ys4J0a70y3Xp2hQqc"],"description":"Use customer identity cookies value when is logged in.","type":"string"},"quantity":{"examples":[2],"type":"number"},"productCode":{"examples":["coca-cola"],"type":"string"},"productVariantCode":{"examples":["coca-cola-zero"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"currency":{"examples":["EUR"],"description":"ISO 4217 currency of the cart (`CZK`, `EUR`, `USD`). The cart remembers it; sending a different currency later switches the cart and re-prices all items. Omitted = current cart currency (organisation default for a new cart).","type":"string"}}}}}}}},"/api/v1/cart/change-quantity":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CartChange-quantity","tags":["cart"],"summary":"Change cart item quantity","description":"Updates the quantity of an existing cart item. Setting quantity to 0 removes the item from the cart.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cartId","itemId","quantity"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"itemId":{"examples":["8YOoIOOuc48IShi2"],"type":"string"},"quantity":{"examples":[4,0],"description":"Set product quantity. Use `0` to remove item from cart.","type":"number"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["cartId","itemId","quantity"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"itemId":{"examples":["8YOoIOOuc48IShi2"],"type":"string"},"quantity":{"examples":[4,0],"description":"Set product quantity. Use `0` to remove item from cart.","type":"number"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["cartId","itemId","quantity"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"itemId":{"examples":["8YOoIOOuc48IShi2"],"type":"string"},"quantity":{"examples":[4,0],"description":"Set product quantity. Use `0` to remove item from cart.","type":"number"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/cart/set-delivery":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CartSet-delivery","tags":["cart"],"summary":"Set cart delivery method","description":"Sets the delivery method for the cart. Use codes from the deliveryList returned by /detail. A payment chosen earlier that cannot be combined with the new delivery is cleared. Unknown or inactive code = 404.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cartId","deliveryCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"deliveryCode":{"description":"Delivery method code.","examples":["packeta"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["cartId","deliveryCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"deliveryCode":{"description":"Delivery method code.","examples":["packeta"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["cartId","deliveryCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"deliveryCode":{"description":"Delivery method code.","examples":["packeta"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/cart/set-payment":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CartSet-payment","tags":["cart"],"summary":"Set cart payment method","description":"Sets the payment method for the cart. Use codes from the paymentList returned by /detail. With a delivery already chosen, the pair must be offered (deliveryAndPaymentCombinations). Unknown, inactive or not combinable code = 404.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cartId","paymentCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"paymentCode":{"description":"Payment method code.","examples":["comgate"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["cartId","paymentCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"paymentCode":{"description":"Payment method code.","examples":["comgate"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["cartId","paymentCode"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"paymentCode":{"description":"Payment method code.","examples":["comgate"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/cart/set-packeta-branch":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CartSet-packeta-branch","tags":["cart"],"summary":"Set Packeta pickup branch","description":"Sets the Packeta pickup point for the cart. Only applicable when delivery method is Packeta.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cartId","packetaBranchId"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"packetaBranchId":{"description":"Packeta pickup point branch ID.","examples":[12345],"type":"number"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["cartId","packetaBranchId"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"packetaBranchId":{"description":"Packeta pickup point branch ID.","examples":[12345],"type":"number"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["cartId","packetaBranchId"],"properties":{"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"packetaBranchId":{"description":"Packeta pickup point branch ID.","examples":[12345],"type":"number"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/chat/room":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"in":"query","name":"kind","required":false},{"schema":{"type":"string","maxLength":32},"in":"query","name":"source","required":false},{"description":"Partition rooms by end-user id (e.g. ChatSPC cuRefNo, anon-token).","schema":{"type":"string","maxLength":64},"in":"query","name":"externalUserRef","required":false},{"description":"Filter to threads owned by this shop__contact.external_id.","schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"contactExternalId","required":false},{"description":"ILIKE filter against title.","schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false},{"description":"Maximum items (1–200, default 50). Sent as a query string.","schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Number of items to skip (default 0). Sent as a query string.","schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","kind","title","source","model","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"description":"16-char shop__contact.external_id of the logged-in customer who owns this thread. Null for anonymous threads and member-owned (internal) threads.","type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"description":"Display name of the owning contact (first_name + last_name, or company_name as fallback). Null when no owner is set or when the contact has no name fields filled.","type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"description":"True when the conversation is flagged as a problem case (toggleable).","type":"boolean"},"hasProblematicMessage":{"description":"True when at least one message in the thread is marked problematic.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","kind","title","source","model","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"description":"16-char shop__contact.external_id of the logged-in customer who owns this thread. Null for anonymous threads and member-owned (internal) threads.","type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"description":"Display name of the owning contact (first_name + last_name, or company_name as fallback). Null when no owner is set or when the contact has no name fields filled.","type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"description":"True when the conversation is flagged as a problem case (toggleable).","type":"boolean"},"hasProblematicMessage":{"description":"True when at least one message in the thread is marked problematic.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","kind","title","source","model","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"description":"16-char shop__contact.external_id of the logged-in customer who owns this thread. Null for anonymous threads and member-owned (internal) threads.","type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"description":"Display name of the owning contact (first_name + last_name, or company_name as fallback). Null when no owner is set or when the contact has no name fields filled.","type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"description":"True when the conversation is flagged as a problem case (toggleable).","type":"boolean"},"hasProblematicMessage":{"description":"True when at least one message in the thread is marked problematic.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}}}}},"operationId":"getApiV1ChatRoom","tags":["chat"],"summary":"List chat rooms (paginated)","description":"Returns rooms owned by the API key holder, newest activity first."},"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"}},"required":["id"]}}}}},"operationId":"postApiV1ChatRoom","tags":["chat"],"summary":"Create a new chat room","description":"Returns the 24-char public id you can use to append messages.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"external","type":"string"}]},"title":{"maxLength":200,"type":"string"},"source":{"maxLength":32,"type":"string"},"model":{"maxLength":100,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"contactExternalId":{"minLength":16,"maxLength":16,"description":"16-char `shop__contact.external_id` of the logged-in customer who's starting this thread. The API resolves it to a numeric contact id, stamps it on `cas__chat_room.owner_contact_id`, and inserts a matching `cas__chat_participant` row. Unknown ids are silently ignored (the room is still created without an owner).","type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"external","type":"string"}]},"title":{"maxLength":200,"type":"string"},"source":{"maxLength":32,"type":"string"},"model":{"maxLength":100,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"contactExternalId":{"minLength":16,"maxLength":16,"description":"16-char `shop__contact.external_id` of the logged-in customer who's starting this thread. The API resolves it to a numeric contact id, stamps it on `cas__chat_room.owner_contact_id`, and inserts a matching `cas__chat_participant` row. Unknown ids are silently ignored (the room is still created without an owner).","type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"text/plain":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"external","type":"string"}]},"title":{"maxLength":200,"type":"string"},"source":{"maxLength":32,"type":"string"},"model":{"maxLength":100,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"contactExternalId":{"minLength":16,"maxLength":16,"description":"16-char `shop__contact.external_id` of the logged-in customer who's starting this thread. The API resolves it to a numeric contact id, stamps it on `cas__chat_room.owner_contact_id`, and inserts a matching `cas__chat_participant` row. Unknown ids are silently ignored (the room is still created without an owner).","type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}}}},"/api/v1/chat/room/{id}":{"get":{"parameters":[{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"schema":{"type":"string","minLength":24,"maxLength":24},"in":"path","name":"id","required":true},{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","kind","title","source","model","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"description":"16-char shop__contact.external_id of the logged-in customer who owns this thread. Null for anonymous threads and member-owned (internal) threads.","type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"description":"Display name of the owning contact (first_name + last_name, or company_name as fallback). Null when no owner is set or when the contact has no name fields filled.","type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"description":"True when the conversation is flagged as a problem case (toggleable).","type":"boolean"},"hasProblematicMessage":{"description":"True when at least one message in the thread is marked problematic.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"messages":{"type":"array","items":{"type":"object","required":["id","position","role","content","model","inputTokens","outputTokens","toolCalls","isMarkedProblematic","insertedDate","metadata"],"properties":{"id":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"content":{"type":"string"},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"outputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"toolCalls":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},{"type":"null"}]},"isMarkedProblematic":{"description":"True when this single turn is flagged problematic (permanent — no untoggle).","type":"boolean"},"insertedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","kind","title","source","model","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"description":"16-char shop__contact.external_id of the logged-in customer who owns this thread. Null for anonymous threads and member-owned (internal) threads.","type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"description":"Display name of the owning contact (first_name + last_name, or company_name as fallback). Null when no owner is set or when the contact has no name fields filled.","type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"description":"True when the conversation is flagged as a problem case (toggleable).","type":"boolean"},"hasProblematicMessage":{"description":"True when at least one message in the thread is marked problematic.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"messages":{"type":"array","items":{"type":"object","required":["id","position","role","content","model","inputTokens","outputTokens","toolCalls","isMarkedProblematic","insertedDate","metadata"],"properties":{"id":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"content":{"type":"string"},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"outputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"toolCalls":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},{"type":"null"}]},"isMarkedProblematic":{"description":"True when this single turn is flagged problematic (permanent — no untoggle).","type":"boolean"},"insertedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","kind","title","source","model","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"description":"16-char shop__contact.external_id of the logged-in customer who owns this thread. Null for anonymous threads and member-owned (internal) threads.","type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"description":"Display name of the owning contact (first_name + last_name, or company_name as fallback). Null when no owner is set or when the contact has no name fields filled.","type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"description":"True when the conversation is flagged as a problem case (toggleable).","type":"boolean"},"hasProblematicMessage":{"description":"True when at least one message in the thread is marked problematic.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"messages":{"type":"array","items":{"type":"object","required":["id","position","role","content","model","inputTokens","outputTokens","toolCalls","isMarkedProblematic","insertedDate","metadata"],"properties":{"id":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"content":{"type":"string"},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"outputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"toolCalls":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},{"type":"null"}]},"isMarkedProblematic":{"description":"True when this single turn is flagged problematic (permanent — no untoggle).","type":"boolean"},"insertedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","kind","title","source","model","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"description":"16-char shop__contact.external_id of the logged-in customer who owns this thread. Null for anonymous threads and member-owned (internal) threads.","type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"description":"Display name of the owning contact (first_name + last_name, or company_name as fallback). Null when no owner is set or when the contact has no name fields filled.","type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"description":"True when the conversation is flagged as a problem case (toggleable).","type":"boolean"},"hasProblematicMessage":{"description":"True when at least one message in the thread is marked problematic.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"messages":{"type":"array","items":{"type":"object","required":["id","position","role","content","model","inputTokens","outputTokens","toolCalls","isMarkedProblematic","insertedDate","metadata"],"properties":{"id":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"content":{"type":"string"},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"outputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"toolCalls":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},{"type":"null"}]},"isMarkedProblematic":{"description":"True when this single turn is flagged problematic (permanent — no untoggle).","type":"boolean"},"insertedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}}}}},"operationId":"getApiV1ChatRoomById","tags":["chat"],"summary":"Get a chat room with all its messages"},"delete":{"parameters":[{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"schema":{"type":"string","minLength":24,"maxLength":24},"in":"path","name":"id","required":true},{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}}}}},"operationId":"deleteApiV1ChatRoomById","tags":["chat"],"summary":"Soft-delete a chat room (sets deleted_date)"}},"/api/v1/chat/room/{id}/message":{"post":{"parameters":[{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"schema":{"type":"string","minLength":24,"maxLength":24},"in":"path","name":"id","required":true},{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","id","position"],"properties":{"state":{"const":"ok","type":"string"},"id":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","id","position"],"properties":{"state":{"const":"ok","type":"string"},"id":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","id","position"],"properties":{"state":{"const":"ok","type":"string"},"id":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","id","position"],"properties":{"state":{"const":"ok","type":"string"},"id":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}}}}},"operationId":"postApiV1ChatRoomByIdMessage","tags":["chat"],"summary":"Append a message to a chat room","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content"],"properties":{"content":{"minLength":1,"description":"Message body.","type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"model":{"maxLength":100,"type":"string"},"inputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"outputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"toolCalls":{"description":"Debug trail of tool invocations for this turn — each entry is one tool call ({ toolCallId, toolName, args, result, state }). Persisted as-is in cas__chat_message.tool_calls (jsonb).","type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"markProblematic":{"description":"Permanently flag this single message as problematic. Used by ChatSPC when the model calls `recordUnansweredQuery` — there's no message-level untoggle.","type":"boolean"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["content"],"properties":{"content":{"minLength":1,"description":"Message body.","type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"model":{"maxLength":100,"type":"string"},"inputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"outputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"toolCalls":{"description":"Debug trail of tool invocations for this turn — each entry is one tool call ({ toolCallId, toolName, args, result, state }). Persisted as-is in cas__chat_message.tool_calls (jsonb).","type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"markProblematic":{"description":"Permanently flag this single message as problematic. Used by ChatSPC when the model calls `recordUnansweredQuery` — there's no message-level untoggle.","type":"boolean"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"text/plain":{"schema":{"type":"object","required":["content"],"properties":{"content":{"minLength":1,"description":"Message body.","type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"model":{"maxLength":100,"type":"string"},"inputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"outputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"toolCalls":{"description":"Debug trail of tool invocations for this turn — each entry is one tool call ({ toolCallId, toolName, args, result, state }). Persisted as-is in cas__chat_message.tool_calls (jsonb).","type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"markProblematic":{"description":"Permanently flag this single message as problematic. Used by ChatSPC when the model calls `recordUnansweredQuery` — there's no message-level untoggle.","type":"boolean"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}}}},"/api/v1/chat/room/{id}/title":{"post":{"parameters":[{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"schema":{"type":"string","minLength":24,"maxLength":24},"in":"path","name":"id","required":true},{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}}}}},"operationId":"postApiV1ChatRoomByIdTitle","tags":["chat"],"summary":"Rename a chat room","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"minLength":1,"maxLength":200,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["title"],"properties":{"title":{"minLength":1,"maxLength":200,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["title"],"properties":{"title":{"minLength":1,"maxLength":200,"type":"string"}}}}}}}},"/api/v1/chat/room/{id}/problem":{"post":{"parameters":[{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"schema":{"type":"string","minLength":24,"maxLength":24},"in":"path","name":"id","required":true},{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","success"],"properties":{"state":{"const":"ok","type":"string"},"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"}}}]}}}}},"operationId":"postApiV1ChatRoomByIdProblem","tags":["chat"],"summary":"Toggle the conversation-level problem flag","description":"ChatSPC sets this to true when the model calls `recordUnansweredQuery`, and back to false on a follow-up turn that does provide an answer. Idempotent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["state"],"properties":{"state":{"description":"true → stamp `problem_marked_date = NOW()` (flag as a problem case). false → clear it (model resolved the question after all).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["state"],"properties":{"state":{"description":"true → stamp `problem_marked_date = NOW()` (flag as a problem case). false → clear it (model resolved the question after all).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["state"],"properties":{"state":{"description":"true → stamp `problem_marked_date = NOW()` (flag as a problem case). false → clear it (model resolved the question after all).","type":"boolean"}}}}}}}},"/api/v1/chat/ai-turn":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"userMessageId":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"answer":{"type":"string"}},"required":["roomId","userMessageId","assistantMessageId","answer"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"roomId":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"userMessageId":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"answer":{"type":"string"}},"required":["roomId","userMessageId","assistantMessageId","answer"]}},"text/plain":{"schema":{"type":"object","properties":{"roomId":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"userMessageId":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"description":"Chat message public id (cas__chat_message.external_id), 24 chars.","minLength":24,"maxLength":24,"type":"string"},"answer":{"type":"string"}},"required":["roomId","userMessageId","assistantMessageId","answer"]}}}}},"operationId":"postApiV1ChatAi-turn","tags":["chat"],"summary":"AI turn — append user prompt + assistant answer in one call","description":"Persists both messages in cas__chat_message and returns the answer + ids. Creates the room when `roomId` is omitted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"description":"The user prompt.","type":"string"},"roomId":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"contactExternalId":{"minLength":16,"maxLength":16,"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"description":"The user prompt.","type":"string"},"roomId":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"contactExternalId":{"minLength":16,"maxLength":16,"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"text/plain":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"description":"The user prompt.","type":"string"},"roomId":{"description":"Chat room public id (cas__chat_room.external_id), 24 chars.","minLength":24,"maxLength":24,"examples":["ZUiVZuKwAaXNoT4nGUbnKR75"],"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"contactExternalId":{"minLength":16,"maxLength":16,"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}}}},"/api/v1/crm/member-invite/validate":{"get":{"parameters":[{"description":"Invitation token from the e-mail link.","schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getApiV1CrmMember-inviteValidate","tags":["crm"],"summary":"Validate a member-invitation token","description":"Returns invitation metadata (organisation name, e-mail, optional first/last name pre-fill) if the token is valid and not expired. Used by the public marketing site to render the set-password registration form.","responses":{"200":{}}}},"/api/v1/crm/member-invite/complete":{"post":{"parameters":[],"operationId":"postApiV1CrmMember-inviteComplete","tags":["crm"],"summary":"Complete a member invitation","description":"Finishes the invitation flow — creates the user/contact, joins the organisation, applies pre-granted permissions stored on the invitation, and invalidates the token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","firstName","lastName","password","agreeToTerms"],"properties":{"token":{"description":"Invitation token from the e-mail link.","type":"string"},"firstName":{"description":"First name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"lastName":{"description":"Last name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"password":{"description":"Chosen account password.","minLength":8,"type":"string"},"agreeToTerms":{"description":"Accepted Terms of Service.","type":"boolean"},"agreeToMarketing":{"description":"Accepted marketing communications.","type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","firstName","lastName","password","agreeToTerms"],"properties":{"token":{"description":"Invitation token from the e-mail link.","type":"string"},"firstName":{"description":"First name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"lastName":{"description":"Last name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"password":{"description":"Chosen account password.","minLength":8,"type":"string"},"agreeToTerms":{"description":"Accepted Terms of Service.","type":"boolean"},"agreeToMarketing":{"description":"Accepted marketing communications.","type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token","firstName","lastName","password","agreeToTerms"],"properties":{"token":{"description":"Invitation token from the e-mail link.","type":"string"},"firstName":{"description":"First name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"lastName":{"description":"Last name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"password":{"description":"Chosen account password.","minLength":8,"type":"string"},"agreeToTerms":{"description":"Accepted Terms of Service.","type":"boolean"},"agreeToMarketing":{"description":"Accepted marketing communications.","type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}},"responses":{"200":{}}}},"/api/v1/cron-run/start":{"post":{"parameters":[],"operationId":"postApiV1Cron-runStart","tags":["cron-run"],"summary":"Start a cron run","description":"Opens a new run and returns its `id`. Errors: `PUBLIC_CRON_JOB_CODE_INVALID`, `PUBLIC_CRON_JOB_LIMIT_EXCEEDED`, `PUBLIC_CRON_RUN_LIMIT_EXCEEDED`, `PUBLIC_CRON_RUN_RATE_LIMITED`, `PUBLIC_REQUEST_VALIDATION_FAILED`. A `meta` over 16 KB is stored as a truncation marker. Counts into the cron monitor quota of the API key (10,000 requests per hour, separate from other endpoints). Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix seconds).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"minLength":1,"maxLength":200,"description":"Job type identifier. A code seen for the first time creates the job automatically. Normalized to `[A-Za-z0-9._:-]`, max 64 characters. Recommended form: `<application>:<job>`. Keep it stable: never put ids, dates or arguments into it.","examples":["eshop:sync-orders"],"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"Human-readable job name shown in the admin. Ignored when empty, equal to `code`, or after the job was renamed in the admin.","type":"string"},{"type":"null"}]},"expiration":{"nullable":true,"anyOf":[{"minimum":10,"maximum":604800,"description":"Idle timeout in seconds. Every log / heartbeat call extends it again. When no call arrives in time the run is closed as `timeout` and a critical log entry is written. Default 3600 (60 min).","examples":[900],"type":"number"},{"type":"null"}]},"meta":{"nullable":true,"anyOf":[{"description":"Context of the run (host, version, arguments), up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"tier":{"nullable":true,"anyOf":[{"maxLength":48,"description":"Scheduler bucket, filterable in the admin job list.","examples":["nightly"],"type":"string"},{"type":"null"}]},"idempotencyKey":{"nullable":true,"anyOf":[{"maxLength":64,"description":"When a call is retried with the same key for the same job, the existing run is returned (`reused: true`).","type":"string"},{"type":"null"}]},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Expected schedule as a cron expression (5 fields, or 6 with leading seconds; macros like `@daily`). Enables the dead man's switch: when no run starts within the grace period after an expected time, a critical \"missed run\" alert is raised. `null` removes the schedule, omitting it keeps the stored one (falls back to `meta.schedule`). An invalid value does not reject the run; it is ignored and reported in `warnings`. A schedule edited in the admin takes precedence.","examples":["*/5 * * * *"],"type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone of `schedule`. Default UTC.","examples":["Europe/Prague"],"type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","type":"integer"}]},{"type":"null"}]}},"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"minLength":1,"maxLength":200,"description":"Job type identifier. A code seen for the first time creates the job automatically. Normalized to `[A-Za-z0-9._:-]`, max 64 characters. Recommended form: `<application>:<job>`. Keep it stable: never put ids, dates or arguments into it.","examples":["eshop:sync-orders"],"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"Human-readable job name shown in the admin. Ignored when empty, equal to `code`, or after the job was renamed in the admin.","type":"string"},{"type":"null"}]},"expiration":{"nullable":true,"anyOf":[{"minimum":10,"maximum":604800,"description":"Idle timeout in seconds. Every log / heartbeat call extends it again. When no call arrives in time the run is closed as `timeout` and a critical log entry is written. Default 3600 (60 min).","examples":[900],"type":"number"},{"type":"null"}]},"meta":{"nullable":true,"anyOf":[{"description":"Context of the run (host, version, arguments), up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"tier":{"nullable":true,"anyOf":[{"maxLength":48,"description":"Scheduler bucket, filterable in the admin job list.","examples":["nightly"],"type":"string"},{"type":"null"}]},"idempotencyKey":{"nullable":true,"anyOf":[{"maxLength":64,"description":"When a call is retried with the same key for the same job, the existing run is returned (`reused: true`).","type":"string"},{"type":"null"}]},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Expected schedule as a cron expression (5 fields, or 6 with leading seconds; macros like `@daily`). Enables the dead man's switch: when no run starts within the grace period after an expected time, a critical \"missed run\" alert is raised. `null` removes the schedule, omitting it keeps the stored one (falls back to `meta.schedule`). An invalid value does not reject the run; it is ignored and reported in `warnings`. A schedule edited in the admin takes precedence.","examples":["*/5 * * * *"],"type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone of `schedule`. Default UTC.","examples":["Europe/Prague"],"type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","type":"integer"}]},{"type":"null"}]}},"additionalProperties":false}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"minLength":1,"maxLength":200,"description":"Job type identifier. A code seen for the first time creates the job automatically. Normalized to `[A-Za-z0-9._:-]`, max 64 characters. Recommended form: `<application>:<job>`. Keep it stable: never put ids, dates or arguments into it.","examples":["eshop:sync-orders"],"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"Human-readable job name shown in the admin. Ignored when empty, equal to `code`, or after the job was renamed in the admin.","type":"string"},{"type":"null"}]},"expiration":{"nullable":true,"anyOf":[{"minimum":10,"maximum":604800,"description":"Idle timeout in seconds. Every log / heartbeat call extends it again. When no call arrives in time the run is closed as `timeout` and a critical log entry is written. Default 3600 (60 min).","examples":[900],"type":"number"},{"type":"null"}]},"meta":{"nullable":true,"anyOf":[{"description":"Context of the run (host, version, arguments), up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"tier":{"nullable":true,"anyOf":[{"maxLength":48,"description":"Scheduler bucket, filterable in the admin job list.","examples":["nightly"],"type":"string"},{"type":"null"}]},"idempotencyKey":{"nullable":true,"anyOf":[{"maxLength":64,"description":"When a call is retried with the same key for the same job, the existing run is returned (`reused: true`).","type":"string"},{"type":"null"}]},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Expected schedule as a cron expression (5 fields, or 6 with leading seconds; macros like `@daily`). Enables the dead man's switch: when no run starts within the grace period after an expected time, a critical \"missed run\" alert is raised. `null` removes the schedule, omitting it keeps the stored one (falls back to `meta.schedule`). An invalid value does not reject the run; it is ignored and reported in `warnings`. A schedule edited in the admin takes precedence.","examples":["*/5 * * * *"],"type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone of `schedule`. Default UTC.","examples":["Europe/Prague"],"type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","type":"integer"}]},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{}}}},"/api/v1/cron-run/record":{"post":{"parameters":[],"operationId":"postApiV1Cron-runRecord","tags":["cron-run"],"summary":"Record a finished cron run in one request","description":"Stores a run that already happened (start, end, outcome, up to 100 log entries) with one call instead of start + finish. Meant for short, frequent jobs. The run counts into the job statistics and alerts exactly like a regular one. Errors: `PUBLIC_CRON_RUN_RECORD_INVALID` (timestamps), `PUBLIC_CRON_JOB_CODE_INVALID`, `PUBLIC_CRON_JOB_LIMIT_EXCEEDED`, `PUBLIC_CRON_RUN_RATE_LIMITED`. Counts into the cron monitor quota of the API key (10,000 requests per hour, separate from other endpoints). Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix seconds).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","startedAt","finishedAt"],"properties":{"code":{"minLength":1,"maxLength":200,"description":"Job type identifier. A code seen for the first time creates the job automatically. Normalized to `[A-Za-z0-9._:-]`, max 64 characters. Recommended form: `<application>:<job>`. Keep it stable: never put ids, dates or arguments into it.","examples":["eshop:sync-orders"],"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"Human-readable job name shown in the admin. Ignored when empty, equal to `code`, or after the job was renamed in the admin.","type":"string"},{"type":"null"}]},"expiration":{"nullable":true,"anyOf":[{"minimum":10,"maximum":604800,"description":"Idle timeout in seconds. Every log / heartbeat call extends it again. When no call arrives in time the run is closed as `timeout` and a critical log entry is written. Default 3600 (60 min).","examples":[900],"type":"number"},{"type":"null"}]},"meta":{"nullable":true,"anyOf":[{"description":"Context of the run (host, version, arguments), up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"tier":{"nullable":true,"anyOf":[{"maxLength":48,"description":"Scheduler bucket, filterable in the admin job list.","examples":["nightly"],"type":"string"},{"type":"null"}]},"idempotencyKey":{"nullable":true,"anyOf":[{"maxLength":64,"description":"When a call is retried with the same key for the same job, the existing run is returned (`reused: true`).","type":"string"},{"type":"null"}]},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Expected schedule as a cron expression (5 fields, or 6 with leading seconds; macros like `@daily`). Enables the dead man's switch: when no run starts within the grace period after an expected time, a critical \"missed run\" alert is raised. `null` removes the schedule, omitting it keeps the stored one (falls back to `meta.schedule`). An invalid value does not reject the run; it is ignored and reported in `warnings`. A schedule edited in the admin takes precedence.","examples":["*/5 * * * *"],"type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone of `schedule`. Default UTC.","examples":["Europe/Prague"],"type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","type":"integer"}]},{"type":"null"}]},"startedAt":{"description":"ISO-8601 start of the run (at most 7 days old).","examples":["2026-11-05T12:00:00.120Z"],"type":"string"},"finishedAt":{"description":"ISO-8601 end of the run, not before `startedAt`.","examples":["2026-11-05T12:00:00.480Z"],"type":"string"},"status":{"nullable":true,"anyOf":[{"description":"Outcome of the run. Defaults to `success`.","anyOf":[{"const":"success","type":"string"},{"const":"error","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"maxLength":20000,"description":"Final message, e.g. the error text. `null` = none.","type":"string"},{"type":"null"}]},"report":{"nullable":true,"anyOf":[{"description":"Summary of the run, e.g. `{ \"processed\": 120 }`, up to 16 KB. `null` = none.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"exitCode":{"nullable":true,"anyOf":[{"minimum":-32768,"maximum":32767,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-32768,"maximum":32767,"type":"integer"}]},{"type":"null"}]},"peakMemoryMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"heapUsedMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"entries":{"nullable":true,"anyOf":[{"maxItems":100,"description":"Log entries of the run, in order.","type":"array","items":{"type":"object","required":["message"],"properties":{"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"minLength":1,"maxLength":20000,"description":"Log message (stored up to 4000 characters).","type":"string"},"context":{"nullable":true,"anyOf":[{"description":"Structured context, up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"description":"ISO-8601 time the entry was produced on the client.","examples":["2026-11-05T10:15:00.000Z"],"type":"string"},{"type":"null"}]}}}},{"type":"null"}]}},"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","required":["code","startedAt","finishedAt"],"properties":{"code":{"minLength":1,"maxLength":200,"description":"Job type identifier. A code seen for the first time creates the job automatically. Normalized to `[A-Za-z0-9._:-]`, max 64 characters. Recommended form: `<application>:<job>`. Keep it stable: never put ids, dates or arguments into it.","examples":["eshop:sync-orders"],"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"Human-readable job name shown in the admin. Ignored when empty, equal to `code`, or after the job was renamed in the admin.","type":"string"},{"type":"null"}]},"expiration":{"nullable":true,"anyOf":[{"minimum":10,"maximum":604800,"description":"Idle timeout in seconds. Every log / heartbeat call extends it again. When no call arrives in time the run is closed as `timeout` and a critical log entry is written. Default 3600 (60 min).","examples":[900],"type":"number"},{"type":"null"}]},"meta":{"nullable":true,"anyOf":[{"description":"Context of the run (host, version, arguments), up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"tier":{"nullable":true,"anyOf":[{"maxLength":48,"description":"Scheduler bucket, filterable in the admin job list.","examples":["nightly"],"type":"string"},{"type":"null"}]},"idempotencyKey":{"nullable":true,"anyOf":[{"maxLength":64,"description":"When a call is retried with the same key for the same job, the existing run is returned (`reused: true`).","type":"string"},{"type":"null"}]},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Expected schedule as a cron expression (5 fields, or 6 with leading seconds; macros like `@daily`). Enables the dead man's switch: when no run starts within the grace period after an expected time, a critical \"missed run\" alert is raised. `null` removes the schedule, omitting it keeps the stored one (falls back to `meta.schedule`). An invalid value does not reject the run; it is ignored and reported in `warnings`. A schedule edited in the admin takes precedence.","examples":["*/5 * * * *"],"type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone of `schedule`. Default UTC.","examples":["Europe/Prague"],"type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","type":"integer"}]},{"type":"null"}]},"startedAt":{"description":"ISO-8601 start of the run (at most 7 days old).","examples":["2026-11-05T12:00:00.120Z"],"type":"string"},"finishedAt":{"description":"ISO-8601 end of the run, not before `startedAt`.","examples":["2026-11-05T12:00:00.480Z"],"type":"string"},"status":{"nullable":true,"anyOf":[{"description":"Outcome of the run. Defaults to `success`.","anyOf":[{"const":"success","type":"string"},{"const":"error","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"maxLength":20000,"description":"Final message, e.g. the error text. `null` = none.","type":"string"},{"type":"null"}]},"report":{"nullable":true,"anyOf":[{"description":"Summary of the run, e.g. `{ \"processed\": 120 }`, up to 16 KB. `null` = none.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"exitCode":{"nullable":true,"anyOf":[{"minimum":-32768,"maximum":32767,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-32768,"maximum":32767,"type":"integer"}]},{"type":"null"}]},"peakMemoryMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"heapUsedMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"entries":{"nullable":true,"anyOf":[{"maxItems":100,"description":"Log entries of the run, in order.","type":"array","items":{"type":"object","required":["message"],"properties":{"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"minLength":1,"maxLength":20000,"description":"Log message (stored up to 4000 characters).","type":"string"},"context":{"nullable":true,"anyOf":[{"description":"Structured context, up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"description":"ISO-8601 time the entry was produced on the client.","examples":["2026-11-05T10:15:00.000Z"],"type":"string"},{"type":"null"}]}}}},{"type":"null"}]}},"additionalProperties":false}},"text/plain":{"schema":{"type":"object","required":["code","startedAt","finishedAt"],"properties":{"code":{"minLength":1,"maxLength":200,"description":"Job type identifier. A code seen for the first time creates the job automatically. Normalized to `[A-Za-z0-9._:-]`, max 64 characters. Recommended form: `<application>:<job>`. Keep it stable: never put ids, dates or arguments into it.","examples":["eshop:sync-orders"],"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"Human-readable job name shown in the admin. Ignored when empty, equal to `code`, or after the job was renamed in the admin.","type":"string"},{"type":"null"}]},"expiration":{"nullable":true,"anyOf":[{"minimum":10,"maximum":604800,"description":"Idle timeout in seconds. Every log / heartbeat call extends it again. When no call arrives in time the run is closed as `timeout` and a critical log entry is written. Default 3600 (60 min).","examples":[900],"type":"number"},{"type":"null"}]},"meta":{"nullable":true,"anyOf":[{"description":"Context of the run (host, version, arguments), up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"tier":{"nullable":true,"anyOf":[{"maxLength":48,"description":"Scheduler bucket, filterable in the admin job list.","examples":["nightly"],"type":"string"},{"type":"null"}]},"idempotencyKey":{"nullable":true,"anyOf":[{"maxLength":64,"description":"When a call is retried with the same key for the same job, the existing run is returned (`reused: true`).","type":"string"},{"type":"null"}]},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Expected schedule as a cron expression (5 fields, or 6 with leading seconds; macros like `@daily`). Enables the dead man's switch: when no run starts within the grace period after an expected time, a critical \"missed run\" alert is raised. `null` removes the schedule, omitting it keeps the stored one (falls back to `meta.schedule`). An invalid value does not reject the run; it is ignored and reported in `warnings`. A schedule edited in the admin takes precedence.","examples":["*/5 * * * *"],"type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone of `schedule`. Default UTC.","examples":["Europe/Prague"],"type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"description":"Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.","type":"integer"}]},{"type":"null"}]},"startedAt":{"description":"ISO-8601 start of the run (at most 7 days old).","examples":["2026-11-05T12:00:00.120Z"],"type":"string"},"finishedAt":{"description":"ISO-8601 end of the run, not before `startedAt`.","examples":["2026-11-05T12:00:00.480Z"],"type":"string"},"status":{"nullable":true,"anyOf":[{"description":"Outcome of the run. Defaults to `success`.","anyOf":[{"const":"success","type":"string"},{"const":"error","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"maxLength":20000,"description":"Final message, e.g. the error text. `null` = none.","type":"string"},{"type":"null"}]},"report":{"nullable":true,"anyOf":[{"description":"Summary of the run, e.g. `{ \"processed\": 120 }`, up to 16 KB. `null` = none.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"exitCode":{"nullable":true,"anyOf":[{"minimum":-32768,"maximum":32767,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-32768,"maximum":32767,"type":"integer"}]},{"type":"null"}]},"peakMemoryMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"heapUsedMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"entries":{"nullable":true,"anyOf":[{"maxItems":100,"description":"Log entries of the run, in order.","type":"array","items":{"type":"object","required":["message"],"properties":{"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"minLength":1,"maxLength":20000,"description":"Log message (stored up to 4000 characters).","type":"string"},"context":{"nullable":true,"anyOf":[{"description":"Structured context, up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"description":"ISO-8601 time the entry was produced on the client.","examples":["2026-11-05T10:15:00.000Z"],"type":"string"},{"type":"null"}]}}}},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{}}}},"/api/v1/cron-run/{id}/log":{"post":{"parameters":[{"description":"Run id returned by `/cron-run/start`.","examples":["aB3dE5fG7hJ9kL1m"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"id","required":true}],"operationId":"postApiV1Cron-runByIdLog","tags":["cron-run"],"summary":"Append log entries to a running cron run","description":"Send one entry (`message`, `level`, `context`) or up to 100 in `entries`. Extends the run expiration. A finished or timed-out run rejects entries with 409 (`PUBLIC_CRON_RUN_CLOSED`, `PUBLIC_CRON_RUN_EXPIRED`). Counts into the cron monitor quota of the API key (10,000 requests per hour, separate from other endpoints). Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix seconds).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"nullable":true,"anyOf":[{"minItems":1,"maxItems":100,"description":"Batch of entries.","type":"array","items":{"type":"object","required":["message"],"properties":{"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"minLength":1,"maxLength":20000,"description":"Log message (stored up to 4000 characters).","type":"string"},"context":{"nullable":true,"anyOf":[{"description":"Structured context, up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"description":"ISO-8601 time the entry was produced on the client.","examples":["2026-11-05T10:15:00.000Z"],"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":20000,"description":"Single-entry shorthand.","type":"string"},{"type":"null"}]},"context":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"entries":{"nullable":true,"anyOf":[{"minItems":1,"maxItems":100,"description":"Batch of entries.","type":"array","items":{"type":"object","required":["message"],"properties":{"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"minLength":1,"maxLength":20000,"description":"Log message (stored up to 4000 characters).","type":"string"},"context":{"nullable":true,"anyOf":[{"description":"Structured context, up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"description":"ISO-8601 time the entry was produced on the client.","examples":["2026-11-05T10:15:00.000Z"],"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":20000,"description":"Single-entry shorthand.","type":"string"},{"type":"null"}]},"context":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"entries":{"nullable":true,"anyOf":[{"minItems":1,"maxItems":100,"description":"Batch of entries.","type":"array","items":{"type":"object","required":["message"],"properties":{"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"minLength":1,"maxLength":20000,"description":"Log message (stored up to 4000 characters).","type":"string"},"context":{"nullable":true,"anyOf":[{"description":"Structured context, up to 16 KB of JSON.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"description":"ISO-8601 time the entry was produced on the client.","examples":["2026-11-05T10:15:00.000Z"],"type":"string"},{"type":"null"}]}}}},{"type":"null"}]},"level":{"nullable":true,"anyOf":[{"description":"Severity of the entry. Defaults to `info`.","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":20000,"description":"Single-entry shorthand.","type":"string"},{"type":"null"}]},"context":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"clientDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/api/v1/cron-run/{id}/heartbeat":{"post":{"parameters":[{"description":"Run id returned by `/cron-run/start`.","examples":["aB3dE5fG7hJ9kL1m"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"id","required":true}],"operationId":"postApiV1Cron-runByIdHeartbeat","tags":["cron-run"],"summary":"Keep a cron run alive","description":"Extends the run expiration without writing a log entry. Use during long silent steps. Counts into the cron monitor quota of the API key (10,000 requests per hour, separate from other endpoints). Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix seconds).","responses":{"200":{}}}},"/api/v1/cron-run/{id}/finish":{"post":{"parameters":[{"description":"Run id returned by `/cron-run/start`.","examples":["aB3dE5fG7hJ9kL1m"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"id","required":true}],"operationId":"postApiV1Cron-runByIdFinish","tags":["cron-run"],"summary":"Finish a cron run","description":"Closes the run (`late: false`). No further log entries are accepted. `null` in optional fields means \"not set\". A run that already timed out still accepts ONE finish: the response is 200 with `late: true`, `status: \"timeout\"` (the run stays a timeout), `lateStatus` and `lateFinishDate`; the late result is shown on the run in the admin and a follow-up CRN_RUN_LATE entry tells whether the job eventually succeeded. A run finished with `status: \"error\"` writes an error entry to the organisation log. Counts into the cron monitor quota of the API key (10,000 requests per hour, separate from other endpoints). Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix seconds).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"nullable":true,"anyOf":[{"description":"Outcome of the run. Defaults to `success`.","anyOf":[{"const":"success","type":"string"},{"const":"error","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"maxLength":20000,"description":"Final message, e.g. the error text. `null` = none.","type":"string"},{"type":"null"}]},"report":{"nullable":true,"anyOf":[{"description":"Summary of the run, e.g. `{ \"processed\": 120 }`, up to 16 KB. `null` = none.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"exitCode":{"nullable":true,"anyOf":[{"minimum":-32768,"maximum":32767,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-32768,"maximum":32767,"type":"integer"}]},{"type":"null"}]},"peakMemoryMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"heapUsedMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}},"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"nullable":true,"anyOf":[{"description":"Outcome of the run. Defaults to `success`.","anyOf":[{"const":"success","type":"string"},{"const":"error","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"maxLength":20000,"description":"Final message, e.g. the error text. `null` = none.","type":"string"},{"type":"null"}]},"report":{"nullable":true,"anyOf":[{"description":"Summary of the run, e.g. `{ \"processed\": 120 }`, up to 16 KB. `null` = none.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"exitCode":{"nullable":true,"anyOf":[{"minimum":-32768,"maximum":32767,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-32768,"maximum":32767,"type":"integer"}]},{"type":"null"}]},"peakMemoryMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"heapUsedMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}},"additionalProperties":false}},"text/plain":{"schema":{"type":"object","properties":{"status":{"nullable":true,"anyOf":[{"description":"Outcome of the run. Defaults to `success`.","anyOf":[{"const":"success","type":"string"},{"const":"error","type":"string"}]},{"type":"null"}]},"message":{"nullable":true,"anyOf":[{"maxLength":20000,"description":"Final message, e.g. the error text. `null` = none.","type":"string"},{"type":"null"}]},"report":{"nullable":true,"anyOf":[{"description":"Summary of the run, e.g. `{ \"processed\": 120 }`, up to 16 KB. `null` = none.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"exitCode":{"nullable":true,"anyOf":[{"minimum":-32768,"maximum":32767,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-32768,"maximum":32767,"type":"integer"}]},{"type":"null"}]},"peakMemoryMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"heapUsedMb":{"nullable":true,"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{}}}},"/api/v1/cron-run/{id}":{"get":{"parameters":[{"description":"Run id returned by `/cron-run/start`.","examples":["aB3dE5fG7hJ9kL1m"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"id","required":true}],"operationId":"getApiV1Cron-runById","tags":["cron-run"],"summary":"Cron run state","description":"Current status, timestamps and log count of a run. Counts into the cron monitor quota of the API key (10,000 requests per hour, separate from other endpoints). Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix seconds).","responses":{"200":{}}}},"/api/v1/customer/create":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"newAccount":{"examples":[true],"type":"boolean"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["success","newAccount","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"newAccount":{"examples":[true],"type":"boolean"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["success","newAccount","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"newAccount":{"examples":[true],"type":"boolean"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["success","newAccount","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}}}}},"operationId":"postApiV1CustomerCreate","tags":["customer"],"summary":"Create customer","description":"Registers a new customer or returns an existing one by email. Returns the full customer profile with a flag indicating whether a new account was created.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/customer/create-api-key":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"apiKey":{"examples":["63VQn5OUY2zfcPdz1I8s2rWzI2KyOX0z"],"type":"string"},"expirationDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["success","apiKey","expirationDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"apiKey":{"examples":["63VQn5OUY2zfcPdz1I8s2rWzI2KyOX0z"],"type":"string"},"expirationDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["success","apiKey","expirationDate"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"apiKey":{"examples":["63VQn5OUY2zfcPdz1I8s2rWzI2KyOX0z"],"type":"string"},"expirationDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["success","apiKey","expirationDate"]}}}}},"operationId":"postApiV1CustomerCreate-api-key","tags":["customer"],"summary":"Create customer API key","description":"Generates a new API key (identity) for an authenticated customer. The key can be scoped to a specific workspace.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"description":{"examples":["User Jan Barasek"],"type":"string"},"workspaceCode":{"examples":["my-workspace"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"description":{"examples":["User Jan Barasek"],"type":"string"},"workspaceCode":{"examples":["my-workspace"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"description":{"examples":["User Jan Barasek"],"type":"string"},"workspaceCode":{"examples":["my-workspace"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/customer/credit-log":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"creditBalance":{"examples":[510],"type":"number"},"creditMoneyBalance":{"examples":[460],"description":"Total credit balance in the organisation default currency.","type":"number"},"currency":{"examples":["CZK"],"description":"ISO 4217 code of the organisation default currency.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","amount","amountMoney","balance","balanceMoney","insertedDate"],"properties":{"id":{"examples":["HxanU4a1n4El61zx"],"type":"string"},"amount":{"examples":[100],"type":"number"},"amountMoney":{"examples":[90],"description":"Transaction value in default currency (CZK). Defaults to same as amount (1:1).","type":"number"},"balance":{"examples":[410],"type":"number"},"balanceMoney":{"examples":[370],"description":"Running balance in default currency (CZK).","type":"number"},"order":{"type":"object","required":["orderNumber","hash","groupName"],"properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"groupName":{"examples":["GymRoom Vinohrady"],"type":"string"}}},"expiration":{"type":"object","required":["date","status"],"properties":{"date":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"examples":["pending"],"anyOf":[{"const":"processed","type":"string"},{"const":"expired","type":"string"},{"const":"pending","type":"string"}]},"processed":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"description":{"examples":["Order 25000087"],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of credit record.","anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of credit record.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["creditBalance","creditMoneyBalance","currency","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"creditBalance":{"examples":[510],"type":"number"},"creditMoneyBalance":{"examples":[460],"description":"Total credit balance in the organisation default currency.","type":"number"},"currency":{"examples":["CZK"],"description":"ISO 4217 code of the organisation default currency.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","amount","amountMoney","balance","balanceMoney","insertedDate"],"properties":{"id":{"examples":["HxanU4a1n4El61zx"],"type":"string"},"amount":{"examples":[100],"type":"number"},"amountMoney":{"examples":[90],"description":"Transaction value in default currency (CZK). Defaults to same as amount (1:1).","type":"number"},"balance":{"examples":[410],"type":"number"},"balanceMoney":{"examples":[370],"description":"Running balance in default currency (CZK).","type":"number"},"order":{"type":"object","required":["orderNumber","hash","groupName"],"properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"groupName":{"examples":["GymRoom Vinohrady"],"type":"string"}}},"expiration":{"type":"object","required":["date","status"],"properties":{"date":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"examples":["pending"],"anyOf":[{"const":"processed","type":"string"},{"const":"expired","type":"string"},{"const":"pending","type":"string"}]},"processed":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"description":{"examples":["Order 25000087"],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of credit record.","anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of credit record.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["creditBalance","creditMoneyBalance","currency","items"]}},"text/plain":{"schema":{"type":"object","properties":{"creditBalance":{"examples":[510],"type":"number"},"creditMoneyBalance":{"examples":[460],"description":"Total credit balance in the organisation default currency.","type":"number"},"currency":{"examples":["CZK"],"description":"ISO 4217 code of the organisation default currency.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","amount","amountMoney","balance","balanceMoney","insertedDate"],"properties":{"id":{"examples":["HxanU4a1n4El61zx"],"type":"string"},"amount":{"examples":[100],"type":"number"},"amountMoney":{"examples":[90],"description":"Transaction value in default currency (CZK). Defaults to same as amount (1:1).","type":"number"},"balance":{"examples":[410],"type":"number"},"balanceMoney":{"examples":[370],"description":"Running balance in default currency (CZK).","type":"number"},"order":{"type":"object","required":["orderNumber","hash","groupName"],"properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"groupName":{"examples":["GymRoom Vinohrady"],"type":"string"}}},"expiration":{"type":"object","required":["date","status"],"properties":{"date":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"examples":["pending"],"anyOf":[{"const":"processed","type":"string"},{"const":"expired","type":"string"},{"const":"pending","type":"string"}]},"processed":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"description":{"examples":["Order 25000087"],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of credit record.","anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of credit record.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["creditBalance","creditMoneyBalance","currency","items"]}}}}},"operationId":"getApiV1CustomerCredit-log","tags":["customer"],"summary":"Get credit log","description":"Returns the customer credit balance and a list of all credit transactions (deposits, spending, expirations)."}},"/api/v1/customer/credit-spend":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"transactionId":{"examples":["HxanU4a1n4El61zx","xxxxxxxxxxxxxxxx"],"description":"Unique transaction id (for example `HxanU4a1n4El61zx`). In case of `amount = 0` transactionId is `xxxxxxxxxxxxxxxx`.","type":"string"},"oldCreditBalance":{"examples":[510],"type":"number"},"newCreditBalance":{"examples":[410],"type":"number"}},"required":["success","transactionId","oldCreditBalance","newCreditBalance"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"transactionId":{"examples":["HxanU4a1n4El61zx","xxxxxxxxxxxxxxxx"],"description":"Unique transaction id (for example `HxanU4a1n4El61zx`). In case of `amount = 0` transactionId is `xxxxxxxxxxxxxxxx`.","type":"string"},"oldCreditBalance":{"examples":[510],"type":"number"},"newCreditBalance":{"examples":[410],"type":"number"}},"required":["success","transactionId","oldCreditBalance","newCreditBalance"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"transactionId":{"examples":["HxanU4a1n4El61zx","xxxxxxxxxxxxxxxx"],"description":"Unique transaction id (for example `HxanU4a1n4El61zx`). In case of `amount = 0` transactionId is `xxxxxxxxxxxxxxxx`.","type":"string"},"oldCreditBalance":{"examples":[510],"type":"number"},"newCreditBalance":{"examples":[410],"type":"number"}},"required":["success","transactionId","oldCreditBalance","newCreditBalance"]}}}}},"operationId":"postApiV1CustomerCredit-spend","tags":["customer"],"summary":"Spend customer credit","description":"Deducts credit from the customer account. The amount is always treated as negative (spending). Returns the old and new balance along with a transaction ID.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityId","amount"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"amount":{"examples":[100],"type":"number"},"description":{"examples":["video.rewrite:15m"],"description":"App internal description.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityId","amount"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"amount":{"examples":[100],"type":"number"},"description":{"examples":["video.rewrite:15m"],"description":"App internal description.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityId","amount"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"amount":{"examples":[100],"type":"number"},"description":{"examples":["video.rewrite:15m"],"description":"App internal description.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/customer/customer-match-customer":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CustomerCustomer-match-customer","tags":["customer"],"summary":"Match two customers","description":"Create many-to-many relation between two customers.\n\nThis feature is suitable, for example, for matching clients and trainers, or for obtaining contacts on a dating site or company contact.\n\nThe call is idempotent. Matching a pair that was previously unmatched via `POST /customer/customer-unmatch-customer` re-activates the relation (its `insertedDate` is reset to now). When `notice` is sent, it replaces the stored note; when omitted, the existing note is kept.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["managerCuRefNo"],"properties":{"managerCuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"customerCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Customer of relation.","type":"string"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"notice":{"examples":["Customer prefers cardio training. Contact obtained via the website."],"description":"A public note for this connection. The note will be visible to both customers. For example, a trainer can write information about a new client here.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["managerCuRefNo"],"properties":{"managerCuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"customerCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Customer of relation.","type":"string"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"notice":{"examples":["Customer prefers cardio training. Contact obtained via the website."],"description":"A public note for this connection. The note will be visible to both customers. For example, a trainer can write information about a new client here.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["managerCuRefNo"],"properties":{"managerCuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"customerCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Customer of relation.","type":"string"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"notice":{"examples":["Customer prefers cardio training. Contact obtained via the website."],"description":"A public note for this connection. The note will be visible to both customers. For example, a trainer can write information about a new client here.","type":"string"}}}}}}}},"/api/v1/customer/customer-unmatch-customer":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CustomerCustomer-unmatch-customer","tags":["customer"],"summary":"Unmatch two customers","description":"Deactivate many-to-many relation between two customers.\n\nThe manager immediately loses access to the customer: the customer disappears from `GET /customer/matched-customer-list`, `GET /customer/detail` returns `PUBLIC_CUSTOMER_DETAIL_NOT_PERMITTED` and the customer's orders are no longer included in `GET /customer/order-list`. The relation can be re-activated by calling `POST /customer/customer-match-customer` again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["managerCuRefNo","customerCuRefNo"],"properties":{"managerCuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"customerCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Customer to unmatch.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["managerCuRefNo","customerCuRefNo"],"properties":{"managerCuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"customerCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Customer to unmatch.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["managerCuRefNo","customerCuRefNo"],"properties":{"managerCuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"customerCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Customer to unmatch.","type":"string"}}}}}}}},"/api/v1/customer/event-access":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"Calendar event code (`lines[].event.id` in `GET /customer/order-list`).","examples":["7lRIAiC69gZMfwsDbG3CJvQdqnY15XdS"],"schema":{"type":"string","minLength":1,"maxLength":32},"in":"query","name":"eventCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"eventCode":{"examples":["7lRIAiC69gZMfwsDbG3CJvQdqnY15XdS"],"type":"string"},"status":{"description":"Access code state, see the endpoint description.","examples":["ready"],"anyOf":[{"const":"ready","type":"string"},{"const":"backup","type":"string"},{"const":"not_generated","type":"string"},{"const":"no_lock","type":"string"},{"const":"failed","type":"string"},{"const":"not_yet_available","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"}]},"password":{"description":"Keypad code.","examples":["48213907"],"type":"string"},"startDate":{"description":"Code valid from.","examples":["2026-11-08T09:59:00.000Z"],"anyOf":[{"description":"Code valid from.","examples":["2026-11-08T09:59:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"Code valid until.","examples":["2026-11-08T11:05:00.000Z"],"anyOf":[{"description":"Code valid until.","examples":["2026-11-08T11:05:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"eventStartTime":{"examples":["2026-11-08T10:00:00.000Z"],"anyOf":[{"examples":["2026-11-08T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"eventEndTime":{"examples":["2026-11-08T11:00:00.000Z"],"anyOf":[{"examples":["2026-11-08T11:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["eventCode","status","eventStartTime","eventEndTime"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"eventCode":{"examples":["7lRIAiC69gZMfwsDbG3CJvQdqnY15XdS"],"type":"string"},"status":{"description":"Access code state, see the endpoint description.","examples":["ready"],"anyOf":[{"const":"ready","type":"string"},{"const":"backup","type":"string"},{"const":"not_generated","type":"string"},{"const":"no_lock","type":"string"},{"const":"failed","type":"string"},{"const":"not_yet_available","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"}]},"password":{"description":"Keypad code.","examples":["48213907"],"type":"string"},"startDate":{"description":"Code valid from.","examples":["2026-11-08T09:59:00.000Z"],"anyOf":[{"description":"Code valid from.","examples":["2026-11-08T09:59:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"Code valid until.","examples":["2026-11-08T11:05:00.000Z"],"anyOf":[{"description":"Code valid until.","examples":["2026-11-08T11:05:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"eventStartTime":{"examples":["2026-11-08T10:00:00.000Z"],"anyOf":[{"examples":["2026-11-08T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"eventEndTime":{"examples":["2026-11-08T11:00:00.000Z"],"anyOf":[{"examples":["2026-11-08T11:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["eventCode","status","eventStartTime","eventEndTime"]}},"text/plain":{"schema":{"type":"object","properties":{"eventCode":{"examples":["7lRIAiC69gZMfwsDbG3CJvQdqnY15XdS"],"type":"string"},"status":{"description":"Access code state, see the endpoint description.","examples":["ready"],"anyOf":[{"const":"ready","type":"string"},{"const":"backup","type":"string"},{"const":"not_generated","type":"string"},{"const":"no_lock","type":"string"},{"const":"failed","type":"string"},{"const":"not_yet_available","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"}]},"password":{"description":"Keypad code.","examples":["48213907"],"type":"string"},"startDate":{"description":"Code valid from.","examples":["2026-11-08T09:59:00.000Z"],"anyOf":[{"description":"Code valid from.","examples":["2026-11-08T09:59:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"Code valid until.","examples":["2026-11-08T11:05:00.000Z"],"anyOf":[{"description":"Code valid until.","examples":["2026-11-08T11:05:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"eventStartTime":{"examples":["2026-11-08T10:00:00.000Z"],"anyOf":[{"examples":["2026-11-08T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"eventEndTime":{"examples":["2026-11-08T11:00:00.000Z"],"anyOf":[{"examples":["2026-11-08T11:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["eventCode","status","eventStartTime","eventEndTime"]}}}}},"operationId":"getApiV1CustomerEvent-access","tags":["customer"],"summary":"Get reservation access code","description":"Returns the smart-lock access code of a reservation for the logged-in customer. Allowed only for an event the customer has a paid, not cancelled order line for, or is an attendee of (shared training); otherwise `PUBLIC_CALENDAR_EVENT_DOES_NOT_EXIST` (404). The code is returned no earlier than the `calendar-event-ping` e-mail is sent and never after the event ends. `status`: `ready` (own code), `backup` (the lock's backup code was used), `not_generated`, `no_lock`, `failed` (generation failed and no backup was available), `not_yet_available` (access e-mail not sent yet), `expired`, `cancelled`. `password`, `startDate` and `endDate` are present only with `ready` / `backup`."}},"/api/v1/customer/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"cuRefNo = customer reference number.","examples":["1cGIHvFoQDGLAbcA"],"schema":{"type":"string","maxLength":16,"minLength":16},"in":"query","name":"cuRefNo","required":true},{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"loggedIn":{"examples":[true],"type":"boolean"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["loggedIn","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"loggedIn":{"examples":[true],"type":"boolean"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["loggedIn","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}},"text/plain":{"schema":{"type":"object","properties":{"loggedIn":{"examples":[true],"type":"boolean"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["loggedIn","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}}}}},"operationId":"getApiV1CustomerDetail","tags":["customer"],"summary":"Get customer detail","description":"Returns the full profile of a customer identified by identityId and cuRefNo. Updates the last activity timestamp. Throws PUBLIC_CUSTOMER_DETAIL_NOT_PERMITTED if the identity cannot access the requested customer."}},"/api/v1/customer/export-gdpr":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true}],"operationId":"getApiV1CustomerExport-gdpr","tags":["customer"],"summary":"Download personal data export (GDPR Art. 15)","description":"Returns an `application/zip` archive with every personal data point the organisation holds about the customer identified by `identityId` — profile, addresses, company record, additional e-mails, consent audit trail, orders, invoices, subscriptions, comments, and the system activity log. Companion `README.md` and `index.html` are rendered in the customer’s preferred language. Internal identifiers, hashes and other non-personal data are deliberately omitted.\n\n### How to call this endpoint safely\n\nThe `apiKey` is an organisation-wide secret — exposing it in the browser would let anyone export anyone’s data. Treat this endpoint as **server-to-server only**:\n\n1. The customer authenticates against **your** application (e.g. via `/customer/login` or `/customer/magic-auth`) and you obtain their short-lived `identityId`.\n2. When the customer requests their data export, **your backend** (never the browser) calls this endpoint with the secret `apiKey` and the customer’s `identityId`.\n3. The endpoint verifies that the identity belongs to a customer in the same organisation as the API key — a mismatch is logged as a critical security event and the request is rejected.\n4. Your backend then proxies the binary response to the end user, typically by streaming the body straight back with the same `Content-Disposition` header, or by storing it briefly and serving a one-time download URL.\n\nThis indirection keeps the API key on your server and lets you layer your own checks (rate limits, audit logging, a second-factor confirmation, etc.) before honouring the request — the endpoint itself enforces only the organisation/identity binding.","responses":{"200":{}}}},"/api/v1/customer/get-account-info":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"loggedIn":{"examples":[true],"type":"boolean"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["loggedIn","identityId","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"loggedIn":{"examples":[true],"type":"boolean"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["loggedIn","identityId","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}},"text/plain":{"schema":{"type":"object","properties":{"loggedIn":{"examples":[true],"type":"boolean"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"creditBalance":{"examples":[123],"type":"number"},"email":{"nullable":true,"anyOf":[{"examples":["jan@barasek.com"],"description":"Contact e-mail address, or `null` for phone-only contacts.\n\n**When null:** the contact was registered with only a phone number (no e-mail), or was anonymised via GDPR right-to-erasure. Such contacts cannot be looked up by e-mail and cannot log in (login requires e-mail). UI should fall back to the contact's name, phone, or external reference when rendering.\n\nWhen non-null, the value is the canonical normalized form (`fixEmail`) and is unique per organisation.","type":"string"},{"type":"null"}]},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"gender":{"description":"Self-reported gender: `female`, `male` or `other`. Omitted when not stated.","examples":["female"],"type":"string"},"birthDate":{"description":"Birth date as `YYYY-MM-DD`, or only the year `YYYY`. Omitted when not stated.","examples":["1990-05-17","1990"],"type":"string"},"premium":{"examples":[true],"type":"boolean"},"ban":{"examples":[false],"type":"boolean"},"groups":{"type":"array","items":{"type":"object","required":["name","slug"],"properties":{"name":{"examples":["Personal Trainer"],"type":"string"},"slug":{"examples":["trainer"],"type":"string"}}}},"meta":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"customFields":{"description":"Custom contact fields defined by the organisation (admin: contact detail, Custom fields), keyed by field key. Values keep their type: number fields are numbers, yes/no fields booleans, text, select and date fields strings. Fields the customer has not filled in are omitted. Definitions: GET /api/v1/customer/custom-field-definitions.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"referral":{"type":"object","required":["code","email"],"properties":{"code":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"}}},"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["loggedIn","identityId","cuRefNo","creditBalance","email","premium","ban","groups","meta","customFields","runningSubscriptionList"]}}}}},"operationId":"getApiV1CustomerGet-account-info","tags":["customer"],"summary":"Get account info","description":"Returns the profile of the currently authenticated customer (by identityId). Updates the last activity timestamp."}},"/api/v1/customer/login":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","identityId","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"identityId":{"examples":["9jq49ZE1xoKI7S5ys4J0a70y3Xp2hQqc"],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006","E007"],"type":"string"},"message":{"examples":["Customer login failed.","Customer e-mail does not exist.","Customer have not a registered account.","Wrong e-mail or password.","Customer account has been banned.","Too many login attempts.","Customer mail has not been authorized."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","identityId","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"identityId":{"examples":["9jq49ZE1xoKI7S5ys4J0a70y3Xp2hQqc"],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006","E007"],"type":"string"},"message":{"examples":["Customer login failed.","Customer e-mail does not exist.","Customer have not a registered account.","Wrong e-mail or password.","Customer account has been banned.","Too many login attempts.","Customer mail has not been authorized."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","identityId","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"identityId":{"examples":["9jq49ZE1xoKI7S5ys4J0a70y3Xp2hQqc"],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006","E007"],"type":"string"},"message":{"examples":["Customer login failed.","Customer e-mail does not exist.","Customer have not a registered account.","Wrong e-mail or password.","Customer account has been banned.","Too many login attempts.","Customer mail has not been authorized."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","identityId","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"identityId":{"examples":["9jq49ZE1xoKI7S5ys4J0a70y3Xp2hQqc"],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006","E007"],"type":"string"},"message":{"examples":["Customer login failed.","Customer e-mail does not exist.","Customer have not a registered account.","Wrong e-mail or password.","Customer account has been banned.","Too many login attempts.","Customer mail has not been authorized."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}}}}},"operationId":"postApiV1CustomerLogin","tags":["customer"],"summary":"Customer login","description":"Create a new customer identity based on real customer e-mail and password. Return identity session value or error code.\n\nList of error codes:\n\n| Code | Message |\n|------|---------|\n| E001 | Customer login failed. |\n| E002 | Customer e-mail does not exist. |\n| E003 | Customer have not a registered account. |\n| E004 | Wrong e-mail or password. |\n| E005 | Customer account has been banned. |\n| E006 | Too many login attempts. |\n| E007 | Customer mail has not been authorized. |","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"password":{"examples":["1234"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"password":{"examples":["1234"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"password":{"examples":["1234"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/customer/logout":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CustomerLogout","tags":["customer"],"summary":"Customer logout","description":"Invalidates the customer identity session and logs activity with geolocation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/customer/magic-auth":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","identityId","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"New created user identity, please store it to your frontend cookies.","type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006","E007"],"type":"string"},"message":{"examples":["Customer login failed.","Customer e-mail does not exist.","Customer have not a registered account.","Wrong e-mail or password.","Customer account has been banned.","Too many login attempts.","Customer mail has not been authorized."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","identityId","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"New created user identity, please store it to your frontend cookies.","type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006","E007"],"type":"string"},"message":{"examples":["Customer login failed.","Customer e-mail does not exist.","Customer have not a registered account.","Wrong e-mail or password.","Customer account has been banned.","Too many login attempts.","Customer mail has not been authorized."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","identityId","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"New created user identity, please store it to your frontend cookies.","type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006","E007"],"type":"string"},"message":{"examples":["Customer login failed.","Customer e-mail does not exist.","Customer have not a registered account.","Wrong e-mail or password.","Customer account has been banned.","Too many login attempts.","Customer mail has not been authorized."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","identityId","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"New created user identity, please store it to your frontend cookies.","type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006","E007"],"type":"string"},"message":{"examples":["Customer login failed.","Customer e-mail does not exist.","Customer have not a registered account.","Wrong e-mail or password.","Customer account has been banned.","Too many login attempts.","Customer mail has not been authorized."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}}}}},"operationId":"postApiV1CustomerMagic-auth","tags":["customer"],"summary":"Magic auth (passwordless login)","description":"Create a new customer identity based on e-mail without password. Return identity session value or error code.\n\nList of error codes:\n\n| Code | Message |\n|------|---------|\n| E001 | Customer login failed. |\n| E002 | Customer e-mail does not exist. |\n| E003 | Customer have not a registered account. |\n| E004 | Wrong e-mail or password. |\n| E005 | Customer account has been banned. |\n| E006 | Too many login attempts. |\n| E007 | Customer mail has not been authorized. |","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}}}}}}},"/api/v1/customer/matched-customer-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"Optional search query to filter matched customers by name, e-mail, phone or company.","schema":{"type":"string"},"in":"query","name":"query","required":false},{"description":"1-based page index. Default `1`.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Items per page. Default `50`, max `200`.","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getApiV1CustomerMatched-customer-list","tags":["customer"],"summary":"List matched customers","description":"Returns a paginated list of customers actively matched (linked) to the customer identified by identityId. Unmatched (deactivated) relations are not included. `total` is the number of matching items across all pages; request further pages with `page` until `page * limit >= total`.","responses":{"200":{}}}},"/api/v1/customer/order-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"Page number (string, converted to number internally).","schema":{"type":"string","default":"1"},"in":"query","name":"page","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","orderNumber","status","price","insertedDate","updatedDate","lines"],"properties":{"id":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderNumber":{"examples":["25000055"],"type":"string"},"status":{"type":"object","required":["label","code","backgroundColor","textColor"],"properties":{"label":{"examples":["Storno"],"type":"string"},"code":{"examples":["storno"],"type":"string"},"backgroundColor":{"examples":["#901020"],"type":"string"},"textColor":{"examples":["#fff"],"type":"string"}}},"price":{"examples":["0&nbsp;Kč"],"type":"string"},"notice":{"examples":["Please reserve a trainer to me."],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lines":{"type":"array","items":{"type":"object","required":["id","label","count","storno","price","insertedDate"],"properties":{"id":{"examples":["2d33677772eddbd4e869c6ed6bf6d9f3"],"type":"string"},"label":{"examples":["Jan Barášek GymRoom Vinohrady rezervace"],"type":"string"},"count":{"examples":[1],"type":"number"},"storno":{"default":false,"type":"boolean"},"price":{"examples":["110&nbsp;Kč"],"type":"string"},"unit":{"examples":["ks","h","kg"],"type":"string"},"vat":{"examples":[21],"type":"number"},"creditAmount":{"examples":[100],"type":"number"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"type":"object","required":["id","calendarId","startTime","endTime","isAllDay","isBlocking","isStorno"],"properties":{"id":{"examples":["7lRIAiC69gZMfwsDbG3CJvQdqnY15XdS"],"type":"string"},"calendarId":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"type":"string"},"startTime":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"examples":["Jan Barášek GymRoom Vinohrady rezervace"],"type":"string"},"isAllDay":{"default":false,"type":"boolean"},"isBlocking":{"default":true,"type":"boolean"},"isStorno":{"default":true,"type":"boolean"}}},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","orderNumber","status","price","insertedDate","updatedDate","lines"],"properties":{"id":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderNumber":{"examples":["25000055"],"type":"string"},"status":{"type":"object","required":["label","code","backgroundColor","textColor"],"properties":{"label":{"examples":["Storno"],"type":"string"},"code":{"examples":["storno"],"type":"string"},"backgroundColor":{"examples":["#901020"],"type":"string"},"textColor":{"examples":["#fff"],"type":"string"}}},"price":{"examples":["0&nbsp;Kč"],"type":"string"},"notice":{"examples":["Please reserve a trainer to me."],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lines":{"type":"array","items":{"type":"object","required":["id","label","count","storno","price","insertedDate"],"properties":{"id":{"examples":["2d33677772eddbd4e869c6ed6bf6d9f3"],"type":"string"},"label":{"examples":["Jan Barášek GymRoom Vinohrady rezervace"],"type":"string"},"count":{"examples":[1],"type":"number"},"storno":{"default":false,"type":"boolean"},"price":{"examples":["110&nbsp;Kč"],"type":"string"},"unit":{"examples":["ks","h","kg"],"type":"string"},"vat":{"examples":[21],"type":"number"},"creditAmount":{"examples":[100],"type":"number"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"type":"object","required":["id","calendarId","startTime","endTime","isAllDay","isBlocking","isStorno"],"properties":{"id":{"examples":["7lRIAiC69gZMfwsDbG3CJvQdqnY15XdS"],"type":"string"},"calendarId":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"type":"string"},"startTime":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"examples":["Jan Barášek GymRoom Vinohrady rezervace"],"type":"string"},"isAllDay":{"default":false,"type":"boolean"},"isBlocking":{"default":true,"type":"boolean"},"isStorno":{"default":true,"type":"boolean"}}},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","orderNumber","status","price","insertedDate","updatedDate","lines"],"properties":{"id":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderNumber":{"examples":["25000055"],"type":"string"},"status":{"type":"object","required":["label","code","backgroundColor","textColor"],"properties":{"label":{"examples":["Storno"],"type":"string"},"code":{"examples":["storno"],"type":"string"},"backgroundColor":{"examples":["#901020"],"type":"string"},"textColor":{"examples":["#fff"],"type":"string"}}},"price":{"examples":["0&nbsp;Kč"],"type":"string"},"notice":{"examples":["Please reserve a trainer to me."],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lines":{"type":"array","items":{"type":"object","required":["id","label","count","storno","price","insertedDate"],"properties":{"id":{"examples":["2d33677772eddbd4e869c6ed6bf6d9f3"],"type":"string"},"label":{"examples":["Jan Barášek GymRoom Vinohrady rezervace"],"type":"string"},"count":{"examples":[1],"type":"number"},"storno":{"default":false,"type":"boolean"},"price":{"examples":["110&nbsp;Kč"],"type":"string"},"unit":{"examples":["ks","h","kg"],"type":"string"},"vat":{"examples":[21],"type":"number"},"creditAmount":{"examples":[100],"type":"number"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"event":{"type":"object","required":["id","calendarId","startTime","endTime","isAllDay","isBlocking","isStorno"],"properties":{"id":{"examples":["7lRIAiC69gZMfwsDbG3CJvQdqnY15XdS"],"type":"string"},"calendarId":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"type":"string"},"startTime":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"examples":["Jan Barášek GymRoom Vinohrady rezervace"],"type":"string"},"isAllDay":{"default":false,"type":"boolean"},"isBlocking":{"default":true,"type":"boolean"},"isStorno":{"default":true,"type":"boolean"}}},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}}}}}}}},"required":["items"]}}}}},"operationId":"getApiV1CustomerOrder-list","tags":["customer"],"summary":"List customer orders","description":"Returns a paginated list of orders for the customer identified by identityId, including order lines, status, prices, and linked calendar events."}},"/api/v1/customer/custom-field-definitions":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"examples":["main_goal"],"type":"string"},"type":{"description":"Value type. `date` = YYYY-MM-DD, `select` = one of `options[].value`.","anyOf":[{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"select","type":"string"},{"const":"date","type":"string"}]},"label":{"examples":["Hlavní cíl"],"type":"string"},"helperText":{"type":"string"},"placeholder":{"type":"string"},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","required":["value","label"],"properties":{"value":{"examples":["strength"],"type":"string"},"label":{"examples":["Síla"],"type":"string"}}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"examples":["main_goal"],"type":"string"},"type":{"description":"Value type. `date` = YYYY-MM-DD, `select` = one of `options[].value`.","anyOf":[{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"select","type":"string"},{"const":"date","type":"string"}]},"label":{"examples":["Hlavní cíl"],"type":"string"},"helperText":{"type":"string"},"placeholder":{"type":"string"},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","required":["value","label"],"properties":{"value":{"examples":["strength"],"type":"string"},"label":{"examples":["Síla"],"type":"string"}}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"examples":["main_goal"],"type":"string"},"type":{"description":"Value type. `date` = YYYY-MM-DD, `select` = one of `options[].value`.","anyOf":[{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"select","type":"string"},{"const":"date","type":"string"}]},"label":{"examples":["Hlavní cíl"],"type":"string"},"helperText":{"type":"string"},"placeholder":{"type":"string"},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","required":["value","label"],"properties":{"value":{"examples":["strength"],"type":"string"},"label":{"examples":["Síla"],"type":"string"}}}}}}}},"required":["items"]}}}}},"operationId":"getApiV1CustomerCustom-field-definitions","tags":["customer"],"summary":"List custom contact fields","description":"Custom contact fields the organisation defined in admin (contact detail, Custom fields), in admin order. Use it to render a profile form and to know which `customFields` keys `POST /customer/update-profile` accepts. `options` lists the allowed values of a `select` field. `required` is informative for the form; the API never requires a custom field."}},"/api/v1/customer/update-profile":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message","errors"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["INVALID_PROFILE_FIELDS"],"type":"string"},"message":{"examples":["birthDate: Birth date must be YYYY or YYYY-MM-DD (year 1900 to today)."],"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","code","message"],"properties":{"field":{"examples":["birthDate","customFields.main_goal"],"type":"string"},"code":{"examples":["INVALID_BIRTH_DATE"],"type":"string"},"message":{"type":"string"}}}}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message","errors"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["INVALID_PROFILE_FIELDS"],"type":"string"},"message":{"examples":["birthDate: Birth date must be YYYY or YYYY-MM-DD (year 1900 to today)."],"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","code","message"],"properties":{"field":{"examples":["birthDate","customFields.main_goal"],"type":"string"},"code":{"examples":["INVALID_BIRTH_DATE"],"type":"string"},"message":{"type":"string"}}}}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message","errors"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["INVALID_PROFILE_FIELDS"],"type":"string"},"message":{"examples":["birthDate: Birth date must be YYYY or YYYY-MM-DD (year 1900 to today)."],"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","code","message"],"properties":{"field":{"examples":["birthDate","customFields.main_goal"],"type":"string"},"code":{"examples":["INVALID_BIRTH_DATE"],"type":"string"},"message":{"type":"string"}}}}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message","errors"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["INVALID_PROFILE_FIELDS"],"type":"string"},"message":{"examples":["birthDate: Birth date must be YYYY or YYYY-MM-DD (year 1900 to today)."],"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","code","message"],"properties":{"field":{"examples":["birthDate","customFields.main_goal"],"type":"string"},"code":{"examples":["INVALID_BIRTH_DATE"],"type":"string"},"message":{"type":"string"}}}}}}]}}}}},"operationId":"postApiV1CustomerUpdate-profile","tags":["customer"],"summary":"Update customer profile","description":"Updates the profile of an existing customer identified by email in the request body.\n\n**Nothing is deleted:** a field that is missing, `null` or an empty string keeps its stored value (name, phone, gender, birth date and every custom field alike).\n\n**Profile fields** (`gender`, `birthDate`, `customFields`) are validated before anything is saved. If any value is invalid, nothing is changed and the response is `success: false` with `errorCode: INVALID_PROFILE_FIELDS` and one entry per invalid field in `errors`:\n\n| Code | Meaning |\n|------|---------|\n| INVALID_GENDER | `gender` is not female, male or other |\n| INVALID_BIRTH_DATE | `birthDate` is not YYYY / YYYY-MM-DD, not a real date, before 1900 or in the future |\n| UNKNOWN_CUSTOM_FIELD | the custom field key is not defined for the organisation |\n| INVALID_CUSTOM_FIELD_VALUE | the value does not match the field type, options or pattern |\n\nThe current values are returned by `GET /customer/get-account-info` (`gender`, `birthDate`, `customFields`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"gender":{"nullable":true,"anyOf":[{"description":"Self-reported gender: `female`, `male` or `other` (case-insensitive).","examples":["female"],"type":"string"},{"type":"null"}]},"birthDate":{"nullable":true,"anyOf":[{"description":"Birth date `YYYY-MM-DD`, or only the year `YYYY`. Year 1900 to today, not in the future.","examples":["1990-05-17","1990"],"type":"string"},{"type":"null"}]},"customFields":{"description":"Custom contact fields, field key → value. Keys must be defined for the organisation (GET /customer/custom-field-definitions). Values by type: `number` → number or numeric string, `boolean` → true/false, `select` → one of the option values, `date` → YYYY-MM-DD, text → string.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"gender":{"nullable":true,"anyOf":[{"description":"Self-reported gender: `female`, `male` or `other` (case-insensitive).","examples":["female"],"type":"string"},{"type":"null"}]},"birthDate":{"nullable":true,"anyOf":[{"description":"Birth date `YYYY-MM-DD`, or only the year `YYYY`. Year 1900 to today, not in the future.","examples":["1990-05-17","1990"],"type":"string"},{"type":"null"}]},"customFields":{"description":"Custom contact fields, field key → value. Keys must be defined for the organisation (GET /customer/custom-field-definitions). Values by type: `number` → number or numeric string, `boolean` → true/false, `select` → one of the option values, `date` → YYYY-MM-DD, text → string.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]}}}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"gender":{"nullable":true,"anyOf":[{"description":"Self-reported gender: `female`, `male` or `other` (case-insensitive).","examples":["female"],"type":"string"},{"type":"null"}]},"birthDate":{"nullable":true,"anyOf":[{"description":"Birth date `YYYY-MM-DD`, or only the year `YYYY`. Year 1900 to today, not in the future.","examples":["1990-05-17","1990"],"type":"string"},{"type":"null"}]},"customFields":{"description":"Custom contact fields, field key → value. Keys must be defined for the organisation (GET /customer/custom-field-definitions). Values by type: `number` → number or numeric string, `boolean` → true/false, `select` → one of the option values, `date` → YYYY-MM-DD, text → string.","examples":[{"height_cm":182,"weight_kg":80,"main_goal":"strength"}],"type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},{"type":"null"}]}}}}}}}}}},"/api/v1/customer/register-account":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004"],"type":"string"},"message":{"examples":["Customer register failed.","Customer has been registered.","Customer account has been banned.","Too many registration attempts."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004"],"type":"string"},"message":{"examples":["Customer register failed.","Customer has been registered.","Customer account has been banned.","Too many registration attempts."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004"],"type":"string"},"message":{"examples":["Customer register failed.","Customer has been registered.","Customer account has been banned.","Too many registration attempts."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004"],"type":"string"},"message":{"examples":["Customer register failed.","Customer has been registered.","Customer account has been banned.","Too many registration attempts."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}}}}},"operationId":"postApiV1CustomerRegister-account","tags":["customer"],"summary":"Register customer account","description":"Registers a new customer account with email and password. Sends a verification email. Returns error codes on validation failure.\n\nList of error codes:\n\n| Code | Message |\n|------|---------|\n| E001 | Customer register failed. |\n| E002 | Customer has been registered. |\n| E003 | Customer account has been banned. |\n| E004 | Too many registration attempts. |","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"password":{"minLength":1,"type":"string"},"returnUrl":{"type":"string"},"defaultCredit":{"description":"Initial credit balance granted to the customer after they verify the e-mail. Only positive numbers are honoured — null, 0 and negative values are ignored.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"password":{"minLength":1,"type":"string"},"returnUrl":{"type":"string"},"defaultCredit":{"description":"Initial credit balance granted to the customer after they verify the e-mail. Only positive numbers are honoured — null, 0 and negative values are ignored.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"password":{"minLength":1,"type":"string"},"returnUrl":{"type":"string"},"defaultCredit":{"description":"Initial credit balance granted to the customer after they verify the e-mail. Only positive numbers are honoured — null, 0 and negative values are ignored.","type":"number"}}}}}}}},"/api/v1/customer/register-account-verify":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"examples":[true],"type":"boolean"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"returnUrl":{"type":"string"}},"required":["success","email"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"examples":[true],"type":"boolean"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"returnUrl":{"type":"string"}},"required":["success","email"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"examples":[true],"type":"boolean"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"returnUrl":{"type":"string"}},"required":["success","email"]}}}}},"operationId":"postApiV1CustomerRegister-account-verify","tags":["customer"],"summary":"Verify account registration","description":"Verifies a customer registration using the one-time token sent via email. Returns the customer email and optional return URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"One-time verification token from the registration email.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"One-time verification token from the registration email.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"One-time verification token from the registration email.","type":"string"}}}}}}}},"/api/v1/customer/reset-password":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CustomerReset-password","tags":["customer"],"summary":"Request password reset","description":"Create a new reset password request and send verification mail to customer automatically. The link in the e-mail leads to `resetPasswordUrl` (or the organisation setting `customer_reset_password_url`), otherwise to the BizKitHub reset page.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"expirationTime":{"examples":["3h 20m"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"resetPasswordUrl":{"maxLength":2048,"examples":["https://bandzone.cz/zapomenute-udaje.html/{token}"],"description":"Absolute http(s) URL of your own reset page used as the link in the e-mail. `{token}` is replaced by the one-time token; without the placeholder the token is appended as `?token=`. Your page then calls `POST /api/v1/customer/set-new-password`. When omitted, the organisation configuration key `customer_reset_password_url` is used, and without it the BizKitHub page `https://bizkithub.com/{locale}/reset-password?token=…`.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"expirationTime":{"examples":["3h 20m"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"resetPasswordUrl":{"maxLength":2048,"examples":["https://bandzone.cz/zapomenute-udaje.html/{token}"],"description":"Absolute http(s) URL of your own reset page used as the link in the e-mail. `{token}` is replaced by the one-time token; without the placeholder the token is appended as `?token=`. Your page then calls `POST /api/v1/customer/set-new-password`. When omitted, the organisation configuration key `customer_reset_password_url` is used, and without it the BizKitHub page `https://bizkithub.com/{locale}/reset-password?token=…`.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"expirationTime":{"examples":["3h 20m"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"resetPasswordUrl":{"maxLength":2048,"examples":["https://bandzone.cz/zapomenute-udaje.html/{token}"],"description":"Absolute http(s) URL of your own reset page used as the link in the e-mail. `{token}` is replaced by the one-time token; without the placeholder the token is appended as `?token=`. Your page then calls `POST /api/v1/customer/set-new-password`. When omitted, the organisation configuration key `customer_reset_password_url` is used, and without it the BizKitHub page `https://bizkithub.com/{locale}/reset-password?token=…`.","type":"string"}}}}}}}},"/api/v1/customer/set-new-password":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006"],"type":"string"},"message":{"examples":["Change password failed.","You have entered a previously used password. For security reasons, please enter a new and unique password.","Reset password request does not exist.","Reset password request has been expired.","Customer account has no e-mail address.","The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit)."],"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006"],"type":"string"},"message":{"examples":["Change password failed.","You have entered a previously used password. For security reasons, please enter a new and unique password.","Reset password request does not exist.","Reset password request has been expired.","Customer account has no e-mail address.","The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit)."],"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006"],"type":"string"},"message":{"examples":["Change password failed.","You have entered a previously used password. For security reasons, please enter a new and unique password.","Reset password request does not exist.","Reset password request has been expired.","Customer account has no e-mail address.","The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit)."],"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006"],"type":"string"},"message":{"examples":["Change password failed.","You have entered a previously used password. For security reasons, please enter a new and unique password.","Reset password request does not exist.","Reset password request has been expired.","Customer account has no e-mail address.","The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit)."],"type":"string"}}}]}}}}},"operationId":"postApiV1CustomerSet-new-password","tags":["customer"],"summary":"Set new password","description":"Set a new password based on one time token given from user verification e-mail.\n\nList of error codes:\n\n| Code | Message |\n|------|---------|\n| E001 | Change password failed. |\n| E002 | You have entered a previously used password. For security reasons, please enter a new and unique password. |\n| E003 | Reset password request does not exist. |\n| E004 | Reset password request has been expired. |\n| E005 | Customer account has no e-mail address. |\n| E006 | The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit). |","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","password"],"properties":{"token":{"examples":["Hm2cDfmTS8x49Mo67gOxId8gEwNBwf1A"],"description":"System one time token given from user verification e-mail.","type":"string"},"password":{"examples":["1234"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","password"],"properties":{"token":{"examples":["Hm2cDfmTS8x49Mo67gOxId8gEwNBwf1A"],"description":"System one time token given from user verification e-mail.","type":"string"},"password":{"examples":["1234"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token","password"],"properties":{"token":{"examples":["Hm2cDfmTS8x49Mo67gOxId8gEwNBwf1A"],"description":"System one time token given from user verification e-mail.","type":"string"},"password":{"examples":["1234"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/customer/sync-password-hash":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","result"],"properties":{"success":{"const":true,"type":"boolean"},"result":{"anyOf":[{"const":"updated","type":"string"},{"const":"unchanged","type":"string"},{"const":"stale","type":"string"}]}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005"],"type":"string"},"message":{"examples":["Password hash sync failed.","Password hash sync is not enabled for this organisation.","Password hash must be a bcrypt hash ($2a$, $2b$ or $2y$).","Customer account does not exist.","changedAt must be an ISO 8601 date-time that is not in the future."],"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","result"],"properties":{"success":{"const":true,"type":"boolean"},"result":{"anyOf":[{"const":"updated","type":"string"},{"const":"unchanged","type":"string"},{"const":"stale","type":"string"}]}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005"],"type":"string"},"message":{"examples":["Password hash sync failed.","Password hash sync is not enabled for this organisation.","Password hash must be a bcrypt hash ($2a$, $2b$ or $2y$).","Customer account does not exist.","changedAt must be an ISO 8601 date-time that is not in the future."],"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","result"],"properties":{"success":{"const":true,"type":"boolean"},"result":{"anyOf":[{"const":"updated","type":"string"},{"const":"unchanged","type":"string"},{"const":"stale","type":"string"}]}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005"],"type":"string"},"message":{"examples":["Password hash sync failed.","Password hash sync is not enabled for this organisation.","Password hash must be a bcrypt hash ($2a$, $2b$ or $2y$).","Customer account does not exist.","changedAt must be an ISO 8601 date-time that is not in the future."],"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","result"],"properties":{"success":{"const":true,"type":"boolean"},"result":{"anyOf":[{"const":"updated","type":"string"},{"const":"unchanged","type":"string"},{"const":"stale","type":"string"}]}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005"],"type":"string"},"message":{"examples":["Password hash sync failed.","Password hash sync is not enabled for this organisation.","Password hash must be a bcrypt hash ($2a$, $2b$ or $2y$).","Customer account does not exist.","changedAt must be an ISO 8601 date-time that is not in the future."],"type":"string"}}}]}}}}},"operationId":"postApiV1CustomerSync-password-hash","tags":["customer"],"summary":"Sync password hash from a legacy system","description":"Overwrite the password hash of an existing customer (looked up by e-mail, case-insensitively) with a bcrypt hash computed by a legacy system, so password changes made there keep working until the cutover. Never creates a customer and sends no e-mail; active customer sessions are revoked. Disabled unless the organisation sets the configuration key `customer_password_hash_sync_enabled` to `true`.\n\nList of error codes:\n\n| Code | Message |\n|------|---------|\n| E001 | Password hash sync failed. |\n| E002 | Password hash sync is not enabled for this organisation. |\n| E003 | Password hash must be a bcrypt hash ($2a$, $2b$ or $2y$). |\n| E004 | Customer account does not exist. |\n| E005 | changedAt must be an ISO 8601 date-time that is not in the future. |","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","passwordHash"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"passwordHash":{"examples":["$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"],"description":"bcrypt hash ($2a$, $2b$ or $2y$) computed by the source system. Never send a plaintext password.","type":"string"},"changedAt":{"examples":["2026-11-02T14:30:00Z"],"description":"When the password was changed in the source system. If BKH already has a newer password, the hash is ignored (result \"stale\").","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email","passwordHash"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"passwordHash":{"examples":["$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"],"description":"bcrypt hash ($2a$, $2b$ or $2y$) computed by the source system. Never send a plaintext password.","type":"string"},"changedAt":{"examples":["2026-11-02T14:30:00Z"],"description":"When the password was changed in the source system. If BKH already has a newer password, the hash is ignored (result \"stale\").","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email","passwordHash"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"passwordHash":{"examples":["$2y$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"],"description":"bcrypt hash ($2a$, $2b$ or $2y$) computed by the source system. Never send a plaintext password.","type":"string"},"changedAt":{"examples":["2026-11-02T14:30:00Z"],"description":"When the password was changed in the source system. If BKH already has a newer password, the hash is ignored (result \"stale\").","type":"string"}}}}}}}},"/api/v1/customer/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Number of items per page.","schema":{"type":"number","default":100},"in":"query","name":"limit","required":true},{"description":"Page number.","schema":{"type":"number","default":1},"in":"query","name":"page","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"itemCount":{"examples":[10],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["cuRefNo","email","locale","registered","premium","credit","referredCustomerCount","insertedDate","updatedDate","lastActivityDate"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"registered":{"examples":[true],"type":"boolean"},"premium":{"examples":[true],"type":"boolean"},"credit":{"examples":[123],"type":"number"},"referralCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Parent referral customer relation.","type":"string"},"referredCustomerCount":{"examples":[2],"description":"Number of customer who referred this customer.","type":"number"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["itemCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"itemCount":{"examples":[10],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["cuRefNo","email","locale","registered","premium","credit","referredCustomerCount","insertedDate","updatedDate","lastActivityDate"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"registered":{"examples":[true],"type":"boolean"},"premium":{"examples":[true],"type":"boolean"},"credit":{"examples":[123],"type":"number"},"referralCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Parent referral customer relation.","type":"string"},"referredCustomerCount":{"examples":[2],"description":"Number of customer who referred this customer.","type":"number"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["itemCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"itemCount":{"examples":[10],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["cuRefNo","email","locale","registered","premium","credit","referredCustomerCount","insertedDate","updatedDate","lastActivityDate"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"registered":{"examples":[true],"type":"boolean"},"premium":{"examples":[true],"type":"boolean"},"credit":{"examples":[123],"type":"number"},"referralCuRefNo":{"examples":["5CmsaVNgAQqRqoen"],"description":"Parent referral customer relation.","type":"string"},"referredCustomerCount":{"examples":[2],"description":"Number of customer who referred this customer.","type":"number"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["itemCount","items"]}}}}},"operationId":"getApiV1CustomerList","tags":["customer"],"summary":"List customers","description":"Returns a paginated list of all customers in the organisation."}},"/api/v1/customer/add-bank-account":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CustomerAdd-bank-account","tags":["customer"],"summary":"Add bank account","description":"Links a bank account number to a customer identified by cuRefNo.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cuRefNo","bankAccount"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"bankAccount":{"examples":["CZ5420100000002002770630","2002770630/2010","000000-2002770630/2010","20027706302010"],"description":"Bank account identifier to be validated / converted to IBAN.\n\nSupported formats:\n- **IBAN** (ISO 7064 MOD-97-10), e.g. `CZ5420100000002002770630`.\n  - Spaces and separators are allowed; they will be removed.\n  - Letters are uppercased automatically.\n  - For `CZ` IBANs with incorrect check digits, the checksum may be repaired (recomputed from BBAN).\n\n- **Czech domestic format** (national account), e.g. `2002770630/2010`.\n  - Optional prefix is supported: `000000-2002770630/2010`.\n  - The bank code must be 4 digits.\n  - Prefix max 6 digits, account number max 10 digits.\n\n- **Digits-only technical formats** (Czech accounts only):\n  - 20 digits BBAN: `BBBBPPPPPPAAAAAAAAAA` (bank 4 + prefix 6 + account 10).\n  - 22 digits: `CCBBBB...` where it represents `CZ` + check digits + BBAN without the country prefix.\n  - Without separators: `<account+optional prefix><bank>`, e.g. `20027706302010`.\n\nInvalid input: If the value contains letters but is not a valid/repairable IBAN, conversion fails and the endpoint returns `{ success: false }`.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["cuRefNo","bankAccount"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"bankAccount":{"examples":["CZ5420100000002002770630","2002770630/2010","000000-2002770630/2010","20027706302010"],"description":"Bank account identifier to be validated / converted to IBAN.\n\nSupported formats:\n- **IBAN** (ISO 7064 MOD-97-10), e.g. `CZ5420100000002002770630`.\n  - Spaces and separators are allowed; they will be removed.\n  - Letters are uppercased automatically.\n  - For `CZ` IBANs with incorrect check digits, the checksum may be repaired (recomputed from BBAN).\n\n- **Czech domestic format** (national account), e.g. `2002770630/2010`.\n  - Optional prefix is supported: `000000-2002770630/2010`.\n  - The bank code must be 4 digits.\n  - Prefix max 6 digits, account number max 10 digits.\n\n- **Digits-only technical formats** (Czech accounts only):\n  - 20 digits BBAN: `BBBBPPPPPPAAAAAAAAAA` (bank 4 + prefix 6 + account 10).\n  - 22 digits: `CCBBBB...` where it represents `CZ` + check digits + BBAN without the country prefix.\n  - Without separators: `<account+optional prefix><bank>`, e.g. `20027706302010`.\n\nInvalid input: If the value contains letters but is not a valid/repairable IBAN, conversion fails and the endpoint returns `{ success: false }`.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["cuRefNo","bankAccount"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"bankAccount":{"examples":["CZ5420100000002002770630","2002770630/2010","000000-2002770630/2010","20027706302010"],"description":"Bank account identifier to be validated / converted to IBAN.\n\nSupported formats:\n- **IBAN** (ISO 7064 MOD-97-10), e.g. `CZ5420100000002002770630`.\n  - Spaces and separators are allowed; they will be removed.\n  - Letters are uppercased automatically.\n  - For `CZ` IBANs with incorrect check digits, the checksum may be repaired (recomputed from BBAN).\n\n- **Czech domestic format** (national account), e.g. `2002770630/2010`.\n  - Optional prefix is supported: `000000-2002770630/2010`.\n  - The bank code must be 4 digits.\n  - Prefix max 6 digits, account number max 10 digits.\n\n- **Digits-only technical formats** (Czech accounts only):\n  - 20 digits BBAN: `BBBBPPPPPPAAAAAAAAAA` (bank 4 + prefix 6 + account 10).\n  - 22 digits: `CCBBBB...` where it represents `CZ` + check digits + BBAN without the country prefix.\n  - Without separators: `<account+optional prefix><bank>`, e.g. `20027706302010`.\n\nInvalid input: If the value contains letters but is not a valid/repairable IBAN, conversion fails and the endpoint returns `{ success: false }`.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"}}}}}}}},"/api/v1/customer/add-groups":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CustomerAdd-groups","tags":["customer"],"summary":"Add groups (tags) to a customer","description":"Adds one or more groups to a customer identified by `email` or `cuRefNo` (at least one is required; `cuRefNo` takes precedence when both are supplied). Idempotent — groups already assigned to the customer are silently skipped, and groups that do not exist yet in the organisation are auto-created. Useful for tagging customers from analytics/automation flows when only the e-mail is known.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"groups":{"minItems":1,"description":"List of group slugs to assign. Non-slug input is normalised via `toSlug`. Groups that do not exist yet in the organisation are auto-created.","type":"array","items":{"examples":["personal-training"],"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"groups":{"minItems":1,"description":"List of group slugs to assign. Non-slug input is normalised via `toSlug`. Groups that do not exist yet in the organisation are auto-created.","type":"array","items":{"examples":["personal-training"],"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"groups":{"minItems":1,"description":"List of group slugs to assign. Non-slug input is normalised via `toSlug`. Groups that do not exist yet in the organisation are auto-created.","type":"array","items":{"examples":["personal-training"],"type":"string"}}}}}}}}},"/api/v1/customer/hierarchy":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"cuRefNo = customer reference number.","examples":["1cGIHvFoQDGLAbcA"],"schema":{"type":"string","maxLength":16,"minLength":16},"in":"query","name":"cuRefNo","required":true}],"operationId":"getApiV1CustomerHierarchy","tags":["customer"],"summary":"Get customer hierarchy","description":"Returns the superior (at most one), subordinates (direct children), and colleagues (customers sharing the same non-null superior) for the given customer.","responses":{"200":{}}}},"/api/v1/customer/set-parent":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1CustomerSet-parent","tags":["customer"],"summary":"Set customer superior","description":"Assigns a parent (superior) customer for the given `cuRefNo`. Pass null/omit `parentCuRefNo` to detach. Rejected when the target would create a cycle or when customer equals parent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cuRefNo"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"parentCuRefNo":{"nullable":true,"anyOf":[{"examples":["1cGIHvFoQDGLAbcA"],"description":"External ID of the new superior. Pass null or omit to detach (customer becomes a root node).","maxLength":16,"minLength":16,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["cuRefNo"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"parentCuRefNo":{"nullable":true,"anyOf":[{"examples":["1cGIHvFoQDGLAbcA"],"description":"External ID of the new superior. Pass null or omit to detach (customer becomes a root node).","maxLength":16,"minLength":16,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["cuRefNo"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"parentCuRefNo":{"nullable":true,"anyOf":[{"examples":["1cGIHvFoQDGLAbcA"],"description":"External ID of the new superior. Pass null or omit to detach (customer becomes a root node).","maxLength":16,"minLength":16,"type":"string"},{"type":"null"}]}}}}}}}},"/api/v1/customer/org-tree":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"cuRefNo = customer reference number.","examples":["1cGIHvFoQDGLAbcA"],"schema":{"type":"string","maxLength":16,"minLength":16},"in":"query","name":"cuRefNo","required":true}],"operationId":"getApiV1CustomerOrg-tree","tags":["customer"],"summary":"Get organisational tree","description":"Returns the focused customer together with ancestors (root-first) and the full subtree rooted at the focused customer. Depth capped at 32 levels in each direction.","responses":{"200":{}}}},"/api/v1/customer/add-activity":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","activityId"],"properties":{"success":{"const":true,"type":"boolean"},"activityId":{"minLength":24,"maxLength":24,"description":"24-char public id of the inserted audit row (`core__activity.external_id`).","examples":["aQ9kZxB2fWpL7mYrT3nX8dCv"],"type":"string"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"description":"Stable short code for programmatic branching. Known values: `INVALID_EVENT_TYPE`, `INVALID_MESSAGE`, `META_TOO_LARGE`, `INVALID_META`, `ACTOR_MEMBER_UNSUPPORTED`, `ACTIVITY_WRITE_FAILED`.","type":"string"},"message":{"description":"Human-readable error for the integration developer.","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","activityId"],"properties":{"success":{"const":true,"type":"boolean"},"activityId":{"minLength":24,"maxLength":24,"description":"24-char public id of the inserted audit row (`core__activity.external_id`).","examples":["aQ9kZxB2fWpL7mYrT3nX8dCv"],"type":"string"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"description":"Stable short code for programmatic branching. Known values: `INVALID_EVENT_TYPE`, `INVALID_MESSAGE`, `META_TOO_LARGE`, `INVALID_META`, `ACTOR_MEMBER_UNSUPPORTED`, `ACTIVITY_WRITE_FAILED`.","type":"string"},"message":{"description":"Human-readable error for the integration developer.","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","activityId"],"properties":{"success":{"const":true,"type":"boolean"},"activityId":{"minLength":24,"maxLength":24,"description":"24-char public id of the inserted audit row (`core__activity.external_id`).","examples":["aQ9kZxB2fWpL7mYrT3nX8dCv"],"type":"string"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"description":"Stable short code for programmatic branching. Known values: `INVALID_EVENT_TYPE`, `INVALID_MESSAGE`, `META_TOO_LARGE`, `INVALID_META`, `ACTOR_MEMBER_UNSUPPORTED`, `ACTIVITY_WRITE_FAILED`.","type":"string"},"message":{"description":"Human-readable error for the integration developer.","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","activityId"],"properties":{"success":{"const":true,"type":"boolean"},"activityId":{"minLength":24,"maxLength":24,"description":"24-char public id of the inserted audit row (`core__activity.external_id`).","examples":["aQ9kZxB2fWpL7mYrT3nX8dCv"],"type":"string"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"description":"Stable short code for programmatic branching. Known values: `INVALID_EVENT_TYPE`, `INVALID_MESSAGE`, `META_TOO_LARGE`, `INVALID_META`, `ACTOR_MEMBER_UNSUPPORTED`, `ACTIVITY_WRITE_FAILED`.","type":"string"},"message":{"description":"Human-readable error for the integration developer.","type":"string"}}}]}}}}},"operationId":"postApiV1CustomerAdd-activity","tags":["Activity"],"summary":"Append an audit activity entry","description":"Writes one row to `core__activity` for this organisation. Designed for external applications (e.g. gymroom, bandzone, cctv) that want to centralise their audit log into the BKH platform without re-implementing a per-tenant store. Returns the 24-char public activity id.\n\n**Target contact** is resolved from `identityId` (preferred) or `customerEmail`; a missing e-mail-bearing contact is created on-the-fly (no welcome mail, no password) so follow-up events for the same person land on the same row.\n\n**Actor** defaults to `kind = \"api\"`. Use `kind = \"contact\"` + `email`/`identityId` when the event is attributable to a specific person; `kind = \"system\" | \"cron\"` for unattended work. When a `contact` actor does not resolve (expired / logged-out identity, unknown e-mail) the row is still written with `kind = \"api\"` and `meta.actorUnresolved = true`.\n\n**Geo attribution**: pass `customerRealIp` to attach the caller's geo footprint; omit it to let the server use the HTTP request's own IP (typically the integration server, not the end-user).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventType","message"],"properties":{"eventType":{"minLength":1,"maxLength":64,"description":"Stable machine-readable event identifier. Convention: `{entity}.{verb}` dot-notation, lowercase slug with letters, digits, dots, dashes, underscores. Max 64 chars. Examples: `bandzone.band.created`, `gymroom.booking.cancelled`, `account.password_reset`.","examples":["bandzone.band.created"],"type":"string"},"message":{"minLength":1,"maxLength":500,"description":"Pre-rendered human-readable one-line summary shown in the admin activity grid. Format in the actor's locale on your side — the audit log does not re-render from a template.","examples":["Nová kapela \"Solární sovy\" byla vytvořena uživatelem petr@example.com."],"type":"string"},"level":{"description":"Severity. `info` (default) for the vast majority of events, `notice` for the ones worth highlighting in admin, `warning` when an operator should look. `error` is intentionally not offered here — operational errors belong on `core__system_log`, not the audit feed.","anyOf":[{"const":"info","type":"string"},{"const":"notice","type":"string"},{"const":"warning","type":"string"}]},"customerEmail":{"description":"E-mail of the TARGET contact (whom the event concerns). Resolved against `shop__contact` in this organisation; a missing contact is created on-the-fly as a bare record (no welcome e-mail, no password). Leave empty when the event is not tied to a specific person (system-wide events) and set `actor.kind = \"api\" | \"system\" | \"cron\"`.","examples":["petr@example.com"],"type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"actor":{"type":"object","required":["kind"],"properties":{"kind":{"description":"Who performed the action. Default `api` (= the external integration itself). `contact` requires `email` or `identityId` to resolve. `member` is NOT accepted on the public API — log member actions through BFF.","anyOf":[{"const":"contact","type":"string"},{"const":"system","type":"string"},{"const":"cron","type":"string"},{"const":"api","type":"string"},{"const":"member","type":"string"}]},"email":{"description":"Actor contact e-mail — used when `kind = \"contact\"` to resolve `actor_contact_id`.","type":"string"},"identityId":{"description":"Actor identity id — preferred over `email` when both are provided. Used when `kind = \"contact\"` to resolve `actor_contact_id`.","type":"string"}}},"correlationId":{"maxLength":36,"description":"Opaque correlation token for grouping related events across multiple requests (e.g. a multi-step registration). Max 36 chars. Omit to let the server derive one from the request.","examples":["bnd-register-01HJ..."],"type":"string"},"meta":{"description":"Free-form JSON payload stored verbatim on the audit row. Hard cap: 32 KB after serialization — larger payloads are rejected. BigInt values are coerced to Number (or string if out of safe range) because jsonb cannot encode BigInt. Keep the shape stable per `eventType` — the admin grid relies on it.","type":"object","patternProperties":{"^(.*)$":{}}},"occurredAt":{"description":"ACCEPTED FOR COMPATIBILITY BUT IGNORED. The audit row's timestamp is server-side (`NOW()`); client-reported timestamps cannot be trusted in an audit log. Put the original timestamp into `meta.occurredAt` if you need to preserve it.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}},"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","required":["eventType","message"],"properties":{"eventType":{"minLength":1,"maxLength":64,"description":"Stable machine-readable event identifier. Convention: `{entity}.{verb}` dot-notation, lowercase slug with letters, digits, dots, dashes, underscores. Max 64 chars. Examples: `bandzone.band.created`, `gymroom.booking.cancelled`, `account.password_reset`.","examples":["bandzone.band.created"],"type":"string"},"message":{"minLength":1,"maxLength":500,"description":"Pre-rendered human-readable one-line summary shown in the admin activity grid. Format in the actor's locale on your side — the audit log does not re-render from a template.","examples":["Nová kapela \"Solární sovy\" byla vytvořena uživatelem petr@example.com."],"type":"string"},"level":{"description":"Severity. `info` (default) for the vast majority of events, `notice` for the ones worth highlighting in admin, `warning` when an operator should look. `error` is intentionally not offered here — operational errors belong on `core__system_log`, not the audit feed.","anyOf":[{"const":"info","type":"string"},{"const":"notice","type":"string"},{"const":"warning","type":"string"}]},"customerEmail":{"description":"E-mail of the TARGET contact (whom the event concerns). Resolved against `shop__contact` in this organisation; a missing contact is created on-the-fly as a bare record (no welcome e-mail, no password). Leave empty when the event is not tied to a specific person (system-wide events) and set `actor.kind = \"api\" | \"system\" | \"cron\"`.","examples":["petr@example.com"],"type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"actor":{"type":"object","required":["kind"],"properties":{"kind":{"description":"Who performed the action. Default `api` (= the external integration itself). `contact` requires `email` or `identityId` to resolve. `member` is NOT accepted on the public API — log member actions through BFF.","anyOf":[{"const":"contact","type":"string"},{"const":"system","type":"string"},{"const":"cron","type":"string"},{"const":"api","type":"string"},{"const":"member","type":"string"}]},"email":{"description":"Actor contact e-mail — used when `kind = \"contact\"` to resolve `actor_contact_id`.","type":"string"},"identityId":{"description":"Actor identity id — preferred over `email` when both are provided. Used when `kind = \"contact\"` to resolve `actor_contact_id`.","type":"string"}}},"correlationId":{"maxLength":36,"description":"Opaque correlation token for grouping related events across multiple requests (e.g. a multi-step registration). Max 36 chars. Omit to let the server derive one from the request.","examples":["bnd-register-01HJ..."],"type":"string"},"meta":{"description":"Free-form JSON payload stored verbatim on the audit row. Hard cap: 32 KB after serialization — larger payloads are rejected. BigInt values are coerced to Number (or string if out of safe range) because jsonb cannot encode BigInt. Keep the shape stable per `eventType` — the admin grid relies on it.","type":"object","patternProperties":{"^(.*)$":{}}},"occurredAt":{"description":"ACCEPTED FOR COMPATIBILITY BUT IGNORED. The audit row's timestamp is server-side (`NOW()`); client-reported timestamps cannot be trusted in an audit log. Put the original timestamp into `meta.occurredAt` if you need to preserve it.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}},"additionalProperties":false}},"text/plain":{"schema":{"type":"object","required":["eventType","message"],"properties":{"eventType":{"minLength":1,"maxLength":64,"description":"Stable machine-readable event identifier. Convention: `{entity}.{verb}` dot-notation, lowercase slug with letters, digits, dots, dashes, underscores. Max 64 chars. Examples: `bandzone.band.created`, `gymroom.booking.cancelled`, `account.password_reset`.","examples":["bandzone.band.created"],"type":"string"},"message":{"minLength":1,"maxLength":500,"description":"Pre-rendered human-readable one-line summary shown in the admin activity grid. Format in the actor's locale on your side — the audit log does not re-render from a template.","examples":["Nová kapela \"Solární sovy\" byla vytvořena uživatelem petr@example.com."],"type":"string"},"level":{"description":"Severity. `info` (default) for the vast majority of events, `notice` for the ones worth highlighting in admin, `warning` when an operator should look. `error` is intentionally not offered here — operational errors belong on `core__system_log`, not the audit feed.","anyOf":[{"const":"info","type":"string"},{"const":"notice","type":"string"},{"const":"warning","type":"string"}]},"customerEmail":{"description":"E-mail of the TARGET contact (whom the event concerns). Resolved against `shop__contact` in this organisation; a missing contact is created on-the-fly as a bare record (no welcome e-mail, no password). Leave empty when the event is not tied to a specific person (system-wide events) and set `actor.kind = \"api\" | \"system\" | \"cron\"`.","examples":["petr@example.com"],"type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"actor":{"type":"object","required":["kind"],"properties":{"kind":{"description":"Who performed the action. Default `api` (= the external integration itself). `contact` requires `email` or `identityId` to resolve. `member` is NOT accepted on the public API — log member actions through BFF.","anyOf":[{"const":"contact","type":"string"},{"const":"system","type":"string"},{"const":"cron","type":"string"},{"const":"api","type":"string"},{"const":"member","type":"string"}]},"email":{"description":"Actor contact e-mail — used when `kind = \"contact\"` to resolve `actor_contact_id`.","type":"string"},"identityId":{"description":"Actor identity id — preferred over `email` when both are provided. Used when `kind = \"contact\"` to resolve `actor_contact_id`.","type":"string"}}},"correlationId":{"maxLength":36,"description":"Opaque correlation token for grouping related events across multiple requests (e.g. a multi-step registration). Max 36 chars. Omit to let the server derive one from the request.","examples":["bnd-register-01HJ..."],"type":"string"},"meta":{"description":"Free-form JSON payload stored verbatim on the audit row. Hard cap: 32 KB after serialization — larger payloads are rejected. BigInt values are coerced to Number (or string if out of safe range) because jsonb cannot encode BigInt. Keep the shape stable per `eventType` — the admin grid relies on it.","type":"object","patternProperties":{"^(.*)$":{}}},"occurredAt":{"description":"ACCEPTED FOR COMPATIBILITY BUT IGNORED. The audit row's timestamp is server-side (`NOW()`); client-reported timestamps cannot be trusted in an audit log. Put the original timestamp into `meta.occurredAt` if you need to preserve it.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}},"additionalProperties":false}}}}}},"/api/v1/disk/store-pdf":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"examples":[true],"type":"boolean"},"downloadUrl":{"description":"Resolvable public URL for downloading the stored PDF.","examples":["https://storage.xhp.cz/..."],"type":"string"},"token":{"description":"Blob access token (storage-level).","examples":["abc123..."],"type":"string"},"blobPath":{"description":"Internal blob path inside storage. The storage layer always injects a 16-char random suffix before the extension for non-enumerability.","examples":["pdf/2026-01/invoice-123_R4nd0mStr1ngHere.pdf"],"type":"string"},"size":{"description":"Stored PDF size in bytes.","examples":[153042],"type":"number"}},"required":["success","downloadUrl","token","blobPath","size"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"examples":[true],"type":"boolean"},"downloadUrl":{"description":"Resolvable public URL for downloading the stored PDF.","examples":["https://storage.xhp.cz/..."],"type":"string"},"token":{"description":"Blob access token (storage-level).","examples":["abc123..."],"type":"string"},"blobPath":{"description":"Internal blob path inside storage. The storage layer always injects a 16-char random suffix before the extension for non-enumerability.","examples":["pdf/2026-01/invoice-123_R4nd0mStr1ngHere.pdf"],"type":"string"},"size":{"description":"Stored PDF size in bytes.","examples":[153042],"type":"number"}},"required":["success","downloadUrl","token","blobPath","size"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"examples":[true],"type":"boolean"},"downloadUrl":{"description":"Resolvable public URL for downloading the stored PDF.","examples":["https://storage.xhp.cz/..."],"type":"string"},"token":{"description":"Blob access token (storage-level).","examples":["abc123..."],"type":"string"},"blobPath":{"description":"Internal blob path inside storage. The storage layer always injects a 16-char random suffix before the extension for non-enumerability.","examples":["pdf/2026-01/invoice-123_R4nd0mStr1ngHere.pdf"],"type":"string"},"size":{"description":"Stored PDF size in bytes.","examples":[153042],"type":"number"}},"required":["success","downloadUrl","token","blobPath","size"]}}}}},"operationId":"diskStorePdf","tags":["disk"],"summary":"Generate PDF from HTML and store it to blob storage","description":"Generates a PDF from provided HTML using the BizKitHub PDF generator parameters, stores it in blob storage, and returns a public download URL.\n\nSizing priority: width overrides format. Optional height makes page size explicit. autoHeight enables print-safe margins; margin overrides them. fitHeight enables single-page receipt mode.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["htmlContent","filename"],"properties":{"htmlContent":{"description":"HTML content to render into PDF. This is sent as the generator request body (compressed).","examples":["<!doctype html><html><body><h1>Invoice #123</h1></body></html>"],"type":"string"},"filename":{"description":"Original filename. The service normalizes it, appends a random suffix, and forces the .pdf extension.","examples":["invoice-123.pdf"],"type":"string"},"tag":{"description":"Optional storage tag (internal metadata label).","examples":["invoice","contract","report"],"type":"string"},"format":{"description":"Standard paper format (e.g. A4, Letter, …). Used when width is not set. Default is A4.","examples":["A4","Letter"],"type":"string"},"width":{"description":"Custom page width (CSS length, e.g. 80mm, 210mm, 800px). When set, it overrides format.","examples":["80mm","210mm","800px"],"type":"string"},"height":{"description":"Custom page height (CSS length). Used in fixed-size mode. When width is set and fitHeight is not enabled, height defaults like A4 height behavior.","examples":["150mm","297mm"],"type":"string"},"autoHeight":{"description":"Enables print-safe margins consistently across pages (improves page breaks and prevents edge clipping).","examples":[true],"type":"boolean"},"margin":{"description":"Overrides margin size when autoHeight=true. CSS shorthand (1–4 values), e.g. \"12mm 10mm\" or \"2mm\".","examples":["12mm 10mm","2mm"],"type":"string"},"fitHeight":{"description":"Receipt mode: generates a single-page PDF whose height is derived from rendered content. Works best with width (e.g. 80mm).","examples":[true],"type":"boolean"},"uuid":{"description":"Optional identifier stored in PDF metadata keywords.","examples":["order_123","invoice_2026_0001"],"type":"string"},"author":{"description":"Optional author label in PDF metadata (Author/Creator/Producer). If omitted, defaults to organisation name.","examples":["BizKitHub","Jan Barášek"],"type":"string"},"debug":{"description":"Adds debug CSS borders to the rendered HTML for layout inspection (internal).","examples":[true],"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["htmlContent","filename"],"properties":{"htmlContent":{"description":"HTML content to render into PDF. This is sent as the generator request body (compressed).","examples":["<!doctype html><html><body><h1>Invoice #123</h1></body></html>"],"type":"string"},"filename":{"description":"Original filename. The service normalizes it, appends a random suffix, and forces the .pdf extension.","examples":["invoice-123.pdf"],"type":"string"},"tag":{"description":"Optional storage tag (internal metadata label).","examples":["invoice","contract","report"],"type":"string"},"format":{"description":"Standard paper format (e.g. A4, Letter, …). Used when width is not set. Default is A4.","examples":["A4","Letter"],"type":"string"},"width":{"description":"Custom page width (CSS length, e.g. 80mm, 210mm, 800px). When set, it overrides format.","examples":["80mm","210mm","800px"],"type":"string"},"height":{"description":"Custom page height (CSS length). Used in fixed-size mode. When width is set and fitHeight is not enabled, height defaults like A4 height behavior.","examples":["150mm","297mm"],"type":"string"},"autoHeight":{"description":"Enables print-safe margins consistently across pages (improves page breaks and prevents edge clipping).","examples":[true],"type":"boolean"},"margin":{"description":"Overrides margin size when autoHeight=true. CSS shorthand (1–4 values), e.g. \"12mm 10mm\" or \"2mm\".","examples":["12mm 10mm","2mm"],"type":"string"},"fitHeight":{"description":"Receipt mode: generates a single-page PDF whose height is derived from rendered content. Works best with width (e.g. 80mm).","examples":[true],"type":"boolean"},"uuid":{"description":"Optional identifier stored in PDF metadata keywords.","examples":["order_123","invoice_2026_0001"],"type":"string"},"author":{"description":"Optional author label in PDF metadata (Author/Creator/Producer). If omitted, defaults to organisation name.","examples":["BizKitHub","Jan Barášek"],"type":"string"},"debug":{"description":"Adds debug CSS borders to the rendered HTML for layout inspection (internal).","examples":[true],"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["htmlContent","filename"],"properties":{"htmlContent":{"description":"HTML content to render into PDF. This is sent as the generator request body (compressed).","examples":["<!doctype html><html><body><h1>Invoice #123</h1></body></html>"],"type":"string"},"filename":{"description":"Original filename. The service normalizes it, appends a random suffix, and forces the .pdf extension.","examples":["invoice-123.pdf"],"type":"string"},"tag":{"description":"Optional storage tag (internal metadata label).","examples":["invoice","contract","report"],"type":"string"},"format":{"description":"Standard paper format (e.g. A4, Letter, …). Used when width is not set. Default is A4.","examples":["A4","Letter"],"type":"string"},"width":{"description":"Custom page width (CSS length, e.g. 80mm, 210mm, 800px). When set, it overrides format.","examples":["80mm","210mm","800px"],"type":"string"},"height":{"description":"Custom page height (CSS length). Used in fixed-size mode. When width is set and fitHeight is not enabled, height defaults like A4 height behavior.","examples":["150mm","297mm"],"type":"string"},"autoHeight":{"description":"Enables print-safe margins consistently across pages (improves page breaks and prevents edge clipping).","examples":[true],"type":"boolean"},"margin":{"description":"Overrides margin size when autoHeight=true. CSS shorthand (1–4 values), e.g. \"12mm 10mm\" or \"2mm\".","examples":["12mm 10mm","2mm"],"type":"string"},"fitHeight":{"description":"Receipt mode: generates a single-page PDF whose height is derived from rendered content. Works best with width (e.g. 80mm).","examples":[true],"type":"boolean"},"uuid":{"description":"Optional identifier stored in PDF metadata keywords.","examples":["order_123","invoice_2026_0001"],"type":"string"},"author":{"description":"Optional author label in PDF metadata (Author/Creator/Producer). If omitted, defaults to organisation name.","examples":["BizKitHub","Jan Barášek"],"type":"string"},"debug":{"description":"Adds debug CSS borders to the rendered HTML for layout inspection (internal).","examples":[true],"type":"boolean"}}}}}}}},"/api/v1/disk/store-blob":{"post":{"parameters":[],"operationId":"postApiV1DiskStore-blob","tags":["disk"],"summary":"Upload file to blob storage","description":"Uploads a file via multipart/form-data to blob storage and returns a public download URL. Form fields: `file` (required, the file blob), `blobPath` (optional, storage directory prefix), `tag` (optional, metadata label).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload.","type":"string","format":"binary"},"blobPath":{"description":"Optional storage directory prefix.","type":"string"},"tag":{"description":"Optional metadata label.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload.","type":"string","format":"binary"},"blobPath":{"description":"Optional storage directory prefix.","type":"string"},"tag":{"description":"Optional metadata label.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload.","type":"string","format":"binary"},"blobPath":{"description":"Optional storage directory prefix.","type":"string"},"tag":{"description":"Optional metadata label.","type":"string"}}}}}},"responses":{"200":{}}}},"/api/v1/disk/store-contract":{"post":{"operationId":"postApiV1DiskStore-contract","tags":["disk"],"summary":"Store contract (not implemented)","description":"Placeholder endpoint for contract storage. Not yet implemented.","responses":{"200":{}}}},"/api/v1/docs/error-list":{"get":{"responses":{"200":{"description":"Complete error code reference.","content":{"application/json":{"schema":{"type":"object","properties":{"errorList":{"description":"Map of error codes to their definitions.","type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["message"],"properties":{"message":{"description":"Short error message.","type":"string"},"httpStatusCode":{"description":"Suggested HTTP status code.","examples":[400,404,500],"type":"number"},"description":{"description":"Detailed explanation of the error.","type":"string"},"troubleshoot":{"description":"List of troubleshooting steps.","type":"array","items":{"type":"string"}}}}}}},"required":["errorList"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"errorList":{"description":"Map of error codes to their definitions.","type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["message"],"properties":{"message":{"description":"Short error message.","type":"string"},"httpStatusCode":{"description":"Suggested HTTP status code.","examples":[400,404,500],"type":"number"},"description":{"description":"Detailed explanation of the error.","type":"string"},"troubleshoot":{"description":"List of troubleshooting steps.","type":"array","items":{"type":"string"}}}}}}},"required":["errorList"]}},"text/plain":{"schema":{"type":"object","properties":{"errorList":{"description":"Map of error codes to their definitions.","type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["message"],"properties":{"message":{"description":"Short error message.","type":"string"},"httpStatusCode":{"description":"Suggested HTTP status code.","examples":[400,404,500],"type":"number"},"description":{"description":"Detailed explanation of the error.","type":"string"},"troubleshoot":{"description":"List of troubleshooting steps.","type":"array","items":{"type":"string"}}}}}}},"required":["errorList"]}}}}},"operationId":"getApiV1DocsError-list","tags":["docs"],"summary":"List all error codes","description":"Returns a dictionary of all known application error codes with their messages, descriptions, and troubleshooting hints."}},"/api/v1/docs/system-log-code-list":{"get":{"responses":{"200":{"description":"System log code reference.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","title","description","module","moduleDescription","severity","impact","retry","causes","resolution","related"],"properties":{"code":{"description":"System log code identifier (max 64 chars).","examples":["TTL_003","INTERNAL_FIO_API_UNAVAILABLE"],"type":"string"},"title":{"description":"Human-readable title. `null` when the code has not been documented yet.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Detailed explanation. `null` when the code has not been documented yet.","anyOf":[{"type":"string"},{"type":"null"}]},"module":{"description":"Module prefix (segment before the first underscore).","examples":["EML","PAY","SHIPM"],"type":"string"},"moduleDescription":{"description":"One-line description of the module, `null` when the prefix is not registered.","anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"description":"How serious the event is. Mirrors the level the code is normally logged with.","anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"critical","type":"string"},{"type":"null"}]},"impact":{"description":"Who is affected: `none` (bookkeeping only), `operator` (organisation staff), `customer` (end customers).","anyOf":[{"const":"none","type":"string"},{"const":"operator","type":"string"},{"const":"customer","type":"string"},{"type":"null"}]},"retry":{"description":"`auto` = the platform retries on its own, `manual` = safe for an operator to retry, `none` = retrying will not help until the cause is fixed.","anyOf":[{"const":"auto","type":"string"},{"const":"manual","type":"string"},{"const":"none","type":"string"},{"type":"null"}]},"causes":{"description":"Typical reasons the code is logged.","type":"array","items":{"type":"string"}},"resolution":{"description":"Ordered steps to resolve or verify the situation.","type":"array","items":{"type":"string"}},"related":{"description":"Other system log codes worth reading alongside.","type":"array","items":{"type":"string"}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","title","description","module","moduleDescription","severity","impact","retry","causes","resolution","related"],"properties":{"code":{"description":"System log code identifier (max 64 chars).","examples":["TTL_003","INTERNAL_FIO_API_UNAVAILABLE"],"type":"string"},"title":{"description":"Human-readable title. `null` when the code has not been documented yet.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Detailed explanation. `null` when the code has not been documented yet.","anyOf":[{"type":"string"},{"type":"null"}]},"module":{"description":"Module prefix (segment before the first underscore).","examples":["EML","PAY","SHIPM"],"type":"string"},"moduleDescription":{"description":"One-line description of the module, `null` when the prefix is not registered.","anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"description":"How serious the event is. Mirrors the level the code is normally logged with.","anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"critical","type":"string"},{"type":"null"}]},"impact":{"description":"Who is affected: `none` (bookkeeping only), `operator` (organisation staff), `customer` (end customers).","anyOf":[{"const":"none","type":"string"},{"const":"operator","type":"string"},{"const":"customer","type":"string"},{"type":"null"}]},"retry":{"description":"`auto` = the platform retries on its own, `manual` = safe for an operator to retry, `none` = retrying will not help until the cause is fixed.","anyOf":[{"const":"auto","type":"string"},{"const":"manual","type":"string"},{"const":"none","type":"string"},{"type":"null"}]},"causes":{"description":"Typical reasons the code is logged.","type":"array","items":{"type":"string"}},"resolution":{"description":"Ordered steps to resolve or verify the situation.","type":"array","items":{"type":"string"}},"related":{"description":"Other system log codes worth reading alongside.","type":"array","items":{"type":"string"}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","title","description","module","moduleDescription","severity","impact","retry","causes","resolution","related"],"properties":{"code":{"description":"System log code identifier (max 64 chars).","examples":["TTL_003","INTERNAL_FIO_API_UNAVAILABLE"],"type":"string"},"title":{"description":"Human-readable title. `null` when the code has not been documented yet.","anyOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Detailed explanation. `null` when the code has not been documented yet.","anyOf":[{"type":"string"},{"type":"null"}]},"module":{"description":"Module prefix (segment before the first underscore).","examples":["EML","PAY","SHIPM"],"type":"string"},"moduleDescription":{"description":"One-line description of the module, `null` when the prefix is not registered.","anyOf":[{"type":"string"},{"type":"null"}]},"severity":{"description":"How serious the event is. Mirrors the level the code is normally logged with.","anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"critical","type":"string"},{"type":"null"}]},"impact":{"description":"Who is affected: `none` (bookkeeping only), `operator` (organisation staff), `customer` (end customers).","anyOf":[{"const":"none","type":"string"},{"const":"operator","type":"string"},{"const":"customer","type":"string"},{"type":"null"}]},"retry":{"description":"`auto` = the platform retries on its own, `manual` = safe for an operator to retry, `none` = retrying will not help until the cause is fixed.","anyOf":[{"const":"auto","type":"string"},{"const":"manual","type":"string"},{"const":"none","type":"string"},{"type":"null"}]},"causes":{"description":"Typical reasons the code is logged.","type":"array","items":{"type":"string"}},"resolution":{"description":"Ordered steps to resolve or verify the situation.","type":"array","items":{"type":"string"}},"related":{"description":"Other system log codes worth reading alongside.","type":"array","items":{"type":"string"}}}}}},"required":["items"]}}}}},"operationId":"getApiV1DocsSystem-log-code-list","tags":["docs"],"summary":"List system log codes","description":"Returns every system log code registered in `core__system_log_code` with its title and description. Powers docs.bizkithub.com/system-codes — the public reference for codes like TTL_003, INTERNAL_FIO_API, MBR_NOTE_MENT that appear in technical-notification e-mails and in the admin log viewer. Operational statistics (occurrence counts, first/last-seen timestamps, severity history) are intentionally not exposed here so the public docs do not disclose platform scale; those live behind the admin BFF instead. Coarse, scale-free activity is available from `/docs/system-log-code-activity`."}},"/api/v1/docs/system-log-code-activity":{"get":{"responses":{"200":{"description":"Relative system log code activity.","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"description":"Length of the trend window in days.","examples":[30],"type":"number"},"levels":{"description":"Highest trend level (the busiest day of a code).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","lastSeen","trend"],"properties":{"code":{"description":"System log code identifier.","examples":["API_UNCAUGHT"],"type":"string"},"lastSeen":{"description":"Most recent occurrence: within 24 hours (`day`), 7 days (`week`), 30 days (`month`), earlier (`older`) or never.","anyOf":[{"const":"day","type":"string"},{"const":"week","type":"string"},{"const":"month","type":"string"},{"const":"older","type":"string"},{"const":"never","type":"string"}]},"trend":{"description":"One relative level per day, oldest first. 0 = no occurrence that day.","examples":[[0,0,1,3,8,2]],"type":"array","items":{"type":"number"}}}}}},"required":["days","levels","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"days":{"description":"Length of the trend window in days.","examples":[30],"type":"number"},"levels":{"description":"Highest trend level (the busiest day of a code).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","lastSeen","trend"],"properties":{"code":{"description":"System log code identifier.","examples":["API_UNCAUGHT"],"type":"string"},"lastSeen":{"description":"Most recent occurrence: within 24 hours (`day`), 7 days (`week`), 30 days (`month`), earlier (`older`) or never.","anyOf":[{"const":"day","type":"string"},{"const":"week","type":"string"},{"const":"month","type":"string"},{"const":"older","type":"string"},{"const":"never","type":"string"}]},"trend":{"description":"One relative level per day, oldest first. 0 = no occurrence that day.","examples":[[0,0,1,3,8,2]],"type":"array","items":{"type":"number"}}}}}},"required":["days","levels","items"]}},"text/plain":{"schema":{"type":"object","properties":{"days":{"description":"Length of the trend window in days.","examples":[30],"type":"number"},"levels":{"description":"Highest trend level (the busiest day of a code).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","lastSeen","trend"],"properties":{"code":{"description":"System log code identifier.","examples":["API_UNCAUGHT"],"type":"string"},"lastSeen":{"description":"Most recent occurrence: within 24 hours (`day`), 7 days (`week`), 30 days (`month`), earlier (`older`) or never.","anyOf":[{"const":"day","type":"string"},{"const":"week","type":"string"},{"const":"month","type":"string"},{"const":"older","type":"string"},{"const":"never","type":"string"}]},"trend":{"description":"One relative level per day, oldest first. 0 = no occurrence that day.","examples":[[0,0,1,3,8,2]],"type":"array","items":{"type":"number"}}}}}},"required":["days","levels","items"]}}}}},"operationId":"getApiV1DocsSystem-log-code-activity","tags":["docs"],"summary":"System log code activity (relative)","description":"Coarse, scale-free activity per system log code for docs.bizkithub.com/system-codes. `lastSeen` is a recency bucket and `trend` is the daily volume of the last `days` days quantised to 0..`levels` relative to the busiest day of the same code. No absolute counts, no exact timestamps and no organisation data are exposed, so the response does not disclose platform scale. Only codes that were ever emitted are listed; treat a missing code as `never`. Cached for 15 minutes."}},"/api/v1/docs/env-list":{"get":{"responses":{"200":{"description":"Configuration key reference.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"List of configuration entries.","type":"array","items":{"type":"object","required":["key"],"properties":{"key":{"description":"Configuration key name.","examples":["comgate_merchant_id"],"type":"string"},"description":{"description":"Human-readable description of the key.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"List of configuration entries.","type":"array","items":{"type":"object","required":["key"],"properties":{"key":{"description":"Configuration key name.","examples":["comgate_merchant_id"],"type":"string"},"description":{"description":"Human-readable description of the key.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"List of configuration entries.","type":"array","items":{"type":"object","required":["key"],"properties":{"key":{"description":"Configuration key name.","examples":["comgate_merchant_id"],"type":"string"},"description":{"description":"Human-readable description of the key.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getApiV1DocsEnv-list","tags":["docs"],"summary":"List configuration keys","description":"Returns a list of all available configuration keys (environment variables / app settings) with their descriptions."}},"/api/v1/emailer/send":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1EmailerSend","tags":["emailer"],"summary":"Send email","description":"Queues or immediately sends an email through the organisation mail system. Content is either a ready `htmlBody` + `subject`, or `templateCode` + `variables` of a template the organisation manages in admin (BIZKIT-125). Supports attachments (from blob storage, URL, or raw text), priority control and linking to an order (`orderHash`). Every e-mail appears in the recipient contact history in admin.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to"],"properties":{"subject":{"description":"Email subject line. Required with `htmlBody`; ignored with `templateCode` (the template has its own).","examples":["Order confirmation #12345"],"type":"string"},"from":{"description":"Sender email address or name+email. If omitted, organisation default is used.","examples":["support@example.com"],"type":"string"},"to":{"description":"Recipient email address.","examples":["customer@example.com"],"type":"string"},"cc":{"description":"CC recipient email address.","type":"string"},"bcc":{"description":"BCC recipient email address.","type":"string"},"replyTo":{"description":"Reply-To email address.","type":"string"},"priority":{"description":"Email priority (lower = higher priority). Default queue priority if omitted.","examples":[1,5,10],"type":"number"},"note":{"description":"Internal note attached to the email record (not sent to recipient).","type":"string"},"htmlBody":{"description":"HTML content of the email body. Send either `htmlBody` (with `subject`) or `templateCode`.","type":"string"},"templateCode":{"minLength":1,"maxLength":64,"description":"Code of the organisation's own template: admin → E-maily → Šablony, type \"Vlastní e-mail (odesílaný přes API)\", field \"variant\". The template language follows `locale` (falls back to another language of the same code). Subject and body are rendered from the template; sending fails (nothing is sent) when the template does not exist or is inactive, or when a `{{ placeholder }}` has no value.","examples":["win-back"],"type":"string"},"variables":{"description":"Values for `{{ name }}` placeholders of the template. Names: letters and digits, starting with a letter. Values are HTML-escaped, except names ending in `Html` (ready-made HTML, e.g. `badgesHtml`). Organisation variables (e.g. organisationName) are always available; with `orderHash` also order variables (orderNumber, orderPrice, payLink, orderPageLink, …).","examples":[{"firstName":"Jana","lastVisitDate":"12. 11. 2026"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"orderHash":{"description":"Order the e-mail is about (`hash` from `POST /shop/order/create`). The e-mail then appears in the order detail in admin; with `templateCode` order variables are available. The `tag` is kept in the internal note.","examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"tag":{"description":"Tag for categorizing the email (e.g. for analytics).","examples":["order-confirmation","newsletter"],"type":"string"},"forceSendNow":{"description":"If true, send immediately bypassing the queue. Default: false.","type":"boolean"},"attachmentList":{"description":"List of attachments. Each item is one of blobToken, attachmentUrl, or rawTextContent.","type":"array","items":{"anyOf":[{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Token of a file stored in blob storage.","type":"string"}}},{"type":"object","required":["attachmentUrl"],"properties":{"attachmentUrl":{"description":"Public URL of the file to attach.","type":"string"}}},{"type":"object","required":["rawTextContent"],"properties":{"rawTextContent":{"description":"Raw text content to attach as a file.","type":"string"}}}]}}}}},"multipart/form-data":{"schema":{"type":"object","required":["to"],"properties":{"subject":{"description":"Email subject line. Required with `htmlBody`; ignored with `templateCode` (the template has its own).","examples":["Order confirmation #12345"],"type":"string"},"from":{"description":"Sender email address or name+email. If omitted, organisation default is used.","examples":["support@example.com"],"type":"string"},"to":{"description":"Recipient email address.","examples":["customer@example.com"],"type":"string"},"cc":{"description":"CC recipient email address.","type":"string"},"bcc":{"description":"BCC recipient email address.","type":"string"},"replyTo":{"description":"Reply-To email address.","type":"string"},"priority":{"description":"Email priority (lower = higher priority). Default queue priority if omitted.","examples":[1,5,10],"type":"number"},"note":{"description":"Internal note attached to the email record (not sent to recipient).","type":"string"},"htmlBody":{"description":"HTML content of the email body. Send either `htmlBody` (with `subject`) or `templateCode`.","type":"string"},"templateCode":{"minLength":1,"maxLength":64,"description":"Code of the organisation's own template: admin → E-maily → Šablony, type \"Vlastní e-mail (odesílaný přes API)\", field \"variant\". The template language follows `locale` (falls back to another language of the same code). Subject and body are rendered from the template; sending fails (nothing is sent) when the template does not exist or is inactive, or when a `{{ placeholder }}` has no value.","examples":["win-back"],"type":"string"},"variables":{"description":"Values for `{{ name }}` placeholders of the template. Names: letters and digits, starting with a letter. Values are HTML-escaped, except names ending in `Html` (ready-made HTML, e.g. `badgesHtml`). Organisation variables (e.g. organisationName) are always available; with `orderHash` also order variables (orderNumber, orderPrice, payLink, orderPageLink, …).","examples":[{"firstName":"Jana","lastVisitDate":"12. 11. 2026"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"orderHash":{"description":"Order the e-mail is about (`hash` from `POST /shop/order/create`). The e-mail then appears in the order detail in admin; with `templateCode` order variables are available. The `tag` is kept in the internal note.","examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"tag":{"description":"Tag for categorizing the email (e.g. for analytics).","examples":["order-confirmation","newsletter"],"type":"string"},"forceSendNow":{"description":"If true, send immediately bypassing the queue. Default: false.","type":"boolean"},"attachmentList":{"description":"List of attachments. Each item is one of blobToken, attachmentUrl, or rawTextContent.","type":"array","items":{"anyOf":[{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Token of a file stored in blob storage.","type":"string"}}},{"type":"object","required":["attachmentUrl"],"properties":{"attachmentUrl":{"description":"Public URL of the file to attach.","type":"string"}}},{"type":"object","required":["rawTextContent"],"properties":{"rawTextContent":{"description":"Raw text content to attach as a file.","type":"string"}}}]}}}}},"text/plain":{"schema":{"type":"object","required":["to"],"properties":{"subject":{"description":"Email subject line. Required with `htmlBody`; ignored with `templateCode` (the template has its own).","examples":["Order confirmation #12345"],"type":"string"},"from":{"description":"Sender email address or name+email. If omitted, organisation default is used.","examples":["support@example.com"],"type":"string"},"to":{"description":"Recipient email address.","examples":["customer@example.com"],"type":"string"},"cc":{"description":"CC recipient email address.","type":"string"},"bcc":{"description":"BCC recipient email address.","type":"string"},"replyTo":{"description":"Reply-To email address.","type":"string"},"priority":{"description":"Email priority (lower = higher priority). Default queue priority if omitted.","examples":[1,5,10],"type":"number"},"note":{"description":"Internal note attached to the email record (not sent to recipient).","type":"string"},"htmlBody":{"description":"HTML content of the email body. Send either `htmlBody` (with `subject`) or `templateCode`.","type":"string"},"templateCode":{"minLength":1,"maxLength":64,"description":"Code of the organisation's own template: admin → E-maily → Šablony, type \"Vlastní e-mail (odesílaný přes API)\", field \"variant\". The template language follows `locale` (falls back to another language of the same code). Subject and body are rendered from the template; sending fails (nothing is sent) when the template does not exist or is inactive, or when a `{{ placeholder }}` has no value.","examples":["win-back"],"type":"string"},"variables":{"description":"Values for `{{ name }}` placeholders of the template. Names: letters and digits, starting with a letter. Values are HTML-escaped, except names ending in `Html` (ready-made HTML, e.g. `badgesHtml`). Organisation variables (e.g. organisationName) are always available; with `orderHash` also order variables (orderNumber, orderPrice, payLink, orderPageLink, …).","examples":[{"firstName":"Jana","lastVisitDate":"12. 11. 2026"}],"type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"orderHash":{"description":"Order the e-mail is about (`hash` from `POST /shop/order/create`). The e-mail then appears in the order detail in admin; with `templateCode` order variables are available. The `tag` is kept in the internal note.","examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"tag":{"description":"Tag for categorizing the email (e.g. for analytics).","examples":["order-confirmation","newsletter"],"type":"string"},"forceSendNow":{"description":"If true, send immediately bypassing the queue. Default: false.","type":"boolean"},"attachmentList":{"description":"List of attachments. Each item is one of blobToken, attachmentUrl, or rawTextContent.","type":"array","items":{"anyOf":[{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Token of a file stored in blob storage.","type":"string"}}},{"type":"object","required":["attachmentUrl"],"properties":{"attachmentUrl":{"description":"Public URL of the file to attach.","type":"string"}}},{"type":"object","required":["rawTextContent"],"properties":{"rawTextContent":{"description":"Raw text content to attach as a file.","type":"string"}}}]}}}}}}}}},"/api/v1/emailer/webhook-incoming-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1EmailerWebhook-incoming-email","tags":["emailer"],"summary":"Incoming email webhook","description":"Receives incoming email data from an external email provider webhook. The body format depends on the provider and is processed internally.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}},"multipart/form-data":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}},"text/plain":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},"/api/v1/form/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Unique form code identifier.","examples":["contact-form"],"schema":{"type":"string"},"in":"query","name":"code","required":false}],"responses":{"200":{"description":"Form definition.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Form code (unique identifier).","examples":["contact-form"],"type":"string"},"name":{"description":"Display name of the form.","examples":["Contact Form"],"type":"string"},"description":{"description":"Form description or instructions.","type":"string"},"fields":{"description":"Ordered list of active form fields.","type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"description":"Field key used for form submission.","examples":["email","message"],"type":"string"},"type":{"description":"Field type.","examples":["text","email","textarea","select","checkbox"],"type":"string"},"label":{"description":"Human-readable field label.","examples":["Your email"],"type":"string"},"helperText":{"description":"Additional helper text shown below the field.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"defaultValue":{"description":"Pre-filled default value.","type":"string"},"options":{"description":"Key-value map of options for select/radio fields.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}},"required":["id","name","fields"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Form code (unique identifier).","examples":["contact-form"],"type":"string"},"name":{"description":"Display name of the form.","examples":["Contact Form"],"type":"string"},"description":{"description":"Form description or instructions.","type":"string"},"fields":{"description":"Ordered list of active form fields.","type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"description":"Field key used for form submission.","examples":["email","message"],"type":"string"},"type":{"description":"Field type.","examples":["text","email","textarea","select","checkbox"],"type":"string"},"label":{"description":"Human-readable field label.","examples":["Your email"],"type":"string"},"helperText":{"description":"Additional helper text shown below the field.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"defaultValue":{"description":"Pre-filled default value.","type":"string"},"options":{"description":"Key-value map of options for select/radio fields.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}},"required":["id","name","fields"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Form code (unique identifier).","examples":["contact-form"],"type":"string"},"name":{"description":"Display name of the form.","examples":["Contact Form"],"type":"string"},"description":{"description":"Form description or instructions.","type":"string"},"fields":{"description":"Ordered list of active form fields.","type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"description":"Field key used for form submission.","examples":["email","message"],"type":"string"},"type":{"description":"Field type.","examples":["text","email","textarea","select","checkbox"],"type":"string"},"label":{"description":"Human-readable field label.","examples":["Your email"],"type":"string"},"helperText":{"description":"Additional helper text shown below the field.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"defaultValue":{"description":"Pre-filled default value.","type":"string"},"options":{"description":"Key-value map of options for select/radio fields.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}},"required":["id","name","fields"]}}}}},"operationId":"getApiV1FormDetail","tags":["form"],"summary":"Get form detail","description":"Returns form definition with all active fields, their types, labels, and validation rules. Throws PUBLIC_FORM_DOES_NOT_EXIST if the form is not found or inactive."}},"/api/v1/glossary/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"description":"Fulltext over term/abbreviation/notes (accent-insensitive).","schema":{"type":"string"},"in":"query","name":"search","required":false},{"description":"Filter by category public id (16-char).","schema":{"type":"string"},"in":"query","name":"categoryId","required":false},{"description":"Filter by category canonical slug in the requested locale. Convenient when the frontend routes on the category page URL and does not want a lookup round-trip. Ignored when `categoryId` is also passed.","examples":["kryptografie-a-sifrovani"],"schema":{"type":"string"},"in":"query","name":"categorySlug","required":false},{"description":"Restrict to terms starting with this letter (case-insensitive, accent-folded).","examples":["A","K","#"],"schema":{"type":"string"},"in":"query","name":"letter","required":false},{"description":"Ordering. Defaults to `alphabetical`.","schema":{"anyOf":[{"const":"alphabetical","type":"string"},{"const":"newest","type":"string"},{"const":"updated","type":"string"}]},"in":"query","name":"sort","required":false},{"description":"1-based page index. Default `1`.","schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Items per page. Default `50`, max `500`.","schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","category","definitionCount","aliasCount","updatedDate"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"type":"string"},"slug":{"nullable":true,"anyOf":[{"examples":["aes"],"type":"string"},{"type":"null"}]},"term":{"examples":["AES"],"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"definitionCount":{"type":"number"},"aliasCount":{"type":"number"},"publishedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of matching terms across all pages.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","category","definitionCount","aliasCount","updatedDate"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"type":"string"},"slug":{"nullable":true,"anyOf":[{"examples":["aes"],"type":"string"},{"type":"null"}]},"term":{"examples":["AES"],"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"definitionCount":{"type":"number"},"aliasCount":{"type":"number"},"publishedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of matching terms across all pages.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","category","definitionCount","aliasCount","updatedDate"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"type":"string"},"slug":{"nullable":true,"anyOf":[{"examples":["aes"],"type":"string"},{"type":"null"}]},"term":{"examples":["AES"],"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"definitionCount":{"type":"number"},"aliasCount":{"type":"number"},"publishedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of matching terms across all pages.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getApiV1GlossaryList","tags":["glossary"],"summary":"List public glossary terms (feed)","description":"Paginated list of publicly-published glossary terms. Every item carries the canonical slug for the requested locale so the frontend can build direct links without a follow-up round-trip. Supports fulltext search, single-letter filter (A-Z index), category filter, and configurable sort."}},"/api/v1/glossary/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"examples":["aes"],"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["id","term","abbreviation","notes","notesHtml","definitions","aliases","crossReferences","route","routes","category","relatedTerms","publishedDate"],"properties":{"id":{"type":"string"},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"description":"Raw notes as authored (Markdown).","type":"string"},{"type":"null"}]},"notesHtml":{"nullable":true,"anyOf":[{"description":"Notes rendered from Markdown (GFM) to HTML. Null when notes are empty.","type":"string"},{"type":"null"}]},"definitions":{"type":"array","items":{"type":"object","required":["text","source"],"properties":{"text":{"description":"Definition text.","type":"string"},"source":{"nullable":true,"anyOf":[{"description":"Optional attribution or source term.","type":"string"},{"type":"null"}]}}}},"aliases":{"type":"array","items":{"type":"string"}},"crossReferences":{"type":"array","items":{"type":"object","required":["targetText","targetSlug"],"properties":{"targetText":{"description":"Free-text pointer as authored.","type":"string"},"targetSlug":{"nullable":true,"anyOf":[{"description":"Canonical slug of the target term in the same locale, when the text resolved to a known term. Null when unresolved.","type":"string"},{"type":"null"}]}}}},"route":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}},"routes":{"type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}}},"category":{"nullable":true,"anyOf":[{"type":"object","required":["id","name","slug","routes"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"name":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"description":"Canonical slug in the requested locale, if any.","type":"string"},{"type":"null"}]},"routes":{"description":"Canonical category routes across all organisation locales.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}}}}},{"type":"null"}]},"relatedTerms":{"description":"Up to 50 related terms combining bidirectional cross-references (highest priority) with terms in the same category and sibling-category matches. Empty when the source term has no category assigned.","type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","category","matchType"],"properties":{"id":{"description":"Related term public id.","type":"string"},"slug":{"nullable":true,"anyOf":[{"description":"Canonical slug in the requested locale, if any.","type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"matchType":{"description":"Signal that qualified this term as related. Cross-references outrank category matches.","anyOf":[{"const":"cross-reference","type":"string"},{"const":"same-category","type":"string"},{"const":"sibling-category","type":"string"}]}}}},"publishedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["id","term","abbreviation","notes","notesHtml","definitions","aliases","crossReferences","route","routes","category","relatedTerms","publishedDate"],"properties":{"id":{"type":"string"},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"description":"Raw notes as authored (Markdown).","type":"string"},{"type":"null"}]},"notesHtml":{"nullable":true,"anyOf":[{"description":"Notes rendered from Markdown (GFM) to HTML. Null when notes are empty.","type":"string"},{"type":"null"}]},"definitions":{"type":"array","items":{"type":"object","required":["text","source"],"properties":{"text":{"description":"Definition text.","type":"string"},"source":{"nullable":true,"anyOf":[{"description":"Optional attribution or source term.","type":"string"},{"type":"null"}]}}}},"aliases":{"type":"array","items":{"type":"string"}},"crossReferences":{"type":"array","items":{"type":"object","required":["targetText","targetSlug"],"properties":{"targetText":{"description":"Free-text pointer as authored.","type":"string"},"targetSlug":{"nullable":true,"anyOf":[{"description":"Canonical slug of the target term in the same locale, when the text resolved to a known term. Null when unresolved.","type":"string"},{"type":"null"}]}}}},"route":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}},"routes":{"type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}}},"category":{"nullable":true,"anyOf":[{"type":"object","required":["id","name","slug","routes"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"name":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"description":"Canonical slug in the requested locale, if any.","type":"string"},{"type":"null"}]},"routes":{"description":"Canonical category routes across all organisation locales.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}}}}},{"type":"null"}]},"relatedTerms":{"description":"Up to 50 related terms combining bidirectional cross-references (highest priority) with terms in the same category and sibling-category matches. Empty when the source term has no category assigned.","type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","category","matchType"],"properties":{"id":{"description":"Related term public id.","type":"string"},"slug":{"nullable":true,"anyOf":[{"description":"Canonical slug in the requested locale, if any.","type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"matchType":{"description":"Signal that qualified this term as related. Cross-references outrank category matches.","anyOf":[{"const":"cross-reference","type":"string"},{"const":"same-category","type":"string"},{"const":"sibling-category","type":"string"}]}}}},"publishedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["id","term","abbreviation","notes","notesHtml","definitions","aliases","crossReferences","route","routes","category","relatedTerms","publishedDate"],"properties":{"id":{"type":"string"},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"description":"Raw notes as authored (Markdown).","type":"string"},{"type":"null"}]},"notesHtml":{"nullable":true,"anyOf":[{"description":"Notes rendered from Markdown (GFM) to HTML. Null when notes are empty.","type":"string"},{"type":"null"}]},"definitions":{"type":"array","items":{"type":"object","required":["text","source"],"properties":{"text":{"description":"Definition text.","type":"string"},"source":{"nullable":true,"anyOf":[{"description":"Optional attribution or source term.","type":"string"},{"type":"null"}]}}}},"aliases":{"type":"array","items":{"type":"string"}},"crossReferences":{"type":"array","items":{"type":"object","required":["targetText","targetSlug"],"properties":{"targetText":{"description":"Free-text pointer as authored.","type":"string"},"targetSlug":{"nullable":true,"anyOf":[{"description":"Canonical slug of the target term in the same locale, when the text resolved to a known term. Null when unresolved.","type":"string"},{"type":"null"}]}}}},"route":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}},"routes":{"type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}}},"category":{"nullable":true,"anyOf":[{"type":"object","required":["id","name","slug","routes"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"name":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"description":"Canonical slug in the requested locale, if any.","type":"string"},{"type":"null"}]},"routes":{"description":"Canonical category routes across all organisation locales.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}}}}},{"type":"null"}]},"relatedTerms":{"description":"Up to 50 related terms combining bidirectional cross-references (highest priority) with terms in the same category and sibling-category matches. Empty when the source term has no category assigned.","type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","category","matchType"],"properties":{"id":{"description":"Related term public id.","type":"string"},"slug":{"nullable":true,"anyOf":[{"description":"Canonical slug in the requested locale, if any.","type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"matchType":{"description":"Signal that qualified this term as related. Cross-references outrank category matches.","anyOf":[{"const":"cross-reference","type":"string"},{"const":"same-category","type":"string"},{"const":"sibling-category","type":"string"}]}}}},"publishedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["id","term","abbreviation","notes","notesHtml","definitions","aliases","crossReferences","route","routes","category","relatedTerms","publishedDate"],"properties":{"id":{"type":"string"},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"description":"Raw notes as authored (Markdown).","type":"string"},{"type":"null"}]},"notesHtml":{"nullable":true,"anyOf":[{"description":"Notes rendered from Markdown (GFM) to HTML. Null when notes are empty.","type":"string"},{"type":"null"}]},"definitions":{"type":"array","items":{"type":"object","required":["text","source"],"properties":{"text":{"description":"Definition text.","type":"string"},"source":{"nullable":true,"anyOf":[{"description":"Optional attribution or source term.","type":"string"},{"type":"null"}]}}}},"aliases":{"type":"array","items":{"type":"string"}},"crossReferences":{"type":"array","items":{"type":"object","required":["targetText","targetSlug"],"properties":{"targetText":{"description":"Free-text pointer as authored.","type":"string"},"targetSlug":{"nullable":true,"anyOf":[{"description":"Canonical slug of the target term in the same locale, when the text resolved to a known term. Null when unresolved.","type":"string"},{"type":"null"}]}}}},"route":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}},"routes":{"type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}}},"category":{"nullable":true,"anyOf":[{"type":"object","required":["id","name","slug","routes"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"name":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"description":"Canonical slug in the requested locale, if any.","type":"string"},{"type":"null"}]},"routes":{"description":"Canonical category routes across all organisation locales.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"type":"string"},"locale":{"type":"string"}}}}}},{"type":"null"}]},"relatedTerms":{"description":"Up to 50 related terms combining bidirectional cross-references (highest priority) with terms in the same category and sibling-category matches. Empty when the source term has no category assigned.","type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","category","matchType"],"properties":{"id":{"description":"Related term public id.","type":"string"},"slug":{"nullable":true,"anyOf":[{"description":"Canonical slug in the requested locale, if any.","type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"matchType":{"description":"Signal that qualified this term as related. Cross-references outrank category matches.","anyOf":[{"const":"cross-reference","type":"string"},{"const":"same-category","type":"string"},{"const":"sibling-category","type":"string"}]}}}},"publishedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1GlossaryDetail","tags":["glossary"],"summary":"Get a public glossary term by slug","description":"Returns the full public representation of a glossary term: definitions, aliases, cross references (with resolved target slugs when possible), canonical routes across the organisation locales, and the parent category (if set). Returns an error envelope when the slug does not resolve to a published term."}},"/api/v1/glossary/alphabet":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"description":"Restrict to a single category.","schema":{"type":"string"},"in":"query","name":"categoryId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["letter","termCount"],"properties":{"letter":{"examples":["A","B","#"],"type":"string"},"termCount":{"type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["letter","termCount"],"properties":{"letter":{"examples":["A","B","#"],"type":"string"},"termCount":{"type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["letter","termCount"],"properties":{"letter":{"examples":["A","B","#"],"type":"string"},"termCount":{"type":"number"}}}}},"required":["items"]}}}}},"operationId":"getApiV1GlossaryAlphabet","tags":["glossary"],"summary":"A-Z index of published terms","description":"Returns one row per starting letter (accent-folded, digits collapsed into `#`) with the count of terms beneath it. Frontend renders this as the A-Z navigation bar."}},"/api/v1/glossary/random":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"description":"Comma-separated list of term ids to skip (avoids repeats in a series).","schema":{"type":"string"},"in":"query","name":"exclude","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["id","slug","term","abbreviation","definitionPreview"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitionPreview":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["id","slug","term","abbreviation","definitionPreview"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitionPreview":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["id","slug","term","abbreviation","definitionPreview"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitionPreview":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["id","slug","term","abbreviation","definitionPreview"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitionPreview":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1GlossaryRandom","tags":["glossary"],"summary":"One random public term","description":"Picks a single published+public term at random for the given locale. Useful for a \"term of the day\" block on the homepage. Passing `exclude=id1,id2` in a series-of-calls flow prevents immediate repeats."}},"/api/v1/glossary/related":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"description":"Source term public id.","schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Max related terms to return. Default `20`, max `100`.","schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","direction"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"const":"outgoing","type":"string"},{"const":"incoming","type":"string"},{"const":"both","type":"string"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","direction"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"const":"outgoing","type":"string"},{"const":"incoming","type":"string"},{"const":"both","type":"string"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","direction"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"const":"outgoing","type":"string"},{"const":"incoming","type":"string"},{"const":"both","type":"string"}]}}}}},"required":["items"]}}}}},"operationId":"getApiV1GlossaryRelated","tags":["glossary"],"summary":"Related terms (bidirectional cross references)","description":"Returns published+public terms that are linked to the source term either outgoing (source points at them) or incoming (they point at source). Deduplicated: a term linked both ways surfaces once with `direction=both`."}},"/api/v1/glossary/category/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","parentId","name","description","position","termCount"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"termCount":{"type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","parentId","name","description","position","termCount"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"termCount":{"type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","parentId","name","description","position","termCount"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"type":"number"},"termCount":{"type":"number"}}}}},"required":["items"]}}}}},"operationId":"getApiV1GlossaryCategoryList","tags":["glossary"],"summary":"Flat list of public glossary categories","description":"Returns every active, non-deleted category with its canonical slug in the requested locale and the count of public terms directly assigned. Frontend can arrange into a tree via `parentId`."}},"/api/v1/glossary/category/tree":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"operationId":"getApiV1GlossaryCategoryTree","tags":["glossary"],"summary":"Hierarchical tree of public glossary categories","description":"Same underlying data as `/category/list`, arranged into a nested tree keyed by `parentId`. Prefer this endpoint when rendering the sidebar / navigation and the flat form when building a selectbox.","responses":{"200":{}}}},"/api/v1/glossary/category/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"examples":["kryptografie"],"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"1-based page index. Default `1`.","schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Items per page. Default `50`, max `500`.","schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["id","slug","name","description","metaDescription","parent","breadcrumb","terms","termCount"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parent":{"nullable":true,"anyOf":[{"type":"object","required":["id","slug","name"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"breadcrumb":{"type":"array","items":{"type":"object","required":["id","slug","name"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}},"terms":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","definitionCount","aliasCount","publishedDate","updatedDate"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitionCount":{"type":"number"},"aliasCount":{"type":"number"},"publishedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"termCount":{"type":"number"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["id","slug","name","description","metaDescription","parent","breadcrumb","terms","termCount"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parent":{"nullable":true,"anyOf":[{"type":"object","required":["id","slug","name"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"breadcrumb":{"type":"array","items":{"type":"object","required":["id","slug","name"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}},"terms":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","definitionCount","aliasCount","publishedDate","updatedDate"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitionCount":{"type":"number"},"aliasCount":{"type":"number"},"publishedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"termCount":{"type":"number"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["id","slug","name","description","metaDescription","parent","breadcrumb","terms","termCount"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parent":{"nullable":true,"anyOf":[{"type":"object","required":["id","slug","name"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"breadcrumb":{"type":"array","items":{"type":"object","required":["id","slug","name"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}},"terms":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","definitionCount","aliasCount","publishedDate","updatedDate"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitionCount":{"type":"number"},"aliasCount":{"type":"number"},"publishedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"termCount":{"type":"number"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["id","slug","name","description","metaDescription","parent","breadcrumb","terms","termCount"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parent":{"nullable":true,"anyOf":[{"type":"object","required":["id","slug","name"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"breadcrumb":{"type":"array","items":{"type":"object","required":["id","slug","name"],"properties":{"id":{"description":"Category public id (16-char).","type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}},"terms":{"type":"array","items":{"type":"object","required":["id","slug","term","abbreviation","definitionCount","aliasCount","publishedDate","updatedDate"],"properties":{"id":{"type":"string"},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"term":{"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitionCount":{"type":"number"},"aliasCount":{"type":"number"},"publishedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"termCount":{"type":"number"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1GlossaryCategoryDetail","tags":["glossary"],"summary":"Get a public glossary category by slug","description":"Returns the category metadata (name, description, meta description), its breadcrumb chain up to the root, and a paginated slice of published public terms directly assigned to it. Nested subcategories are not merged in — the frontend obtains them via `/category/list` filtered by `parentId`."}},"/api/v1/glossary/sitemap":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["kind","slug","locale","lastModified"],"properties":{"kind":{"anyOf":[{"const":"term","type":"string"},{"const":"category","type":"string"}]},"slug":{"type":"string"},"locale":{"type":"string"},"lastModified":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["kind","slug","locale","lastModified"],"properties":{"kind":{"anyOf":[{"const":"term","type":"string"},{"const":"category","type":"string"}]},"slug":{"type":"string"},"locale":{"type":"string"},"lastModified":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["kind","slug","locale","lastModified"],"properties":{"kind":{"anyOf":[{"const":"term","type":"string"},{"const":"category","type":"string"}]},"slug":{"type":"string"},"locale":{"type":"string"},"lastModified":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["items"]}}}}},"operationId":"getApiV1GlossarySitemap","tags":["glossary"],"summary":"Every public glossary URL for a sitemap.xml","description":"Streams a minimal representation of every public term and active category URL, one row per (kind, slug, locale) with `lastModified`. Omit `locale` to fetch all locales at once."}},"/api/v1/internal/blob/create-product-image-variants":{"post":{"operationId":"postApiV1InternalBlobCreate-product-image-variants","tags":["internal"],"summary":"Create product-image WebP variants","description":"Internal endpoint called by the scout `image-variants` worker (issue #80). Accepts 4 pre-rendered WebP buffers for a `shop__product_image`, uploads them to the same S3 directory as the source blob (deterministic key `<source>.<code>-webp.webp`), and returns the created `core__blob` rows. **Idempotent**: overlapping calls hit the `(blob_path, organisation_id)` unique constraint and return the existing rows.\n\n**Side effects (persist + invalidate):**\n- Sets `shop__product_image.variant_{thumb,card,hero,zoom}_webp_blob_id` on the row.\n- Triggers `updateProductReadModel([product_id])` so `/product/detail` and `/product/feed`   ship the fresh URLs on the next fetch. A best-effort try/catch protects the endpoint   from a failed rebuild — the variant upload itself always succeeds.","responses":{"200":{}}}},"/api/v1/internal/log/":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}}}]}}}}},"operationId":"postApiV1InternalLog","tags":["internal"],"description":"First-party microservice log ingestion. **Requires** an API key issued under the internal organisation (id=1). Any other API key is rejected with HTTP 403.\n\nThis is where scout, pdf, proxy and other VPS/edge workers POST their own logs so the platform operator sees them side-by-side with core-emitted logs in the admin dashboard. The entry is written against the internal organisation and prefixed with `[svc:<service>]` so dashboard filters can group by originating service without needing a new column.\n\nWhy not reuse `/tracking/log`? `/tracking/log` writes to the **caller's own** organisation; a microservice would need a key for every tenant it touches. This endpoint always writes to the internal org regardless of the caller's key, which is the semantic microservices actually want.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["service","message"],"properties":{"service":{"maxLength":32,"description":"Name of the microservice emitting the log. Free-form short slug — kebab-case, matches the subdomain or systemd unit. Prepended to the stored message as `[svc:<name>] …` so dashboard filters can group by it.","examples":["scout","scout:sync-blob-backup","pdf","proxy","cdn"],"type":"string"},"message":{"description":"Human-readable log body. For exceptions include the error class, message, and the smallest set of identifiers that reproduces the context (e.g. blob id, cron tick, HTTP method/URL). JSON is accepted but prefer flat text.","examples":["sync-blob-backup tick crashed: ConnectionTimeoutError at pg pool acquire (after 212 iters, 847 blobs backed up)","puppeteer launch failed: ENOENT /tmp/chromium (nodeVersion=v22.22.3, memoryMb=512)"],"type":"string"},"code":{"maxLength":64,"description":"Application-defined log code (short slug). Groups related events for anomaly detection and links to `docs.bizkithub.com/system-codes/<code>`. Defaults to `MSVC_LOG` when omitted — but prefer a specific code (e.g. `BLOB_BAK_CRASH`, `PDF_GEN_CRASH`) so dashboards and runbooks can key off it.","examples":["BLOB_BAK_CRASH","PDF_GEN_CRASH","PROXY_FORWARD_F"],"type":"string"},"component":{"maxLength":32,"description":"Sub-system that produced the log. Used for dashboard grouping. Typical values: `cron`, `api`, `common`.","examples":["cron","api"],"type":"string"},"subject":{"maxLength":200,"description":"One-line summary used as the subject of any notification email dispatched for this log entry.","examples":["scout sync-blob-backup worker crashed"],"type":"string"},"level":{"enum":["info","success","warning","error","critical"],"description":"Severity level. Defaults to `info` if omitted. Use `error` for a single failed operation, `critical` for a crash that stops the whole worker.","examples":["error","critical"],"type":"string"},"sendNotification":{"description":"When `true`, the log entry is eligible to trigger notifications (email) according to the internal-org notification rules. Use sparingly — most microservice entries are debounced and should NOT page.","examples":[true,false],"type":"boolean"},"useDebounce":{"anyOf":[{"description":"Advanced debounce configuration. `maxInterval` defines maximum grouping window for duplicates (if omitted, backend uses a default interval).","type":"object","required":["enabled","maxInterval"],"properties":{"enabled":{"description":"Enable/disable debouncing for this event. If omitted, the backend treats it as enabled.","examples":[true],"type":"boolean"},"key":{"description":"Optional custom debounce key. When provided, logs sharing the same key will be grouped together (useful for dynamic messages).","examples":["stripe-webhook-timeout","db-connection-failed"],"type":"string"},"maxInterval":{"anyOf":[{"examples":["3w 4d 12h","10m","0.5h","2.5","3,1"],"description":"Relative time interval expressed as a string.\n\nSupported units and conversion (`REAL_TIME_CHAR_TO_MINUTES`):\n\n| Unit | Name   | Minutes | Notes |\n|------|--------|---------|-------|\n| `m`  | minute | `1`     | |\n| `h`  | hour   | `60`    | |\n| `d`  | day    | `1440`  | 24h |\n| `w`  | week   | `10080` | 7d |\n| `y`  | year   | `525600`| 365d |\n\nRules:\n- Units are case-insensitive and can be combined: `3w 4d 12h`.\n- Decimal values are allowed: `0.5h`, `2.5d`.\n- Spaces and unit variants are tolerated: `10m`, `10 min`, `10 minutes`.\n- Numeric value without a unit is interpreted as **hours**.\n\nRounding:\n- Result is returned in minutes and rounded **up** (`Math.ceil`).\n\nInvalid or empty input returns `0`.","type":"string"},{"examples":[30,60,150,1440],"description":"Relative time interval expressed as a number of minutes.\n\nRules:\n- Value is taken directly as minutes (e.g. `30` = 30 minutes).\n- No unit parsing or conversion is applied.","type":"number"}]}}},{"description":"Simple debounce toggle. When `true`, repeated logs may be deduplicated/grouped within a backend-defined window. When `false`, debouncing is disabled and every event is stored.","examples":[true,false],"type":"boolean"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["service","message"],"properties":{"service":{"maxLength":32,"description":"Name of the microservice emitting the log. Free-form short slug — kebab-case, matches the subdomain or systemd unit. Prepended to the stored message as `[svc:<name>] …` so dashboard filters can group by it.","examples":["scout","scout:sync-blob-backup","pdf","proxy","cdn"],"type":"string"},"message":{"description":"Human-readable log body. For exceptions include the error class, message, and the smallest set of identifiers that reproduces the context (e.g. blob id, cron tick, HTTP method/URL). JSON is accepted but prefer flat text.","examples":["sync-blob-backup tick crashed: ConnectionTimeoutError at pg pool acquire (after 212 iters, 847 blobs backed up)","puppeteer launch failed: ENOENT /tmp/chromium (nodeVersion=v22.22.3, memoryMb=512)"],"type":"string"},"code":{"maxLength":64,"description":"Application-defined log code (short slug). Groups related events for anomaly detection and links to `docs.bizkithub.com/system-codes/<code>`. Defaults to `MSVC_LOG` when omitted — but prefer a specific code (e.g. `BLOB_BAK_CRASH`, `PDF_GEN_CRASH`) so dashboards and runbooks can key off it.","examples":["BLOB_BAK_CRASH","PDF_GEN_CRASH","PROXY_FORWARD_F"],"type":"string"},"component":{"maxLength":32,"description":"Sub-system that produced the log. Used for dashboard grouping. Typical values: `cron`, `api`, `common`.","examples":["cron","api"],"type":"string"},"subject":{"maxLength":200,"description":"One-line summary used as the subject of any notification email dispatched for this log entry.","examples":["scout sync-blob-backup worker crashed"],"type":"string"},"level":{"enum":["info","success","warning","error","critical"],"description":"Severity level. Defaults to `info` if omitted. Use `error` for a single failed operation, `critical` for a crash that stops the whole worker.","examples":["error","critical"],"type":"string"},"sendNotification":{"description":"When `true`, the log entry is eligible to trigger notifications (email) according to the internal-org notification rules. Use sparingly — most microservice entries are debounced and should NOT page.","examples":[true,false],"type":"boolean"},"useDebounce":{"anyOf":[{"description":"Advanced debounce configuration. `maxInterval` defines maximum grouping window for duplicates (if omitted, backend uses a default interval).","type":"object","required":["enabled","maxInterval"],"properties":{"enabled":{"description":"Enable/disable debouncing for this event. If omitted, the backend treats it as enabled.","examples":[true],"type":"boolean"},"key":{"description":"Optional custom debounce key. When provided, logs sharing the same key will be grouped together (useful for dynamic messages).","examples":["stripe-webhook-timeout","db-connection-failed"],"type":"string"},"maxInterval":{"anyOf":[{"examples":["3w 4d 12h","10m","0.5h","2.5","3,1"],"description":"Relative time interval expressed as a string.\n\nSupported units and conversion (`REAL_TIME_CHAR_TO_MINUTES`):\n\n| Unit | Name   | Minutes | Notes |\n|------|--------|---------|-------|\n| `m`  | minute | `1`     | |\n| `h`  | hour   | `60`    | |\n| `d`  | day    | `1440`  | 24h |\n| `w`  | week   | `10080` | 7d |\n| `y`  | year   | `525600`| 365d |\n\nRules:\n- Units are case-insensitive and can be combined: `3w 4d 12h`.\n- Decimal values are allowed: `0.5h`, `2.5d`.\n- Spaces and unit variants are tolerated: `10m`, `10 min`, `10 minutes`.\n- Numeric value without a unit is interpreted as **hours**.\n\nRounding:\n- Result is returned in minutes and rounded **up** (`Math.ceil`).\n\nInvalid or empty input returns `0`.","type":"string"},{"examples":[30,60,150,1440],"description":"Relative time interval expressed as a number of minutes.\n\nRules:\n- Value is taken directly as minutes (e.g. `30` = 30 minutes).\n- No unit parsing or conversion is applied.","type":"number"}]}}},{"description":"Simple debounce toggle. When `true`, repeated logs may be deduplicated/grouped within a backend-defined window. When `false`, debouncing is disabled and every event is stored.","examples":[true,false],"type":"boolean"}]}}}},"text/plain":{"schema":{"type":"object","required":["service","message"],"properties":{"service":{"maxLength":32,"description":"Name of the microservice emitting the log. Free-form short slug — kebab-case, matches the subdomain or systemd unit. Prepended to the stored message as `[svc:<name>] …` so dashboard filters can group by it.","examples":["scout","scout:sync-blob-backup","pdf","proxy","cdn"],"type":"string"},"message":{"description":"Human-readable log body. For exceptions include the error class, message, and the smallest set of identifiers that reproduces the context (e.g. blob id, cron tick, HTTP method/URL). JSON is accepted but prefer flat text.","examples":["sync-blob-backup tick crashed: ConnectionTimeoutError at pg pool acquire (after 212 iters, 847 blobs backed up)","puppeteer launch failed: ENOENT /tmp/chromium (nodeVersion=v22.22.3, memoryMb=512)"],"type":"string"},"code":{"maxLength":64,"description":"Application-defined log code (short slug). Groups related events for anomaly detection and links to `docs.bizkithub.com/system-codes/<code>`. Defaults to `MSVC_LOG` when omitted — but prefer a specific code (e.g. `BLOB_BAK_CRASH`, `PDF_GEN_CRASH`) so dashboards and runbooks can key off it.","examples":["BLOB_BAK_CRASH","PDF_GEN_CRASH","PROXY_FORWARD_F"],"type":"string"},"component":{"maxLength":32,"description":"Sub-system that produced the log. Used for dashboard grouping. Typical values: `cron`, `api`, `common`.","examples":["cron","api"],"type":"string"},"subject":{"maxLength":200,"description":"One-line summary used as the subject of any notification email dispatched for this log entry.","examples":["scout sync-blob-backup worker crashed"],"type":"string"},"level":{"enum":["info","success","warning","error","critical"],"description":"Severity level. Defaults to `info` if omitted. Use `error` for a single failed operation, `critical` for a crash that stops the whole worker.","examples":["error","critical"],"type":"string"},"sendNotification":{"description":"When `true`, the log entry is eligible to trigger notifications (email) according to the internal-org notification rules. Use sparingly — most microservice entries are debounced and should NOT page.","examples":[true,false],"type":"boolean"},"useDebounce":{"anyOf":[{"description":"Advanced debounce configuration. `maxInterval` defines maximum grouping window for duplicates (if omitted, backend uses a default interval).","type":"object","required":["enabled","maxInterval"],"properties":{"enabled":{"description":"Enable/disable debouncing for this event. If omitted, the backend treats it as enabled.","examples":[true],"type":"boolean"},"key":{"description":"Optional custom debounce key. When provided, logs sharing the same key will be grouped together (useful for dynamic messages).","examples":["stripe-webhook-timeout","db-connection-failed"],"type":"string"},"maxInterval":{"anyOf":[{"examples":["3w 4d 12h","10m","0.5h","2.5","3,1"],"description":"Relative time interval expressed as a string.\n\nSupported units and conversion (`REAL_TIME_CHAR_TO_MINUTES`):\n\n| Unit | Name   | Minutes | Notes |\n|------|--------|---------|-------|\n| `m`  | minute | `1`     | |\n| `h`  | hour   | `60`    | |\n| `d`  | day    | `1440`  | 24h |\n| `w`  | week   | `10080` | 7d |\n| `y`  | year   | `525600`| 365d |\n\nRules:\n- Units are case-insensitive and can be combined: `3w 4d 12h`.\n- Decimal values are allowed: `0.5h`, `2.5d`.\n- Spaces and unit variants are tolerated: `10m`, `10 min`, `10 minutes`.\n- Numeric value without a unit is interpreted as **hours**.\n\nRounding:\n- Result is returned in minutes and rounded **up** (`Math.ceil`).\n\nInvalid or empty input returns `0`.","type":"string"},{"examples":[30,60,150,1440],"description":"Relative time interval expressed as a number of minutes.\n\nRules:\n- Value is taken directly as minutes (e.g. `30` = 30 minutes).\n- No unit parsing or conversion is applied.","type":"number"}]}}},{"description":"Simple debounce toggle. When `true`, repeated logs may be deduplicated/grouped within a backend-defined window. When `false`, debouncing is disabled and every event is stored.","examples":[true,false],"type":"boolean"}]}}}}}}}},"/api/v1/issue/unsubscribe":{"get":{"parameters":[{"description":"HMAC-signed token from the e-mail footer encoding (contactId, issueId). Tokens never expire — they stay valid as long as `SECRETS_MASTER_KEY` is not rotated.","schema":{"type":"string","minLength":10},"in":"query","name":"token","required":true}],"responses":{"200":{"description":"HTML confirmation page.","content":{"application/json":{"schema":{"description":"HTML confirmation page.","type":"string"}},"multipart/form-data":{"schema":{"description":"HTML confirmation page.","type":"string"}},"text/plain":{"schema":{"description":"HTML confirmation page.","type":"string"}}}},"400":{"description":"HTML error page — invalid or malformed token.","content":{"application/json":{"schema":{"description":"HTML error page — invalid or malformed token.","type":"string"}},"multipart/form-data":{"schema":{"description":"HTML error page — invalid or malformed token.","type":"string"}},"text/plain":{"schema":{"description":"HTML error page — invalid or malformed token.","type":"string"}}}},"404":{"description":"HTML error page — issue no longer exists.","content":{"application/json":{"schema":{"description":"HTML error page — issue no longer exists.","type":"string"}},"multipart/form-data":{"schema":{"description":"HTML error page — issue no longer exists.","type":"string"}},"text/plain":{"schema":{"description":"HTML error page — issue no longer exists.","type":"string"}}}}},"operationId":"getApiV1IssueUnsubscribe","tags":["Issue"],"summary":"Unsubscribe a contact from one issue (one-click opt-out from mail footer)","description":"Verifies the HMAC token, sets `muted_date = NOW()` on every `pm__issue_participant` row matching `(contact_id, issue_id)`, and renders a localised confirmation page. Idempotent — hitting the link twice shows the same page without raising an error. Returns `text/html` so a user clicking from a mail client sees a plain confirmation page; machine clients that want JSON should use the BFF `/bff/issue/unfollow` endpoint instead (cookie-authenticated)."}},"/api/v1/ledger/entity-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","baseCurrency","accountingStartsOn","fiscalYearStartMonth","lockedUntil"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"baseCurrency":{"examples":["CZK"],"type":"string"},"accountingStartsOn":{"anyOf":[{"type":"string"},{"type":"null"}]},"fiscalYearStartMonth":{"minimum":1,"maximum":12,"type":"number"},"lockedUntil":{"anyOf":[{"description":"No postings on or before this date.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","baseCurrency","accountingStartsOn","fiscalYearStartMonth","lockedUntil"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"baseCurrency":{"examples":["CZK"],"type":"string"},"accountingStartsOn":{"anyOf":[{"type":"string"},{"type":"null"}]},"fiscalYearStartMonth":{"minimum":1,"maximum":12,"type":"number"},"lockedUntil":{"anyOf":[{"description":"No postings on or before this date.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","baseCurrency","accountingStartsOn","fiscalYearStartMonth","lockedUntil"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"baseCurrency":{"examples":["CZK"],"type":"string"},"accountingStartsOn":{"anyOf":[{"type":"string"},{"type":"null"}]},"fiscalYearStartMonth":{"minimum":1,"maximum":12,"type":"number"},"lockedUntil":{"anyOf":[{"description":"No postings on or before this date.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getApiV1LedgerEntity-list","tags":["ledger"],"description":"List accounting entities of the organisation that keep double-entry books.\n\nUse the returned `id` as `entityId` in the other ledger endpoints. Entities without activated bookkeeping are omitted."}},"/api/v1/ledger/account-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","code","syntheticCode","parentCode","name","type","normalSide","isSynthetic","isActive"],"properties":{"id":{"type":"string"},"code":{"examples":["311.100"],"type":"string"},"syntheticCode":{"examples":["311"],"type":"string"},"parentCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"type":{"description":"`asset`, `liability`, `equity`, `revenue`, `expense`, `offbalance`, `closing`.","type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"isSynthetic":{"type":"boolean"},"isActive":{"type":"boolean"}}}},"itemCount":{"type":"number"}},"required":["asOf","items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","code","syntheticCode","parentCode","name","type","normalSide","isSynthetic","isActive"],"properties":{"id":{"type":"string"},"code":{"examples":["311.100"],"type":"string"},"syntheticCode":{"examples":["311"],"type":"string"},"parentCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"type":{"description":"`asset`, `liability`, `equity`, `revenue`, `expense`, `offbalance`, `closing`.","type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"isSynthetic":{"type":"boolean"},"isActive":{"type":"boolean"}}}},"itemCount":{"type":"number"}},"required":["asOf","items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","code","syntheticCode","parentCode","name","type","normalSide","isSynthetic","isActive"],"properties":{"id":{"type":"string"},"code":{"examples":["311.100"],"type":"string"},"syntheticCode":{"examples":["311"],"type":"string"},"parentCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"type":{"description":"`asset`, `liability`, `equity`, `revenue`, `expense`, `offbalance`, `closing`.","type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"isSynthetic":{"type":"boolean"},"isActive":{"type":"boolean"}}}},"itemCount":{"type":"number"}},"required":["asOf","items","itemCount"]}}}}},"operationId":"getApiV1LedgerAccount-list","tags":["ledger"],"description":"Chart of accounts (účtový rozvrh) of an accounting entity as of a date.\n\nNames and the active flag are effective-dated: `asOf` (default today) selects the version. Analytic accounts carry `parentCode`."}},"/api/v1/ledger/journal":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"minimum":1900,"maximum":2999,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1900,"maximum":2999,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateFrom","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateTo","required":false},{"examples":["311"],"schema":{"type":"string","maxLength":16},"in":"query","name":"accountCode","required":false},{"schema":{"minimum":1,"default":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"default":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":500,"default":100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"default":100,"type":"number"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","entryNo","entryDate","documentDate","documentNo","description","amount","sourceType","origin","fiscalYear","reversesEntryId","reversedByEntryId","accountCodes"],"properties":{"id":{"description":"Journal entry id.","type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryDate":{"description":"Accounting date (YYYY-MM-DD).","type":"string"},"documentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"sourceType":{"description":"Origin document type (`manual`, `invoice`, `bank`, …).","type":"string"},"origin":{"description":"`manual`, `document`, `opening`, `closing`, `adjustment`, …","type":"string"},"fiscalYear":{"type":"number"},"reversesEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reversedByEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCodes":{"type":"array","items":{"type":"string"}}}}},"itemCount":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","itemCount","page","limit"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","entryNo","entryDate","documentDate","documentNo","description","amount","sourceType","origin","fiscalYear","reversesEntryId","reversedByEntryId","accountCodes"],"properties":{"id":{"description":"Journal entry id.","type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryDate":{"description":"Accounting date (YYYY-MM-DD).","type":"string"},"documentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"sourceType":{"description":"Origin document type (`manual`, `invoice`, `bank`, …).","type":"string"},"origin":{"description":"`manual`, `document`, `opening`, `closing`, `adjustment`, …","type":"string"},"fiscalYear":{"type":"number"},"reversesEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reversedByEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCodes":{"type":"array","items":{"type":"string"}}}}},"itemCount":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","itemCount","page","limit"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","entryNo","entryDate","documentDate","documentNo","description","amount","sourceType","origin","fiscalYear","reversesEntryId","reversedByEntryId","accountCodes"],"properties":{"id":{"description":"Journal entry id.","type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryDate":{"description":"Accounting date (YYYY-MM-DD).","type":"string"},"documentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"sourceType":{"description":"Origin document type (`manual`, `invoice`, `bank`, …).","type":"string"},"origin":{"description":"`manual`, `document`, `opening`, `closing`, `adjustment`, …","type":"string"},"fiscalYear":{"type":"number"},"reversesEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reversedByEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCodes":{"type":"array","items":{"type":"string"}}}}},"itemCount":{"type":"number"},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","itemCount","page","limit"]}}}}},"operationId":"getApiV1LedgerJournal","tags":["ledger"],"description":"Posted journal entries (účetní deník), newest first, paginated.\n\n### Filters\n- `fiscalYear`, `dateFrom`, `dateTo`: accounting date range.\n- `accountCode`: prefix match on any line's account (`311` matches `311.100`).\n\nReversals (storno) are regular entries linked by `reversesEntryId`. Lines are in `/ledger/journal-detail`."}},"/api/v1/ledger/journal-detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Journal entry id.","type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryDate":{"description":"Accounting date (YYYY-MM-DD).","type":"string"},"documentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"sourceType":{"description":"Origin document type (`manual`, `invoice`, `bank`, …).","type":"string"},"origin":{"description":"`manual`, `document`, `opening`, `closing`, `adjustment`, …","type":"string"},"fiscalYear":{"type":"number"},"reversesEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reversedByEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["lineNo","accountCode","accountName","side","amount","isRedStorno","partnerId","description","dimensions"],"properties":{"lineNo":{"type":"number"},"accountCode":{"type":"string"},"accountName":{"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"isRedStorno":{"type":"boolean"},"partnerId":{"anyOf":[{"description":"Contact id of the counterparty.","type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dimensions":{"description":"Dimension values of the line (cost centre, project, …), one per dimension type.","type":"array","items":{"type":"object","required":["typeId","typeName","valueId","valueCode","valueName"],"properties":{"typeId":{"type":"string"},"typeName":{"examples":["Středisko"],"type":"string"},"valueId":{"type":"string"},"valueCode":{"examples":["PRAHA"],"type":"string"},"valueName":{"type":"string"}}}}}}}},"required":["id","entryNo","entryDate","documentDate","documentNo","description","amount","sourceType","origin","fiscalYear","reversesEntryId","reversedByEntryId","lines"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Journal entry id.","type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryDate":{"description":"Accounting date (YYYY-MM-DD).","type":"string"},"documentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"sourceType":{"description":"Origin document type (`manual`, `invoice`, `bank`, …).","type":"string"},"origin":{"description":"`manual`, `document`, `opening`, `closing`, `adjustment`, …","type":"string"},"fiscalYear":{"type":"number"},"reversesEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reversedByEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["lineNo","accountCode","accountName","side","amount","isRedStorno","partnerId","description","dimensions"],"properties":{"lineNo":{"type":"number"},"accountCode":{"type":"string"},"accountName":{"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"isRedStorno":{"type":"boolean"},"partnerId":{"anyOf":[{"description":"Contact id of the counterparty.","type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dimensions":{"description":"Dimension values of the line (cost centre, project, …), one per dimension type.","type":"array","items":{"type":"object","required":["typeId","typeName","valueId","valueCode","valueName"],"properties":{"typeId":{"type":"string"},"typeName":{"examples":["Středisko"],"type":"string"},"valueId":{"type":"string"},"valueCode":{"examples":["PRAHA"],"type":"string"},"valueName":{"type":"string"}}}}}}}},"required":["id","entryNo","entryDate","documentDate","documentNo","description","amount","sourceType","origin","fiscalYear","reversesEntryId","reversedByEntryId","lines"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Journal entry id.","type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryDate":{"description":"Accounting date (YYYY-MM-DD).","type":"string"},"documentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"sourceType":{"description":"Origin document type (`manual`, `invoice`, `bank`, …).","type":"string"},"origin":{"description":"`manual`, `document`, `opening`, `closing`, `adjustment`, …","type":"string"},"fiscalYear":{"type":"number"},"reversesEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"reversedByEntryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["lineNo","accountCode","accountName","side","amount","isRedStorno","partnerId","description","dimensions"],"properties":{"lineNo":{"type":"number"},"accountCode":{"type":"string"},"accountName":{"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"isRedStorno":{"type":"boolean"},"partnerId":{"anyOf":[{"description":"Contact id of the counterparty.","type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"dimensions":{"description":"Dimension values of the line (cost centre, project, …), one per dimension type.","type":"array","items":{"type":"object","required":["typeId","typeName","valueId","valueCode","valueName"],"properties":{"typeId":{"type":"string"},"typeName":{"examples":["Středisko"],"type":"string"},"valueId":{"type":"string"},"valueCode":{"examples":["PRAHA"],"type":"string"},"valueName":{"type":"string"}}}}}}}},"required":["id","entryNo","entryDate","documentDate","documentNo","description","amount","sourceType","origin","fiscalYear","reversesEntryId","reversedByEntryId","lines"]}}}}},"operationId":"getApiV1LedgerJournal-detail","tags":["ledger"],"description":"One posted journal entry with its lines.\n\nEach line has a `side` (`debit` = MD, `credit` = Dal) and a positive `amount`. `isRedStorno` lines count negatively on their side (červené storno)."}},"/api/v1/ledger/trial-balance":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"minimum":1900,"maximum":2999,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1900,"maximum":2999,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"default":true,"anyOf":[{"default":true,"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"analytics","required":false},{"schema":{"default":false,"anyOf":[{"default":false,"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"afterClosing","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"fiscalYear":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"rows":{"type":"array","items":{"type":"object","required":["code","name","type","openingDebit","openingCredit","turnoverDebit","turnoverCredit","closingDebit","closingCredit"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"openingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}},"totals":{"type":"object","required":["openingDebit","openingCredit","turnoverDebit","turnoverCredit","closingDebit","closingCredit"],"properties":{"openingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}},"checks":{"type":"object","required":["turnoverBalanced","openingBalanced","closingBalanced","matchesJournal"],"properties":{"turnoverBalanced":{"type":"boolean"},"openingBalanced":{"type":"boolean"},"closingBalanced":{"type":"boolean"},"matchesJournal":{"type":"boolean"}}}},"required":["fiscalYear","from","to","rows","totals","checks"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"fiscalYear":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"rows":{"type":"array","items":{"type":"object","required":["code","name","type","openingDebit","openingCredit","turnoverDebit","turnoverCredit","closingDebit","closingCredit"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"openingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}},"totals":{"type":"object","required":["openingDebit","openingCredit","turnoverDebit","turnoverCredit","closingDebit","closingCredit"],"properties":{"openingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}},"checks":{"type":"object","required":["turnoverBalanced","openingBalanced","closingBalanced","matchesJournal"],"properties":{"turnoverBalanced":{"type":"boolean"},"openingBalanced":{"type":"boolean"},"closingBalanced":{"type":"boolean"},"matchesJournal":{"type":"boolean"}}}},"required":["fiscalYear","from","to","rows","totals","checks"]}},"text/plain":{"schema":{"type":"object","properties":{"fiscalYear":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"rows":{"type":"array","items":{"type":"object","required":["code","name","type","openingDebit","openingCredit","turnoverDebit","turnoverCredit","closingDebit","closingCredit"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"openingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}},"totals":{"type":"object","required":["openingDebit","openingCredit","turnoverDebit","turnoverCredit","closingDebit","closingCredit"],"properties":{"openingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"turnoverCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingDebit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"closingCredit":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}},"checks":{"type":"object","required":["turnoverBalanced","openingBalanced","closingBalanced","matchesJournal"],"properties":{"turnoverBalanced":{"type":"boolean"},"openingBalanced":{"type":"boolean"},"closingBalanced":{"type":"boolean"},"matchesJournal":{"type":"boolean"}}}},"required":["fiscalYear","from","to","rows","totals","checks"]}}}}},"operationId":"getApiV1LedgerTrial-balance","tags":["ledger"],"description":"Trial balance (obratová předvaha) for one fiscal period.\n\n### Range\n- `fiscalYear` picks the period; default is the newest open period.\n- `from` / `to` narrow the range and are clamped to the period bounds.\n\n### Semantics\n- Opening (PS) = opening entry + movements of the period before `from`; balance accounts carry forward when no opening entry exists.\n- Opening and closing balances are netted to one side; turnovers are gross.\n- `analytics=false` rolls analytic accounts into their synthetic account.\n- `afterClosing=true` includes closing entries.\n- `checks` are the control equations (Σ MD = Σ Dal, trial balance turnover = journal turnover)."}},"/api/v1/ledger/document-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["issued_invoice"],"schema":{"type":"string","maxLength":32},"in":"query","name":"kind","required":false},{"schema":{"anyOf":[{"const":"issued","type":"string"},{"const":"received","type":"string"},{"const":"internal","type":"string"}]},"in":"query","name":"direction","required":false},{"schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"ready","type":"string"},{"const":"blocked","type":"string"},{"const":"posted","type":"string"},{"const":"cancelled","type":"string"},{"const":"voided","type":"string"}]},"in":"query","name":"status","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateFrom","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateTo","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"number"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","kind","direction","status","documentNo","externalDocumentNo","partnerName","partnerVatId","accountingDate","taxableSupplyDate","dueDate","currency","totalNet","totalVat","totalGross","totalGrossBase","openFindings","blockingFindings"],"properties":{"id":{"description":"Document id.","type":"string"},"kind":{"type":"string"},"direction":{"type":"string"},"status":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"externalDocumentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingDate":{"type":"string"},"taxableSupplyDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"totalGross":{"type":"number"},"totalGrossBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openFindings":{"type":"number"},"blockingFindings":{"type":"number"}}}}},"required":["page","limit","total","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","kind","direction","status","documentNo","externalDocumentNo","partnerName","partnerVatId","accountingDate","taxableSupplyDate","dueDate","currency","totalNet","totalVat","totalGross","totalGrossBase","openFindings","blockingFindings"],"properties":{"id":{"description":"Document id.","type":"string"},"kind":{"type":"string"},"direction":{"type":"string"},"status":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"externalDocumentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingDate":{"type":"string"},"taxableSupplyDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"totalGross":{"type":"number"},"totalGrossBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openFindings":{"type":"number"},"blockingFindings":{"type":"number"}}}}},"required":["page","limit","total","items"]}},"text/plain":{"schema":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","kind","direction","status","documentNo","externalDocumentNo","partnerName","partnerVatId","accountingDate","taxableSupplyDate","dueDate","currency","totalNet","totalVat","totalGross","totalGrossBase","openFindings","blockingFindings"],"properties":{"id":{"description":"Document id.","type":"string"},"kind":{"type":"string"},"direction":{"type":"string"},"status":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"externalDocumentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingDate":{"type":"string"},"taxableSupplyDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"type":"string"},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"totalGross":{"type":"number"},"totalGrossBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openFindings":{"type":"number"},"blockingFindings":{"type":"number"}}}}},"required":["page","limit","total","items"]}}}}},"operationId":"getApiV1LedgerDocument-list","tags":["ledger"],"description":"Canonical accounting documents (doklady) of an entity, projected from invoices, purchase invoices and expenses.\n\n- `status`: draft, ready, blocked (open blocking data-quality finding), posted, cancelled, voided.\n- Amounts `totalNet/Vat/Gross` are in the document currency; `totalGrossBase` in the entity base currency.\n- Ordered by accounting date, newest first."}},"/api/v1/ledger/vat-ledger":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2027-01"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"in":"query","name":"period","required":true},{"schema":{"anyOf":[{"const":"issued","type":"string"},{"const":"received","type":"string"}]},"in":"query","name":"direction","required":false},{"schema":{"anyOf":[{"const":"tax_point","type":"string"},{"const":"claimed","type":"string"}]},"in":"query","name":"basis","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string"},"basis":{"type":"string"},"totals":{"type":"object","required":["outputBase","outputVat","inputBase","inputVat","balance"],"properties":{"outputBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"outputVat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"inputBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"inputVat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"balance":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}},"byFormRow":{"type":"array","items":{"type":"object","required":["key","direction","base","vat","count"],"properties":{"key":{"type":"string"},"direction":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"}}}},"byKhSection":{"type":"array","items":{"type":"object","required":["key","direction","base","vat","count"],"properties":{"key":{"type":"string"},"direction":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"}}}},"entries":{"type":"array","items":{"type":"object","required":["direction","taxPointDate","claimedPeriod","classificationCode","dphFormRow","khSection","vatRate","partnerVatId","documentNo","documentId","base","vat"],"properties":{"direction":{"type":"string"},"taxPointDate":{"type":"string"},"claimedPeriod":{"anyOf":[{"type":"string"},{"type":"null"}]},"classificationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"dphFormRow":{"anyOf":[{"type":"string"},{"type":"null"}]},"khSection":{"anyOf":[{"type":"string"},{"type":"null"}]},"vatRate":{"type":"number"},"partnerVatId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}},"required":["period","basis","totals","byFormRow","byKhSection","entries"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"period":{"type":"string"},"basis":{"type":"string"},"totals":{"type":"object","required":["outputBase","outputVat","inputBase","inputVat","balance"],"properties":{"outputBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"outputVat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"inputBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"inputVat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"balance":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}},"byFormRow":{"type":"array","items":{"type":"object","required":["key","direction","base","vat","count"],"properties":{"key":{"type":"string"},"direction":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"}}}},"byKhSection":{"type":"array","items":{"type":"object","required":["key","direction","base","vat","count"],"properties":{"key":{"type":"string"},"direction":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"}}}},"entries":{"type":"array","items":{"type":"object","required":["direction","taxPointDate","claimedPeriod","classificationCode","dphFormRow","khSection","vatRate","partnerVatId","documentNo","documentId","base","vat"],"properties":{"direction":{"type":"string"},"taxPointDate":{"type":"string"},"claimedPeriod":{"anyOf":[{"type":"string"},{"type":"null"}]},"classificationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"dphFormRow":{"anyOf":[{"type":"string"},{"type":"null"}]},"khSection":{"anyOf":[{"type":"string"},{"type":"null"}]},"vatRate":{"type":"number"},"partnerVatId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}},"required":["period","basis","totals","byFormRow","byKhSection","entries"]}},"text/plain":{"schema":{"type":"object","properties":{"period":{"type":"string"},"basis":{"type":"string"},"totals":{"type":"object","required":["outputBase","outputVat","inputBase","inputVat","balance"],"properties":{"outputBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"outputVat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"inputBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"inputVat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"balance":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}},"byFormRow":{"type":"array","items":{"type":"object","required":["key","direction","base","vat","count"],"properties":{"key":{"type":"string"},"direction":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"}}}},"byKhSection":{"type":"array","items":{"type":"object","required":["key","direction","base","vat","count"],"properties":{"key":{"type":"string"},"direction":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"}}}},"entries":{"type":"array","items":{"type":"object","required":["direction","taxPointDate","claimedPeriod","classificationCode","dphFormRow","khSection","vatRate","partnerVatId","documentNo","documentId","base","vat"],"properties":{"direction":{"type":"string"},"taxPointDate":{"type":"string"},"claimedPeriod":{"anyOf":[{"type":"string"},{"type":"null"}]},"classificationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"dphFormRow":{"anyOf":[{"type":"string"},{"type":"null"}]},"khSection":{"anyOf":[{"type":"string"},{"type":"null"}]},"vatRate":{"type":"number"},"partnerVatId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentId":{"type":"string"},"base":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"vat":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}},"required":["period","basis","totals","byFormRow","byKhSection","entries"]}}}}},"operationId":"getApiV1LedgerVat-ledger","tags":["ledger"],"description":"VAT ledger (evidence pro DPH, § 100 ZDPH) of one month.\n\n- `basis=tax_point` (default) groups by the tax point; `claimed` groups received VAT by the period it may be claimed in.\n- `byFormRow` sums per DPH return row, `byKhSection` per control statement section (A4/A5 and B2/B3 split at 10 000 CZK)."}},"/api/v1/ledger/posting-rule-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["ruleKey","description","global","override","effective"],"properties":{"ruleKey":{"examples":["issued.revenue.services"],"type":"string"},"description":{"type":"string"},"global":{"type":"object","required":["debit","credit"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"override":{"anyOf":[{"type":"object","required":["debit","credit","isActive","updatedDate"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"updatedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"effective":{"type":"object","required":["debit","credit"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["ruleKey","description","global","override","effective"],"properties":{"ruleKey":{"examples":["issued.revenue.services"],"type":"string"},"description":{"type":"string"},"global":{"type":"object","required":["debit","credit"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"override":{"anyOf":[{"type":"object","required":["debit","credit","isActive","updatedDate"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"updatedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"effective":{"type":"object","required":["debit","credit"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["ruleKey","description","global","override","effective"],"properties":{"ruleKey":{"examples":["issued.revenue.services"],"type":"string"},"description":{"type":"string"},"global":{"type":"object","required":["debit","credit"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"override":{"anyOf":[{"type":"object","required":["debit","credit","isActive","updatedDate"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"updatedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"effective":{"type":"object","required":["debit","credit"],"properties":{"debit":{"anyOf":[{"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"required":["items"]}}}}},"operationId":"getApiV1LedgerPosting-rule-list","tags":["ledger"],"description":"Posting rules (předkontace) of an entity. `global` is the platform default, `override` the entity override (if any) and `effective` what document posting uses. A `null` side is decided by another rule."}},"/api/v1/ledger/document-posting":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Document id from /document-list.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"documentStatus":{"type":"string"},"operationType":{"examples":["document.issued"],"type":"string"},"decision":{"examples":["auto"],"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"journalEntry":{"anyOf":[{"type":"object","required":["id","entryNo","origin","isReversed"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"origin":{"type":"string"},"isReversed":{"type":"boolean"}}},{"type":"null"}]},"proposal":{"anyOf":[{"type":"object","required":["entryDate","amount","lines"],"properties":{"entryDate":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"lines":{"type":"array","items":{"type":"object","required":["accountCode","accountName","side","amount","ruleKey"],"properties":{"accountCode":{"type":"string"},"accountName":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"ruleKey":{"type":"string"}}}}}},{"type":"null"}]}},"required":["documentStatus","operationType","decision","reason","error","journalEntry","proposal"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"documentStatus":{"type":"string"},"operationType":{"examples":["document.issued"],"type":"string"},"decision":{"examples":["auto"],"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"journalEntry":{"anyOf":[{"type":"object","required":["id","entryNo","origin","isReversed"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"origin":{"type":"string"},"isReversed":{"type":"boolean"}}},{"type":"null"}]},"proposal":{"anyOf":[{"type":"object","required":["entryDate","amount","lines"],"properties":{"entryDate":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"lines":{"type":"array","items":{"type":"object","required":["accountCode","accountName","side","amount","ruleKey"],"properties":{"accountCode":{"type":"string"},"accountName":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"ruleKey":{"type":"string"}}}}}},{"type":"null"}]}},"required":["documentStatus","operationType","decision","reason","error","journalEntry","proposal"]}},"text/plain":{"schema":{"type":"object","properties":{"documentStatus":{"type":"string"},"operationType":{"examples":["document.issued"],"type":"string"},"decision":{"examples":["auto"],"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},{"type":"null"}]},"journalEntry":{"anyOf":[{"type":"object","required":["id","entryNo","origin","isReversed"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"origin":{"type":"string"},"isReversed":{"type":"boolean"}}},{"type":"null"}]},"proposal":{"anyOf":[{"type":"object","required":["entryDate","amount","lines"],"properties":{"entryDate":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"lines":{"type":"array","items":{"type":"object","required":["accountCode","accountName","side","amount","ruleKey"],"properties":{"accountCode":{"type":"string"},"accountName":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"ruleKey":{"type":"string"}}}}}},{"type":"null"}]}},"required":["documentStatus","operationType","decision","reason","error","journalEntry","proposal"]}}}}},"operationId":"getApiV1LedgerDocument-posting","tags":["ledger"],"description":"Posting of one accounting document: the journal entry it would get now (accounts resolved exactly as posting would), what the automation would decide (`auto`, `suggest`, `needs_input`, `blocked`, `skip`) with a reason code, and the live journal entry once posted. Read only."}},"/api/v1/ledger/payment-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"unmatched","type":"string"},{"const":"partial","type":"string"},{"const":"settled","type":"string"},{"const":"over","type":"string"}]},"in":"query","name":"state","required":false},{"schema":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"in":"query","name":"direction","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateFrom","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateTo","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"number"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","kind","direction","valueDate","amount","currency","amountBase","variableSymbol","counterpartyName","settledAmount","openAmount","settlementState","journalEntry"],"properties":{"id":{"type":"string"},"kind":{"examples":["bank"],"type":"string"},"direction":{"examples":["in"],"type":"string"},"valueDate":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"currency":{"examples":["CZK"],"type":"string"},"amountBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"variableSymbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"settledAmount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openAmount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"settlementState":{"examples":["settled"],"type":"string"},"journalEntry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}},"required":["page","limit","total","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","kind","direction","valueDate","amount","currency","amountBase","variableSymbol","counterpartyName","settledAmount","openAmount","settlementState","journalEntry"],"properties":{"id":{"type":"string"},"kind":{"examples":["bank"],"type":"string"},"direction":{"examples":["in"],"type":"string"},"valueDate":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"currency":{"examples":["CZK"],"type":"string"},"amountBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"variableSymbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"settledAmount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openAmount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"settlementState":{"examples":["settled"],"type":"string"},"journalEntry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}},"required":["page","limit","total","items"]}},"text/plain":{"schema":{"type":"object","properties":{"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","kind","direction","valueDate","amount","currency","amountBase","variableSymbol","counterpartyName","settledAmount","openAmount","settlementState","journalEntry"],"properties":{"id":{"type":"string"},"kind":{"examples":["bank"],"type":"string"},"direction":{"examples":["in"],"type":"string"},"valueDate":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"currency":{"examples":["CZK"],"type":"string"},"amountBase":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"variableSymbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"settledAmount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"openAmount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"settlementState":{"examples":["settled"],"type":"string"},"journalEntry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}},"required":["page","limit","total","items"]}}}}},"operationId":"getApiV1LedgerPayment-list","tags":["ledger"],"description":"Payments (bank transactions and order payments) of an entity with their allocation to documents.\n\n- `direction`: in (money received) or out (money paid).\n- `settlementState`: unmatched, partial, settled, over. `openAmount` is the part not allocated to any document.\n- `journalEntry` is set once the payment is posted."}},"/api/v1/ledger/saldo":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false},{"schema":{"anyOf":[{"const":"receivable","type":"string"},{"const":"payable","type":"string"}]},"in":"query","name":"side","required":false},{"examples":["311"],"schema":{"type":"string","maxLength":16},"in":"query","name":"accountCode","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"number"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"accounts":{"type":"array","items":{"type":"object","required":["code","name","side","amount","count","buckets"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"},"buckets":{"type":"object","patternProperties":{"^(.*)$":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}}},"items":{"type":"array","items":{"type":"object","required":["documentId","documentNo","dueDate","partnerName","accountCode","side","amount","daysOverdue","bucket"],"properties":{"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"daysOverdue":{"anyOf":[{"type":"number"},{"type":"null"}]},"bucket":{"type":"string"}}}}},"required":["asOf","page","limit","total","accounts","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"accounts":{"type":"array","items":{"type":"object","required":["code","name","side","amount","count","buckets"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"},"buckets":{"type":"object","patternProperties":{"^(.*)$":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}}},"items":{"type":"array","items":{"type":"object","required":["documentId","documentNo","dueDate","partnerName","accountCode","side","amount","daysOverdue","bucket"],"properties":{"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"daysOverdue":{"anyOf":[{"type":"number"},{"type":"null"}]},"bucket":{"type":"string"}}}}},"required":["asOf","page","limit","total","accounts","items"]}},"text/plain":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"page":{"type":"number"},"limit":{"type":"number"},"total":{"type":"number"},"accounts":{"type":"array","items":{"type":"object","required":["code","name","side","amount","count","buckets"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"count":{"type":"number"},"buckets":{"type":"object","patternProperties":{"^(.*)$":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}}},"items":{"type":"array","items":{"type":"object","required":["documentId","documentNo","dueDate","partnerName","accountCode","side","amount","daysOverdue","bucket"],"properties":{"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"type":"string"},"side":{"type":"string"},"amount":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"daysOverdue":{"anyOf":[{"type":"number"},{"type":"null"}]},"bucket":{"type":"string"}}}}},"required":["asOf","page","limit","total","accounts","items"]}}}}},"operationId":"getApiV1LedgerSaldo","tags":["ledger"],"description":"Saldokonto: open receivables and payables from the journal as of a date (default today), per document, with aging.\n\n- `amount` is positive for what is owed (to the entity for receivables, by the entity for payables), in the base currency.\n- `bucket`: not_due, d1_30, d31_60, d61_90, d91_180, d181_365, over_365, unassigned (journal lines without a document).\n- `accounts` sums every open-item account with the same buckets."}},"/api/v1/ledger/vat-filing-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"dp3","type":"string"},{"const":"kh","type":"string"},{"const":"sh","type":"string"}]},"in":"query","name":"kind","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"vatStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"vatPeriod":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["kind","period","deadline","state","filed"],"properties":{"kind":{"examples":["dp3"],"type":"string"},"period":{"examples":["2027-02"],"type":"string"},"deadline":{"examples":["2027-03-25"],"type":"string"},"state":{"examples":["filed"],"type":"string"},"filed":{"anyOf":[{"type":"object","required":["id","filingType","filedDate","reference","ownTax"],"properties":{"id":{"type":"string"},"filingType":{"examples":["regular"],"type":"string"},"filedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownTax":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]}}}}},"required":["vatStatus","vatPeriod","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"vatStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"vatPeriod":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["kind","period","deadline","state","filed"],"properties":{"kind":{"examples":["dp3"],"type":"string"},"period":{"examples":["2027-02"],"type":"string"},"deadline":{"examples":["2027-03-25"],"type":"string"},"state":{"examples":["filed"],"type":"string"},"filed":{"anyOf":[{"type":"object","required":["id","filingType","filedDate","reference","ownTax"],"properties":{"id":{"type":"string"},"filingType":{"examples":["regular"],"type":"string"},"filedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownTax":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]}}}}},"required":["vatStatus","vatPeriod","items"]}},"text/plain":{"schema":{"type":"object","properties":{"vatStatus":{"anyOf":[{"type":"string"},{"type":"null"}]},"vatPeriod":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["kind","period","deadline","state","filed"],"properties":{"kind":{"examples":["dp3"],"type":"string"},"period":{"examples":["2027-02"],"type":"string"},"deadline":{"examples":["2027-03-25"],"type":"string"},"state":{"examples":["filed"],"type":"string"},"filed":{"anyOf":[{"type":"object","required":["id","filingType","filedDate","reference","ownTax"],"properties":{"id":{"type":"string"},"filingType":{"examples":["regular"],"type":"string"},"filedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"ownTax":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]}}}}},"required":["vatStatus","vatPeriod","items"]}}}}},"operationId":"getApiV1LedgerVat-filing-list","tags":["ledger"],"description":"VAT filing calendar of an entity: VAT return (dp3), control statement (kh) and EC sales list (sh) per period, latest first.\n\n- `state`: filed, draft, not_due (period still running), missing (due, before the deadline), overdue.\n- `ownTax`: own tax in whole CZK (negative = excess deduction), DP3 only."}},"/api/v1/ledger/statement":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"balance_sheet","type":"string"},{"const":"income_statement","type":"string"}]},"in":"query","name":"kind","required":true},{"schema":{"anyOf":[{"const":"full","type":"string"},{"const":"small","type":"string"},{"const":"micro","type":"string"}]},"in":"query","name":"scope","required":false},{"schema":{"minimum":1990,"maximum":2100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1990,"maximum":2100,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"examples":["balance_sheet"],"type":"string"},"scope":{"examples":["full"],"type":"string"},"fiscalYear":{"examples":[2027],"type":"number"},"asOf":{"examples":["2027-12-31"],"type":"string"},"balanced":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","required":["code","section","label","level","gross","correction","net","previousNet"],"properties":{"code":{"examples":["B.II."],"type":"string"},"section":{"examples":["assets"],"type":"string"},"label":{"type":"string"},"level":{"type":"number"},"gross":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"correction":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"net":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"previousNet":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}},"required":["kind","scope","fiscalYear","asOf","balanced","rows"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"kind":{"examples":["balance_sheet"],"type":"string"},"scope":{"examples":["full"],"type":"string"},"fiscalYear":{"examples":[2027],"type":"number"},"asOf":{"examples":["2027-12-31"],"type":"string"},"balanced":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","required":["code","section","label","level","gross","correction","net","previousNet"],"properties":{"code":{"examples":["B.II."],"type":"string"},"section":{"examples":["assets"],"type":"string"},"label":{"type":"string"},"level":{"type":"number"},"gross":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"correction":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"net":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"previousNet":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}},"required":["kind","scope","fiscalYear","asOf","balanced","rows"]}},"text/plain":{"schema":{"type":"object","properties":{"kind":{"examples":["balance_sheet"],"type":"string"},"scope":{"examples":["full"],"type":"string"},"fiscalYear":{"examples":[2027],"type":"number"},"asOf":{"examples":["2027-12-31"],"type":"string"},"balanced":{"type":"boolean"},"rows":{"type":"array","items":{"type":"object","required":["code","section","label","level","gross","correction","net","previousNet"],"properties":{"code":{"examples":["B.II."],"type":"string"},"section":{"examples":["assets"],"type":"string"},"label":{"type":"string"},"level":{"type":"number"},"gross":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"correction":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"net":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},"previousNet":{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"}}}}},"required":["kind","scope","fiscalYear","asOf","balanced","rows"]}}}}},"operationId":"getApiV1LedgerStatement","tags":["ledger"],"description":"Balance sheet or income statement by nature under decree 500/2002 Sb. as of a date (default: the end of the newest open period or today).\n\n- `scope`: full, small (abridged for a small entity) or micro.\n- Assets carry `gross`, `correction` and `net`; other rows only `net` (gross = net, correction = 0).\n- `previousNet`: the previous fiscal period at its end, or the opening balance sheet in the first period.\n- Year-end closing entries are left out, so the current result shows on row A.V."}},"/api/v1/ledger/dimension-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","kind","isActive","values"],"properties":{"id":{"type":"string"},"code":{"examples":["STR"],"type":"string"},"name":{"examples":["Středisko"],"type":"string"},"kind":{"examples":["cost_center"],"type":"string"},"isActive":{"type":"boolean"},"values":{"type":"array","items":{"type":"object","required":["id","code","name","parentId","isActive"],"properties":{"id":{"type":"string"},"code":{"examples":["PRAHA"],"type":"string"},"name":{"examples":["Pobočka Praha"],"type":"string"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"}}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","kind","isActive","values"],"properties":{"id":{"type":"string"},"code":{"examples":["STR"],"type":"string"},"name":{"examples":["Středisko"],"type":"string"},"kind":{"examples":["cost_center"],"type":"string"},"isActive":{"type":"boolean"},"values":{"type":"array","items":{"type":"object","required":["id","code","name","parentId","isActive"],"properties":{"id":{"type":"string"},"code":{"examples":["PRAHA"],"type":"string"},"name":{"examples":["Pobočka Praha"],"type":"string"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"}}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","kind","isActive","values"],"properties":{"id":{"type":"string"},"code":{"examples":["STR"],"type":"string"},"name":{"examples":["Středisko"],"type":"string"},"kind":{"examples":["cost_center"],"type":"string"},"isActive":{"type":"boolean"},"values":{"type":"array","items":{"type":"object","required":["id","code","name","parentId","isActive"],"properties":{"id":{"type":"string"},"code":{"examples":["PRAHA"],"type":"string"},"name":{"examples":["Pobočka Praha"],"type":"string"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"}}}}}}}},"required":["items"]}}}}},"operationId":"getApiV1LedgerDimension-list","tags":["ledger"],"description":"Dimensions of the accounting entity (cost centre, project, branch, …) with their values. Journal lines carry at most one value per dimension; see `dimensions` in `journal-detail`."}},"/api/v1/ledger/journal-template-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","description","seedKey","lines"],"properties":{"id":{"type":"string"},"name":{"examples":["Mzdy"],"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"seedKey":{"anyOf":[{"examples":["payroll"],"type":"string"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["lineNo","label","accountCode","side","defaultAmount"],"properties":{"lineNo":{"type":"number"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"examples":["521"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"defaultAmount":{"anyOf":[{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},{"type":"null"}]}}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","description","seedKey","lines"],"properties":{"id":{"type":"string"},"name":{"examples":["Mzdy"],"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"seedKey":{"anyOf":[{"examples":["payroll"],"type":"string"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["lineNo","label","accountCode","side","defaultAmount"],"properties":{"lineNo":{"type":"number"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"examples":["521"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"defaultAmount":{"anyOf":[{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},{"type":"null"}]}}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","description","seedKey","lines"],"properties":{"id":{"type":"string"},"name":{"examples":["Mzdy"],"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"seedKey":{"anyOf":[{"examples":["payroll"],"type":"string"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["lineNo","label","accountCode","side","defaultAmount"],"properties":{"lineNo":{"type":"number"},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"examples":["521"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"defaultAmount":{"anyOf":[{"description":"Amount in the base currency of the accounting entity (2 decimals).","examples":[12100.5],"type":"number"},{"type":"null"}]}}}}}}}},"required":["items"]}}}}},"operationId":"getApiV1LedgerJournal-template-list","tags":["ledger"],"description":"Journal templates of the accounting entity: the recommended ones (`seedKey`: payroll, closing.*) and the entity's own. `defaultAmount` null means the amount is filled in when the template is used."}},"/api/v1/ledger/bank-rule-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","direction","counterpartyAccount","counterpartyBank","variableSymbol","messageContains","accountCode","mode","isActive","hitCount"],"properties":{"id":{"type":"string"},"name":{"examples":["Bankovní poplatek"],"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"counterpartyAccount":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyBank":{"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageContains":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"examples":["568"],"type":"string"},"mode":{"anyOf":[{"const":"suggest","type":"string"},{"const":"auto","type":"string"}]},"isActive":{"type":"boolean"},"hitCount":{"type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","direction","counterpartyAccount","counterpartyBank","variableSymbol","messageContains","accountCode","mode","isActive","hitCount"],"properties":{"id":{"type":"string"},"name":{"examples":["Bankovní poplatek"],"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"counterpartyAccount":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyBank":{"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageContains":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"examples":["568"],"type":"string"},"mode":{"anyOf":[{"const":"suggest","type":"string"},{"const":"auto","type":"string"}]},"isActive":{"type":"boolean"},"hitCount":{"type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","direction","counterpartyAccount","counterpartyBank","variableSymbol","messageContains","accountCode","mode","isActive","hitCount"],"properties":{"id":{"type":"string"},"name":{"examples":["Bankovní poplatek"],"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"counterpartyAccount":{"anyOf":[{"type":"string"},{"type":"null"}]},"counterpartyBank":{"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageContains":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountCode":{"examples":["568"],"type":"string"},"mode":{"anyOf":[{"const":"suggest","type":"string"},{"const":"auto","type":"string"}]},"isActive":{"type":"boolean"},"hitCount":{"type":"number"}}}}},"required":["items"]}}}}},"operationId":"getApiV1LedgerBank-rule-list","tags":["ledger"],"description":"Bank rules of the accounting entity: they classify the unidentified part of a bank payment (no document behind it) to a counter-account. `mode` auto posts without review, suggest waits for a person."}},"/api/v1/ledger/closing-state":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"periodId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"fiscalYear":{"examples":[2026],"type":"number"},"status":{"examples":["open"],"type":"string"},"result":{"anyOf":[{"type":"number"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","status","entryId","doneDate"],"properties":{"key":{"examples":["close_books"],"type":"string"},"status":{"examples":["done"],"type":"string"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"doneDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"findings":{"type":"array","items":{"type":"object","required":["code","severity","count"],"properties":{"code":{"examples":["unposted_documents"],"type":"string"},"severity":{"type":"string"},"count":{"type":"number"}}}}},"required":["fiscalYear","status","result","steps","findings"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"fiscalYear":{"examples":[2026],"type":"number"},"status":{"examples":["open"],"type":"string"},"result":{"anyOf":[{"type":"number"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","status","entryId","doneDate"],"properties":{"key":{"examples":["close_books"],"type":"string"},"status":{"examples":["done"],"type":"string"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"doneDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"findings":{"type":"array","items":{"type":"object","required":["code","severity","count"],"properties":{"code":{"examples":["unposted_documents"],"type":"string"},"severity":{"type":"string"},"count":{"type":"number"}}}}},"required":["fiscalYear","status","result","steps","findings"]}},"text/plain":{"schema":{"type":"object","properties":{"fiscalYear":{"examples":[2026],"type":"number"},"status":{"examples":["open"],"type":"string"},"result":{"anyOf":[{"type":"number"},{"type":"null"}]},"steps":{"type":"array","items":{"type":"object","required":["key","status","entryId","doneDate"],"properties":{"key":{"examples":["close_books"],"type":"string"},"status":{"examples":["done"],"type":"string"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"doneDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"findings":{"type":"array","items":{"type":"object","required":["code","severity","count"],"properties":{"code":{"examples":["unposted_documents"],"type":"string"},"severity":{"type":"string"},"count":{"type":"number"}}}}},"required":["fiscalYear","status","result","steps","findings"]}}}}},"operationId":"getApiV1LedgerClosing-state","tags":["ledger"],"description":"Year-end closing progress of a fiscal period: wizard steps (precheck, FX revaluation, accruals, depreciation, provisions, inventory, income tax, closing entry, opening of the next period, profit distribution), live precheck findings and the result of the year."}},"/api/v1/ledger/check-runs":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"integrity","type":"string"},{"const":"monthly","type":"string"}]},"in":"query","name":"kind","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","month","asOf","status","errorCount","warningCount","findings","insertedDate"],"properties":{"id":{"type":"string"},"month":{"anyOf":[{"type":"string"},{"type":"null"}]},"asOf":{"examples":["2026-10-31"],"type":"string"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"errorCount":{"type":"number"},"warningCount":{"type":"number"},"findings":{"type":"array","items":{"type":"object","required":["code","severity","count"],"properties":{"code":{"examples":["bank_reconciliation"],"type":"string"},"severity":{"type":"string"},"count":{"type":"number"}}}},"insertedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","month","asOf","status","errorCount","warningCount","findings","insertedDate"],"properties":{"id":{"type":"string"},"month":{"anyOf":[{"type":"string"},{"type":"null"}]},"asOf":{"examples":["2026-10-31"],"type":"string"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"errorCount":{"type":"number"},"warningCount":{"type":"number"},"findings":{"type":"array","items":{"type":"object","required":["code","severity","count"],"properties":{"code":{"examples":["bank_reconciliation"],"type":"string"},"severity":{"type":"string"},"count":{"type":"number"}}}},"insertedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","month","asOf","status","errorCount","warningCount","findings","insertedDate"],"properties":{"id":{"type":"string"},"month":{"anyOf":[{"type":"string"},{"type":"null"}]},"asOf":{"examples":["2026-10-31"],"type":"string"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"errorCount":{"type":"number"},"warningCount":{"type":"number"},"findings":{"type":"array","items":{"type":"object","required":["code","severity","count"],"properties":{"code":{"examples":["bank_reconciliation"],"type":"string"},"severity":{"type":"string"},"count":{"type":"number"}}}},"insertedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getApiV1LedgerCheck-runs","tags":["ledger"],"description":"Ledger check runs: `integrity` (daily, kernel invariants) or `monthly` (latest run per month: invariants, unposted work, negative cash, bank reconciliation against the payment register, suspense balance, open items without a document)."}},"/api/v1/ledger/offset-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","partnerName","date","amount","status","entryId","items"],"properties":{"id":{"type":"string"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"date":{"examples":["2026-10-31"],"type":"string"},"amount":{"type":"number"},"status":{"anyOf":[{"const":"posted","type":"string"},{"const":"reversed","type":"string"}]},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["side","accountCode","documentId","documentNo","amount"],"properties":{"side":{"anyOf":[{"const":"receivable","type":"string"},{"const":"payable","type":"string"}]},"accountCode":{"examples":["311"],"type":"string"},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"}}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","partnerName","date","amount","status","entryId","items"],"properties":{"id":{"type":"string"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"date":{"examples":["2026-10-31"],"type":"string"},"amount":{"type":"number"},"status":{"anyOf":[{"const":"posted","type":"string"},{"const":"reversed","type":"string"}]},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["side","accountCode","documentId","documentNo","amount"],"properties":{"side":{"anyOf":[{"const":"receivable","type":"string"},{"const":"payable","type":"string"}]},"accountCode":{"examples":["311"],"type":"string"},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"}}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","partnerName","date","amount","status","entryId","items"],"properties":{"id":{"type":"string"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"date":{"examples":["2026-10-31"],"type":"string"},"amount":{"type":"number"},"status":{"anyOf":[{"const":"posted","type":"string"},{"const":"reversed","type":"string"}]},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["side","accountCode","documentId","documentNo","amount"],"properties":{"side":{"anyOf":[{"const":"receivable","type":"string"},{"const":"payable","type":"string"}]},"accountCode":{"examples":["311"],"type":"string"},"documentId":{"anyOf":[{"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"amount":{"type":"number"}}}}}}}},"required":["items"]}}}}},"operationId":"getApiV1LedgerOffset-list","tags":["ledger"],"description":"Offsets (zápočty) of receivables against payables of one partner, newest first."}},"/api/v1/ledger/asset-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-12-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false},{"schema":{"anyOf":[{"const":"all","type":"string"},{"const":"draft","type":"string"},{"const":"in_use","type":"string"},{"const":"disposed","type":"string"}]},"in":"query","name":"status","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","inventoryNumber","name","kind","status","assetAccountCode","accumulatedAccountCode","acquisitionDate","putIntoUseDate","disposalDate","taxMethod","taxGroup","price","accumulated","residual","taxResidual"],"properties":{"id":{"type":"string"},"inventoryNumber":{"examples":["DM-0001"],"type":"string"},"name":{"type":"string"},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"in_use","type":"string"},{"const":"disposed","type":"string"}]},"assetAccountCode":{"examples":["022"],"type":"string"},"accumulatedAccountCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"acquisitionDate":{"type":"string"},"putIntoUseDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"disposalDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"type":"number"},{"type":"null"}]},"price":{"type":"number"},"accumulated":{"type":"number"},"residual":{"type":"number"},"taxResidual":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","inventoryNumber","name","kind","status","assetAccountCode","accumulatedAccountCode","acquisitionDate","putIntoUseDate","disposalDate","taxMethod","taxGroup","price","accumulated","residual","taxResidual"],"properties":{"id":{"type":"string"},"inventoryNumber":{"examples":["DM-0001"],"type":"string"},"name":{"type":"string"},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"in_use","type":"string"},{"const":"disposed","type":"string"}]},"assetAccountCode":{"examples":["022"],"type":"string"},"accumulatedAccountCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"acquisitionDate":{"type":"string"},"putIntoUseDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"disposalDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"type":"number"},{"type":"null"}]},"price":{"type":"number"},"accumulated":{"type":"number"},"residual":{"type":"number"},"taxResidual":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","inventoryNumber","name","kind","status","assetAccountCode","accumulatedAccountCode","acquisitionDate","putIntoUseDate","disposalDate","taxMethod","taxGroup","price","accumulated","residual","taxResidual"],"properties":{"id":{"type":"string"},"inventoryNumber":{"examples":["DM-0001"],"type":"string"},"name":{"type":"string"},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"in_use","type":"string"},{"const":"disposed","type":"string"}]},"assetAccountCode":{"examples":["022"],"type":"string"},"accumulatedAccountCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"acquisitionDate":{"type":"string"},"putIntoUseDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"disposalDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"type":"number"},{"type":"null"}]},"price":{"type":"number"},"accumulated":{"type":"number"},"residual":{"type":"number"},"taxResidual":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getApiV1LedgerAsset-list","tags":["ledger"],"description":"Fixed-asset register of an accounting entity with values (price incl. improvements, accumulated depreciation, residual values) as of a date."}},"/api/v1/ledger/cash-book":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Cash money account external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"registerId","required":true},{"examples":["2026-11-01"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-11-30"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"register":{"type":"object","required":["id","name","currency","accountCode","isActive"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"accountCode":{"examples":["211"],"type":"string"},"isActive":{"type":"boolean"}}},"from":{"type":"string"},"to":{"type":"string"},"opening":{"type":"number"},"receipts":{"type":"number"},"expenses":{"type":"number"},"otherMovements":{"type":"number"},"closing":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","documentNo","direction","purpose","status","issueDate","partnerName","description","total","balance"],"properties":{"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"examples":["sale"],"type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"posted","type":"string"},{"const":"reversed","type":"string"}]},"issueDate":{"type":"string"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string"},"total":{"type":"number"},"balance":{"type":"number"}}}}},"required":["register","from","to","opening","receipts","expenses","otherMovements","closing","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"register":{"type":"object","required":["id","name","currency","accountCode","isActive"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"accountCode":{"examples":["211"],"type":"string"},"isActive":{"type":"boolean"}}},"from":{"type":"string"},"to":{"type":"string"},"opening":{"type":"number"},"receipts":{"type":"number"},"expenses":{"type":"number"},"otherMovements":{"type":"number"},"closing":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","documentNo","direction","purpose","status","issueDate","partnerName","description","total","balance"],"properties":{"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"examples":["sale"],"type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"posted","type":"string"},{"const":"reversed","type":"string"}]},"issueDate":{"type":"string"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string"},"total":{"type":"number"},"balance":{"type":"number"}}}}},"required":["register","from","to","opening","receipts","expenses","otherMovements","closing","items"]}},"text/plain":{"schema":{"type":"object","properties":{"register":{"type":"object","required":["id","name","currency","accountCode","isActive"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"accountCode":{"examples":["211"],"type":"string"},"isActive":{"type":"boolean"}}},"from":{"type":"string"},"to":{"type":"string"},"opening":{"type":"number"},"receipts":{"type":"number"},"expenses":{"type":"number"},"otherMovements":{"type":"number"},"closing":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","documentNo","direction","purpose","status","issueDate","partnerName","description","total","balance"],"properties":{"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"examples":["sale"],"type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"posted","type":"string"},{"const":"reversed","type":"string"}]},"issueDate":{"type":"string"},"partnerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"type":"string"},"total":{"type":"number"},"balance":{"type":"number"}}}}},"required":["register","from","to","opening","receipts","expenses","otherMovements","closing","items"]}}}}},"operationId":"getApiV1LedgerCash-book","tags":["ledger"],"description":"Cash book of one cash register (cash money account) for a period: opening and closing balance from the ledger, receipts (PPD) and expenses (VPD) with a running balance, and other entries on the cash account."}},"/api/v1/ledger/inventory":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Fiscal period external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"periodId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","required":["id","fiscalYear","startsOn","endsOn"],"properties":{"id":{"type":"string"},"fiscalYear":{"type":"number"},"startsOn":{"type":"string"},"endsOn":{"type":"string"}}},"status":{"anyOf":[{"const":"not_started","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"}]},"asOf":{"anyOf":[{"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"inventoryDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"protocolRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["accountCode","accountName","method","book","counted","difference","resolution","adjustmentEntryNo"],"properties":{"accountCode":{"examples":["211"],"type":"string"},"accountName":{"type":"string"},"method":{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},"book":{"type":"number"},"counted":{"anyOf":[{"type":"number"},{"type":"null"}]},"difference":{"type":"number"},"resolution":{"anyOf":[{"const":"open","type":"string"},{"const":"resolved","type":"string"},{"const":"posted","type":"string"}]},"adjustmentEntryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["period","status","asOf","responsiblePerson","inventoryDate","protocolRef","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"period":{"type":"object","required":["id","fiscalYear","startsOn","endsOn"],"properties":{"id":{"type":"string"},"fiscalYear":{"type":"number"},"startsOn":{"type":"string"},"endsOn":{"type":"string"}}},"status":{"anyOf":[{"const":"not_started","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"}]},"asOf":{"anyOf":[{"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"inventoryDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"protocolRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["accountCode","accountName","method","book","counted","difference","resolution","adjustmentEntryNo"],"properties":{"accountCode":{"examples":["211"],"type":"string"},"accountName":{"type":"string"},"method":{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},"book":{"type":"number"},"counted":{"anyOf":[{"type":"number"},{"type":"null"}]},"difference":{"type":"number"},"resolution":{"anyOf":[{"const":"open","type":"string"},{"const":"resolved","type":"string"},{"const":"posted","type":"string"}]},"adjustmentEntryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["period","status","asOf","responsiblePerson","inventoryDate","protocolRef","items"]}},"text/plain":{"schema":{"type":"object","properties":{"period":{"type":"object","required":["id","fiscalYear","startsOn","endsOn"],"properties":{"id":{"type":"string"},"fiscalYear":{"type":"number"},"startsOn":{"type":"string"},"endsOn":{"type":"string"}}},"status":{"anyOf":[{"const":"not_started","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"}]},"asOf":{"anyOf":[{"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"inventoryDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"protocolRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["accountCode","accountName","method","book","counted","difference","resolution","adjustmentEntryNo"],"properties":{"accountCode":{"examples":["211"],"type":"string"},"accountName":{"type":"string"},"method":{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},"book":{"type":"number"},"counted":{"anyOf":[{"type":"number"},{"type":"null"}]},"difference":{"type":"number"},"resolution":{"anyOf":[{"const":"open","type":"string"},{"const":"resolved","type":"string"},{"const":"posted","type":"string"}]},"adjustmentEntryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["period","status","asOf","responsiblePerson","inventoryDate","protocolRef","items"]}}}}},"operationId":"getApiV1LedgerInventory","tags":["ledger"],"description":"Inventory of balance-sheet accounts for one fiscal period (§ 29–30 of the Czech Accounting Act): book balance at the balance-sheet date, actual (counted) balance, difference and how it was resolved."}},"/api/v1/ledger/stock-status":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Accounting entity id (from `/ledger/entity-list`).","examples":["Kq3vTnY8mZ0aB1cD2eF3gH4i"],"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-12-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false},{"description":"Warehouse external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"warehouseId","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"search","required":false},{"examples":["true"],"schema":{"type":"string"},"in":"query","name":"onlyInStock","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","code","name","unit","kind","productId","stockAccount","quantity","value","unitCost"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccount":{"examples":["132"],"type":"string"},"quantity":{"type":"number"},"value":{"type":"number"},"unitCost":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["asOf","total","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","code","name","unit","kind","productId","stockAccount","quantity","value","unitCost"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccount":{"examples":["132"],"type":"string"},"quantity":{"type":"number"},"value":{"type":"number"},"unitCost":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["asOf","total","items"]}},"text/plain":{"schema":{"type":"object","properties":{"asOf":{"type":"string"},"total":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","code","name","unit","kind","productId","stockAccount","quantity","value","unitCost"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccount":{"examples":["132"],"type":"string"},"quantity":{"type":"number"},"value":{"type":"number"},"unitCost":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["asOf","total","items"]}}}}},"operationId":"getApiV1LedgerStock-status","tags":["ledger"],"description":"Stock kept by method A: quantity, value and average unit cost of every stock card as of a date, for all warehouses or one. Values come from the posted stock movements (moving average or FIFO per warehouse)."}},"/api/v1/link-shorten/create-link":{"post":{"parameters":[],"responses":{"200":{"description":"Shortened link result.","content":{"application/json":{"schema":{"type":"object","properties":{"originalUrl":{"description":"The original URL that was shortened.","type":"string"},"shortUrl":{"description":"The generated short URL.","examples":["https://xhp.cz/my-link"],"type":"string"}},"required":["originalUrl","shortUrl"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"originalUrl":{"description":"The original URL that was shortened.","type":"string"},"shortUrl":{"description":"The generated short URL.","examples":["https://xhp.cz/my-link"],"type":"string"}},"required":["originalUrl","shortUrl"]}},"text/plain":{"schema":{"type":"object","properties":{"originalUrl":{"description":"The original URL that was shortened.","type":"string"},"shortUrl":{"description":"The generated short URL.","examples":["https://xhp.cz/my-link"],"type":"string"}},"required":["originalUrl","shortUrl"]}}}}},"operationId":"postApiV1Link-shortenCreate-link","tags":["linkShorten"],"summary":"Create a shortened link","description":"Creates a shortened URL. Optionally accepts a custom alias and expiration date. Returns both the original and the shortened URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"description":"The original URL to shorten.","examples":["https://example.com/very/long/path"],"type":"string"},"customAlias":{"description":"Custom short URL alias. If omitted, a random alias is generated.","examples":["my-link"],"type":"string"},"expiresAt":{"description":"Expiration date in ISO 8601 format. Link becomes invalid after this date.","examples":["2026-12-31T23:59:59Z"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["url"],"properties":{"url":{"description":"The original URL to shorten.","examples":["https://example.com/very/long/path"],"type":"string"},"customAlias":{"description":"Custom short URL alias. If omitted, a random alias is generated.","examples":["my-link"],"type":"string"},"expiresAt":{"description":"Expiration date in ISO 8601 format. Link becomes invalid after this date.","examples":["2026-12-31T23:59:59Z"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["url"],"properties":{"url":{"description":"The original URL to shorten.","examples":["https://example.com/very/long/path"],"type":"string"},"customAlias":{"description":"Custom short URL alias. If omitted, a random alias is generated.","examples":["my-link"],"type":"string"},"expiresAt":{"description":"Expiration date in ISO 8601 format. Link becomes invalid after this date.","examples":["2026-12-31T23:59:59Z"],"type":"string"}}}}}}}},"/api/v1/lock/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","alias","hasGateway","active"],"properties":{"lockId":{"description":"TTLock lock ID (external identifier).","type":"string"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway.","type":"boolean"},"active":{"description":"Whether the lock is active in the system.","type":"boolean"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","alias","hasGateway","active"],"properties":{"lockId":{"description":"TTLock lock ID (external identifier).","type":"string"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway.","type":"boolean"},"active":{"description":"Whether the lock is active in the system.","type":"boolean"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","alias","hasGateway","active"],"properties":{"lockId":{"description":"TTLock lock ID (external identifier).","type":"string"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway.","type":"boolean"},"active":{"description":"Whether the lock is active in the system.","type":"boolean"}}}}},"required":["items"]}}}}},"operationId":"getApiV1LockList","tags":["IoT"],"summary":"List locks","description":"Returns a simple list of all non-deleted TTLock smart locks for the organisation. Designed for mobile app usage — returns only essential fields needed for lock selection and status display."}},"/api/v1/lock/unlock":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"TTLock lock ID (external identifier).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"lockId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"True if the unlock command was sent successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"True if the unlock command was sent successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"True if the unlock command was sent successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1LockUnlock","tags":["IoT"],"summary":"Unlock lock remotely","description":"Sends an immediate remote unlock command to the specified lock via the TTLock API. The lock is identified by its TTLock lock ID (external identifier). Requires an active, non-deleted lock connected to a Wi-Fi gateway."}},"/api/v1/newsletter/register-contact":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"confirmed":{"description":"True when the subscription is active right away (single opt-in). False when a confirmation e-mail was sent or the contact was already on the list / opted out.","type":"boolean"}},"required":["success","confirmed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"confirmed":{"description":"True when the subscription is active right away (single opt-in). False when a confirmation e-mail was sent or the contact was already on the list / opted out.","type":"boolean"}},"required":["success","confirmed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"confirmed":{"description":"True when the subscription is active right away (single opt-in). False when a confirmation e-mail was sent or the contact was already on the list / opted out.","type":"boolean"}},"required":["success","confirmed"]}}}}},"operationId":"postApiV1NewsletterRegister-contact","tags":["newsletter"],"summary":"Register newsletter contact","description":"Registers a new contact for the newsletter. If the contact already exists, it is updated with the provided data. Optionally assigns the contact to one or more newsletter groups.\n\nBy default the contact receives the `newsletter-onboarding-contact` e-mail with a confirmation link (double opt-in) and the subscription is active after the click. Organisations with single opt-in enabled can skip the confirmation by sending `consent` (see the field). Contacts who opted out before are never re-subscribed without confirmation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"source":{"examples":["web","footer","social"],"description":"Signup source identifier for analytics.","type":"string"},"groups":{"description":"Newsletter group tags to assign to the contact.","type":"array","items":{"examples":["trainer","student","b2b"],"type":"string"}},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"consent":{"description":"Proof of the newsletter consent given at the form. Required for single opt-in: when the organisation enabled \"Newsletter without confirmation\" (config `newsletter_single_opt_in`) and this object is sent, the subscription is active immediately, the consent is recorded (wording, page URL, user agent, IP as geo record) and the contact receives the `newsletter-welcome-contact` e-mail with an unsubscribe link instead of the confirmation e-mail. Without it, or for contacts who unsubscribed before, double opt-in applies.","type":"object","required":["text"],"properties":{"text":{"minLength":1,"maxLength":2000,"description":"Exact consent wording shown next to the form, stored verbatim as proof of consent.","examples":["Zadáním e-mailu se přihlašuješ k odběru novinek GymRoom. Odhlásit se můžeš kdykoli."],"type":"string"},"url":{"maxLength":500,"description":"URL of the page with the form.","examples":["https://gymroom.cz/"],"type":"string"},"userAgent":{"maxLength":500,"description":"Visitor's browser user agent. Send it when calling from a server; defaults to the request's User-Agent.","type":"string"}}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"source":{"examples":["web","footer","social"],"description":"Signup source identifier for analytics.","type":"string"},"groups":{"description":"Newsletter group tags to assign to the contact.","type":"array","items":{"examples":["trainer","student","b2b"],"type":"string"}},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"consent":{"description":"Proof of the newsletter consent given at the form. Required for single opt-in: when the organisation enabled \"Newsletter without confirmation\" (config `newsletter_single_opt_in`) and this object is sent, the subscription is active immediately, the consent is recorded (wording, page URL, user agent, IP as geo record) and the contact receives the `newsletter-welcome-contact` e-mail with an unsubscribe link instead of the confirmation e-mail. Without it, or for contacts who unsubscribed before, double opt-in applies.","type":"object","required":["text"],"properties":{"text":{"minLength":1,"maxLength":2000,"description":"Exact consent wording shown next to the form, stored verbatim as proof of consent.","examples":["Zadáním e-mailu se přihlašuješ k odběru novinek GymRoom. Odhlásit se můžeš kdykoli."],"type":"string"},"url":{"maxLength":500,"description":"URL of the page with the form.","examples":["https://gymroom.cz/"],"type":"string"},"userAgent":{"maxLength":500,"description":"Visitor's browser user agent. Send it when calling from a server; defaults to the request's User-Agent.","type":"string"}}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"source":{"examples":["web","footer","social"],"description":"Signup source identifier for analytics.","type":"string"},"groups":{"description":"Newsletter group tags to assign to the contact.","type":"array","items":{"examples":["trainer","student","b2b"],"type":"string"}},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"consent":{"description":"Proof of the newsletter consent given at the form. Required for single opt-in: when the organisation enabled \"Newsletter without confirmation\" (config `newsletter_single_opt_in`) and this object is sent, the subscription is active immediately, the consent is recorded (wording, page URL, user agent, IP as geo record) and the contact receives the `newsletter-welcome-contact` e-mail with an unsubscribe link instead of the confirmation e-mail. Without it, or for contacts who unsubscribed before, double opt-in applies.","type":"object","required":["text"],"properties":{"text":{"minLength":1,"maxLength":2000,"description":"Exact consent wording shown next to the form, stored verbatim as proof of consent.","examples":["Zadáním e-mailu se přihlašuješ k odběru novinek GymRoom. Odhlásit se můžeš kdykoli."],"type":"string"},"url":{"maxLength":500,"description":"URL of the page with the form.","examples":["https://gymroom.cz/"],"type":"string"},"userAgent":{"maxLength":500,"description":"Visitor's browser user agent. Send it when calling from a server; defaults to the request's User-Agent.","type":"string"}}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/newsletter/unsubscribe-contact":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"unsubscribed":{"description":"False when the organisation has no contact with this e-mail address.","type":"boolean"}},"required":["success","unsubscribed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"unsubscribed":{"description":"False when the organisation has no contact with this e-mail address.","type":"boolean"}},"required":["success","unsubscribed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"unsubscribed":{"description":"False when the organisation has no contact with this e-mail address.","type":"boolean"}},"required":["success","unsubscribed"]}}}}},"operationId":"postApiV1NewsletterUnsubscribe-contact","tags":["newsletter"],"summary":"Unsubscribe newsletter contact","description":"Unsubscribes a contact of the organisation from the newsletter: the contact stops receiving bulk e-mails (reason `unsubscribed`) and a revoked newsletter consent is recorded with source `api`. Use it for unsubscribe forms and preference pages on your own website. Calling it again for an already unsubscribed contact is safe. An unknown e-mail is not an error: the response has `unsubscribed: false`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/ping/":{"get":{"responses":{"200":{"description":"Server info including request IDs, environment, location, and optional auth details.","content":{"application/json":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}},"multipart/form-data":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}},"text/plain":{"schema":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}},"operationId":"getApiV1Ping","tags":["ping"],"summary":"Ping","description":"Returns basic server information (app name, version, uptime). If a valid session is present, also returns organisation ID and login status."}},"/api/v1/ping/error":{"get":{"operationId":"getApiV1PingError","tags":["ping"],"summary":"Test error endpoint","description":"This endpoint always fails with a sample error. Useful for testing error handling and monitoring.","responses":{"200":{}}}},"/api/v1/ping/health":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"True if all health checks passed.","const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"True if all health checks passed.","const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"True if all health checks passed.","const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"getApiV1PingHealth","tags":["ping"],"summary":"Health check","description":"Performs basic health checks (database connectivity, etc.) and returns success if all checks pass."}},"/api/v1/shipment/delivery-point/search":{"get":{"parameters":[{"description":"Carrier code. Currently `gls` (ParcelShops and lockers, CZ + SK).","schema":{"type":"string","default":"gls","enum":["gls"]},"in":"query","name":"carrier","required":true},{"examples":["CZ"],"schema":{"type":"string","minLength":2,"maxLength":2},"in":"query","name":"country","required":false},{"description":"Words matched against name, street, city, ZIP and id.","examples":["Brno Lidická"],"schema":{"type":"string"},"in":"query","name":"query","required":false},{"examples":["49.1951"],"schema":{"type":"string"},"in":"query","name":"lat","required":false},{"examples":["16.6068"],"schema":{"type":"string"},"in":"query","name":"lng","required":false},{"schema":{"type":"string","default":"shop","enum":["shop","locker"]},"in":"query","name":"type","required":false},{"description":"`true` = only points accepting cash on delivery.","schema":{"type":"string"},"in":"query","name":"codOnly","required":false},{"description":"1 to 100, default 20.","examples":["20"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["carrierCode","pointId","country","type","name","street","city","zip","lat","lng","acceptsCod","openingHours","isActive"],"properties":{"carrierCode":{"examples":["gls"],"type":"string"},"pointId":{"examples":["CZ60200-PSHOP017"],"description":"Send this value as `deliveryPointId` on `POST /order/create`.","type":"string"},"country":{"examples":["CZ"],"type":"string"},"type":{"examples":["shop"],"description":"`shop` (ParcelShop) or `locker` (parcel box).","type":"string"},"name":{"examples":["PLODY MORAVY s.r.o."],"type":"string"},"street":{"examples":["Lidická 45"],"type":"string"},"city":{"examples":["Brno"],"type":"string"},"zip":{"examples":["60200"],"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"acceptsCod":{"description":"The point accepts cash on delivery parcels.","type":"boolean"},"openingHours":{"type":"array","items":{"type":"object","required":["day","from","to"],"properties":{"day":{"description":"ISO weekday, 1 = Monday.","type":"number"},"from":{"examples":["08:30"],"type":"string"},"to":{"examples":["18:00"],"type":"string"}}}},"isActive":{"description":"False when the point disappeared from the carrier list.","type":"boolean"},"distanceKm":{"description":"Distance from `lat`/`lng`, when they were sent.","type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["carrierCode","pointId","country","type","name","street","city","zip","lat","lng","acceptsCod","openingHours","isActive"],"properties":{"carrierCode":{"examples":["gls"],"type":"string"},"pointId":{"examples":["CZ60200-PSHOP017"],"description":"Send this value as `deliveryPointId` on `POST /order/create`.","type":"string"},"country":{"examples":["CZ"],"type":"string"},"type":{"examples":["shop"],"description":"`shop` (ParcelShop) or `locker` (parcel box).","type":"string"},"name":{"examples":["PLODY MORAVY s.r.o."],"type":"string"},"street":{"examples":["Lidická 45"],"type":"string"},"city":{"examples":["Brno"],"type":"string"},"zip":{"examples":["60200"],"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"acceptsCod":{"description":"The point accepts cash on delivery parcels.","type":"boolean"},"openingHours":{"type":"array","items":{"type":"object","required":["day","from","to"],"properties":{"day":{"description":"ISO weekday, 1 = Monday.","type":"number"},"from":{"examples":["08:30"],"type":"string"},"to":{"examples":["18:00"],"type":"string"}}}},"isActive":{"description":"False when the point disappeared from the carrier list.","type":"boolean"},"distanceKm":{"description":"Distance from `lat`/`lng`, when they were sent.","type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["carrierCode","pointId","country","type","name","street","city","zip","lat","lng","acceptsCod","openingHours","isActive"],"properties":{"carrierCode":{"examples":["gls"],"type":"string"},"pointId":{"examples":["CZ60200-PSHOP017"],"description":"Send this value as `deliveryPointId` on `POST /order/create`.","type":"string"},"country":{"examples":["CZ"],"type":"string"},"type":{"examples":["shop"],"description":"`shop` (ParcelShop) or `locker` (parcel box).","type":"string"},"name":{"examples":["PLODY MORAVY s.r.o."],"type":"string"},"street":{"examples":["Lidická 45"],"type":"string"},"city":{"examples":["Brno"],"type":"string"},"zip":{"examples":["60200"],"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"acceptsCod":{"description":"The point accepts cash on delivery parcels.","type":"boolean"},"openingHours":{"type":"array","items":{"type":"object","required":["day","from","to"],"properties":{"day":{"description":"ISO weekday, 1 = Monday.","type":"number"},"from":{"examples":["08:30"],"type":"string"},"to":{"examples":["18:00"],"type":"string"}}}},"isActive":{"description":"False when the point disappeared from the carrier list.","type":"boolean"},"distanceKm":{"description":"Distance from `lat`/`lng`, when they were sent.","type":"number"}}}}},"required":["items"]}}}}},"operationId":"getApiV1ShipmentDelivery-pointSearch","tags":["shipment"],"summary":"Search carrier pickup points","description":"Pickup points of a carrier (synced daily from the carrier). Use it to build the pickup point picker in your checkout, then send the chosen `pointId` as `deliveryPointId` on `POST /order/create`. With `lat`/`lng` the nearest points come first."}},"/api/v1/shipment/delivery-point/detail":{"get":{"parameters":[{"schema":{"type":"string","default":"gls","enum":["gls"]},"in":"query","name":"carrier","required":true},{"examples":["CZ60200-PSHOP017"],"schema":{"type":"string"},"in":"query","name":"pointId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"carrierCode":{"examples":["gls"],"type":"string"},"pointId":{"examples":["CZ60200-PSHOP017"],"description":"Send this value as `deliveryPointId` on `POST /order/create`.","type":"string"},"country":{"examples":["CZ"],"type":"string"},"type":{"examples":["shop"],"description":"`shop` (ParcelShop) or `locker` (parcel box).","type":"string"},"name":{"examples":["PLODY MORAVY s.r.o."],"type":"string"},"street":{"examples":["Lidická 45"],"type":"string"},"city":{"examples":["Brno"],"type":"string"},"zip":{"examples":["60200"],"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"acceptsCod":{"description":"The point accepts cash on delivery parcels.","type":"boolean"},"openingHours":{"type":"array","items":{"type":"object","required":["day","from","to"],"properties":{"day":{"description":"ISO weekday, 1 = Monday.","type":"number"},"from":{"examples":["08:30"],"type":"string"},"to":{"examples":["18:00"],"type":"string"}}}},"isActive":{"description":"False when the point disappeared from the carrier list.","type":"boolean"},"distanceKm":{"description":"Distance from `lat`/`lng`, when they were sent.","type":"number"}},"required":["carrierCode","pointId","country","type","name","street","city","zip","lat","lng","acceptsCod","openingHours","isActive"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"carrierCode":{"examples":["gls"],"type":"string"},"pointId":{"examples":["CZ60200-PSHOP017"],"description":"Send this value as `deliveryPointId` on `POST /order/create`.","type":"string"},"country":{"examples":["CZ"],"type":"string"},"type":{"examples":["shop"],"description":"`shop` (ParcelShop) or `locker` (parcel box).","type":"string"},"name":{"examples":["PLODY MORAVY s.r.o."],"type":"string"},"street":{"examples":["Lidická 45"],"type":"string"},"city":{"examples":["Brno"],"type":"string"},"zip":{"examples":["60200"],"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"acceptsCod":{"description":"The point accepts cash on delivery parcels.","type":"boolean"},"openingHours":{"type":"array","items":{"type":"object","required":["day","from","to"],"properties":{"day":{"description":"ISO weekday, 1 = Monday.","type":"number"},"from":{"examples":["08:30"],"type":"string"},"to":{"examples":["18:00"],"type":"string"}}}},"isActive":{"description":"False when the point disappeared from the carrier list.","type":"boolean"},"distanceKm":{"description":"Distance from `lat`/`lng`, when they were sent.","type":"number"}},"required":["carrierCode","pointId","country","type","name","street","city","zip","lat","lng","acceptsCod","openingHours","isActive"]}},"text/plain":{"schema":{"type":"object","properties":{"carrierCode":{"examples":["gls"],"type":"string"},"pointId":{"examples":["CZ60200-PSHOP017"],"description":"Send this value as `deliveryPointId` on `POST /order/create`.","type":"string"},"country":{"examples":["CZ"],"type":"string"},"type":{"examples":["shop"],"description":"`shop` (ParcelShop) or `locker` (parcel box).","type":"string"},"name":{"examples":["PLODY MORAVY s.r.o."],"type":"string"},"street":{"examples":["Lidická 45"],"type":"string"},"city":{"examples":["Brno"],"type":"string"},"zip":{"examples":["60200"],"type":"string"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}]},"lng":{"anyOf":[{"type":"number"},{"type":"null"}]},"acceptsCod":{"description":"The point accepts cash on delivery parcels.","type":"boolean"},"openingHours":{"type":"array","items":{"type":"object","required":["day","from","to"],"properties":{"day":{"description":"ISO weekday, 1 = Monday.","type":"number"},"from":{"examples":["08:30"],"type":"string"},"to":{"examples":["18:00"],"type":"string"}}}},"isActive":{"description":"False when the point disappeared from the carrier list.","type":"boolean"},"distanceKm":{"description":"Distance from `lat`/`lng`, when they were sent.","type":"number"}},"required":["carrierCode","pointId","country","type","name","street","city","zip","lat","lng","acceptsCod","openingHours","isActive"]}}}}},"operationId":"getApiV1ShipmentDelivery-pointDetail","tags":["shipment"],"summary":"Read one carrier pickup point"}},"/api/v1/shipment/{externalId}/tracking":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true}],"operationId":"getApiV1ShipmentByExternalIdTracking","tags":["shipment"],"summary":"Read tracking for a shipment","description":"Returns the current state + full event history for a shipment. Callers authenticate with an organisation-scoped API key; shipments belonging to a different organisation return 404.","responses":{"200":{}}}},"/api/v1/shipment/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["order","orderHash","state","shipmentId","error"],"properties":{"order":{"description":"The reference as sent.","type":"string"},"orderHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"description":"`existing` = the order already had an active shipment; nothing was sent to the carrier.","anyOf":[{"const":"created","type":"string"},{"const":"existing","type":"string"},{"const":"failed","type":"string"},{"const":"not_found","type":"string"}]},"shipmentId":{"description":"Shipment id for `/shipment/labels`.","anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["order","orderHash","state","shipmentId","error"],"properties":{"order":{"description":"The reference as sent.","type":"string"},"orderHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"description":"`existing` = the order already had an active shipment; nothing was sent to the carrier.","anyOf":[{"const":"created","type":"string"},{"const":"existing","type":"string"},{"const":"failed","type":"string"},{"const":"not_found","type":"string"}]},"shipmentId":{"description":"Shipment id for `/shipment/labels`.","anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["order","orderHash","state","shipmentId","error"],"properties":{"order":{"description":"The reference as sent.","type":"string"},"orderHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"description":"`existing` = the order already had an active shipment; nothing was sent to the carrier.","anyOf":[{"const":"created","type":"string"},{"const":"existing","type":"string"},{"const":"failed","type":"string"},{"const":"not_found","type":"string"}]},"shipmentId":{"description":"Shipment id for `/shipment/labels`.","anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"postApiV1ShipmentCreate","tags":["shipment"],"summary":"Create shipments for orders","description":"Creates the shipment of each order at the carrier with the carrier account, service, pickup point, weight and COD amount of its shipping method (the same rules as the admin). Never creates a second parcel: an order with an active shipment returns `existing`. Each order is reported on its own; a failure does not stop the others. At most 50 orders per call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orders"],"properties":{"orders":{"minItems":1,"maxItems":50,"description":"Order hashes or order numbers.","examples":[["2600001","2600002"]],"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["orders"],"properties":{"orders":{"minItems":1,"maxItems":50,"description":"Order hashes or order numbers.","examples":[["2600001","2600002"]],"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["orders"],"properties":{"orders":{"minItems":1,"maxItems":50,"description":"Order hashes or order numbers.","examples":[["2600001","2600002"]],"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}}}}}}}}},"/api/v1/shipment/labels":{"post":{"parameters":[],"operationId":"postApiV1ShipmentLabels","tags":["shipment"],"summary":"One PDF with the labels of several shipments","description":"Merges the stored labels in the order asked for and lays them out for printing. The orders are marked as \"label printed\", the same as printing from the admin. At most 200 shipments per call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"maxItems":200,"description":"Order hashes or order numbers; their active shipment is printed. Wins over `shipmentIds`.","type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}},"shipmentIds":{"maxItems":200,"type":"array","items":{"minLength":1,"maxLength":32,"type":"string"}},"layout":{"description":"`a4-2x2` = four labels per A4 sheet, `a6` = one per A6 page, `original` = carrier PDFs.","anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"description":"a4-2x2: first free cell (1–4).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"orders":{"maxItems":200,"description":"Order hashes or order numbers; their active shipment is printed. Wins over `shipmentIds`.","type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}},"shipmentIds":{"maxItems":200,"type":"array","items":{"minLength":1,"maxLength":32,"type":"string"}},"layout":{"description":"`a4-2x2` = four labels per A4 sheet, `a6` = one per A6 page, `original` = carrier PDFs.","anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"description":"a4-2x2: first free cell (1–4).","type":"number"}}}},"text/plain":{"schema":{"type":"object","properties":{"orders":{"maxItems":200,"description":"Order hashes or order numbers; their active shipment is printed. Wins over `shipmentIds`.","type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}},"shipmentIds":{"maxItems":200,"type":"array","items":{"minLength":1,"maxLength":32,"type":"string"}},"layout":{"description":"`a4-2x2` = four labels per A4 sheet, `a6` = one per A6 page, `original` = carrier PDFs.","anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"description":"a4-2x2: first free cell (1–4).","type":"number"}}}}}},"responses":{"200":{}}}},"/api/v1/post/post":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Canonical URL slug of the article in the requested locale (e.g. \"about\"). Preferred addressing mode for regular blog posts. Mutually exclusive with `id`.","examples":["about"],"schema":{"type":"string"},"in":"query","name":"slug","required":false},{"description":"Post external id (16-char string). Optional alternative to `slug` — pass this to fetch a post that has no canonical route, most notably a **branch document** (VOP / GDPR / provozní řád / reklamace) whose `postId` came from `/api/v1/branch/detail.documents.<slot>.postId`. Exactly one of `slug` or `id` must be supplied.","examples":["58714l4gSh9jZOLU"],"schema":{"type":"string"},"in":"query","name":"id","required":false},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false},{"examples":["asc","desc"],"schema":{"type":"string"},"in":"query","name":"sortDirection","required":false},{"description":"Optional ISO 3166-1 alpha-2 country code of the visitor (e.g. \"CZ\"). When set, the response is filtered to posts whose per-country / per-continent allowlist matches the visitor — a post targeted at continent \"EU\" matches every EU country, and a post with no rules stays globally available. When omitted, the filter is disabled and every post is returned regardless of geo settings. The API does NOT infer the country from the caller's IP; it is up to the caller to resolve and supply it. Case-insensitive. Unknown codes are rejected with HTTP 400 (`PUBLIC_COUNTRY_CODE_UNKNOWN`). The pseudo code `INT` selects the international (region-less) edition of a multi-region publication: only posts WITHOUT any country / continent rule.","examples":["CZ","DE","SK","INT"],"schema":{"type":"string","minLength":2,"maxLength":3},"in":"query","name":"country","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["id","author","authors","content","wordCount","readingTimeMinutes","route","routes","anchorList","perex","metaDescription","breadcrumb","related","tagList","attachments"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"type":"string"},"author":{"description":"Main author of the post — mirrors the entry in `authors` where `main === true`. Kept as a top-level field for backwards compatibility; new consumers should prefer `authors`.","type":"object","required":["name","profileSlug"],"properties":{"name":{"examples":["Jan Barášek"],"type":"string"},"profileSlug":{"examples":["71E58E5SjdZN6ut3"],"type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL resolved through the author cascade (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"bio":{"description":"Public bio resolved through the author cascade (locale override → primary locale → linked member `description_public`). Omitted for former authors — mirrors `/api/v1/post/author`.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"}}},"authors":{"description":"Ordered list of every author linked to the post via `content__post_author` → `content__author` (main author first, followed by co-authors in the order they were set in admin). The entry matching `content__post.main_author_id` carries `main: true`. Each entry exposes both `profileSlug` (opaque external id) and `slug` (routable URL slug).","type":"array","items":{"type":"object","required":["name","profileSlug","slug"],"properties":{"name":{"description":"Public byline name (author display name / pseudonym → contact name → linked user name). Empty string when no tier has one.","examples":["Jan Barášek"],"type":"string"},"profileSlug":{"description":"Author `shop__contact.external_id` (16-char, opaque). Machine-safe identifier — pass to `/api/v1/post/author?id=…` or use as a stable key across renames. NOT a routable URL slug (see `slug`).","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable URL slug of the author profile in the caller organisation. Feed it into your consumer's author URL pattern (e.g. `czechcyber.tv/autor/${slug}`) or pass to `/api/v1/post/author?slug=…`. Empty string when the author profile page is hidden (render the name without a link). Lazily backfilled server-side on first read — empty string only for degenerate contacts without a resolvable name/external id (vanishingly rare).","examples":["jan-barasek"],"type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL resolved through the author cascade (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"bio":{"description":"Public bio resolved through the author cascade (locale override → primary locale → linked member `description_public`). Omitted for former authors — mirrors `/api/v1/post/author`.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"jobTitle":{"description":"Localized job title (author locale override → linked member `job_title`). Omitted for former authors.","examples":["Analytik kybernetických hrozeb"],"type":"string"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"main":{"description":"Present and `true` on the main author only (mirrors `content__post.main_content_author_id`). Omitted on co-authors — use `authors.find(a => a.main)` to pick the main author.","examples":[true],"type":"boolean"}}}},"isStar":{"description":"True if the post is starred/pinned. Omitted when false.","type":"boolean"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"description":"Article title as **plain text, not HTML** (`content__post_locale.title`, trimmed). Identical to `title` in `/post/feed`. Characters such as `'`, `\"`, `&` and `<` are returned verbatim; the client escapes the value itself when writing it to HTML, `<title>`, breadcrumbs or JSON-LD. The title is never part of `content`. Omitted only when the locale row has an empty title.","type":"string"},"content":{"examples":["<p>Žijeme ve světě, kde je normální řídit...</p>"],"description":"Rendered HTML body (Markdown → HTML). Does not include the article title. Headings h2–h6 carry `id` anchors whose values are the keys of `anchorList`.","type":"string"},"paywalled":{"description":"true = the organisation enforces the paywall server-side (`post_paywall_enabled`) and this visitor has no active subscription, so `content` holds only the free part of the article. Show a subscription call-to-action after it. Subscribers get the full text and `paywalled: false`.","type":"boolean"},"paywallSource":{"description":"Why the article has a paid part: `separator` = manual `---` in the text, `default` = the organisation's default cut for older articles. Omitted when the article is fully free or the paywall is off.","anyOf":[{"const":"separator","type":"string"},{"const":"default","type":"string"}]},"wordCount":{"description":"Number of words in the post body (HTML tags stripped). 0 for empty posts.","examples":[842],"type":"number"},"readingTimeMinutes":{"description":"Estimated reading time in minutes at ~200 words per minute (Medium's convention). Minimum 1 for non-empty bodies, 0 for empty.","examples":[5],"type":"number"},"kind":{"examples":["post","branch"],"description":"Post kind code from `content__post_kind` (`post` for articles, `branch` for branch-owned documents). Only populated when the post was fetched by `id`; slug-based fetches omit it because the endpoint filters to `post` and the field would be redundant.","type":"string"},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"description":"Canonical URL slug of the post in the returned locale. Empty string when the post has no route (branch documents) — treat empty as \"no public URL\".","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"}}},"routes":{"description":"Cross-locale canonical routes for hreflang / sitemap. Empty array when the post has no routes (branch documents).","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"editions":{"description":"Editions (language × optional country) the post is published in. An unrestricted post lists one international edition (`countryCode: null`) per translated organisation language; it also appears in every regional edition of that language as a copy whose canonical URL is the international one. A post restricted to countries / continents lists one self-canonical regional edition per allowed country where a translated language is official (`core__country_language`), and no international edition. Omitted for posts fetched by `id` (branch documents).","type":"array","items":{"type":"object","required":["locale","countryCode","slug"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"countryCode":{"nullable":true,"anyOf":[{"examples":["CH"],"description":"ISO 3166-1 alpha-2 country of a regional edition, or null for the international edition of `locale`.","type":"string"},{"type":"null"}]},"slug":{"description":"Canonical slug of the post in `locale`.","type":"string"}}}},"anchorList":{"description":"Map of heading anchor id → heading text for h2–h6 in `content`. **Values are HTML** (the heading inner HTML, entity-escaped, e.g. `Why it&#39;s late`), unlike `title` / `perex`. Keys are the `id` attributes in `content` and are derived from that escaped text (e.g. `why-it-and-39s-late`); they are kept stable because published `#…` links point at them.","examples":[{"why-it-and-39s-late":"Why it&#39;s late"}],"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"perex":{"description":"Short lead paragraph as **plain text, not HTML**. The authored `content__post_locale.perex` when set, otherwise the first plain paragraph of the body with HTML entities decoded. Empty string when neither exists. The client escapes it at output time.","type":"string"},"metaTitle":{"description":"SEO `<title>` value authored in admin (separate from the visible article title). **Omitted (undefined) when the editor did not fill it in** — in that case the caller MUST fall back to `title` (or its own site convention) to render `<title>`. This mirrors `content__post_locale.meta_title` for the resolved locale.","examples":["KYBER CENA ROKU 2025 | Czech Cyber TV"],"type":"string"},"metaDescription":{"type":"string"},"publishedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Timestamp of the last update to the parent post. Populated on id-based fetches (useful for branch-doc revalidation); omitted on legacy slug-based fetches for backwards compatibility.","anyOf":[{"description":"Timestamp of the last update to the parent post. Populated on id-based fetches (useful for branch-doc revalidation); omitted on legacy slug-based fetches for backwards compatibility.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"mainCategory":{"description":"Main category of the post. Omitted for posts with no category (e.g. branch documents).","type":"object","required":["id","name","slug"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"}}},"breadcrumb":{"type":"array","items":{"type":"object","required":["slug","children"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"children":{"type":"array","items":{}}}}},"related":{"type":"array","items":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"slug":{"type":"string"}}}},"tagList":{"description":"Array of tags assigned to this post. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag.","examples":["#3B82F6"],"type":"string"}}}},"attachments":{"description":"Array of attachments linked to the post, ordered by upload date (oldest first). Empty array when the post has no attachments.","type":"array","items":{"description":"Attachment (e.g. original SPC PDF) linked to the post.","type":"object","required":["id","filename","downloadUrl","size","contentType"],"properties":{"id":{"description":"Blob token — stable identifier for the attachment (32-char string).","examples":["3e43IKfVwc4Bl2D40y5r0x7Uu3x0h9SS"],"type":"string"},"filename":{"description":"Human-readable filename of the attachment.","examples":["SPC-Ticagrelor.pdf"],"type":"string"},"downloadUrl":{"description":"Public URL from which the attachment can be downloaded / streamed.","examples":["https://storage.xhp.cz/..."],"type":"string"},"size":{"description":"Attachment size in bytes.","examples":[524288],"type":"number"},"contentType":{"description":"MIME type of the attachment.","examples":["application/pdf"],"type":"string"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Post \"about\" does not exist."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["id","author","authors","content","wordCount","readingTimeMinutes","route","routes","anchorList","perex","metaDescription","breadcrumb","related","tagList","attachments"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"type":"string"},"author":{"description":"Main author of the post — mirrors the entry in `authors` where `main === true`. Kept as a top-level field for backwards compatibility; new consumers should prefer `authors`.","type":"object","required":["name","profileSlug"],"properties":{"name":{"examples":["Jan Barášek"],"type":"string"},"profileSlug":{"examples":["71E58E5SjdZN6ut3"],"type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL resolved through the author cascade (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"bio":{"description":"Public bio resolved through the author cascade (locale override → primary locale → linked member `description_public`). Omitted for former authors — mirrors `/api/v1/post/author`.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"}}},"authors":{"description":"Ordered list of every author linked to the post via `content__post_author` → `content__author` (main author first, followed by co-authors in the order they were set in admin). The entry matching `content__post.main_author_id` carries `main: true`. Each entry exposes both `profileSlug` (opaque external id) and `slug` (routable URL slug).","type":"array","items":{"type":"object","required":["name","profileSlug","slug"],"properties":{"name":{"description":"Public byline name (author display name / pseudonym → contact name → linked user name). Empty string when no tier has one.","examples":["Jan Barášek"],"type":"string"},"profileSlug":{"description":"Author `shop__contact.external_id` (16-char, opaque). Machine-safe identifier — pass to `/api/v1/post/author?id=…` or use as a stable key across renames. NOT a routable URL slug (see `slug`).","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable URL slug of the author profile in the caller organisation. Feed it into your consumer's author URL pattern (e.g. `czechcyber.tv/autor/${slug}`) or pass to `/api/v1/post/author?slug=…`. Empty string when the author profile page is hidden (render the name without a link). Lazily backfilled server-side on first read — empty string only for degenerate contacts without a resolvable name/external id (vanishingly rare).","examples":["jan-barasek"],"type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL resolved through the author cascade (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"bio":{"description":"Public bio resolved through the author cascade (locale override → primary locale → linked member `description_public`). Omitted for former authors — mirrors `/api/v1/post/author`.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"jobTitle":{"description":"Localized job title (author locale override → linked member `job_title`). Omitted for former authors.","examples":["Analytik kybernetických hrozeb"],"type":"string"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"main":{"description":"Present and `true` on the main author only (mirrors `content__post.main_content_author_id`). Omitted on co-authors — use `authors.find(a => a.main)` to pick the main author.","examples":[true],"type":"boolean"}}}},"isStar":{"description":"True if the post is starred/pinned. Omitted when false.","type":"boolean"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"description":"Article title as **plain text, not HTML** (`content__post_locale.title`, trimmed). Identical to `title` in `/post/feed`. Characters such as `'`, `\"`, `&` and `<` are returned verbatim; the client escapes the value itself when writing it to HTML, `<title>`, breadcrumbs or JSON-LD. The title is never part of `content`. Omitted only when the locale row has an empty title.","type":"string"},"content":{"examples":["<p>Žijeme ve světě, kde je normální řídit...</p>"],"description":"Rendered HTML body (Markdown → HTML). Does not include the article title. Headings h2–h6 carry `id` anchors whose values are the keys of `anchorList`.","type":"string"},"paywalled":{"description":"true = the organisation enforces the paywall server-side (`post_paywall_enabled`) and this visitor has no active subscription, so `content` holds only the free part of the article. Show a subscription call-to-action after it. Subscribers get the full text and `paywalled: false`.","type":"boolean"},"paywallSource":{"description":"Why the article has a paid part: `separator` = manual `---` in the text, `default` = the organisation's default cut for older articles. Omitted when the article is fully free or the paywall is off.","anyOf":[{"const":"separator","type":"string"},{"const":"default","type":"string"}]},"wordCount":{"description":"Number of words in the post body (HTML tags stripped). 0 for empty posts.","examples":[842],"type":"number"},"readingTimeMinutes":{"description":"Estimated reading time in minutes at ~200 words per minute (Medium's convention). Minimum 1 for non-empty bodies, 0 for empty.","examples":[5],"type":"number"},"kind":{"examples":["post","branch"],"description":"Post kind code from `content__post_kind` (`post` for articles, `branch` for branch-owned documents). Only populated when the post was fetched by `id`; slug-based fetches omit it because the endpoint filters to `post` and the field would be redundant.","type":"string"},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"description":"Canonical URL slug of the post in the returned locale. Empty string when the post has no route (branch documents) — treat empty as \"no public URL\".","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"}}},"routes":{"description":"Cross-locale canonical routes for hreflang / sitemap. Empty array when the post has no routes (branch documents).","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"editions":{"description":"Editions (language × optional country) the post is published in. An unrestricted post lists one international edition (`countryCode: null`) per translated organisation language; it also appears in every regional edition of that language as a copy whose canonical URL is the international one. A post restricted to countries / continents lists one self-canonical regional edition per allowed country where a translated language is official (`core__country_language`), and no international edition. Omitted for posts fetched by `id` (branch documents).","type":"array","items":{"type":"object","required":["locale","countryCode","slug"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"countryCode":{"nullable":true,"anyOf":[{"examples":["CH"],"description":"ISO 3166-1 alpha-2 country of a regional edition, or null for the international edition of `locale`.","type":"string"},{"type":"null"}]},"slug":{"description":"Canonical slug of the post in `locale`.","type":"string"}}}},"anchorList":{"description":"Map of heading anchor id → heading text for h2–h6 in `content`. **Values are HTML** (the heading inner HTML, entity-escaped, e.g. `Why it&#39;s late`), unlike `title` / `perex`. Keys are the `id` attributes in `content` and are derived from that escaped text (e.g. `why-it-and-39s-late`); they are kept stable because published `#…` links point at them.","examples":[{"why-it-and-39s-late":"Why it&#39;s late"}],"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"perex":{"description":"Short lead paragraph as **plain text, not HTML**. The authored `content__post_locale.perex` when set, otherwise the first plain paragraph of the body with HTML entities decoded. Empty string when neither exists. The client escapes it at output time.","type":"string"},"metaTitle":{"description":"SEO `<title>` value authored in admin (separate from the visible article title). **Omitted (undefined) when the editor did not fill it in** — in that case the caller MUST fall back to `title` (or its own site convention) to render `<title>`. This mirrors `content__post_locale.meta_title` for the resolved locale.","examples":["KYBER CENA ROKU 2025 | Czech Cyber TV"],"type":"string"},"metaDescription":{"type":"string"},"publishedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Timestamp of the last update to the parent post. Populated on id-based fetches (useful for branch-doc revalidation); omitted on legacy slug-based fetches for backwards compatibility.","anyOf":[{"description":"Timestamp of the last update to the parent post. Populated on id-based fetches (useful for branch-doc revalidation); omitted on legacy slug-based fetches for backwards compatibility.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"mainCategory":{"description":"Main category of the post. Omitted for posts with no category (e.g. branch documents).","type":"object","required":["id","name","slug"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"}}},"breadcrumb":{"type":"array","items":{"type":"object","required":["slug","children"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"children":{"type":"array","items":{}}}}},"related":{"type":"array","items":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"slug":{"type":"string"}}}},"tagList":{"description":"Array of tags assigned to this post. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag.","examples":["#3B82F6"],"type":"string"}}}},"attachments":{"description":"Array of attachments linked to the post, ordered by upload date (oldest first). Empty array when the post has no attachments.","type":"array","items":{"description":"Attachment (e.g. original SPC PDF) linked to the post.","type":"object","required":["id","filename","downloadUrl","size","contentType"],"properties":{"id":{"description":"Blob token — stable identifier for the attachment (32-char string).","examples":["3e43IKfVwc4Bl2D40y5r0x7Uu3x0h9SS"],"type":"string"},"filename":{"description":"Human-readable filename of the attachment.","examples":["SPC-Ticagrelor.pdf"],"type":"string"},"downloadUrl":{"description":"Public URL from which the attachment can be downloaded / streamed.","examples":["https://storage.xhp.cz/..."],"type":"string"},"size":{"description":"Attachment size in bytes.","examples":[524288],"type":"number"},"contentType":{"description":"MIME type of the attachment.","examples":["application/pdf"],"type":"string"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Post \"about\" does not exist."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["id","author","authors","content","wordCount","readingTimeMinutes","route","routes","anchorList","perex","metaDescription","breadcrumb","related","tagList","attachments"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"type":"string"},"author":{"description":"Main author of the post — mirrors the entry in `authors` where `main === true`. Kept as a top-level field for backwards compatibility; new consumers should prefer `authors`.","type":"object","required":["name","profileSlug"],"properties":{"name":{"examples":["Jan Barášek"],"type":"string"},"profileSlug":{"examples":["71E58E5SjdZN6ut3"],"type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL resolved through the author cascade (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"bio":{"description":"Public bio resolved through the author cascade (locale override → primary locale → linked member `description_public`). Omitted for former authors — mirrors `/api/v1/post/author`.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"}}},"authors":{"description":"Ordered list of every author linked to the post via `content__post_author` → `content__author` (main author first, followed by co-authors in the order they were set in admin). The entry matching `content__post.main_author_id` carries `main: true`. Each entry exposes both `profileSlug` (opaque external id) and `slug` (routable URL slug).","type":"array","items":{"type":"object","required":["name","profileSlug","slug"],"properties":{"name":{"description":"Public byline name (author display name / pseudonym → contact name → linked user name). Empty string when no tier has one.","examples":["Jan Barášek"],"type":"string"},"profileSlug":{"description":"Author `shop__contact.external_id` (16-char, opaque). Machine-safe identifier — pass to `/api/v1/post/author?id=…` or use as a stable key across renames. NOT a routable URL slug (see `slug`).","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable URL slug of the author profile in the caller organisation. Feed it into your consumer's author URL pattern (e.g. `czechcyber.tv/autor/${slug}`) or pass to `/api/v1/post/author?slug=…`. Empty string when the author profile page is hidden (render the name without a link). Lazily backfilled server-side on first read — empty string only for degenerate contacts without a resolvable name/external id (vanishingly rare).","examples":["jan-barasek"],"type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL resolved through the author cascade (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"bio":{"description":"Public bio resolved through the author cascade (locale override → primary locale → linked member `description_public`). Omitted for former authors — mirrors `/api/v1/post/author`.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"jobTitle":{"description":"Localized job title (author locale override → linked member `job_title`). Omitted for former authors.","examples":["Analytik kybernetických hrozeb"],"type":"string"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"main":{"description":"Present and `true` on the main author only (mirrors `content__post.main_content_author_id`). Omitted on co-authors — use `authors.find(a => a.main)` to pick the main author.","examples":[true],"type":"boolean"}}}},"isStar":{"description":"True if the post is starred/pinned. Omitted when false.","type":"boolean"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"description":"Article title as **plain text, not HTML** (`content__post_locale.title`, trimmed). Identical to `title` in `/post/feed`. Characters such as `'`, `\"`, `&` and `<` are returned verbatim; the client escapes the value itself when writing it to HTML, `<title>`, breadcrumbs or JSON-LD. The title is never part of `content`. Omitted only when the locale row has an empty title.","type":"string"},"content":{"examples":["<p>Žijeme ve světě, kde je normální řídit...</p>"],"description":"Rendered HTML body (Markdown → HTML). Does not include the article title. Headings h2–h6 carry `id` anchors whose values are the keys of `anchorList`.","type":"string"},"paywalled":{"description":"true = the organisation enforces the paywall server-side (`post_paywall_enabled`) and this visitor has no active subscription, so `content` holds only the free part of the article. Show a subscription call-to-action after it. Subscribers get the full text and `paywalled: false`.","type":"boolean"},"paywallSource":{"description":"Why the article has a paid part: `separator` = manual `---` in the text, `default` = the organisation's default cut for older articles. Omitted when the article is fully free or the paywall is off.","anyOf":[{"const":"separator","type":"string"},{"const":"default","type":"string"}]},"wordCount":{"description":"Number of words in the post body (HTML tags stripped). 0 for empty posts.","examples":[842],"type":"number"},"readingTimeMinutes":{"description":"Estimated reading time in minutes at ~200 words per minute (Medium's convention). Minimum 1 for non-empty bodies, 0 for empty.","examples":[5],"type":"number"},"kind":{"examples":["post","branch"],"description":"Post kind code from `content__post_kind` (`post` for articles, `branch` for branch-owned documents). Only populated when the post was fetched by `id`; slug-based fetches omit it because the endpoint filters to `post` and the field would be redundant.","type":"string"},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"description":"Canonical URL slug of the post in the returned locale. Empty string when the post has no route (branch documents) — treat empty as \"no public URL\".","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"}}},"routes":{"description":"Cross-locale canonical routes for hreflang / sitemap. Empty array when the post has no routes (branch documents).","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"editions":{"description":"Editions (language × optional country) the post is published in. An unrestricted post lists one international edition (`countryCode: null`) per translated organisation language; it also appears in every regional edition of that language as a copy whose canonical URL is the international one. A post restricted to countries / continents lists one self-canonical regional edition per allowed country where a translated language is official (`core__country_language`), and no international edition. Omitted for posts fetched by `id` (branch documents).","type":"array","items":{"type":"object","required":["locale","countryCode","slug"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"countryCode":{"nullable":true,"anyOf":[{"examples":["CH"],"description":"ISO 3166-1 alpha-2 country of a regional edition, or null for the international edition of `locale`.","type":"string"},{"type":"null"}]},"slug":{"description":"Canonical slug of the post in `locale`.","type":"string"}}}},"anchorList":{"description":"Map of heading anchor id → heading text for h2–h6 in `content`. **Values are HTML** (the heading inner HTML, entity-escaped, e.g. `Why it&#39;s late`), unlike `title` / `perex`. Keys are the `id` attributes in `content` and are derived from that escaped text (e.g. `why-it-and-39s-late`); they are kept stable because published `#…` links point at them.","examples":[{"why-it-and-39s-late":"Why it&#39;s late"}],"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"perex":{"description":"Short lead paragraph as **plain text, not HTML**. The authored `content__post_locale.perex` when set, otherwise the first plain paragraph of the body with HTML entities decoded. Empty string when neither exists. The client escapes it at output time.","type":"string"},"metaTitle":{"description":"SEO `<title>` value authored in admin (separate from the visible article title). **Omitted (undefined) when the editor did not fill it in** — in that case the caller MUST fall back to `title` (or its own site convention) to render `<title>`. This mirrors `content__post_locale.meta_title` for the resolved locale.","examples":["KYBER CENA ROKU 2025 | Czech Cyber TV"],"type":"string"},"metaDescription":{"type":"string"},"publishedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Timestamp of the last update to the parent post. Populated on id-based fetches (useful for branch-doc revalidation); omitted on legacy slug-based fetches for backwards compatibility.","anyOf":[{"description":"Timestamp of the last update to the parent post. Populated on id-based fetches (useful for branch-doc revalidation); omitted on legacy slug-based fetches for backwards compatibility.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"mainCategory":{"description":"Main category of the post. Omitted for posts with no category (e.g. branch documents).","type":"object","required":["id","name","slug"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"}}},"breadcrumb":{"type":"array","items":{"type":"object","required":["slug","children"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"children":{"type":"array","items":{}}}}},"related":{"type":"array","items":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"slug":{"type":"string"}}}},"tagList":{"description":"Array of tags assigned to this post. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag.","examples":["#3B82F6"],"type":"string"}}}},"attachments":{"description":"Array of attachments linked to the post, ordered by upload date (oldest first). Empty array when the post has no attachments.","type":"array","items":{"description":"Attachment (e.g. original SPC PDF) linked to the post.","type":"object","required":["id","filename","downloadUrl","size","contentType"],"properties":{"id":{"description":"Blob token — stable identifier for the attachment (32-char string).","examples":["3e43IKfVwc4Bl2D40y5r0x7Uu3x0h9SS"],"type":"string"},"filename":{"description":"Human-readable filename of the attachment.","examples":["SPC-Ticagrelor.pdf"],"type":"string"},"downloadUrl":{"description":"Public URL from which the attachment can be downloaded / streamed.","examples":["https://storage.xhp.cz/..."],"type":"string"},"size":{"description":"Attachment size in bytes.","examples":[524288],"type":"number"},"contentType":{"description":"MIME type of the attachment.","examples":["application/pdf"],"type":"string"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Post \"about\" does not exist."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["id","author","authors","content","wordCount","readingTimeMinutes","route","routes","anchorList","perex","metaDescription","breadcrumb","related","tagList","attachments"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"type":"string"},"author":{"description":"Main author of the post — mirrors the entry in `authors` where `main === true`. Kept as a top-level field for backwards compatibility; new consumers should prefer `authors`.","type":"object","required":["name","profileSlug"],"properties":{"name":{"examples":["Jan Barášek"],"type":"string"},"profileSlug":{"examples":["71E58E5SjdZN6ut3"],"type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL resolved through the author cascade (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"bio":{"description":"Public bio resolved through the author cascade (locale override → primary locale → linked member `description_public`). Omitted for former authors — mirrors `/api/v1/post/author`.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"}}},"authors":{"description":"Ordered list of every author linked to the post via `content__post_author` → `content__author` (main author first, followed by co-authors in the order they were set in admin). The entry matching `content__post.main_author_id` carries `main: true`. Each entry exposes both `profileSlug` (opaque external id) and `slug` (routable URL slug).","type":"array","items":{"type":"object","required":["name","profileSlug","slug"],"properties":{"name":{"description":"Public byline name (author display name / pseudonym → contact name → linked user name). Empty string when no tier has one.","examples":["Jan Barášek"],"type":"string"},"profileSlug":{"description":"Author `shop__contact.external_id` (16-char, opaque). Machine-safe identifier — pass to `/api/v1/post/author?id=…` or use as a stable key across renames. NOT a routable URL slug (see `slug`).","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable URL slug of the author profile in the caller organisation. Feed it into your consumer's author URL pattern (e.g. `czechcyber.tv/autor/${slug}`) or pass to `/api/v1/post/author?slug=…`. Empty string when the author profile page is hidden (render the name without a link). Lazily backfilled server-side on first read — empty string only for degenerate contacts without a resolvable name/external id (vanishingly rare).","examples":["jan-barasek"],"type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL resolved through the author cascade (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"bio":{"description":"Public bio resolved through the author cascade (locale override → primary locale → linked member `description_public`). Omitted for former authors — mirrors `/api/v1/post/author`.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"jobTitle":{"description":"Localized job title (author locale override → linked member `job_title`). Omitted for former authors.","examples":["Analytik kybernetických hrozeb"],"type":"string"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"main":{"description":"Present and `true` on the main author only (mirrors `content__post.main_content_author_id`). Omitted on co-authors — use `authors.find(a => a.main)` to pick the main author.","examples":[true],"type":"boolean"}}}},"isStar":{"description":"True if the post is starred/pinned. Omitted when false.","type":"boolean"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"description":"Article title as **plain text, not HTML** (`content__post_locale.title`, trimmed). Identical to `title` in `/post/feed`. Characters such as `'`, `\"`, `&` and `<` are returned verbatim; the client escapes the value itself when writing it to HTML, `<title>`, breadcrumbs or JSON-LD. The title is never part of `content`. Omitted only when the locale row has an empty title.","type":"string"},"content":{"examples":["<p>Žijeme ve světě, kde je normální řídit...</p>"],"description":"Rendered HTML body (Markdown → HTML). Does not include the article title. Headings h2–h6 carry `id` anchors whose values are the keys of `anchorList`.","type":"string"},"paywalled":{"description":"true = the organisation enforces the paywall server-side (`post_paywall_enabled`) and this visitor has no active subscription, so `content` holds only the free part of the article. Show a subscription call-to-action after it. Subscribers get the full text and `paywalled: false`.","type":"boolean"},"paywallSource":{"description":"Why the article has a paid part: `separator` = manual `---` in the text, `default` = the organisation's default cut for older articles. Omitted when the article is fully free or the paywall is off.","anyOf":[{"const":"separator","type":"string"},{"const":"default","type":"string"}]},"wordCount":{"description":"Number of words in the post body (HTML tags stripped). 0 for empty posts.","examples":[842],"type":"number"},"readingTimeMinutes":{"description":"Estimated reading time in minutes at ~200 words per minute (Medium's convention). Minimum 1 for non-empty bodies, 0 for empty.","examples":[5],"type":"number"},"kind":{"examples":["post","branch"],"description":"Post kind code from `content__post_kind` (`post` for articles, `branch` for branch-owned documents). Only populated when the post was fetched by `id`; slug-based fetches omit it because the endpoint filters to `post` and the field would be redundant.","type":"string"},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"description":"Canonical URL slug of the post in the returned locale. Empty string when the post has no route (branch documents) — treat empty as \"no public URL\".","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"}}},"routes":{"description":"Cross-locale canonical routes for hreflang / sitemap. Empty array when the post has no routes (branch documents).","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"editions":{"description":"Editions (language × optional country) the post is published in. An unrestricted post lists one international edition (`countryCode: null`) per translated organisation language; it also appears in every regional edition of that language as a copy whose canonical URL is the international one. A post restricted to countries / continents lists one self-canonical regional edition per allowed country where a translated language is official (`core__country_language`), and no international edition. Omitted for posts fetched by `id` (branch documents).","type":"array","items":{"type":"object","required":["locale","countryCode","slug"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"countryCode":{"nullable":true,"anyOf":[{"examples":["CH"],"description":"ISO 3166-1 alpha-2 country of a regional edition, or null for the international edition of `locale`.","type":"string"},{"type":"null"}]},"slug":{"description":"Canonical slug of the post in `locale`.","type":"string"}}}},"anchorList":{"description":"Map of heading anchor id → heading text for h2–h6 in `content`. **Values are HTML** (the heading inner HTML, entity-escaped, e.g. `Why it&#39;s late`), unlike `title` / `perex`. Keys are the `id` attributes in `content` and are derived from that escaped text (e.g. `why-it-and-39s-late`); they are kept stable because published `#…` links point at them.","examples":[{"why-it-and-39s-late":"Why it&#39;s late"}],"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"perex":{"description":"Short lead paragraph as **plain text, not HTML**. The authored `content__post_locale.perex` when set, otherwise the first plain paragraph of the body with HTML entities decoded. Empty string when neither exists. The client escapes it at output time.","type":"string"},"metaTitle":{"description":"SEO `<title>` value authored in admin (separate from the visible article title). **Omitted (undefined) when the editor did not fill it in** — in that case the caller MUST fall back to `title` (or its own site convention) to render `<title>`. This mirrors `content__post_locale.meta_title` for the resolved locale.","examples":["KYBER CENA ROKU 2025 | Czech Cyber TV"],"type":"string"},"metaDescription":{"type":"string"},"publishedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Timestamp of the last update to the parent post. Populated on id-based fetches (useful for branch-doc revalidation); omitted on legacy slug-based fetches for backwards compatibility.","anyOf":[{"description":"Timestamp of the last update to the parent post. Populated on id-based fetches (useful for branch-doc revalidation); omitted on legacy slug-based fetches for backwards compatibility.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"mainCategory":{"description":"Main category of the post. Omitted for posts with no category (e.g. branch documents).","type":"object","required":["id","name","slug"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"slug":{"type":"string"}}},"breadcrumb":{"type":"array","items":{"type":"object","required":["slug","children"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"children":{"type":"array","items":{}}}}},"related":{"type":"array","items":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"slug":{"type":"string"}}}},"tagList":{"description":"Array of tags assigned to this post. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag.","examples":["#3B82F6"],"type":"string"}}}},"attachments":{"description":"Array of attachments linked to the post, ordered by upload date (oldest first). Empty array when the post has no attachments.","type":"array","items":{"description":"Attachment (e.g. original SPC PDF) linked to the post.","type":"object","required":["id","filename","downloadUrl","size","contentType"],"properties":{"id":{"description":"Blob token — stable identifier for the attachment (32-char string).","examples":["3e43IKfVwc4Bl2D40y5r0x7Uu3x0h9SS"],"type":"string"},"filename":{"description":"Human-readable filename of the attachment.","examples":["SPC-Ticagrelor.pdf"],"type":"string"},"downloadUrl":{"description":"Public URL from which the attachment can be downloaded / streamed.","examples":["https://storage.xhp.cz/..."],"type":"string"},"size":{"description":"Attachment size in bytes.","examples":[524288],"type":"number"},"contentType":{"description":"MIME type of the attachment.","examples":["application/pdf"],"type":"string"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Post \"about\" does not exist."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostPost","tags":["post"],"summary":"Get post detail","description":"Returns the full detail of a post, including title, markdown content, routes, breadcrumbs, related posts and tags. Returns an error object (`state: \"error\"`) if the post does not exist or if neither `slug` nor `id` was supplied.\n\nTwo addressing modes:\n- `slug` — canonical URL slug in the requested locale. Use for blog / marketing articles.\n- `id` — post external id (16-char string). Use for posts that have no canonical URL, notably **branch documents**: obtain the `postId` from `GET /api/v1/branch/detail?apiKey=…&slug=<branch>&locale=<loc>` under `documents.<termsOfBusiness|reclaim|gdpr|operatingRules>.postId`, then call `GET /api/v1/post/post?apiKey=…&id=<postId>&locale=<loc>` to fetch the body.\n\nFor posts without a route/main-category (branch docs), `route.slug` is empty, `mainCategory` is omitted, and `breadcrumb` / `related` are empty arrays — the rest of the response mirrors the slug-based fetch exactly, so a single renderer can handle both.\n\nThe response also carries `wordCount` and `readingTimeMinutes` derived from the HTML body (tags stripped, ~200 words per minute — Medium's convention); both are `0` for empty posts."}},"/api/v1/post/create":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"External id of the created or updated post (use this in /post, /feed, etc.).","type":"string"},"code":{"nullable":true,"anyOf":[{"examples":["chatspc-SUKL12345-2026-04-27"],"description":"Echo of the supplied `code`, or null when none was provided.","type":"string"},{"type":"null"}]},"created":{"description":"True when a new post was inserted; false when an existing post (matched by code) was updated.","type":"boolean"}},"required":["success","id","code","created"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"External id of the created or updated post (use this in /post, /feed, etc.).","type":"string"},"code":{"nullable":true,"anyOf":[{"examples":["chatspc-SUKL12345-2026-04-27"],"description":"Echo of the supplied `code`, or null when none was provided.","type":"string"},{"type":"null"}]},"created":{"description":"True when a new post was inserted; false when an existing post (matched by code) was updated.","type":"boolean"}},"required":["success","id","code","created"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"External id of the created or updated post (use this in /post, /feed, etc.).","type":"string"},"code":{"nullable":true,"anyOf":[{"examples":["chatspc-SUKL12345-2026-04-27"],"description":"Echo of the supplied `code`, or null when none was provided.","type":"string"},{"type":"null"}]},"created":{"description":"True when a new post was inserted; false when an existing post (matched by code) was updated.","type":"boolean"}},"required":["success","id","code","created"]}}}}},"operationId":"postApiV1PostCreate","tags":["post"],"summary":"Create or update a post (idempotent upsert by code)","description":"Creates a new post for the authenticated organisation, or — when `code` is provided and a post with the same code already exists in the organisation — updates that post in place.\n\nOn update, the per-locale row (title, content, perex) is overwritten for the supplied `locale` via an upsert on `(post_id, locale_id)`; other locales are left untouched. `updatedDate` is bumped on every successful call. Visibility transitions out of `private` trigger a `publishedDate` stamp when one is not already set.\n\nThis endpoint is intended for batch importers (e.g. ChatSPC SPC ingestion) that need to push the same article repeatedly without producing duplicates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","content","locale"],"properties":{"code":{"maxLength":64,"examples":["chatspc-sukl12345-2026-04-27"],"description":"Optional caller-supplied stable identifier for this article. When omitted (or empty), a new post is always inserted. When provided, the post is matched within the organisation by `code`: an existing post with the same code is updated in place, a missing one is inserted with that code attached. This makes /create idempotent for batch importers — the same call with the same code can be safely retried or used to push content updates.","type":"string"},"title":{"minLength":1,"examples":["KYBER CENA ROKU 2025"],"description":"Post title (single-line plain text).","type":"string"},"content":{"examples":["<p>Žijeme ve světě, kde…</p>"],"description":"Post body. HTML is preserved; whitespace is normalized.","type":"string"},"perex":{"examples":["Třetí ročník vyhlášení proběhl 9. října 2025…"],"description":"Short summary / teaser. Stored in the locale row alongside title and content.","type":"string"},"visibility":{"default":"public","description":"Post visibility. Defaults to `public`. Updates may change visibility; transitioning out of `private` triggers a publishedDate stamp if not already set.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"mainCategory":{"examples":["novinky"],"description":"External id of the category to assign as `mainCategory`. On insert, when omitted the platform falls back to the first active category and attempts AI-based categorization in the background. On update, when omitted the existing category is left untouched.","type":"string"},"mainAuthorCuRefNo":{"maxLength":16,"minLength":16,"examples":["1cGIHvFoQDGLAbcA"],"description":"Optional cuRefNo of the contact to attribute as the main author on insert. When omitted the organisation’s internal customer is used. Ignored on update.","type":"string"},"commitMessage":{"examples":["Weekly SÚKL ingest 2026-04-27"],"description":"Optional human-readable commit message recorded on the version history entry for this call. When omitted, the system fills a sensible default (e.g. `Initial version via /api/v1/post/create (code=…)` or `Update via /api/v1/post/create (code=…)`).","type":"string"},"metadata":{"examples":[{"sukl_code":"SUKL12345","version_date":"2026-04-27","pdf_sha256":"8f2c…","page_count":"42","ingested_at":"2026-04-27T10:11:12Z"}],"description":"Optional structured key/value metadata bag merged into `content__post_meta` after the post upsert. Designed for external integrations (e.g. ChatSPC) that need to attach provenance — `sukl_code`, `version_date`, `pdf_sha256`, `page_count`, `suspicious_pages`, `ingested_at`, … — without operating their own database. Read it back via `/api/v1/post/meta`. Pass `null` for a key to clear it. Keys must fit 64 chars; values are strings — stringify your numbers/booleans before sending.","type":"object","patternProperties":{"^(.*)$":{}}},"attachments":{"examples":[[{"id":"aBcDeFgHiJkLmNoPqRsTuVwXyZ012345"},{"id":"fEdCbA9876543210fEdCbA9876543210"}]],"description":"Optional list of blob attachments to link to the post.\n\nOn **insert** the supplied attachments become the post’s initial attachment set. On **update** they are appended to the post’s existing set — this endpoint never removes attachments. Use the admin (/bff/post/post-attachment-delete) to detach.\n\nDuplicate tokens inside one call, and tokens that are already attached to the post, are silently collapsed — a blob is never linked twice to the same post. If any supplied token does not exist or belongs to a different organisation, the whole call is aborted before any change is written to the post.","type":"array","items":{"type":"object","required":["id"],"properties":{"id":{"minLength":32,"maxLength":32,"examples":["aBcDeFgHiJkLmNoPqRsTuVwXyZ012345"],"description":"Blob token (32-char string) returned by /api/v1/blob/upload. The blob must belong to the same organisation as the API key; cross-organisation tokens are rejected and the whole call fails before any write.","type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["title","content","locale"],"properties":{"code":{"maxLength":64,"examples":["chatspc-sukl12345-2026-04-27"],"description":"Optional caller-supplied stable identifier for this article. When omitted (or empty), a new post is always inserted. When provided, the post is matched within the organisation by `code`: an existing post with the same code is updated in place, a missing one is inserted with that code attached. This makes /create idempotent for batch importers — the same call with the same code can be safely retried or used to push content updates.","type":"string"},"title":{"minLength":1,"examples":["KYBER CENA ROKU 2025"],"description":"Post title (single-line plain text).","type":"string"},"content":{"examples":["<p>Žijeme ve světě, kde…</p>"],"description":"Post body. HTML is preserved; whitespace is normalized.","type":"string"},"perex":{"examples":["Třetí ročník vyhlášení proběhl 9. října 2025…"],"description":"Short summary / teaser. Stored in the locale row alongside title and content.","type":"string"},"visibility":{"default":"public","description":"Post visibility. Defaults to `public`. Updates may change visibility; transitioning out of `private` triggers a publishedDate stamp if not already set.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"mainCategory":{"examples":["novinky"],"description":"External id of the category to assign as `mainCategory`. On insert, when omitted the platform falls back to the first active category and attempts AI-based categorization in the background. On update, when omitted the existing category is left untouched.","type":"string"},"mainAuthorCuRefNo":{"maxLength":16,"minLength":16,"examples":["1cGIHvFoQDGLAbcA"],"description":"Optional cuRefNo of the contact to attribute as the main author on insert. When omitted the organisation’s internal customer is used. Ignored on update.","type":"string"},"commitMessage":{"examples":["Weekly SÚKL ingest 2026-04-27"],"description":"Optional human-readable commit message recorded on the version history entry for this call. When omitted, the system fills a sensible default (e.g. `Initial version via /api/v1/post/create (code=…)` or `Update via /api/v1/post/create (code=…)`).","type":"string"},"metadata":{"examples":[{"sukl_code":"SUKL12345","version_date":"2026-04-27","pdf_sha256":"8f2c…","page_count":"42","ingested_at":"2026-04-27T10:11:12Z"}],"description":"Optional structured key/value metadata bag merged into `content__post_meta` after the post upsert. Designed for external integrations (e.g. ChatSPC) that need to attach provenance — `sukl_code`, `version_date`, `pdf_sha256`, `page_count`, `suspicious_pages`, `ingested_at`, … — without operating their own database. Read it back via `/api/v1/post/meta`. Pass `null` for a key to clear it. Keys must fit 64 chars; values are strings — stringify your numbers/booleans before sending.","type":"object","patternProperties":{"^(.*)$":{}}},"attachments":{"examples":[[{"id":"aBcDeFgHiJkLmNoPqRsTuVwXyZ012345"},{"id":"fEdCbA9876543210fEdCbA9876543210"}]],"description":"Optional list of blob attachments to link to the post.\n\nOn **insert** the supplied attachments become the post’s initial attachment set. On **update** they are appended to the post’s existing set — this endpoint never removes attachments. Use the admin (/bff/post/post-attachment-delete) to detach.\n\nDuplicate tokens inside one call, and tokens that are already attached to the post, are silently collapsed — a blob is never linked twice to the same post. If any supplied token does not exist or belongs to a different organisation, the whole call is aborted before any change is written to the post.","type":"array","items":{"type":"object","required":["id"],"properties":{"id":{"minLength":32,"maxLength":32,"examples":["aBcDeFgHiJkLmNoPqRsTuVwXyZ012345"],"description":"Blob token (32-char string) returned by /api/v1/blob/upload. The blob must belong to the same organisation as the API key; cross-organisation tokens are rejected and the whole call fails before any write.","type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","required":["title","content","locale"],"properties":{"code":{"maxLength":64,"examples":["chatspc-sukl12345-2026-04-27"],"description":"Optional caller-supplied stable identifier for this article. When omitted (or empty), a new post is always inserted. When provided, the post is matched within the organisation by `code`: an existing post with the same code is updated in place, a missing one is inserted with that code attached. This makes /create idempotent for batch importers — the same call with the same code can be safely retried or used to push content updates.","type":"string"},"title":{"minLength":1,"examples":["KYBER CENA ROKU 2025"],"description":"Post title (single-line plain text).","type":"string"},"content":{"examples":["<p>Žijeme ve světě, kde…</p>"],"description":"Post body. HTML is preserved; whitespace is normalized.","type":"string"},"perex":{"examples":["Třetí ročník vyhlášení proběhl 9. října 2025…"],"description":"Short summary / teaser. Stored in the locale row alongside title and content.","type":"string"},"visibility":{"default":"public","description":"Post visibility. Defaults to `public`. Updates may change visibility; transitioning out of `private` triggers a publishedDate stamp if not already set.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"mainCategory":{"examples":["novinky"],"description":"External id of the category to assign as `mainCategory`. On insert, when omitted the platform falls back to the first active category and attempts AI-based categorization in the background. On update, when omitted the existing category is left untouched.","type":"string"},"mainAuthorCuRefNo":{"maxLength":16,"minLength":16,"examples":["1cGIHvFoQDGLAbcA"],"description":"Optional cuRefNo of the contact to attribute as the main author on insert. When omitted the organisation’s internal customer is used. Ignored on update.","type":"string"},"commitMessage":{"examples":["Weekly SÚKL ingest 2026-04-27"],"description":"Optional human-readable commit message recorded on the version history entry for this call. When omitted, the system fills a sensible default (e.g. `Initial version via /api/v1/post/create (code=…)` or `Update via /api/v1/post/create (code=…)`).","type":"string"},"metadata":{"examples":[{"sukl_code":"SUKL12345","version_date":"2026-04-27","pdf_sha256":"8f2c…","page_count":"42","ingested_at":"2026-04-27T10:11:12Z"}],"description":"Optional structured key/value metadata bag merged into `content__post_meta` after the post upsert. Designed for external integrations (e.g. ChatSPC) that need to attach provenance — `sukl_code`, `version_date`, `pdf_sha256`, `page_count`, `suspicious_pages`, `ingested_at`, … — without operating their own database. Read it back via `/api/v1/post/meta`. Pass `null` for a key to clear it. Keys must fit 64 chars; values are strings — stringify your numbers/booleans before sending.","type":"object","patternProperties":{"^(.*)$":{}}},"attachments":{"examples":[[{"id":"aBcDeFgHiJkLmNoPqRsTuVwXyZ012345"},{"id":"fEdCbA9876543210fEdCbA9876543210"}]],"description":"Optional list of blob attachments to link to the post.\n\nOn **insert** the supplied attachments become the post’s initial attachment set. On **update** they are appended to the post’s existing set — this endpoint never removes attachments. Use the admin (/bff/post/post-attachment-delete) to detach.\n\nDuplicate tokens inside one call, and tokens that are already attached to the post, are silently collapsed — a blob is never linked twice to the same post. If any supplied token does not exist or belongs to a different organisation, the whole call is aborted before any change is written to the post.","type":"array","items":{"type":"object","required":["id"],"properties":{"id":{"minLength":32,"maxLength":32,"examples":["aBcDeFgHiJkLmNoPqRsTuVwXyZ012345"],"description":"Blob token (32-char string) returned by /api/v1/blob/upload. The blob must belong to the same organisation as the API key; cross-organisation tokens are rejected and the whole call fails before any write.","type":"string"}}}}}}}}}}},"/api/v1/post/view":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"postApiV1PostView","tags":["post"],"summary":"Track a post view","description":"Records one page view for a post — increments the same `views_count` counter that `GET /post/post` uses, via the shared Redis buffer flushed every 5 min.\n\n**Why a separate endpoint?** When `docs/` (or any consumer) serves pages via ISR or a long-lived server cache, the upstream `GET /post/post` is called once per cache window, not once per actual visitor. Firing this endpoint client-side after each real page load gives accurate per-visitor counts without re-fetching the full article.\n\n**GeoIP side effect:** when `customerRealIp` is supplied (or can be inferred from Vercel edge headers), the IP is registered in `brj__geo_ip`. This is a best-effort operation — a lookup failure never blocks the view count. The registered record is enriched in the background by the existing geo-IP cron and will be the foundation for visitor-origin analytics in a future release.\n\n**`identityId`** is accepted for forward-compatibility but is not yet used for unique-view deduplication. Pass the same value you use in `GET /post/post`.\n\n**Double-count note:** if your integration calls both `GET /post/post` (server-side) and `POST /post/view` (client-side) for the same page load, the first uncached server-side fetch will count one extra view. For ISR-heavy sites this is negligible; for high-precision analytics, avoid calling `GET /post/post` from your renderer and rely solely on this endpoint.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"minLength":1,"examples":["nazev-clanku"],"description":"Canonical URL slug of the article to record a view for.","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}},"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"minLength":1,"examples":["nazev-clanku"],"description":"Canonical URL slug of the article to record a view for.","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}},"additionalProperties":false}},"text/plain":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"minLength":1,"examples":["nazev-clanku"],"description":"Canonical URL slug of the article to record a view for.","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}},"additionalProperties":false}}}}}},"/api/v1/post/history":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Post public id (content__post.external_id).","examples":["6IU2SWgP76FO2UXw"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["postId","locale","items"],"properties":{"postId":{"description":"Echo of the post external id.","type":"string"},"locale":{"nullable":true,"anyOf":[{"description":"Echo of the locale filter, or null when none was applied.","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","insertedDate","locale","title","commitMessage","contentSize","author"],"properties":{"id":{"examples":["vErSiOnHaNdLe123"],"description":"Version handle (16 chars). Pass to /history/version to read the body.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"description":"Locale code of this revision (e.g. \"cs\", \"en\").","type":"string"},"title":{"description":"Snapshot of the post title at this revision.","type":"string"},"commitMessage":{"nullable":true,"anyOf":[{"description":"Optional human commit message; null for auto-versions.","type":"string"},{"type":"null"}]},"contentSize":{"description":"Byte size of the content blob.","type":"number"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"description":"cuRefNo of the author contact.","type":"string"},{"type":"null"}]},"name":{"description":"Display name of the author.","type":"string"}}}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["postId","locale","items"],"properties":{"postId":{"description":"Echo of the post external id.","type":"string"},"locale":{"nullable":true,"anyOf":[{"description":"Echo of the locale filter, or null when none was applied.","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","insertedDate","locale","title","commitMessage","contentSize","author"],"properties":{"id":{"examples":["vErSiOnHaNdLe123"],"description":"Version handle (16 chars). Pass to /history/version to read the body.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"description":"Locale code of this revision (e.g. \"cs\", \"en\").","type":"string"},"title":{"description":"Snapshot of the post title at this revision.","type":"string"},"commitMessage":{"nullable":true,"anyOf":[{"description":"Optional human commit message; null for auto-versions.","type":"string"},{"type":"null"}]},"contentSize":{"description":"Byte size of the content blob.","type":"number"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"description":"cuRefNo of the author contact.","type":"string"},{"type":"null"}]},"name":{"description":"Display name of the author.","type":"string"}}}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["postId","locale","items"],"properties":{"postId":{"description":"Echo of the post external id.","type":"string"},"locale":{"nullable":true,"anyOf":[{"description":"Echo of the locale filter, or null when none was applied.","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","insertedDate","locale","title","commitMessage","contentSize","author"],"properties":{"id":{"examples":["vErSiOnHaNdLe123"],"description":"Version handle (16 chars). Pass to /history/version to read the body.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"description":"Locale code of this revision (e.g. \"cs\", \"en\").","type":"string"},"title":{"description":"Snapshot of the post title at this revision.","type":"string"},"commitMessage":{"nullable":true,"anyOf":[{"description":"Optional human commit message; null for auto-versions.","type":"string"},{"type":"null"}]},"contentSize":{"description":"Byte size of the content blob.","type":"number"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"description":"cuRefNo of the author contact.","type":"string"},{"type":"null"}]},"name":{"description":"Display name of the author.","type":"string"}}}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["postId","locale","items"],"properties":{"postId":{"description":"Echo of the post external id.","type":"string"},"locale":{"nullable":true,"anyOf":[{"description":"Echo of the locale filter, or null when none was applied.","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","insertedDate","locale","title","commitMessage","contentSize","author"],"properties":{"id":{"examples":["vErSiOnHaNdLe123"],"description":"Version handle (16 chars). Pass to /history/version to read the body.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"description":"Locale code of this revision (e.g. \"cs\", \"en\").","type":"string"},"title":{"description":"Snapshot of the post title at this revision.","type":"string"},"commitMessage":{"nullable":true,"anyOf":[{"description":"Optional human commit message; null for auto-versions.","type":"string"},{"type":"null"}]},"contentSize":{"description":"Byte size of the content blob.","type":"number"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"description":"cuRefNo of the author contact.","type":"string"},{"type":"null"}]},"name":{"description":"Display name of the author.","type":"string"}}}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostHistory","tags":["post"],"summary":"List post version history","description":"Returns the commit log for a post: every revision recorded in `content__post_history`, newest first.\n\nA post with multi-locale content (e.g. cs + en + de) has independent revision streams per language. Pass `locale=cs` to scope to one language, omit to get all languages mixed; either way each item exposes its own `locale` field.\n\nDesigned so external consumers (e.g. ChatSPC) can present a version timeline without operating their own database. Each entry carries the version handle, timestamp, locale, snapshot title, optional commit message and the byte size of the stored content blob. The HTML body itself is fetched on demand via `/api/v1/post/history/version`."}},"/api/v1/post/history/version":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Version handle returned by /api/v1/post/history.","examples":["vErSiOnHaNdLe123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["id","postId","locale","insertedDate","title","content","contentSize","commitMessage","author"],"properties":{"id":{"description":"Version handle (echo).","type":"string"},"postId":{"description":"External id of the parent post.","type":"string"},"locale":{"description":"Locale code of this revision.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"content":{"description":"Full HTML content snapshot at this revision.","type":"string"},"contentSize":{"type":"number"},"commitMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["id","postId","locale","insertedDate","title","content","contentSize","commitMessage","author"],"properties":{"id":{"description":"Version handle (echo).","type":"string"},"postId":{"description":"External id of the parent post.","type":"string"},"locale":{"description":"Locale code of this revision.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"content":{"description":"Full HTML content snapshot at this revision.","type":"string"},"contentSize":{"type":"number"},"commitMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["id","postId","locale","insertedDate","title","content","contentSize","commitMessage","author"],"properties":{"id":{"description":"Version handle (echo).","type":"string"},"postId":{"description":"External id of the parent post.","type":"string"},"locale":{"description":"Locale code of this revision.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"content":{"description":"Full HTML content snapshot at this revision.","type":"string"},"contentSize":{"type":"number"},"commitMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["id","postId","locale","insertedDate","title","content","contentSize","commitMessage","author"],"properties":{"id":{"description":"Version handle (echo).","type":"string"},"postId":{"description":"External id of the parent post.","type":"string"},"locale":{"description":"Locale code of this revision.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"content":{"description":"Full HTML content snapshot at this revision.","type":"string"},"contentSize":{"type":"number"},"commitMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostHistoryVersion","tags":["post"],"summary":"Get post history version detail","description":"Returns one specific revision in full, including the HTML content snapshot (body is loaded from blob storage on demand). Use this when an external consumer needs to render a historical version of a post body or compute a diff against another version."}},"/api/v1/post/history/diff":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Older revision handle (left side of the diff).","examples":["vErSiOnHaNdLe123"],"schema":{"type":"string"},"in":"query","name":"from","required":true},{"description":"Newer revision handle (right side of the diff).","examples":["vErSiOnHaNdLe456"],"schema":{"type":"string"},"in":"query","name":"to","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["from","to","titleDiff","contentDiff","stats"],"properties":{"from":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"to":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"titleDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"type":"string"}}}},"contentDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"type":"string"}}}},"stats":{"type":"object","required":["titleAdded","titleRemoved","contentAddedLines","contentRemovedLines"],"properties":{"titleAdded":{"type":"number"},"titleRemoved":{"type":"number"},"contentAddedLines":{"type":"number"},"contentRemovedLines":{"type":"number"}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["from","to","titleDiff","contentDiff","stats"],"properties":{"from":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"to":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"titleDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"type":"string"}}}},"contentDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"type":"string"}}}},"stats":{"type":"object","required":["titleAdded","titleRemoved","contentAddedLines","contentRemovedLines"],"properties":{"titleAdded":{"type":"number"},"titleRemoved":{"type":"number"},"contentAddedLines":{"type":"number"},"contentRemovedLines":{"type":"number"}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["from","to","titleDiff","contentDiff","stats"],"properties":{"from":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"to":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"titleDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"type":"string"}}}},"contentDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"type":"string"}}}},"stats":{"type":"object","required":["titleAdded","titleRemoved","contentAddedLines","contentRemovedLines"],"properties":{"titleAdded":{"type":"number"},"titleRemoved":{"type":"number"},"contentAddedLines":{"type":"number"},"contentRemovedLines":{"type":"number"}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["from","to","titleDiff","contentDiff","stats"],"properties":{"from":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"to":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"titleDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"type":"string"}}}},"contentDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"type":"string"}}}},"stats":{"type":"object","required":["titleAdded","titleRemoved","contentAddedLines","contentRemovedLines"],"properties":{"titleAdded":{"type":"number"},"titleRemoved":{"type":"number"},"contentAddedLines":{"type":"number"},"contentRemovedLines":{"type":"number"}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostHistoryDiff","tags":["post"],"summary":"Diff two post revisions","description":"Returns a structured diff between two revisions of the same post and locale.\n\nTitle is word-grain (titles are short, word grain reads naturally), content is line-grain (HTML/markdown bodies — line grain keeps block edits readable). Each diff segment is tagged `add` / `remove` / `context`; concatenating context+add produces the `to` document, concatenating context+remove produces the `from` document.\n\nBoth revisions must belong to the same post and same locale; cross-post or cross-locale diffs return an error envelope."}},"/api/v1/post/meta":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Post public id (content__post.external_id).","examples":["6IU2SWgP76FO2UXw"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["postId","metadata"],"properties":{"postId":{"description":"Echo of the post external id.","type":"string"},"metadata":{"description":"Free-form key/value bag, keyed by string and valued by string. Clients parse numbers/booleans/dates as needed."}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["postId","metadata"],"properties":{"postId":{"description":"Echo of the post external id.","type":"string"},"metadata":{"description":"Free-form key/value bag, keyed by string and valued by string. Clients parse numbers/booleans/dates as needed."}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["postId","metadata"],"properties":{"postId":{"description":"Echo of the post external id.","type":"string"},"metadata":{"description":"Free-form key/value bag, keyed by string and valued by string. Clients parse numbers/booleans/dates as needed."}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["postId","metadata"],"properties":{"postId":{"description":"Echo of the post external id.","type":"string"},"metadata":{"description":"Free-form key/value bag, keyed by string and valued by string. Clients parse numbers/booleans/dates as needed."}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostMeta","tags":["post"],"summary":"Get post structured metadata","description":"Returns the key/value metadata bag attached to a post via /api/v1/post/create.\n\nUseful for external integrations (e.g. ChatSPC) that store provenance — sukl_code, version_date, pdf_sha256, page_count, suspicious_pages, ingested_at, … — alongside the post and need to read it back without owning their own database. Posts with no metadata return an empty `metadata` object (not an error)."}},"/api/v1/post/category":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"examples":["novinky"],"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["name","description","route","routes","children","breadcrumb","postFeed"],"properties":{"name":{"examples":["Novinky"],"type":"string"},"description":{"examples":["Nejnovější zprávy a aktuality ze světa kyberbezpečnosti."],"type":"string"},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["Novinky"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"}}},"routes":{"type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["novinky"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"children":{"type":"array","items":{"type":"object","required":["slug","name","description","postCount"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"postCount":{"type":"number"}}}},"breadcrumb":{"type":"array","items":{"type":"object","required":["slug","children"],"properties":{"name":{"examples":["Novinky"],"type":"string"},"slug":{"examples":["novinky"],"type":"string"},"children":{"type":"array","items":{}}}}},"postFeed":{"type":"array","items":{"type":"object","required":["slug","title","content","perex","publishedDate"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"type":"string"},"content":{"examples":["Žijeme ve světě, kde je..."],"type":"string"},"perex":{"nullable":true,"anyOf":[{"examples":["Třetí ročník vyhlášení proběhl..."],"type":"string"},{"type":"null"}]},"publishedDate":{"nullable":true,"anyOf":[{"examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}},"parent":{"type":"object","required":["name","slug","description"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Category \"about\" does not exist."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["name","description","route","routes","children","breadcrumb","postFeed"],"properties":{"name":{"examples":["Novinky"],"type":"string"},"description":{"examples":["Nejnovější zprávy a aktuality ze světa kyberbezpečnosti."],"type":"string"},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["Novinky"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"}}},"routes":{"type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["novinky"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"children":{"type":"array","items":{"type":"object","required":["slug","name","description","postCount"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"postCount":{"type":"number"}}}},"breadcrumb":{"type":"array","items":{"type":"object","required":["slug","children"],"properties":{"name":{"examples":["Novinky"],"type":"string"},"slug":{"examples":["novinky"],"type":"string"},"children":{"type":"array","items":{}}}}},"postFeed":{"type":"array","items":{"type":"object","required":["slug","title","content","perex","publishedDate"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"type":"string"},"content":{"examples":["Žijeme ve světě, kde je..."],"type":"string"},"perex":{"nullable":true,"anyOf":[{"examples":["Třetí ročník vyhlášení proběhl..."],"type":"string"},{"type":"null"}]},"publishedDate":{"nullable":true,"anyOf":[{"examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}},"parent":{"type":"object","required":["name","slug","description"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Category \"about\" does not exist."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["name","description","route","routes","children","breadcrumb","postFeed"],"properties":{"name":{"examples":["Novinky"],"type":"string"},"description":{"examples":["Nejnovější zprávy a aktuality ze světa kyberbezpečnosti."],"type":"string"},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["Novinky"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"}}},"routes":{"type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["novinky"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"children":{"type":"array","items":{"type":"object","required":["slug","name","description","postCount"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"postCount":{"type":"number"}}}},"breadcrumb":{"type":"array","items":{"type":"object","required":["slug","children"],"properties":{"name":{"examples":["Novinky"],"type":"string"},"slug":{"examples":["novinky"],"type":"string"},"children":{"type":"array","items":{}}}}},"postFeed":{"type":"array","items":{"type":"object","required":["slug","title","content","perex","publishedDate"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"type":"string"},"content":{"examples":["Žijeme ve světě, kde je..."],"type":"string"},"perex":{"nullable":true,"anyOf":[{"examples":["Třetí ročník vyhlášení proběhl..."],"type":"string"},{"type":"null"}]},"publishedDate":{"nullable":true,"anyOf":[{"examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}},"parent":{"type":"object","required":["name","slug","description"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Category \"about\" does not exist."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["name","description","route","routes","children","breadcrumb","postFeed"],"properties":{"name":{"examples":["Novinky"],"type":"string"},"description":{"examples":["Nejnovější zprávy a aktuality ze světa kyberbezpečnosti."],"type":"string"},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["Novinky"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"}}},"routes":{"type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["novinky"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"children":{"type":"array","items":{"type":"object","required":["slug","name","description","postCount"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"postCount":{"type":"number"}}}},"breadcrumb":{"type":"array","items":{"type":"object","required":["slug","children"],"properties":{"name":{"examples":["Novinky"],"type":"string"},"slug":{"examples":["novinky"],"type":"string"},"children":{"type":"array","items":{}}}}},"postFeed":{"type":"array","items":{"type":"object","required":["slug","title","content","perex","publishedDate"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"type":"string"},"content":{"examples":["Žijeme ve světě, kde je..."],"type":"string"},"perex":{"nullable":true,"anyOf":[{"examples":["Třetí ročník vyhlášení proběhl..."],"type":"string"},{"type":"null"}]},"publishedDate":{"nullable":true,"anyOf":[{"examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}},"parent":{"type":"object","required":["name","slug","description"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Category \"about\" does not exist."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostCategory","tags":["post"],"summary":"Get post category detail","description":"Returns category detail with child categories, breadcrumb, post feed, and routing info. Returns an error object if the category does not exist."}},"/api/v1/post/category-tree":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false},{"description":"When true, every node also carries `posts`: its direct published posts (slug, title, locale), newest first.","schema":{"anyOf":[{"description":"When true, every node also carries `posts`: its direct published posts (slug, title, locale), newest first.","type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"posts","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","title","active","postCount","children"],"properties":{"id":{"examples":["Yxadt7Yebzp28n5g"],"description":"Category external id (content__category.external_id).","type":"string"},"slug":{"examples":["sales"],"type":"string"},"title":{"examples":["Sales"],"type":"string"},"active":{"type":"boolean"},"postCount":{"examples":[9],"description":"Number of posts under this node — includes descendant categories, not just direct children.","type":"number"},"posts":{"type":"array","items":{"type":"object","required":["slug","title","locale"],"properties":{"slug":{"examples":["api-key"],"type":"string"},"title":{"examples":["API key"],"type":"string"},"locale":{"examples":["en"],"description":"Locale of slug + title (fallback when untranslated).","type":"string"}}}},"children":{"type":"array","items":{}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","title","active","postCount","children"],"properties":{"id":{"examples":["Yxadt7Yebzp28n5g"],"description":"Category external id (content__category.external_id).","type":"string"},"slug":{"examples":["sales"],"type":"string"},"title":{"examples":["Sales"],"type":"string"},"active":{"type":"boolean"},"postCount":{"examples":[9],"description":"Number of posts under this node — includes descendant categories, not just direct children.","type":"number"},"posts":{"type":"array","items":{"type":"object","required":["slug","title","locale"],"properties":{"slug":{"examples":["api-key"],"type":"string"},"title":{"examples":["API key"],"type":"string"},"locale":{"examples":["en"],"description":"Locale of slug + title (fallback when untranslated).","type":"string"}}}},"children":{"type":"array","items":{}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","title","active","postCount","children"],"properties":{"id":{"examples":["Yxadt7Yebzp28n5g"],"description":"Category external id (content__category.external_id).","type":"string"},"slug":{"examples":["sales"],"type":"string"},"title":{"examples":["Sales"],"type":"string"},"active":{"type":"boolean"},"postCount":{"examples":[9],"description":"Number of posts under this node — includes descendant categories, not just direct children.","type":"number"},"posts":{"type":"array","items":{"type":"object","required":["slug","title","locale"],"properties":{"slug":{"examples":["api-key"],"type":"string"},"title":{"examples":["API key"],"type":"string"},"locale":{"examples":["en"],"description":"Locale of slug + title (fallback when untranslated).","type":"string"}}}},"children":{"type":"array","items":{}}}}}},"required":["items"]}}}}},"operationId":"getApiV1PostCategory-tree","tags":["post"],"summary":"Get full post-category tree","description":"Returns the full active category tree for the caller organisation, one node per category, with recursive `postCount` (sum of the node and all descendants) already computed by the server. Payload intentionally omits post content — use `/api/v1/post/category?slug=…` to fetch the articles listed under a specific category. Inactive and unrouted categories are stripped so the response is safe to render directly as a navigation sidebar."}},"/api/v1/post/search":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Full-text search query entered by the client. Can contain words, phrases or year numbers, e.g. \"2025\".","examples":["2025"],"schema":{"type":"string"},"in":"query","name":"query","required":true},{"description":"Optional ISO 3166-1 alpha-2 country code of the visitor (e.g. \"CZ\"). When set, the response is filtered to posts whose per-country / per-continent allowlist matches the visitor — a post targeted at continent \"EU\" matches every EU country, and a post with no rules stays globally available. When omitted, the filter is disabled and every post is returned regardless of geo settings. The API does NOT infer the country from the caller's IP; it is up to the caller to resolve and supply it. Case-insensitive. Unknown codes are rejected with HTTP 400 (`PUBLIC_COUNTRY_CODE_UNKNOWN`). The pseudo code `INT` selects the international (region-less) edition of a multi-region publication: only posts WITHOUT any country / continent rule.","examples":["CZ","DE","SK","INT"],"schema":{"type":"string","minLength":2,"maxLength":3},"in":"query","name":"country","required":false},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false},{"description":"Maximum number of items to return in `items`, ordered by relevance descending. When omitted, the server default of 100 is applied. Hard-capped at 200 regardless of a larger value being requested.","examples":[100],"schema":{"minimum":1,"maximum":200,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":200,"examples":[100],"description":"Maximum number of items to return in `items`, ordered by relevance descending. When omitted, the server default of 100 is applied. Hard-capped at 200 regardless of a larger value being requested.","type":"integer"}]},"in":"query","name":"limit","required":false},{"description":"Number of ranked results to skip, for pagination (\"load more\"). Default 0. Honoured by the in-memory search used for organisations with a small post corpus; the large-corpus SQL search always starts at 0 (check `offset` in the response).","examples":[0,20],"schema":{"minimum":0,"maximum":10000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":10000,"examples":[0,20],"description":"Number of ranked results to skip, for pagination (\"load more\"). Default 0. Honoured by the in-memory search used for organisations with a small post corpus; the large-corpus SQL search always starts at 0 (check `offset` in the response).","type":"integer"}]},"in":"query","name":"offset","required":false},{"description":"Optional main category route slug to restrict the search to posts assigned to that category. The slug is resolved in the requested `locale` against the organisation category routes; when it resolves to no category, the search returns zero results.","examples":["novinky","clanky"],"schema":{"type":"string"},"in":"query","name":"mainCategory","required":false},{"description":"Ordering of the returned `items`. Defaults to `relevance` (score descending, current behavior). `date` returns the most-recently-published matches first (`published_date DESC NULLS LAST`, then `inserted_date DESC`). The `score` field is still populated in both modes.","examples":["relevance","date"],"schema":{"anyOf":[{"const":"relevance","type":"string"},{"const":"date","type":"string"}]},"in":"query","name":"orderBy","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"examples":["2025"],"description":"Normalized form of the search query actually used by the search engine (e.g. trimmed and lower-cased).","type":"string"},"title":{"examples":["2025"],"description":"Human-readable version of the query intended for UI headings (typically first letter upper-cased).","type":"string"},"countResults":{"examples":[1],"description":"Total number of matching posts found before the response-side truncation is applied. May be larger than `items.length` when the result set is capped by `limit`. Compare with `truncated` to know whether the client should suggest a more specific query.","type":"number"},"limit":{"examples":[100],"description":"Effective maximum number of items included in this response. Echoes the `limit` query parameter (if provided and within 1–200), otherwise falls back to the server default of 100. The search returns at most this many entries in `items`, sorted by relevance descending.","type":"number"},"truncated":{"examples":[false],"description":"True when `countResults` exceeds `limit`, i.e. some matching posts were dropped from the `items` array. Use as a hint to nudge the user to refine the query.","type":"boolean"},"durationMs":{"examples":[42],"description":"Server-side wall-clock time spent producing this response, in milliseconds. Covers the SQL search, tag/blob enrichment and scoring; excludes network transfer. Useful for \"Found X results in Y ms\" UI copy and for spotting slow queries.","type":"number"},"didYouMean":{"nullable":true,"anyOf":[{"examples":["2024"],"description":"Optional alternative query suggestion when a likely typo or more relevant variant is detected. Null if no suggestion is available.","type":"string"},{"type":"null"}]},"offset":{"examples":[0],"description":"Number of skipped results this page starts after.","type":"number"},"autoCorrected":{"examples":[true],"description":"True when the query as typed matched nothing and the results are for `didYouMean` instead (show \"Showing results for …\"). False / absent: `didYouMean`, if set, is only a suggestion.","type":"boolean"},"crossLocale":{"examples":[false],"description":"True when nothing matched in the requested `locale` and the hits were found in another locale. Items are still returned in the requested locale when a translation exists (see `items[].locale`).","type":"boolean"},"partial":{"examples":[false],"description":"True when no post contains every query word and the items match only some of them.","type":"boolean"},"facets":{"description":"Main categories of all matching posts with counts, computed before the `mainCategory` filter, for a \"filter by category\" UI. In-memory search only.","type":"array","items":{"type":"object","required":["slug","name","count"],"properties":{"slug":{"examples":["sales"],"description":"Category route slug (use as `mainCategory`).","type":"string"},"name":{"examples":["Sales"],"description":"Category name in the requested locale.","type":"string"},"count":{"examples":[4],"description":"Number of matching posts whose main category this is.","type":"number"}}}},"items":{"description":"List of search results for the given query, ordered by relevance (highest score first). Limited to a maximum of 100 items.","type":"array","items":{"type":"object","required":["slug","title","snippet","titleHighlighted","snippetHighlighted","tags","score"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"description":"Canonical URL slug of the matched post in the requested locale. Append to your site base URL to create a link.","type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"description":"Plain-text title of the post, normalized for search but without HTML highlighting.","type":"string"},"snippet":{"examples":["proto vznikla soutěž KYBER CENA ROKU: aby ukázala lidi a projekty, kteří dělají Českou republiku bezpečnější. Třetí ročník vyhlášení proběhl 9. října 2025 na slavnostním galavečeru za účasti odborné poroty, partnerů a finalistů ze školství, státní správy, průmyslu i komerční bezpečnosti. Letos šlo m"],"description":"Plain-text excerpt from the post content around the matched query, shortened for use in the search results list.","type":"string"},"titleHighlighted":{"examples":["KYBER CENA ROKU <strong style=\"color:#003F99;background:#CCE0FF\">2025</strong>: největší večer české kyberbezpečnosti letošního roku."],"description":"Post title with all occurrences of the query wrapped in a `<strong>` tag with inline highlight styles. Contains HTML and should be rendered as HTML, not escaped.","type":"string"},"snippetHighlighted":{"examples":["proto vznikla soutěž KYBER CENA ROKU: aby ukázala lidi a projekty, kteří dělají Českou republiku bezpečnější. Třetí ročník vyhlášení proběhl 9. října <strong style=\"color:#003F99;background:#CCE0FF\">2025</strong> na slavnostním galavečeru za účasti odborné poroty, partnerů a finalistů ze školství, státní správy, průmyslu i komerční bezpečnosti. Letos šlo m"],"description":"Content snippet with matched query terms highlighted using a `<strong>` tag with inline styles. Contains HTML and should be rendered as HTML, not escaped.","type":"string"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"tags":{"description":"Array of tags assigned to this post. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag.","examples":["#3B82F6"],"type":"string"}}}},"locale":{"examples":["en"],"description":"Locale of `slug` (differs from the request on cross-locale hits).","type":"string"},"perex":{"description":"Plain-text perex of the post.","type":"string"},"publishedDate":{"examples":["2026-07-26T10:00:00.000Z"],"description":"ISO publication date.","type":"string"},"category":{"description":"Main category of the post.","type":"object","required":["slug","name"],"properties":{"slug":{"examples":["vouchers"],"type":"string"},"name":{"examples":["Vouchers"],"type":"string"}}},"section":{"description":"Section of the post where the query words occur; `snippet` is cut from it. Absent when the post as a whole is the answer.","type":"object","required":["id","title","titleHighlighted"],"properties":{"id":{"examples":["validity"],"description":"Heading anchor id; link to `/{slug}#{id}`.","type":"string"},"title":{"examples":["Validity"],"type":"string"},"titleHighlighted":{"description":"Heading with highlight markup. Render as HTML.","type":"string"}}},"score":{"examples":[195],"description":"Relative relevance score computed from the text match and year-based boosting. Higher values indicate more relevant results and are used to sort items in descending order. The absolute range is not fixed and should be treated as an internal ranking hint.","type":"number"}}}},"categories":{"description":"Active categories whose name in the requested `locale` contains every word of the query (max 5, exact and prefix matches first). Always empty when `mainCategory` is set.","type":"array","items":{"type":"object","required":["id","slug","name","nameHighlighted"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Category external id (16 chars).","type":"string"},"slug":{"examples":["airlines"],"description":"Canonical category route slug in the requested `locale`.","type":"string"},"name":{"examples":["Airlines"],"description":"Category name in the requested `locale`.","type":"string"},"nameHighlighted":{"examples":["<strong>Air</strong>lines"],"description":"Category name with `<strong>` markup around the matched words. Render as HTML.","type":"string"}}}}},"required":["query","title","countResults","limit","truncated","durationMs","didYouMean","items","categories"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"query":{"examples":["2025"],"description":"Normalized form of the search query actually used by the search engine (e.g. trimmed and lower-cased).","type":"string"},"title":{"examples":["2025"],"description":"Human-readable version of the query intended for UI headings (typically first letter upper-cased).","type":"string"},"countResults":{"examples":[1],"description":"Total number of matching posts found before the response-side truncation is applied. May be larger than `items.length` when the result set is capped by `limit`. Compare with `truncated` to know whether the client should suggest a more specific query.","type":"number"},"limit":{"examples":[100],"description":"Effective maximum number of items included in this response. Echoes the `limit` query parameter (if provided and within 1–200), otherwise falls back to the server default of 100. The search returns at most this many entries in `items`, sorted by relevance descending.","type":"number"},"truncated":{"examples":[false],"description":"True when `countResults` exceeds `limit`, i.e. some matching posts were dropped from the `items` array. Use as a hint to nudge the user to refine the query.","type":"boolean"},"durationMs":{"examples":[42],"description":"Server-side wall-clock time spent producing this response, in milliseconds. Covers the SQL search, tag/blob enrichment and scoring; excludes network transfer. Useful for \"Found X results in Y ms\" UI copy and for spotting slow queries.","type":"number"},"didYouMean":{"nullable":true,"anyOf":[{"examples":["2024"],"description":"Optional alternative query suggestion when a likely typo or more relevant variant is detected. Null if no suggestion is available.","type":"string"},{"type":"null"}]},"offset":{"examples":[0],"description":"Number of skipped results this page starts after.","type":"number"},"autoCorrected":{"examples":[true],"description":"True when the query as typed matched nothing and the results are for `didYouMean` instead (show \"Showing results for …\"). False / absent: `didYouMean`, if set, is only a suggestion.","type":"boolean"},"crossLocale":{"examples":[false],"description":"True when nothing matched in the requested `locale` and the hits were found in another locale. Items are still returned in the requested locale when a translation exists (see `items[].locale`).","type":"boolean"},"partial":{"examples":[false],"description":"True when no post contains every query word and the items match only some of them.","type":"boolean"},"facets":{"description":"Main categories of all matching posts with counts, computed before the `mainCategory` filter, for a \"filter by category\" UI. In-memory search only.","type":"array","items":{"type":"object","required":["slug","name","count"],"properties":{"slug":{"examples":["sales"],"description":"Category route slug (use as `mainCategory`).","type":"string"},"name":{"examples":["Sales"],"description":"Category name in the requested locale.","type":"string"},"count":{"examples":[4],"description":"Number of matching posts whose main category this is.","type":"number"}}}},"items":{"description":"List of search results for the given query, ordered by relevance (highest score first). Limited to a maximum of 100 items.","type":"array","items":{"type":"object","required":["slug","title","snippet","titleHighlighted","snippetHighlighted","tags","score"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"description":"Canonical URL slug of the matched post in the requested locale. Append to your site base URL to create a link.","type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"description":"Plain-text title of the post, normalized for search but without HTML highlighting.","type":"string"},"snippet":{"examples":["proto vznikla soutěž KYBER CENA ROKU: aby ukázala lidi a projekty, kteří dělají Českou republiku bezpečnější. Třetí ročník vyhlášení proběhl 9. října 2025 na slavnostním galavečeru za účasti odborné poroty, partnerů a finalistů ze školství, státní správy, průmyslu i komerční bezpečnosti. Letos šlo m"],"description":"Plain-text excerpt from the post content around the matched query, shortened for use in the search results list.","type":"string"},"titleHighlighted":{"examples":["KYBER CENA ROKU <strong style=\"color:#003F99;background:#CCE0FF\">2025</strong>: největší večer české kyberbezpečnosti letošního roku."],"description":"Post title with all occurrences of the query wrapped in a `<strong>` tag with inline highlight styles. Contains HTML and should be rendered as HTML, not escaped.","type":"string"},"snippetHighlighted":{"examples":["proto vznikla soutěž KYBER CENA ROKU: aby ukázala lidi a projekty, kteří dělají Českou republiku bezpečnější. Třetí ročník vyhlášení proběhl 9. října <strong style=\"color:#003F99;background:#CCE0FF\">2025</strong> na slavnostním galavečeru za účasti odborné poroty, partnerů a finalistů ze školství, státní správy, průmyslu i komerční bezpečnosti. Letos šlo m"],"description":"Content snippet with matched query terms highlighted using a `<strong>` tag with inline styles. Contains HTML and should be rendered as HTML, not escaped.","type":"string"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"tags":{"description":"Array of tags assigned to this post. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag.","examples":["#3B82F6"],"type":"string"}}}},"locale":{"examples":["en"],"description":"Locale of `slug` (differs from the request on cross-locale hits).","type":"string"},"perex":{"description":"Plain-text perex of the post.","type":"string"},"publishedDate":{"examples":["2026-07-26T10:00:00.000Z"],"description":"ISO publication date.","type":"string"},"category":{"description":"Main category of the post.","type":"object","required":["slug","name"],"properties":{"slug":{"examples":["vouchers"],"type":"string"},"name":{"examples":["Vouchers"],"type":"string"}}},"section":{"description":"Section of the post where the query words occur; `snippet` is cut from it. Absent when the post as a whole is the answer.","type":"object","required":["id","title","titleHighlighted"],"properties":{"id":{"examples":["validity"],"description":"Heading anchor id; link to `/{slug}#{id}`.","type":"string"},"title":{"examples":["Validity"],"type":"string"},"titleHighlighted":{"description":"Heading with highlight markup. Render as HTML.","type":"string"}}},"score":{"examples":[195],"description":"Relative relevance score computed from the text match and year-based boosting. Higher values indicate more relevant results and are used to sort items in descending order. The absolute range is not fixed and should be treated as an internal ranking hint.","type":"number"}}}},"categories":{"description":"Active categories whose name in the requested `locale` contains every word of the query (max 5, exact and prefix matches first). Always empty when `mainCategory` is set.","type":"array","items":{"type":"object","required":["id","slug","name","nameHighlighted"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Category external id (16 chars).","type":"string"},"slug":{"examples":["airlines"],"description":"Canonical category route slug in the requested `locale`.","type":"string"},"name":{"examples":["Airlines"],"description":"Category name in the requested `locale`.","type":"string"},"nameHighlighted":{"examples":["<strong>Air</strong>lines"],"description":"Category name with `<strong>` markup around the matched words. Render as HTML.","type":"string"}}}}},"required":["query","title","countResults","limit","truncated","durationMs","didYouMean","items","categories"]}},"text/plain":{"schema":{"type":"object","properties":{"query":{"examples":["2025"],"description":"Normalized form of the search query actually used by the search engine (e.g. trimmed and lower-cased).","type":"string"},"title":{"examples":["2025"],"description":"Human-readable version of the query intended for UI headings (typically first letter upper-cased).","type":"string"},"countResults":{"examples":[1],"description":"Total number of matching posts found before the response-side truncation is applied. May be larger than `items.length` when the result set is capped by `limit`. Compare with `truncated` to know whether the client should suggest a more specific query.","type":"number"},"limit":{"examples":[100],"description":"Effective maximum number of items included in this response. Echoes the `limit` query parameter (if provided and within 1–200), otherwise falls back to the server default of 100. The search returns at most this many entries in `items`, sorted by relevance descending.","type":"number"},"truncated":{"examples":[false],"description":"True when `countResults` exceeds `limit`, i.e. some matching posts were dropped from the `items` array. Use as a hint to nudge the user to refine the query.","type":"boolean"},"durationMs":{"examples":[42],"description":"Server-side wall-clock time spent producing this response, in milliseconds. Covers the SQL search, tag/blob enrichment and scoring; excludes network transfer. Useful for \"Found X results in Y ms\" UI copy and for spotting slow queries.","type":"number"},"didYouMean":{"nullable":true,"anyOf":[{"examples":["2024"],"description":"Optional alternative query suggestion when a likely typo or more relevant variant is detected. Null if no suggestion is available.","type":"string"},{"type":"null"}]},"offset":{"examples":[0],"description":"Number of skipped results this page starts after.","type":"number"},"autoCorrected":{"examples":[true],"description":"True when the query as typed matched nothing and the results are for `didYouMean` instead (show \"Showing results for …\"). False / absent: `didYouMean`, if set, is only a suggestion.","type":"boolean"},"crossLocale":{"examples":[false],"description":"True when nothing matched in the requested `locale` and the hits were found in another locale. Items are still returned in the requested locale when a translation exists (see `items[].locale`).","type":"boolean"},"partial":{"examples":[false],"description":"True when no post contains every query word and the items match only some of them.","type":"boolean"},"facets":{"description":"Main categories of all matching posts with counts, computed before the `mainCategory` filter, for a \"filter by category\" UI. In-memory search only.","type":"array","items":{"type":"object","required":["slug","name","count"],"properties":{"slug":{"examples":["sales"],"description":"Category route slug (use as `mainCategory`).","type":"string"},"name":{"examples":["Sales"],"description":"Category name in the requested locale.","type":"string"},"count":{"examples":[4],"description":"Number of matching posts whose main category this is.","type":"number"}}}},"items":{"description":"List of search results for the given query, ordered by relevance (highest score first). Limited to a maximum of 100 items.","type":"array","items":{"type":"object","required":["slug","title","snippet","titleHighlighted","snippetHighlighted","tags","score"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"description":"Canonical URL slug of the matched post in the requested locale. Append to your site base URL to create a link.","type":"string"},"title":{"examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"description":"Plain-text title of the post, normalized for search but without HTML highlighting.","type":"string"},"snippet":{"examples":["proto vznikla soutěž KYBER CENA ROKU: aby ukázala lidi a projekty, kteří dělají Českou republiku bezpečnější. Třetí ročník vyhlášení proběhl 9. října 2025 na slavnostním galavečeru za účasti odborné poroty, partnerů a finalistů ze školství, státní správy, průmyslu i komerční bezpečnosti. Letos šlo m"],"description":"Plain-text excerpt from the post content around the matched query, shortened for use in the search results list.","type":"string"},"titleHighlighted":{"examples":["KYBER CENA ROKU <strong style=\"color:#003F99;background:#CCE0FF\">2025</strong>: největší večer české kyberbezpečnosti letošního roku."],"description":"Post title with all occurrences of the query wrapped in a `<strong>` tag with inline highlight styles. Contains HTML and should be rendered as HTML, not escaped.","type":"string"},"snippetHighlighted":{"examples":["proto vznikla soutěž KYBER CENA ROKU: aby ukázala lidi a projekty, kteří dělají Českou republiku bezpečnější. Třetí ročník vyhlášení proběhl 9. října <strong style=\"color:#003F99;background:#CCE0FF\">2025</strong> na slavnostním galavečeru za účasti odborné poroty, partnerů a finalistů ze školství, státní správy, průmyslu i komerční bezpečnosti. Letos šlo m"],"description":"Content snippet with matched query terms highlighted using a `<strong>` tag with inline styles. Contains HTML and should be rendered as HTML, not escaped.","type":"string"},"mainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"tags":{"description":"Array of tags assigned to this post. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag.","examples":["#3B82F6"],"type":"string"}}}},"locale":{"examples":["en"],"description":"Locale of `slug` (differs from the request on cross-locale hits).","type":"string"},"perex":{"description":"Plain-text perex of the post.","type":"string"},"publishedDate":{"examples":["2026-07-26T10:00:00.000Z"],"description":"ISO publication date.","type":"string"},"category":{"description":"Main category of the post.","type":"object","required":["slug","name"],"properties":{"slug":{"examples":["vouchers"],"type":"string"},"name":{"examples":["Vouchers"],"type":"string"}}},"section":{"description":"Section of the post where the query words occur; `snippet` is cut from it. Absent when the post as a whole is the answer.","type":"object","required":["id","title","titleHighlighted"],"properties":{"id":{"examples":["validity"],"description":"Heading anchor id; link to `/{slug}#{id}`.","type":"string"},"title":{"examples":["Validity"],"type":"string"},"titleHighlighted":{"description":"Heading with highlight markup. Render as HTML.","type":"string"}}},"score":{"examples":[195],"description":"Relative relevance score computed from the text match and year-based boosting. Higher values indicate more relevant results and are used to sort items in descending order. The absolute range is not fixed and should be treated as an internal ranking hint.","type":"number"}}}},"categories":{"description":"Active categories whose name in the requested `locale` contains every word of the query (max 5, exact and prefix matches first). Always empty when `mainCategory` is set.","type":"array","items":{"type":"object","required":["id","slug","name","nameHighlighted"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Category external id (16 chars).","type":"string"},"slug":{"examples":["airlines"],"description":"Canonical category route slug in the requested `locale`.","type":"string"},"name":{"examples":["Airlines"],"description":"Category name in the requested `locale`.","type":"string"},"nameHighlighted":{"examples":["<strong>Air</strong>lines"],"description":"Category name with `<strong>` markup around the matched words. Render as HTML.","type":"string"}}}}},"required":["query","title","countResults","limit","truncated","durationMs","didYouMean","items","categories"]}}}}},"operationId":"getApiV1PostSearch","tags":["post"],"summary":"Search posts","description":"Full-text search across posts. Returns matching posts with highlighted title and snippet, relevance score, and optional \"did you mean\" suggestions. Results can be narrowed to a single category via `mainCategory` (resolved as a route slug in the requested locale) and sorted either by relevance (default) or by publication date via `orderBy=date`."}},"/api/v1/post/author":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Routable author profile slug (e.g. `jan-barasek`). Preferred addressing mode for public URLs. Mutually exclusive with `id`.","examples":["jan-barasek"],"schema":{"type":"string"},"in":"query","name":"slug","required":false},{"description":"Contact `shop__contact.external_id` (16-char). Stable machine-safe identifier — use when you have the id from `/post/post` `authors[].profileSlug` and want to fetch the author profile without knowing the slug. Mutually exclusive with `slug`.","examples":["71E58E5SjdZN6ut3"],"schema":{"type":"string"},"in":"query","name":"id","required":false},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["id","slug","name","socialLinks","isPseudonym","status","postCount","metaTitle","metaDescription","jsonLd","route","routes"],"properties":{"id":{"description":"Contact `shop__contact.external_id` (16-char). Stable across renames / slug changes.","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable profile slug — same across every org locale (author name is language-independent). Feed into your `/autor/<slug>` URL pattern.","examples":["jan-barasek"],"type":"string"},"name":{"description":"Public byline name (display name / pseudonym → contact name → linked user name). Falls back to `\"Autor <id>\"` when no tier has one.","examples":["Jan Barášek"],"type":"string"},"jobTitle":{"description":"Localized job title (author locale override → primary locale → linked member `job_title`). Omitted for former authors — that title no longer reflects the person's current role.","examples":["Editor in Chief","Cyber Security Correspondent"],"type":"string"},"bio":{"description":"Short plain-text bio (author locale override → primary locale → linked member `description_public`). Omitted for former authors.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"about":{"description":"Long \"about the author\" text in **Markdown** (author locale override → primary locale). Omitted when not set or for former authors.","type":"string"},"aboutHtml":{"description":"`about` rendered to HTML server-side (same renderer as glossary notes). Present iff `about` is.","type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"socialLinks":{"description":"Public social / professional links of the author (`content__author.social_links`, falling back to the linked member). Render as icon links; `http(s)` entries are also emitted as JSON-LD `sameAs`.","type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"description":"Lower-case platform slug (`telegram`, `x`, `linkedin`, `mastodon`, `github`, `website`, …).","examples":["telegram"],"type":"string"},"url":{"description":"Absolute http(s):// or mailto: URL.","examples":["https://t.me/kyberdacan"],"type":"string"}}}},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"postCount":{"description":"Count of publicly visible published posts main-authored by this contact in the organisation. Always ≥ 1 (the endpoint 404s when this would be 0).","examples":[42],"type":"number"},"lastPublishedDate":{"description":"Publish date of the newest post main-authored by this author.","examples":["2026-04-15T09:12:00.000Z"],"anyOf":[{"description":"Publish date of the newest post main-authored by this author.","examples":["2026-04-15T09:12:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"firstPublishedDate":{"description":"Publish date of the oldest publicly visible post main-authored by this author.","examples":["2024-02-01T08:00:00.000Z"],"anyOf":[{"description":"Publish date of the oldest publicly visible post main-authored by this author.","examples":["2024-02-01T08:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"metaTitle":{"description":"Backend-computed SEO `<title>` for the profile page — the author locale override when set, else `\"{name} — {orgName}\"`. Render directly into `<title>` — no client-side fallback needed.","examples":["Jan Barášek — Czech Cyber TV"],"type":"string"},"metaDescription":{"description":"Backend-computed SEO `<meta description>` — author locale override, then bio; falls back to a synthesized \"{jobTitle} v {orgName}. {postCount} článků.\" string. Truncated to 160 chars at a word boundary.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"jsonLd":{"description":"Ready-to-embed schema.org `Person` for `<script type=\"application/ld+json\">` on the profile page: `{ \"@context\": \"https://schema.org\", \"@type\": \"Person\", name, image?, jobTitle?, description?, sameAs?, worksFor: { \"@type\": \"Organization\", name } }`. Add your own `url` for the canonical profile URL.","type":"object","patternProperties":{"^(.*)$":{}}},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["jan-barasek"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"description":"`false` when the request hit a previous (renamed) slug — redirect (301) to the top-level `slug`.","type":"boolean"}}},"routes":{"description":"Cross-locale canonical routes for hreflang. Same slug repeats across every org locale — the author's name is language-independent, so the URL is stable across languages.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["jan-barasek"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Author \"jan-barasek\" not found or has no published posts."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["id","slug","name","socialLinks","isPseudonym","status","postCount","metaTitle","metaDescription","jsonLd","route","routes"],"properties":{"id":{"description":"Contact `shop__contact.external_id` (16-char). Stable across renames / slug changes.","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable profile slug — same across every org locale (author name is language-independent). Feed into your `/autor/<slug>` URL pattern.","examples":["jan-barasek"],"type":"string"},"name":{"description":"Public byline name (display name / pseudonym → contact name → linked user name). Falls back to `\"Autor <id>\"` when no tier has one.","examples":["Jan Barášek"],"type":"string"},"jobTitle":{"description":"Localized job title (author locale override → primary locale → linked member `job_title`). Omitted for former authors — that title no longer reflects the person's current role.","examples":["Editor in Chief","Cyber Security Correspondent"],"type":"string"},"bio":{"description":"Short plain-text bio (author locale override → primary locale → linked member `description_public`). Omitted for former authors.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"about":{"description":"Long \"about the author\" text in **Markdown** (author locale override → primary locale). Omitted when not set or for former authors.","type":"string"},"aboutHtml":{"description":"`about` rendered to HTML server-side (same renderer as glossary notes). Present iff `about` is.","type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"socialLinks":{"description":"Public social / professional links of the author (`content__author.social_links`, falling back to the linked member). Render as icon links; `http(s)` entries are also emitted as JSON-LD `sameAs`.","type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"description":"Lower-case platform slug (`telegram`, `x`, `linkedin`, `mastodon`, `github`, `website`, …).","examples":["telegram"],"type":"string"},"url":{"description":"Absolute http(s):// or mailto: URL.","examples":["https://t.me/kyberdacan"],"type":"string"}}}},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"postCount":{"description":"Count of publicly visible published posts main-authored by this contact in the organisation. Always ≥ 1 (the endpoint 404s when this would be 0).","examples":[42],"type":"number"},"lastPublishedDate":{"description":"Publish date of the newest post main-authored by this author.","examples":["2026-04-15T09:12:00.000Z"],"anyOf":[{"description":"Publish date of the newest post main-authored by this author.","examples":["2026-04-15T09:12:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"firstPublishedDate":{"description":"Publish date of the oldest publicly visible post main-authored by this author.","examples":["2024-02-01T08:00:00.000Z"],"anyOf":[{"description":"Publish date of the oldest publicly visible post main-authored by this author.","examples":["2024-02-01T08:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"metaTitle":{"description":"Backend-computed SEO `<title>` for the profile page — the author locale override when set, else `\"{name} — {orgName}\"`. Render directly into `<title>` — no client-side fallback needed.","examples":["Jan Barášek — Czech Cyber TV"],"type":"string"},"metaDescription":{"description":"Backend-computed SEO `<meta description>` — author locale override, then bio; falls back to a synthesized \"{jobTitle} v {orgName}. {postCount} článků.\" string. Truncated to 160 chars at a word boundary.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"jsonLd":{"description":"Ready-to-embed schema.org `Person` for `<script type=\"application/ld+json\">` on the profile page: `{ \"@context\": \"https://schema.org\", \"@type\": \"Person\", name, image?, jobTitle?, description?, sameAs?, worksFor: { \"@type\": \"Organization\", name } }`. Add your own `url` for the canonical profile URL.","type":"object","patternProperties":{"^(.*)$":{}}},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["jan-barasek"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"description":"`false` when the request hit a previous (renamed) slug — redirect (301) to the top-level `slug`.","type":"boolean"}}},"routes":{"description":"Cross-locale canonical routes for hreflang. Same slug repeats across every org locale — the author's name is language-independent, so the URL is stable across languages.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["jan-barasek"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Author \"jan-barasek\" not found or has no published posts."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["id","slug","name","socialLinks","isPseudonym","status","postCount","metaTitle","metaDescription","jsonLd","route","routes"],"properties":{"id":{"description":"Contact `shop__contact.external_id` (16-char). Stable across renames / slug changes.","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable profile slug — same across every org locale (author name is language-independent). Feed into your `/autor/<slug>` URL pattern.","examples":["jan-barasek"],"type":"string"},"name":{"description":"Public byline name (display name / pseudonym → contact name → linked user name). Falls back to `\"Autor <id>\"` when no tier has one.","examples":["Jan Barášek"],"type":"string"},"jobTitle":{"description":"Localized job title (author locale override → primary locale → linked member `job_title`). Omitted for former authors — that title no longer reflects the person's current role.","examples":["Editor in Chief","Cyber Security Correspondent"],"type":"string"},"bio":{"description":"Short plain-text bio (author locale override → primary locale → linked member `description_public`). Omitted for former authors.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"about":{"description":"Long \"about the author\" text in **Markdown** (author locale override → primary locale). Omitted when not set or for former authors.","type":"string"},"aboutHtml":{"description":"`about` rendered to HTML server-side (same renderer as glossary notes). Present iff `about` is.","type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"socialLinks":{"description":"Public social / professional links of the author (`content__author.social_links`, falling back to the linked member). Render as icon links; `http(s)` entries are also emitted as JSON-LD `sameAs`.","type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"description":"Lower-case platform slug (`telegram`, `x`, `linkedin`, `mastodon`, `github`, `website`, …).","examples":["telegram"],"type":"string"},"url":{"description":"Absolute http(s):// or mailto: URL.","examples":["https://t.me/kyberdacan"],"type":"string"}}}},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"postCount":{"description":"Count of publicly visible published posts main-authored by this contact in the organisation. Always ≥ 1 (the endpoint 404s when this would be 0).","examples":[42],"type":"number"},"lastPublishedDate":{"description":"Publish date of the newest post main-authored by this author.","examples":["2026-04-15T09:12:00.000Z"],"anyOf":[{"description":"Publish date of the newest post main-authored by this author.","examples":["2026-04-15T09:12:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"firstPublishedDate":{"description":"Publish date of the oldest publicly visible post main-authored by this author.","examples":["2024-02-01T08:00:00.000Z"],"anyOf":[{"description":"Publish date of the oldest publicly visible post main-authored by this author.","examples":["2024-02-01T08:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"metaTitle":{"description":"Backend-computed SEO `<title>` for the profile page — the author locale override when set, else `\"{name} — {orgName}\"`. Render directly into `<title>` — no client-side fallback needed.","examples":["Jan Barášek — Czech Cyber TV"],"type":"string"},"metaDescription":{"description":"Backend-computed SEO `<meta description>` — author locale override, then bio; falls back to a synthesized \"{jobTitle} v {orgName}. {postCount} článků.\" string. Truncated to 160 chars at a word boundary.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"jsonLd":{"description":"Ready-to-embed schema.org `Person` for `<script type=\"application/ld+json\">` on the profile page: `{ \"@context\": \"https://schema.org\", \"@type\": \"Person\", name, image?, jobTitle?, description?, sameAs?, worksFor: { \"@type\": \"Organization\", name } }`. Add your own `url` for the canonical profile URL.","type":"object","patternProperties":{"^(.*)$":{}}},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["jan-barasek"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"description":"`false` when the request hit a previous (renamed) slug — redirect (301) to the top-level `slug`.","type":"boolean"}}},"routes":{"description":"Cross-locale canonical routes for hreflang. Same slug repeats across every org locale — the author's name is language-independent, so the URL is stable across languages.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["jan-barasek"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Author \"jan-barasek\" not found or has no published posts."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["id","slug","name","socialLinks","isPseudonym","status","postCount","metaTitle","metaDescription","jsonLd","route","routes"],"properties":{"id":{"description":"Contact `shop__contact.external_id` (16-char). Stable across renames / slug changes.","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable profile slug — same across every org locale (author name is language-independent). Feed into your `/autor/<slug>` URL pattern.","examples":["jan-barasek"],"type":"string"},"name":{"description":"Public byline name (display name / pseudonym → contact name → linked user name). Falls back to `\"Autor <id>\"` when no tier has one.","examples":["Jan Barášek"],"type":"string"},"jobTitle":{"description":"Localized job title (author locale override → primary locale → linked member `job_title`). Omitted for former authors — that title no longer reflects the person's current role.","examples":["Editor in Chief","Cyber Security Correspondent"],"type":"string"},"bio":{"description":"Short plain-text bio (author locale override → primary locale → linked member `description_public`). Omitted for former authors.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"about":{"description":"Long \"about the author\" text in **Markdown** (author locale override → primary locale). Omitted when not set or for former authors.","type":"string"},"aboutHtml":{"description":"`about` rendered to HTML server-side (same renderer as glossary notes). Present iff `about` is.","type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"socialLinks":{"description":"Public social / professional links of the author (`content__author.social_links`, falling back to the linked member). Render as icon links; `http(s)` entries are also emitted as JSON-LD `sameAs`.","type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"description":"Lower-case platform slug (`telegram`, `x`, `linkedin`, `mastodon`, `github`, `website`, …).","examples":["telegram"],"type":"string"},"url":{"description":"Absolute http(s):// or mailto: URL.","examples":["https://t.me/kyberdacan"],"type":"string"}}}},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"postCount":{"description":"Count of publicly visible published posts main-authored by this contact in the organisation. Always ≥ 1 (the endpoint 404s when this would be 0).","examples":[42],"type":"number"},"lastPublishedDate":{"description":"Publish date of the newest post main-authored by this author.","examples":["2026-04-15T09:12:00.000Z"],"anyOf":[{"description":"Publish date of the newest post main-authored by this author.","examples":["2026-04-15T09:12:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"firstPublishedDate":{"description":"Publish date of the oldest publicly visible post main-authored by this author.","examples":["2024-02-01T08:00:00.000Z"],"anyOf":[{"description":"Publish date of the oldest publicly visible post main-authored by this author.","examples":["2024-02-01T08:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"metaTitle":{"description":"Backend-computed SEO `<title>` for the profile page — the author locale override when set, else `\"{name} — {orgName}\"`. Render directly into `<title>` — no client-side fallback needed.","examples":["Jan Barášek — Czech Cyber TV"],"type":"string"},"metaDescription":{"description":"Backend-computed SEO `<meta description>` — author locale override, then bio; falls back to a synthesized \"{jobTitle} v {orgName}. {postCount} článků.\" string. Truncated to 160 chars at a word boundary.","examples":["Novinář se specializací na kyberbezpečnost a AI. 15 let v oboru…"],"type":"string"},"jsonLd":{"description":"Ready-to-embed schema.org `Person` for `<script type=\"application/ld+json\">` on the profile page: `{ \"@context\": \"https://schema.org\", \"@type\": \"Person\", name, image?, jobTitle?, description?, sameAs?, worksFor: { \"@type\": \"Organization\", name } }`. Add your own `url` for the canonical profile URL.","type":"object","patternProperties":{"^(.*)$":{}}},"route":{"type":"object","required":["slug","locale","canonical"],"properties":{"slug":{"examples":["jan-barasek"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"description":"`false` when the request hit a previous (renamed) slug — redirect (301) to the top-level `slug`.","type":"boolean"}}},"routes":{"description":"Cross-locale canonical routes for hreflang. Same slug repeats across every org locale — the author's name is language-independent, so the URL is stable across languages.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"examples":["jan-barasek"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"examples":["Author \"jan-barasek\" not found or has no published posts."],"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostAuthor","tags":["post"],"summary":"Get author profile detail","description":"Returns a public author profile for the given `slug` (routable URL) or `id` (contact external id). The author must own at least one publicly visible published post — otherwise returns an error envelope (contacts without published content have no public profile by design).\n\n**Lazy route backfill.** The very first request per author triggers a route insert (one row per org locale, same slug across all locales — author names are language-independent). Every subsequent request is a plain read. No batch job is needed to populate profiles ahead of time.\n\n**Author profiles (`content__author`).** Every presentational field is an override with inheritance: name (display name / pseudonym → contact → linked user), avatar (author → contact → linked user), jobTitle / bio / about (requested-locale override → primary-locale override → linked member). Only an explicitly linked member is inherited from, so pseudonymous authors never leak the real person.\n\n**Renamed slugs.** A previous (demoted) slug still resolves: the response then carries `route.canonical = false` and the new canonical `slug` — 301 to it.\n\n**Status flag.** `status: \"active\"` unless the author profile has an end date or its linked member is blocked (`\"former\"`). External contributors without membership are active. Historical posts stay attributed regardless — news sites do not rewrite bylines — but `bio`, `about` and `jobTitle` are suppressed for former authors because they no longer represent the person's current role. Consumer sites typically render a small \"former contributor\" badge on former profiles.\n\n**Backend-computed SEO.** `metaTitle = \"{name} — {orgName}\"`, `metaDescription = bio || fallback \"{jobTitle} v {orgName}. {postCount} článků.\"` (truncated to 160 chars). Frontends should render these directly into `<title>` / `<meta description>` without applying their own fallback logic.\n\n**Article feed.** Use `/api/v1/post/feed?author=<slug-or-id>` to fetch the paginated list of articles by this author — same shape as the main feed, just filtered."}},"/api/v1/post/author-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false},{"description":"Maximum number of authors to return. Default 50, hard-capped at 200.","examples":[50],"schema":{"minimum":1,"maximum":200,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":200,"examples":[50],"description":"Maximum number of authors to return. Default 50, hard-capped at 200.","type":"integer"}]},"in":"query","name":"limit","required":false},{"description":"Zero-based pagination offset. Use with `limit` + `hasMore`/`total`.","examples":[0,50,100],"schema":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"examples":[0,50,100],"description":"Zero-based pagination offset. Use with `limit` + `hasMore`/`total`.","type":"integer"}]},"in":"query","name":"offset","required":false},{"description":"Ordering of the returned list. Default `postCount:desc` — editorial standard (prolific journalists first, matches how news sites present /autori indexes). `lastPublishedDate:desc` = \"recently active\" (best for dynamic sidebars). `name:asc` = predictable alphabetical directory (best for print-style team pages). `position:asc` = editorial order set in admin (Posts → Authors), unordered authors last.","examples":["postCount:desc","lastPublishedDate:desc","name:asc","position:asc"],"schema":{"anyOf":[{"const":"postCount:desc","type":"string"},{"const":"lastPublishedDate:desc","type":"string"},{"const":"name:asc","type":"string"},{"const":"position:asc","type":"string"}]},"in":"query","name":"orderBy","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","socialLinks","isPseudonym","status","postCount"],"properties":{"id":{"description":"Contact `shop__contact.external_id` (16-char).","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable profile slug for the current locale (same across every org locale).","examples":["jan-barasek"],"type":"string"},"name":{"description":"Public byline name (display name / pseudonym → contact → linked user).","examples":["Jan Barášek"],"type":"string"},"jobTitle":{"description":"Localized job title. Omitted for former authors.","examples":["Editor in Chief"],"type":"string"},"bio":{"description":"Localized short plain-text bio. Omitted for former authors.","type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"socialLinks":{"description":"Public social / professional links of the author (`content__author.social_links`, falling back to the linked member). Render as icon links; `http(s)` entries are also emitted as JSON-LD `sameAs`.","type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"description":"Lower-case platform slug (`telegram`, `x`, `linkedin`, `mastodon`, `github`, `website`, …).","examples":["telegram"],"type":"string"},"url":{"description":"Absolute http(s):// or mailto: URL.","examples":["https://t.me/kyberdacan"],"type":"string"}}}},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"postCount":{"description":"Count of publicly visible published posts main-authored by this contact.","examples":[42],"type":"number"},"lastPublishedDate":{"description":"Publish date of the newest post main-authored by this contact.","examples":["2026-04-15T09:12:00.000Z"],"anyOf":[{"description":"Publish date of the newest post main-authored by this contact.","examples":["2026-04-15T09:12:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"total":{"examples":[23],"description":"Total number of authors matching the base filter (published-post owners). Independent of `limit`/`offset`.","type":"number"},"hasMore":{"examples":[true,false],"description":"`offset + items.length < total` — true when more pages are available.","type":"boolean"}},"required":["items","total","hasMore"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","socialLinks","isPseudonym","status","postCount"],"properties":{"id":{"description":"Contact `shop__contact.external_id` (16-char).","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable profile slug for the current locale (same across every org locale).","examples":["jan-barasek"],"type":"string"},"name":{"description":"Public byline name (display name / pseudonym → contact → linked user).","examples":["Jan Barášek"],"type":"string"},"jobTitle":{"description":"Localized job title. Omitted for former authors.","examples":["Editor in Chief"],"type":"string"},"bio":{"description":"Localized short plain-text bio. Omitted for former authors.","type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"socialLinks":{"description":"Public social / professional links of the author (`content__author.social_links`, falling back to the linked member). Render as icon links; `http(s)` entries are also emitted as JSON-LD `sameAs`.","type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"description":"Lower-case platform slug (`telegram`, `x`, `linkedin`, `mastodon`, `github`, `website`, …).","examples":["telegram"],"type":"string"},"url":{"description":"Absolute http(s):// or mailto: URL.","examples":["https://t.me/kyberdacan"],"type":"string"}}}},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"postCount":{"description":"Count of publicly visible published posts main-authored by this contact.","examples":[42],"type":"number"},"lastPublishedDate":{"description":"Publish date of the newest post main-authored by this contact.","examples":["2026-04-15T09:12:00.000Z"],"anyOf":[{"description":"Publish date of the newest post main-authored by this contact.","examples":["2026-04-15T09:12:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"total":{"examples":[23],"description":"Total number of authors matching the base filter (published-post owners). Independent of `limit`/`offset`.","type":"number"},"hasMore":{"examples":[true,false],"description":"`offset + items.length < total` — true when more pages are available.","type":"boolean"}},"required":["items","total","hasMore"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","socialLinks","isPseudonym","status","postCount"],"properties":{"id":{"description":"Contact `shop__contact.external_id` (16-char).","examples":["71E58E5SjdZN6ut3"],"type":"string"},"slug":{"description":"Routable profile slug for the current locale (same across every org locale).","examples":["jan-barasek"],"type":"string"},"name":{"description":"Public byline name (display name / pseudonym → contact → linked user).","examples":["Jan Barášek"],"type":"string"},"jobTitle":{"description":"Localized job title. Omitted for former authors.","examples":["Editor in Chief"],"type":"string"},"bio":{"description":"Localized short plain-text bio. Omitted for former authors.","type":"string"},"avatarUrl":{"description":"Fully qualified avatar URL (author avatar → contact avatar → linked user avatar). Omitted when no tier has one.","examples":["https://storage.xhp.cz/avatar/…"],"type":"string"},"socialLinks":{"description":"Public social / professional links of the author (`content__author.social_links`, falling back to the linked member). Render as icon links; `http(s)` entries are also emitted as JSON-LD `sameAs`.","type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"description":"Lower-case platform slug (`telegram`, `x`, `linkedin`, `mastodon`, `github`, `website`, …).","examples":["telegram"],"type":"string"},"url":{"description":"Absolute http(s):// or mailto: URL.","examples":["https://t.me/kyberdacan"],"type":"string"}}}},"isPseudonym":{"description":"True when the author writes under a pseudonym (`content__author.is_pseudonym`).","examples":[false],"type":"boolean"},"status":{"description":"`former` when the author profile has an end date or its linked member is blocked; `active` otherwise (external contributors without membership are active).","anyOf":[{"const":"active","type":"string"},{"const":"former","type":"string"}]},"postCount":{"description":"Count of publicly visible published posts main-authored by this contact.","examples":[42],"type":"number"},"lastPublishedDate":{"description":"Publish date of the newest post main-authored by this contact.","examples":["2026-04-15T09:12:00.000Z"],"anyOf":[{"description":"Publish date of the newest post main-authored by this contact.","examples":["2026-04-15T09:12:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"total":{"examples":[23],"description":"Total number of authors matching the base filter (published-post owners). Independent of `limit`/`offset`.","type":"number"},"hasMore":{"examples":[true,false],"description":"`offset + items.length < total` — true when more pages are available.","type":"boolean"}},"required":["items","total","hasMore"]}}}}},"operationId":"getApiV1PostAuthor-list","tags":["post"],"summary":"List authors for the organisation","description":"Returns a paginated feed of authors that have shipped at least one publicly visible published post in the organisation. Powers the `/autori` index page + footer/sitemap author list. Authors with a hidden profile page are excluded.\n\n**Only main authors are counted.** Co-authors do not appear in the index — the \"authors\" page convention on news sites lists primary bylines only. Co-author attributions still show up on individual article pages via `/api/v1/post/post` `authors[]`.\n\n**Batched route resolution.** Every returned author already carries the routable `slug` (lazy backfilled server-side in one round-trip regardless of author count). Feed into your `/autor/<slug>` URL pattern directly.\n\n**Article feed per author:** `/api/v1/post/feed?author=<slug-or-id>`."}},"/api/v1/post/feed":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false},{"description":"Comma-separated list of additional fields to include in the response. Supported values: `content` (adds a sanitized single-line teaser), `routes` (adds the cross-locale canonical routes for hreflang / sitemap use), `editions` (adds the language × country editions the post is published in), `author` (adds `{ name, profileSlug }` for the post main author), `views` (adds cumulative `viewsCount`), `perex` (adds the localized perex; empty string when not authored), `readingTime` (adds `readingTimeMinutes` computed from the post HTML at ~200 wpm, always >= 1), `fallbackImage` (adds `fallbackImageUrl`: the first `<img src>` in the body, else the thumbnail of the first embedded YouTube video; only when the post has no main image). Example: `content,routes,author`.","examples":["content","routes","content,routes","author,views,readingTime","routes,editions"],"schema":{"type":"string"},"in":"query","name":"fields","required":false},{"description":"Maximum number of items to return. If omitted, a default internal limit is applied.","examples":[64],"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"description":"Zero-based offset for pagination. Skips the first `offset` items after the WHERE / ORDER BY are applied. Combine with `limit` to page through results; use the top-level `total` / `hasMore` in the response to know when to stop.","examples":[0,20,40],"schema":{"type":"number","minimum":0},"in":"query","name":"offset","required":false},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false},{"description":"Optional tag code to filter posts. Only posts that have this tag assigned will be returned. The tag must be active and belong to the same organisation.","examples":["novinky","bezpecnost"],"schema":{"type":"string"},"in":"query","name":"tag","required":false},{"description":"Optional main category route slug to filter posts. Only posts that have this category set as their main category will be returned.","examples":["novinky","clanky"],"schema":{"type":"string"},"in":"query","name":"mainCategory","required":false},{"description":"Filter to only pinned/starred posts (typically the homepage hero slot).","examples":[true],"schema":{"type":"boolean"},"in":"query","name":"onlyStarred","required":false},{"description":"Filter to posts main-authored by this identifier. Accepts either the author route slug (routable public URL — resolved via `core__route` with `type_id=author`) OR the `shop__contact.external_id` (16-char). Same value works for both — the endpoint picks the first matching contact in the caller organisation. Powers the \"posts by author X\" feed on `/autor/<slug>` pages.","examples":["jan-barasek","71E58E5SjdZN6ut3"],"schema":{"type":"string"},"in":"query","name":"author","required":false},{"description":"Ordering of the returned list. Defaults to the organisation setting `post_feed_default_order` (admin /settings/posts), else `updatedDate:desc`. The implicit `is_star DESC` prefix is preserved for every ordering so pinned posts stay at the top.","examples":["publishedDate:desc","views:desc"],"schema":{"anyOf":[{"const":"updatedDate:desc","type":"string"},{"const":"publishedDate:desc","type":"string"},{"const":"publishedDate:asc","type":"string"},{"const":"views:desc","type":"string"},{"const":"commentCount:desc","type":"string"},{"const":"title:asc","type":"string"},{"const":"title:desc","type":"string"}]},"in":"query","name":"orderBy","required":false},{"description":"Optional ISO 3166-1 alpha-2 country code of the visitor (e.g. \"CZ\"). When set, the response is filtered to posts whose per-country / per-continent allowlist matches the visitor — a post targeted at continent \"EU\" matches every EU country, and a post with no rules stays globally available. When omitted, the filter is disabled and every post is returned regardless of geo settings. The API does NOT infer the country from the caller's IP; it is up to the caller to resolve and supply it. Case-insensitive. Unknown codes are rejected with HTTP 400 (`PUBLIC_COUNTRY_CODE_UNKNOWN`). The pseudo code `INT` selects the international (region-less) edition of a multi-region publication: only posts WITHOUT any country / continent rule.","examples":["CZ","DE","SK","INT"],"schema":{"type":"string","minLength":2,"maxLength":3},"in":"query","name":"country","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","title","last_modification_date","publishedDate","commentCount","tagList"],"properties":{"id":{"description":"Post public id (`content__post.external_id`, 16-char string). Stable across renames.","examples":["6IU2SWgP76FO2UXw"],"type":"string"},"slug":{"description":"Unique URL-friendly identifier of the article. Used to construct the public route.","examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"title":{"description":"Human-readable article title. Returned in the language specified in the locale parameter.","examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"type":"string"},"mainImageUrl":{"description":"URL of the main/featured image for the post. Null if no main image is set.","examples":["https://storage.xhp.cz/..."],"type":"string"},"last_modification_date":{"description":"Timestamp of the last modification of the article. ISO 8601 format.","examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"description":"Timestamp of the last modification of the article. ISO 8601 format.","examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"publishedDate":{"nullable":true,"anyOf":[{"description":"First-published timestamp of the article. Null for older posts that never had a publish date recorded.","examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"description":"First-published timestamp of the article. Null for older posts that never had a publish date recorded.","examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"commentCount":{"examples":[12],"description":"Number of comments associated with the article.","type":"number"},"isStar":{"description":"True if the post is starred/pinned. Omitted when false.","type":"boolean"},"content":{"description":"Full article content in plain text or HTML. Returned only if the field is explicitly requested via the `fields` query parameter.","examples":["Žijeme ve světě, kde je normální..."],"type":"string"},"perex":{"description":"Localized perex (short lead paragraph). Present only when `fields` includes `perex`. Empty string when the author did not fill in a perex for this locale.","examples":["Krátký úvodní odstavec článku…"],"type":"string"},"viewsCount":{"description":"Cumulative public read count from `/api/v1/post` (buffered + flushed by cron). Present only when `fields` includes `views`.","examples":[1240],"type":"number"},"readingTimeMinutes":{"description":"Estimated reading time in whole minutes at ~200 words per minute. Computed on the fly from the post HTML. Always at least `1`, even for very short posts (matches the Medium convention). Present only when `fields` includes `readingTime`.","examples":[1,3,12],"type":"number"},"fallbackImageUrl":{"nullable":true,"anyOf":[{"description":"URL of the first `<img>` found in the post body, else the thumbnail of the first embedded YouTube video (`https://i.ytimg.com/vi/<id>/hqdefault.jpg`). Present only when `fields` includes `fallbackImage`. `null` when the post already has a `mainImageUrl` (no fallback needed) or when the body contains neither. Relative paths are returned as-is; the caller is responsible for resolving them against a base URL.","examples":["https://cdn.example.com/inline-hero.jpg"],"type":"string"},{"type":"null"}]},"author":{"description":"Main author of the post. Present only when `fields` includes `author`. Falls back to `{ name: \"\", profileSlug: \"\" }` when the author record is missing or filtered out by the organisation scope.","type":"object","required":["name","profileSlug"],"properties":{"name":{"description":"Public byline name of the main author (display name / pseudonym aware).","examples":["Jan Barášek"],"type":"string"},"profileSlug":{"description":"Author identity — `shop__contact.external_id` of the main author.","examples":["abcdef0123456789"],"type":"string"},"slug":{"description":"Routable author profile slug (`/post/author?slug=`). Empty string when the profile page is hidden.","examples":["jan-barasek"],"type":"string"},"avatarUrl":{"description":"Author avatar URL (author → contact → linked user). Omitted when none.","type":"string"}}},"mainCategory":{"description":"Main category of the post. Null if no main category is assigned or if the category has no route/locale data for the requested locale.","type":"object","required":["slug","title"],"properties":{"slug":{"description":"URL-friendly slug of the main category route in the requested locale. Use this to construct links to the category page.","examples":["novinky"],"type":"string"},"title":{"description":"Localized display name of the main category.","examples":["Novinky"],"type":"string"}}},"tagList":{"description":"Array of tags assigned to this post. Empty array if no tags are assigned. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag. Can be used to filter posts by tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag (e.g., \"#FF5733\"). Null if no color is set.","examples":["#3B82F6"],"type":"string"}}}},"routes":{"description":"Canonical routes for every locale this post is translated into. Present only when `fields` includes `routes`. Use it to build sitemap alternates / hreflang links without calling /post per item.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"description":"Canonical URL-friendly slug of the post in the given locale.","examples":["kyber-cena-roku-2025"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"editions":{"description":"Editions (language × optional country) the post is published in. An unrestricted post lists one international edition (`countryCode: null`) per translated organisation language; it also appears in every regional edition of that language as a copy whose canonical URL is the international one. A post restricted to countries / continents lists one self-canonical regional edition per allowed country where a translated language is official (`core__country_language`), and no international edition. Present only when `fields` includes `editions`.","type":"array","items":{"type":"object","required":["locale","countryCode","slug"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"countryCode":{"nullable":true,"anyOf":[{"examples":["CH"],"description":"ISO 3166-1 alpha-2 country of a regional edition, or null for the international edition of `locale`.","type":"string"},{"type":"null"}]},"slug":{"description":"Canonical slug of the post in `locale`.","type":"string"}}}}}}},"total":{"examples":[428],"description":"Total number of posts matching the same WHERE (locale, tag, mainCategory, onlyStarred, visibility). Independent of `limit` / `offset` — use it to render paginators.","type":"number"},"hasMore":{"examples":[true,false],"description":"True when there are more items beyond the current page — computed as `offset + items.length < total`.","type":"boolean"}},"required":["items","total","hasMore"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","title","last_modification_date","publishedDate","commentCount","tagList"],"properties":{"id":{"description":"Post public id (`content__post.external_id`, 16-char string). Stable across renames.","examples":["6IU2SWgP76FO2UXw"],"type":"string"},"slug":{"description":"Unique URL-friendly identifier of the article. Used to construct the public route.","examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"title":{"description":"Human-readable article title. Returned in the language specified in the locale parameter.","examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"type":"string"},"mainImageUrl":{"description":"URL of the main/featured image for the post. Null if no main image is set.","examples":["https://storage.xhp.cz/..."],"type":"string"},"last_modification_date":{"description":"Timestamp of the last modification of the article. ISO 8601 format.","examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"description":"Timestamp of the last modification of the article. ISO 8601 format.","examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"publishedDate":{"nullable":true,"anyOf":[{"description":"First-published timestamp of the article. Null for older posts that never had a publish date recorded.","examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"description":"First-published timestamp of the article. Null for older posts that never had a publish date recorded.","examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"commentCount":{"examples":[12],"description":"Number of comments associated with the article.","type":"number"},"isStar":{"description":"True if the post is starred/pinned. Omitted when false.","type":"boolean"},"content":{"description":"Full article content in plain text or HTML. Returned only if the field is explicitly requested via the `fields` query parameter.","examples":["Žijeme ve světě, kde je normální..."],"type":"string"},"perex":{"description":"Localized perex (short lead paragraph). Present only when `fields` includes `perex`. Empty string when the author did not fill in a perex for this locale.","examples":["Krátký úvodní odstavec článku…"],"type":"string"},"viewsCount":{"description":"Cumulative public read count from `/api/v1/post` (buffered + flushed by cron). Present only when `fields` includes `views`.","examples":[1240],"type":"number"},"readingTimeMinutes":{"description":"Estimated reading time in whole minutes at ~200 words per minute. Computed on the fly from the post HTML. Always at least `1`, even for very short posts (matches the Medium convention). Present only when `fields` includes `readingTime`.","examples":[1,3,12],"type":"number"},"fallbackImageUrl":{"nullable":true,"anyOf":[{"description":"URL of the first `<img>` found in the post body, else the thumbnail of the first embedded YouTube video (`https://i.ytimg.com/vi/<id>/hqdefault.jpg`). Present only when `fields` includes `fallbackImage`. `null` when the post already has a `mainImageUrl` (no fallback needed) or when the body contains neither. Relative paths are returned as-is; the caller is responsible for resolving them against a base URL.","examples":["https://cdn.example.com/inline-hero.jpg"],"type":"string"},{"type":"null"}]},"author":{"description":"Main author of the post. Present only when `fields` includes `author`. Falls back to `{ name: \"\", profileSlug: \"\" }` when the author record is missing or filtered out by the organisation scope.","type":"object","required":["name","profileSlug"],"properties":{"name":{"description":"Public byline name of the main author (display name / pseudonym aware).","examples":["Jan Barášek"],"type":"string"},"profileSlug":{"description":"Author identity — `shop__contact.external_id` of the main author.","examples":["abcdef0123456789"],"type":"string"},"slug":{"description":"Routable author profile slug (`/post/author?slug=`). Empty string when the profile page is hidden.","examples":["jan-barasek"],"type":"string"},"avatarUrl":{"description":"Author avatar URL (author → contact → linked user). Omitted when none.","type":"string"}}},"mainCategory":{"description":"Main category of the post. Null if no main category is assigned or if the category has no route/locale data for the requested locale.","type":"object","required":["slug","title"],"properties":{"slug":{"description":"URL-friendly slug of the main category route in the requested locale. Use this to construct links to the category page.","examples":["novinky"],"type":"string"},"title":{"description":"Localized display name of the main category.","examples":["Novinky"],"type":"string"}}},"tagList":{"description":"Array of tags assigned to this post. Empty array if no tags are assigned. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag. Can be used to filter posts by tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag (e.g., \"#FF5733\"). Null if no color is set.","examples":["#3B82F6"],"type":"string"}}}},"routes":{"description":"Canonical routes for every locale this post is translated into. Present only when `fields` includes `routes`. Use it to build sitemap alternates / hreflang links without calling /post per item.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"description":"Canonical URL-friendly slug of the post in the given locale.","examples":["kyber-cena-roku-2025"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"editions":{"description":"Editions (language × optional country) the post is published in. An unrestricted post lists one international edition (`countryCode: null`) per translated organisation language; it also appears in every regional edition of that language as a copy whose canonical URL is the international one. A post restricted to countries / continents lists one self-canonical regional edition per allowed country where a translated language is official (`core__country_language`), and no international edition. Present only when `fields` includes `editions`.","type":"array","items":{"type":"object","required":["locale","countryCode","slug"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"countryCode":{"nullable":true,"anyOf":[{"examples":["CH"],"description":"ISO 3166-1 alpha-2 country of a regional edition, or null for the international edition of `locale`.","type":"string"},{"type":"null"}]},"slug":{"description":"Canonical slug of the post in `locale`.","type":"string"}}}}}}},"total":{"examples":[428],"description":"Total number of posts matching the same WHERE (locale, tag, mainCategory, onlyStarred, visibility). Independent of `limit` / `offset` — use it to render paginators.","type":"number"},"hasMore":{"examples":[true,false],"description":"True when there are more items beyond the current page — computed as `offset + items.length < total`.","type":"boolean"}},"required":["items","total","hasMore"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","title","last_modification_date","publishedDate","commentCount","tagList"],"properties":{"id":{"description":"Post public id (`content__post.external_id`, 16-char string). Stable across renames.","examples":["6IU2SWgP76FO2UXw"],"type":"string"},"slug":{"description":"Unique URL-friendly identifier of the article. Used to construct the public route.","examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"title":{"description":"Human-readable article title. Returned in the language specified in the locale parameter.","examples":["KYBER CENA ROKU 2025: největší večer české kyberbezpečnosti letošního roku."],"type":"string"},"mainImageUrl":{"description":"URL of the main/featured image for the post. Null if no main image is set.","examples":["https://storage.xhp.cz/..."],"type":"string"},"last_modification_date":{"description":"Timestamp of the last modification of the article. ISO 8601 format.","examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"description":"Timestamp of the last modification of the article. ISO 8601 format.","examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"publishedDate":{"nullable":true,"anyOf":[{"description":"First-published timestamp of the article. Null for older posts that never had a publish date recorded.","examples":["2025-11-05T15:54:44.280Z"],"anyOf":[{"description":"First-published timestamp of the article. Null for older posts that never had a publish date recorded.","examples":["2025-11-05T15:54:44.280Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"commentCount":{"examples":[12],"description":"Number of comments associated with the article.","type":"number"},"isStar":{"description":"True if the post is starred/pinned. Omitted when false.","type":"boolean"},"content":{"description":"Full article content in plain text or HTML. Returned only if the field is explicitly requested via the `fields` query parameter.","examples":["Žijeme ve světě, kde je normální..."],"type":"string"},"perex":{"description":"Localized perex (short lead paragraph). Present only when `fields` includes `perex`. Empty string when the author did not fill in a perex for this locale.","examples":["Krátký úvodní odstavec článku…"],"type":"string"},"viewsCount":{"description":"Cumulative public read count from `/api/v1/post` (buffered + flushed by cron). Present only when `fields` includes `views`.","examples":[1240],"type":"number"},"readingTimeMinutes":{"description":"Estimated reading time in whole minutes at ~200 words per minute. Computed on the fly from the post HTML. Always at least `1`, even for very short posts (matches the Medium convention). Present only when `fields` includes `readingTime`.","examples":[1,3,12],"type":"number"},"fallbackImageUrl":{"nullable":true,"anyOf":[{"description":"URL of the first `<img>` found in the post body, else the thumbnail of the first embedded YouTube video (`https://i.ytimg.com/vi/<id>/hqdefault.jpg`). Present only when `fields` includes `fallbackImage`. `null` when the post already has a `mainImageUrl` (no fallback needed) or when the body contains neither. Relative paths are returned as-is; the caller is responsible for resolving them against a base URL.","examples":["https://cdn.example.com/inline-hero.jpg"],"type":"string"},{"type":"null"}]},"author":{"description":"Main author of the post. Present only when `fields` includes `author`. Falls back to `{ name: \"\", profileSlug: \"\" }` when the author record is missing or filtered out by the organisation scope.","type":"object","required":["name","profileSlug"],"properties":{"name":{"description":"Public byline name of the main author (display name / pseudonym aware).","examples":["Jan Barášek"],"type":"string"},"profileSlug":{"description":"Author identity — `shop__contact.external_id` of the main author.","examples":["abcdef0123456789"],"type":"string"},"slug":{"description":"Routable author profile slug (`/post/author?slug=`). Empty string when the profile page is hidden.","examples":["jan-barasek"],"type":"string"},"avatarUrl":{"description":"Author avatar URL (author → contact → linked user). Omitted when none.","type":"string"}}},"mainCategory":{"description":"Main category of the post. Null if no main category is assigned or if the category has no route/locale data for the requested locale.","type":"object","required":["slug","title"],"properties":{"slug":{"description":"URL-friendly slug of the main category route in the requested locale. Use this to construct links to the category page.","examples":["novinky"],"type":"string"},"title":{"description":"Localized display name of the main category.","examples":["Novinky"],"type":"string"}}},"tagList":{"description":"Array of tags assigned to this post. Empty array if no tags are assigned. Only active tags are included.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"URL-friendly code/slug of the tag. Can be used to filter posts by tag.","examples":["bezpecnost"],"type":"string"},"name":{"description":"Human-readable display name of the tag.","examples":["Bezpečnost"],"type":"string"},"color":{"description":"Hex color code for the tag (e.g., \"#FF5733\"). Null if no color is set.","examples":["#3B82F6"],"type":"string"}}}},"routes":{"description":"Canonical routes for every locale this post is translated into. Present only when `fields` includes `routes`. Use it to build sitemap alternates / hreflang links without calling /post per item.","type":"array","items":{"type":"object","required":["slug","locale"],"properties":{"slug":{"description":"Canonical URL-friendly slug of the post in the given locale.","examples":["kyber-cena-roku-2025"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"editions":{"description":"Editions (language × optional country) the post is published in. An unrestricted post lists one international edition (`countryCode: null`) per translated organisation language; it also appears in every regional edition of that language as a copy whose canonical URL is the international one. A post restricted to countries / continents lists one self-canonical regional edition per allowed country where a translated language is official (`core__country_language`), and no international edition. Present only when `fields` includes `editions`.","type":"array","items":{"type":"object","required":["locale","countryCode","slug"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"countryCode":{"nullable":true,"anyOf":[{"examples":["CH"],"description":"ISO 3166-1 alpha-2 country of a regional edition, or null for the international edition of `locale`.","type":"string"},{"type":"null"}]},"slug":{"description":"Canonical slug of the post in `locale`.","type":"string"}}}}}}},"total":{"examples":[428],"description":"Total number of posts matching the same WHERE (locale, tag, mainCategory, onlyStarred, visibility). Independent of `limit` / `offset` — use it to render paginators.","type":"number"},"hasMore":{"examples":[true,false],"description":"True when there are more items beyond the current page — computed as `offset + items.length < total`.","type":"boolean"}},"required":["items","total","hasMore"]}}}}},"operationId":"getApiV1PostFeed","tags":["post"],"summary":"Get post feed","description":"Returns a feed of the most recent posts. Posts are filtered by the requested locale and ordered by their last modification date. The limit parameter controls how many items are returned, and the optional fields parameter lets you request additional properties (for example content). When requested, the content field is returned as a sanitized, single-line teaser truncated to a fixed length suitable for listing views. You can filter posts by tag (using tag code) or by main category (using category route slug).\n\n**Pagination:** use `limit` together with `offset` to page through results. The response always carries a top-level `total` (count of items matching the same WHERE) and `hasMore` (`offset + items.length < total`) so paginators do not need a second call to know when to stop.\n\n**Ordering:** `orderBy` accepts a whitelisted set of values (`updatedDate:desc` — default, `publishedDate:desc`, `publishedDate:asc`, `views:desc`, `commentCount:desc`, `title:asc`, `title:desc`). Starred/pinned posts are always kept at the top regardless of the selected ordering.\n\n**Extra opt-in fields:** `fields` accepts `content`, `routes`, `author`, `views`, `perex`, `readingTime`, `fallbackImage`.\n\n**Locale fallback:** `locale` is optional. When omitted or resolved to an unsupported value, the organisation's primary locale is used automatically."}},"/api/v1/post/mentions":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Comma-separated identifiers, each `[A-Za-z0-9_]{2,64}`. Invalid entries are ignored; at most 500 are used.","examples":["API_UNCAUGHT,PUBLIC_API_KEY_DOES_NOT_EXIST"],"schema":{"type":"string","minLength":2,"maxLength":20000},"in":"query","name":"identifiers","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"supported":{"description":"False when mention lookup is not available for this organisation.","type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["identifier","posts"],"properties":{"identifier":{"examples":["PUBLIC_API_KEY_DOES_NOT_EXIST"],"type":"string"},"posts":{"type":"array","items":{"type":"object","required":["slug","title","locale"],"properties":{"slug":{"examples":["api-integration"],"type":"string"},"title":{"examples":["API integration"],"type":"string"},"locale":{"examples":["en"],"description":"Locale of the returned translation.","type":"string"}}}}}}}},"required":["supported","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"supported":{"description":"False when mention lookup is not available for this organisation.","type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["identifier","posts"],"properties":{"identifier":{"examples":["PUBLIC_API_KEY_DOES_NOT_EXIST"],"type":"string"},"posts":{"type":"array","items":{"type":"object","required":["slug","title","locale"],"properties":{"slug":{"examples":["api-integration"],"type":"string"},"title":{"examples":["API integration"],"type":"string"},"locale":{"examples":["en"],"description":"Locale of the returned translation.","type":"string"}}}}}}}},"required":["supported","items"]}},"text/plain":{"schema":{"type":"object","properties":{"supported":{"description":"False when mention lookup is not available for this organisation.","type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["identifier","posts"],"properties":{"identifier":{"examples":["PUBLIC_API_KEY_DOES_NOT_EXIST"],"type":"string"},"posts":{"type":"array","items":{"type":"object","required":["slug","title","locale"],"properties":{"slug":{"examples":["api-integration"],"type":"string"},"title":{"examples":["API integration"],"type":"string"},"locale":{"examples":["en"],"description":"Locale of the returned translation.","type":"string"}}}}}}}},"required":["supported","items"]}}}}},"operationId":"getApiV1PostMentions","tags":["post"],"summary":"Posts mentioning identifiers","description":"For each identifier (e.g. a system log code or an API error code) returns the publicly visible, already published posts whose title, perex or body contains it as an exact, case-sensitive whole token. Unlike `/search` the identifier is never split into words, so `API_UNCAUGHT` does not match a post that only says \"API\". A post matches when any of its translations mentions the identifier; it is returned in `locale` when that translation exists. Identifiers without a match are omitted. `supported` is false for organisations whose content is too large for the in-memory index."}},"/api/v1/post/last-update":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"examples":["2025-11-25 14:11:59"],"type":"string"}},"required":["date"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"date":{"examples":["2025-11-25 14:11:59"],"type":"string"}},"required":["date"]}},"text/plain":{"schema":{"type":"object","properties":{"date":{"examples":["2025-11-25 14:11:59"],"type":"string"}},"required":["date"]}}}}},"operationId":"getApiV1PostLast-update","tags":["post"],"summary":"Get last post update timestamp","description":"Returns the timestamp of the most recently published post for the organisation identified by the API key. Use this endpoint to quickly check whether any content has changed since your last sync (e.g. for cache invalidation or incremental updates).\n\nThe result is based on the `publishedDate` of posts that are already visible (`publishedDate < NOW()` on the server). If no post is found, the current server time is returned."}},"/api/v1/post/rss":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true},{"description":"Optional main category route slug to filter posts. Only posts whose `mainCategory` matches this slug will be included in the feed. Same semantics as `/post/feed`.","examples":["novinky","clanky"],"schema":{"type":"string"},"in":"query","name":"mainCategory","required":false},{"description":"Optional tag code to filter posts. Only posts that have this tag assigned will be included. The tag must be active and belong to the same organisation. Same semantics as `/post/feed`.","examples":["novinky","bezpecnost"],"schema":{"type":"string"},"in":"query","name":"tag","required":false},{"description":"Optional author filter: the author's `profileSlug` (`shop__contact.external_id`) or the routable author slug — same semantics as `/post/feed?author=`. Every <item> carries `<dc:creator>`.","examples":["71E58E5SjdZN6ut3"],"schema":{"type":"string"},"in":"query","name":"author","required":false},{"description":"When true, each `<item>` includes the full HTML body of the post as `<content:encoded><![CDATA[…]]></content:encoded>` (the standard RSS content-module extension). When false or omitted, the current teaser-only behavior is preserved.","examples":[true],"schema":{"type":"boolean","default":false},"in":"query","name":"fullContent","required":false},{"description":"Optional ISO 3166-1 alpha-2 country code of the visitor (e.g. \"CZ\"). When set, the response is filtered to posts whose per-country / per-continent allowlist matches the visitor — a post targeted at continent \"EU\" matches every EU country, and a post with no rules stays globally available. When omitted, the filter is disabled and every post is returned regardless of geo settings. The API does NOT infer the country from the caller's IP; it is up to the caller to resolve and supply it. Case-insensitive. Unknown codes are rejected with HTTP 400 (`PUBLIC_COUNTRY_CODE_UNKNOWN`). The pseudo code `INT` selects the international (region-less) edition of a multi-region publication: only posts WITHOUT any country / continent rule.","examples":["CZ","DE","SK","INT"],"schema":{"type":"string","minLength":2,"maxLength":3},"in":"query","name":"country","required":false}],"operationId":"getApiV1PostRss","tags":["post"],"summary":"Get RSS feed","description":"Returns an RSS 2.0 XML feed of published posts for the given locale. Response Content-Type is application/rss+xml.\n\n**Filters:** `mainCategory` (category route slug), `tag` (tag code) and `author` (author `profileSlug` = `shop__contact.external_id`) narrow the feed. All three may be combined and are optional.\n\n**Full-body syndication:** set `fullContent=true` to embed the raw HTML body of each post inside `<content:encoded><![CDATA[…]]></content:encoded>` (the standard RSS content-module extension). When omitted or false, only the short teaser (`<description>`) is emitted.","responses":{"200":{}}}},"/api/v1/post/comment/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Post public id (content__post.external_id).","examples":["6IU2SWgP76FO2UXw"],"schema":{"type":"string"},"in":"query","name":"postId","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false},{"description":"Internal only. If true, includes deleted comments (deletedDate not null).","schema":{"type":"boolean","default":false},"in":"query","name":"includeDeleted","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","parentId","content","insertedDate","deletedDate","author"],"properties":{"id":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"parentId":{"nullable":true,"anyOf":[{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"deletedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"author":{"type":"object","required":["name","profileSlug"],"properties":{"name":{"type":"string"},"profileSlug":{"type":"string"}}},"usingSubscriptionService":{"description":"True if the author is using a subscription service (has active subscription).","type":"boolean"},"isMine":{"description":"True if identityId belongs to the comment author.","type":"boolean"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","parentId","content","insertedDate","deletedDate","author"],"properties":{"id":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"parentId":{"nullable":true,"anyOf":[{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"deletedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"author":{"type":"object","required":["name","profileSlug"],"properties":{"name":{"type":"string"},"profileSlug":{"type":"string"}}},"usingSubscriptionService":{"description":"True if the author is using a subscription service (has active subscription).","type":"boolean"},"isMine":{"description":"True if identityId belongs to the comment author.","type":"boolean"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","parentId","content","insertedDate","deletedDate","author"],"properties":{"id":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"parentId":{"nullable":true,"anyOf":[{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"deletedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"author":{"type":"object","required":["name","profileSlug"],"properties":{"name":{"type":"string"},"profileSlug":{"type":"string"}}},"usingSubscriptionService":{"description":"True if the author is using a subscription service (has active subscription).","type":"boolean"},"isMine":{"description":"True if identityId belongs to the comment author.","type":"boolean"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["id","parentId","content","insertedDate","deletedDate","author"],"properties":{"id":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"parentId":{"nullable":true,"anyOf":[{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"deletedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"author":{"type":"object","required":["name","profileSlug"],"properties":{"name":{"type":"string"},"profileSlug":{"type":"string"}}},"usingSubscriptionService":{"description":"True if the author is using a subscription service (has active subscription).","type":"boolean"},"isMine":{"description":"True if identityId belongs to the comment author.","type":"boolean"}}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostCommentList","tags":["post"],"summary":"List post comments","description":"Returns a flat list of comments for a post (no nested structure). Frontend can build parent/child UI using parentId."}},"/api/v1/post/comment/count":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Post public id (content__post.external_id).","examples":["6IU2SWgP76FO2UXw"],"schema":{"type":"string"},"in":"query","name":"postId","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["count"],"properties":{"count":{"examples":[12],"type":"number"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["count"],"properties":{"count":{"examples":[12],"type":"number"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["count"],"properties":{"count":{"examples":[12],"type":"number"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["count"],"properties":{"count":{"examples":[12],"type":"number"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1PostCommentCount","tags":["post"],"summary":"Count post comments","description":"Returns number of non-deleted comments for a post."}},"/api/v1/post/comment/create":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","comment"],"properties":{"success":{"const":true,"type":"boolean"},"comment":{"type":"object","required":["id","parentId","content","insertedDate","deletedDate","author"],"properties":{"id":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"parentId":{"nullable":true,"anyOf":[{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"deletedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"author":{"type":"object","required":["name","profileSlug"],"properties":{"name":{"type":"string"},"profileSlug":{"type":"string"}}},"usingSubscriptionService":{"description":"True if the author is using a subscription service (has active subscription).","type":"boolean"},"isMine":{"description":"True if identityId belongs to the comment author.","type":"boolean"}}}}},{"type":"object","required":["success","isSpam","reason"],"properties":{"success":{"const":false,"type":"boolean"},"isSpam":{"const":true,"type":"boolean"},"reason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","comment"],"properties":{"success":{"const":true,"type":"boolean"},"comment":{"type":"object","required":["id","parentId","content","insertedDate","deletedDate","author"],"properties":{"id":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"parentId":{"nullable":true,"anyOf":[{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"deletedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"author":{"type":"object","required":["name","profileSlug"],"properties":{"name":{"type":"string"},"profileSlug":{"type":"string"}}},"usingSubscriptionService":{"description":"True if the author is using a subscription service (has active subscription).","type":"boolean"},"isMine":{"description":"True if identityId belongs to the comment author.","type":"boolean"}}}}},{"type":"object","required":["success","isSpam","reason"],"properties":{"success":{"const":false,"type":"boolean"},"isSpam":{"const":true,"type":"boolean"},"reason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","comment"],"properties":{"success":{"const":true,"type":"boolean"},"comment":{"type":"object","required":["id","parentId","content","insertedDate","deletedDate","author"],"properties":{"id":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"parentId":{"nullable":true,"anyOf":[{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"deletedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"author":{"type":"object","required":["name","profileSlug"],"properties":{"name":{"type":"string"},"profileSlug":{"type":"string"}}},"usingSubscriptionService":{"description":"True if the author is using a subscription service (has active subscription).","type":"boolean"},"isMine":{"description":"True if identityId belongs to the comment author.","type":"boolean"}}}}},{"type":"object","required":["success","isSpam","reason"],"properties":{"success":{"const":false,"type":"boolean"},"isSpam":{"const":true,"type":"boolean"},"reason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","comment"],"properties":{"success":{"const":true,"type":"boolean"},"comment":{"type":"object","required":["id","parentId","content","insertedDate","deletedDate","author"],"properties":{"id":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"parentId":{"nullable":true,"anyOf":[{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"deletedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"author":{"type":"object","required":["name","profileSlug"],"properties":{"name":{"type":"string"},"profileSlug":{"type":"string"}}},"usingSubscriptionService":{"description":"True if the author is using a subscription service (has active subscription).","type":"boolean"},"isMine":{"description":"True if identityId belongs to the comment author.","type":"boolean"}}}}},{"type":"object","required":["success","isSpam","reason"],"properties":{"success":{"const":false,"type":"boolean"},"isSpam":{"const":true,"type":"boolean"},"reason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"postApiV1PostCommentCreate","tags":["post"],"summary":"Create post comment","description":"Create a new post comment. Always resolves contact via identityId and stores GEO IP. Runs spam detection before insert; spam comments are NOT stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","identityId","content"],"properties":{"postId":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id).","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"content":{"minLength":1,"maxLength":5000,"examples":["Super článek, díky!"],"description":"Plain text comment content.","type":"string"},"parentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","identityId","content"],"properties":{"postId":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id).","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"content":{"minLength":1,"maxLength":5000,"examples":["Super článek, díky!"],"description":"Plain text comment content.","type":"string"},"parentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["postId","identityId","content"],"properties":{"postId":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id).","type":"string"},"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"content":{"minLength":1,"maxLength":5000,"examples":["Super článek, díky!"],"description":"Plain text comment content.","type":"string"},"parentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/post/comment/edit":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","isSpam","reason"],"properties":{"success":{"const":false,"type":"boolean"},"isSpam":{"const":true,"type":"boolean"},"reason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","isSpam","reason"],"properties":{"success":{"const":false,"type":"boolean"},"isSpam":{"const":true,"type":"boolean"},"reason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","isSpam","reason"],"properties":{"success":{"const":false,"type":"boolean"},"isSpam":{"const":true,"type":"boolean"},"reason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","isSpam","reason"],"properties":{"success":{"const":false,"type":"boolean"},"isSpam":{"const":true,"type":"boolean"},"reason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}}}}},"operationId":"postApiV1PostCommentEdit","tags":["post"],"summary":"Edit post comment","description":"INTERNAL. Edit an existing comment (content only). Note: table has no updated_date; consider adding it if you want \"edited\" UI.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["commentId","content"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"content":{"minLength":1,"maxLength":5000,"examples":["Super článek, díky!"],"description":"Plain text comment content.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["commentId","content"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"content":{"minLength":1,"maxLength":5000,"examples":["Super článek, díky!"],"description":"Plain text comment content.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["commentId","content"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"},"content":{"minLength":1,"maxLength":5000,"examples":["Super článek, díky!"],"description":"Plain text comment content.","type":"string"}}}}}}}},"/api/v1/post/comment/delete":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}}}}},"operationId":"postApiV1PostCommentDelete","tags":["post"],"summary":"Delete post comment","description":"INTERNAL. Soft delete a comment by setting deleted_date.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["commentId"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["commentId"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["commentId"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"}}}}}}}},"/api/v1/post/comment/restore":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}}}}},"operationId":"postApiV1PostCommentRestore","tags":["post"],"summary":"Restore post comment","description":"INTERNAL. Restore a soft-deleted comment (sets deleted_date = null).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["commentId"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["commentId"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["commentId"],"properties":{"commentId":{"examples":["Abc1dEf2gHiJ3kL4"],"description":"Comment external ID (content__post_comment.external_id), 16-char string.","type":"string"}}}}}}}},"/api/v1/post-feedback/info":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Post public id (content__post.external_id), 16 chars.","examples":["6IU2SWgP76FO2UXw"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"postId","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["post","organisation"],"properties":{"post":{"type":"object","required":["id","title"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id), 16 chars.","minLength":16,"maxLength":16,"type":"string"},"title":{"type":"string"}}},"organisation":{"type":"object","required":["name","logoUrl"],"properties":{"name":{"type":"string"},"logoUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["post","organisation"],"properties":{"post":{"type":"object","required":["id","title"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id), 16 chars.","minLength":16,"maxLength":16,"type":"string"},"title":{"type":"string"}}},"organisation":{"type":"object","required":["name","logoUrl"],"properties":{"name":{"type":"string"},"logoUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["post","organisation"],"properties":{"post":{"type":"object","required":["id","title"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id), 16 chars.","minLength":16,"maxLength":16,"type":"string"},"title":{"type":"string"}}},"organisation":{"type":"object","required":["name","logoUrl"],"properties":{"name":{"type":"string"},"logoUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["post","organisation"],"properties":{"post":{"type":"object","required":["id","title"],"properties":{"id":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id), 16 chars.","minLength":16,"maxLength":16,"type":"string"},"title":{"type":"string"}}},"organisation":{"type":"object","required":["name","logoUrl"],"properties":{"name":{"type":"string"},"logoUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1Post-feedbackInfo","tags":["post-feedback"],"summary":"Get post feedback page metadata","description":"Returns the post title and the owning organisation (name + logo URL). Used by the public /post-feedback page on bizkithub.com to render the header card."}},"/api/v1/post-feedback/":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"postApiV1Post-feedback","tags":["post-feedback"],"summary":"Submit post feedback","description":"Stores a 1-5 rating and an optional note for a post identified by its public external id. Used by the public /post-feedback page on bizkithub.com.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","score"],"properties":{"postId":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id), 16 chars.","minLength":16,"maxLength":16,"type":"string"},"score":{"minimum":1,"maximum":5,"examples":[5],"description":"1 = velmi špatné, 5 = výborné.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":5,"examples":[5],"description":"1 = velmi špatné, 5 = výborné.","type":"integer"}]},"description":{"maxLength":1000,"description":"Optional free-form note from the visitor.","examples":["Skvělý článek, jen by chtělo víc příkladů."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","score"],"properties":{"postId":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id), 16 chars.","minLength":16,"maxLength":16,"type":"string"},"score":{"minimum":1,"maximum":5,"examples":[5],"description":"1 = velmi špatné, 5 = výborné.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":5,"examples":[5],"description":"1 = velmi špatné, 5 = výborné.","type":"integer"}]},"description":{"maxLength":1000,"description":"Optional free-form note from the visitor.","examples":["Skvělý článek, jen by chtělo víc příkladů."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["postId","score"],"properties":{"postId":{"examples":["6IU2SWgP76FO2UXw"],"description":"Post public id (content__post.external_id), 16 chars.","minLength":16,"maxLength":16,"type":"string"},"score":{"minimum":1,"maximum":5,"examples":[5],"description":"1 = velmi špatné, 5 = výborné.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":5,"examples":[5],"description":"1 = velmi špatné, 5 = výborné.","type":"integer"}]},"description":{"maxLength":1000,"description":"Optional free-form note from the visitor.","examples":["Skvělý článek, jen by chtělo víc příkladů."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/product/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"ISO 4217 currency of returned prices (`CZK`, `EUR`, `USD`). Default = organisation currency. Each price is the manual price set on the product / variant for that currency, otherwise the default price converted by the organisation rate (fixed price-list rate, or the daily CNB/ECB rate) and rounded by the organisation rounding rule. Applies to `price`, `priceWithoutVat`, `variantItems[].price` and `relatedProducts[].price`; the response carries `currency`.","examples":["EUR"],"schema":{"type":"string"},"in":"query","name":"currency","required":false},{"description":"Locale code (e.g. \"cs\", \"en\"). Returns translated read model for the given locale with fallback.","examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"description":"Add extra on demand properties separated by semicolon.\n\nSupported values:\n\n| Property | Description |\n|----------|-------------|\n| `orderStatistics` | Extra statistics data like `totalQuantitySold` and count of orders in states. |\n| `galleryItemsCount` | Count of public images in product detail. |\n| `lowestPrice30Days` | Lowest price of the last 30 days in the response currency (`lowestPrice30Days`), for showing next to a discount (Omnibus directive). Always present in product detail. |","examples":["orderStatistics;galleryItemsCount","galleryItemsCount"],"schema":{"type":"string"},"in":"query","name":"properties","required":false}],"responses":{"200":{"description":"Full product detail from the read model.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Product code identifier.","examples":["burger"],"type":"string"},"code":{"description":"Product code identifier (same as id).","examples":["burger"],"type":"string"},"name":{"description":"Localized product name.","examples":["Cheese Burger"],"type":"string"},"slug":{"description":"URL-friendly product identifier.","examples":["cheese-burger"],"type":"string"},"shortDescription":{"description":"Short HTML description for listings. Returned as sanitized HTML string.","type":"string"},"longDescription":{"description":"Full HTML description for product detail page. Returned as sanitized HTML string.","type":"string"},"mainImageUrl":{"description":"URL of the main product image (original blob). **Legacy field** — kept for backward compatibility with clients written before issue #80. New integrations should prefer `mainImage.originalUrl` (identical value) alongside `mainImage.lqip` / `mainImage.thumbUrl` / `mainImage.cardUrl` / `mainImage.heroUrl` / `mainImage.zoomUrl` for progressive rendering.","examples":["https://storage.xhp.cz/..."],"type":"string"},"mainImage":{"nullable":true,"anyOf":[{"description":"Full main-image payload with all pre-rendered variants (issue #80).\n\n**Rendering contract for the FE:** always paint `lqip` immediately as a CSS background, then progressively enhance with whichever sharp variant matches the intended display size — `thumbUrl` (≤ 128 px), `cardUrl` (≤ 480 px), `heroUrl` (≤ 1280 px), `zoomUrl` (≤ 2048 px). Fall back to `originalUrl` only for lightbox / download-as-image cases where the pre-rendered variants are insufficient.\n\n**Nullable slots vs. progressive rendering:** every variant slot is present on the wire; `null` means scout hasn't rendered that particular size yet. The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return the URLs — usually within seconds of a fresh upload, longer under scout backlog. Never fall back to `originalUrl` for a null variant in list UIs — that would defeat the whole point of pre-generating right-sized derivatives.","type":"object","required":["id","originalUrl","lqip","thumbUrl","cardUrl","heroUrl","zoomUrl"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"External blob token of the source image (stable across variant regenerations). Use this to correlate frontend cache keys and re-request the payload after an update.","type":"string"},"originalUrl":{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.jpg"],"description":"Public CDN URL of the original upload — always present when the product has a main image.\n\n**Format:** whatever the operator uploaded (typically JPEG or PNG, occasionally WebP or AVIF). Dimensions and byte size are unbounded and depend on the source; expect anywhere from 200 KB to several MB.\n\n**Use cases:**\n- Lightbox / zoom UI that needs the highest fidelity available (fallback for zoom variant).\n- Downloadable \"original\" link.\n- Feeds for third parties that expect an unmodified source.\n\n**Do not** use the original for above-the-fold rendering or list thumbnails — the pipeline exists precisely so those cases can bind to a pre-rendered, right-sized WebP variant instead.","type":"string"},"lqip":{"examples":["data:image/webp;base64,UklGRi4AAABXRUJQVlA4ICI…"],"description":"**Low-Quality Image Placeholder** — a 32×32 WebP q40 blur encoded as a base64 data URI. Populated inline the moment the image is uploaded, so it is always present when a main image exists.\n\n**Byte range:** typically 400–1400 bytes. Ships inside the JSON payload — no extra HTTP request needed to render it.\n\n**Intended use:** paint immediately as a CSS `background-image` on the wrapper element. Once one of the sharp variants (`thumbUrl`, `cardUrl`, `heroUrl`, `zoomUrl`) finishes loading, fade it in on top; the LQIP remains behind and covers any transparent pixels.\n\n**Edge case:** an empty string is possible only if the source blob was unreadable when the LQIP was generated (sharp threw and no fallback was stored). Treat empty as \"no LQIP available\" and skip the background paint.","type":"string"},"thumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"cardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"heroUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.hero-webp.webp"],"description":"Scout-generated **1280×1280 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 1280×1280 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~50–150 KB per file.\n\n**Intended use:** large product previews — desktop product-detail hero image (520–1280 px), homepage feature slots, campaign landing pages, retina 2× rendering for card-sized cells.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If falling back, prefer `cardUrl` over `thumbUrl` when the intended display size is > ~480 px.","type":"string"},{"type":"null"}]},"zoomUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.zoom-webp.webp"],"description":"Scout-generated **2048×2048 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 2048×2048 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~150–400 KB per file.\n\n**Intended use:** lightbox / product-image zoom UI, retina 2× rendering for hero-sized cells, download-as-image feature. The largest pre-rendered variant — for anything sharper, fall back to `originalUrl` (unbounded, unmodified source).\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If a lightbox request comes in before `zoomUrl` is ready, use `originalUrl` as an interim fallback so the feature still works.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"mainImageThumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"mainImageCardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"galleryItems":{"description":"List of product gallery media items.","type":"array","items":{"description":"Product gallery media item.","type":"object","required":["type","id","url"],"properties":{"type":{"default":"image","description":"Media type of the gallery item.","type":"string","enum":["image","video"]},"id":{"description":"Gallery item ID.","type":"number"},"url":{"description":"Public URL of the media file.","examples":["https://storage.xhp.cz/..."],"type":"string"},"title":{"description":"Optional title of the gallery item.","type":"string"},"tag":{"description":"Optional tag for grouping or filtering.","type":"string"}}}},"galleryItemsCount":{"description":"Total count of gallery items.","type":"number"},"isVariantProduct":{"description":"Whether the product has variants.","type":"boolean"},"variantItems":{"description":"List of product variants (only non-sold-out).","type":"array","items":{"description":"Product variant item.","type":"object","required":["id","code","name","price"],"properties":{"id":{"description":"Variant relation hash.","examples":["abc123"],"type":"string"},"code":{"description":"Variant code identifier.","examples":["cheese-burger"],"type":"string"},"name":{"description":"Variant display name.","examples":["Cheese Burger"],"type":"string"},"ean":{"description":"EAN barcode.","examples":["8594000000001"],"type":"string"},"price":{"description":"Variant price (base product price + variant addition).","examples":[250],"type":"number"},"warehouseAllQuantity":{"description":"Available warehouse quantity for this variant.","type":"number"}}}},"active":{"description":"Whether the product is active and visible.","type":"boolean"},"b2b":{"description":"Whether this is a B2B-only product.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in public feed.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"position":{"description":"Display position for sorting.","examples":[1],"type":"number"},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"categoryPathItems":{"description":"Breadcrumb path from root to main category.","type":"array","items":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}}},"categoryItems":{"description":"All categories the product belongs to.","type":"array","items":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}}},"brandId":{"description":"Associated brand ID.","type":"number"},"price":{"description":"Final product price including VAT.","examples":[250],"type":"number"},"regularPrice":{"nullable":true,"anyOf":[{"description":"Crossed-out price incl. VAT while a sale runs (in the response currency); null / missing = no sale. Show `lowestPrice30Days` next to it: by law the discount is measured from that one.","examples":[599],"type":"number"},{"type":"null"}]},"saleValidTo":{"nullable":true,"anyOf":[{"description":"ISO date-time the running sale ends; null / missing = no sale.","type":"string"},{"type":"null"}]},"lowestPrice30Days":{"nullable":true,"anyOf":[{"description":"Lowest price incl. VAT of the last 30 days in the response currency, the current price included (Czech consumer law / Omnibus directive: show it next to a discount). Manual currency prices where set, otherwise the default price converted at today's rate. Product level; variants are not covered. During a sale: the 30 days before it started. Feed: with `properties=lowestPrice30Days`, and always for products on sale.","examples":[449],"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency of every price in this object (BIZKIT-90). Equals the `currency` query parameter, or the organisation default currency.","examples":["CZK","EUR"],"type":"string"},"isRequestedLocale":{"description":"True when the product has a translation in the requested `locale`; false when a fallback language is served.","type":"boolean"},"priceWithoutVat":{"description":"Product price excluding VAT.","examples":[206.61],"type":"number"},"vat":{"description":"VAT percentage rate.","examples":[21],"type":"number"},"standardPricePercentage":{"description":"Standard price percentage (e.g. for discounts).","type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","type":"number"},"weightGrams":{"description":"Product weight in grams.","type":"number"},"warehouseAllQuantity":{"description":"Total available warehouse quantity.","type":"number"},"warehouseLimit":{"description":"Minimum warehouse quantity threshold.","type":"number"},"event":{"description":"Calendar event linked to the product.","type":"object","required":["id","startTime","endTime","isAllDay","isBlocking","title"],"properties":{"id":{"description":"Event code identifier.","type":"string"},"startTime":{"description":"Event start date and time.","anyOf":[{"description":"Event start date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end date and time.","anyOf":[{"description":"Event end date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks other bookings.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"description":{"description":"Event description text.","type":"string"},"agenda":{"description":"Event agenda or schedule.","type":"string"},"url":{"description":"External URL for the event.","type":"string"},"locationTitle":{"description":"Name of the event location.","type":"string"}}},"advance":{"description":"Advanced product data.","type":"object","required":["relatedCustomers"],"properties":{"relatedCustomers":{"description":"External IDs of related customers.","type":"array","items":{"type":"string"}}}},"relatedProducts":{"description":"List of related products.","type":"array","items":{"description":"Related product reference.","type":"object","required":["slug","name","price"],"properties":{"slug":{"description":"URL slug of the related product.","type":"string"},"name":{"description":"Related product name.","type":"string"},"mainImageUrl":{"description":"URL of the main image.","type":"string"},"price":{"description":"Product price.","type":"number"},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"shortDescription":{"description":"Short HTML description. Returned as sanitized HTML string.","type":"string"}}}},"customFields":{"description":"Custom key-value fields defined by the organisation.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"lastUpdate":{"description":"Timestamp of the last read model update.","anyOf":[{"description":"Timestamp of the last read model update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderStatistics":{"description":"Aggregated order statistics for the product.","type":"object","required":["totalQuantitySold","statusNew","statusProcessing","statusStorno","statusDone"],"properties":{"totalQuantitySold":{"description":"Total quantity sold across all order statuses.","type":"number"},"statusNew":{"description":"Quantity in new orders.","type":"number"},"statusProcessing":{"description":"Quantity in processing orders.","type":"number"},"statusStorno":{"description":"Quantity in canceled orders.","type":"number"},"statusDone":{"description":"Quantity in completed orders.","type":"number"}}}},"required":["id","code","name","slug","shortDescription","longDescription","mainImage","galleryItems","galleryItemsCount","isVariantProduct","variantItems","active","b2b","showInFeed","soldOut","position","categoryPathItems","categoryItems","price","priceWithoutVat","vat","advance","relatedProducts","customFields","lastUpdate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Product code identifier.","examples":["burger"],"type":"string"},"code":{"description":"Product code identifier (same as id).","examples":["burger"],"type":"string"},"name":{"description":"Localized product name.","examples":["Cheese Burger"],"type":"string"},"slug":{"description":"URL-friendly product identifier.","examples":["cheese-burger"],"type":"string"},"shortDescription":{"description":"Short HTML description for listings. Returned as sanitized HTML string.","type":"string"},"longDescription":{"description":"Full HTML description for product detail page. Returned as sanitized HTML string.","type":"string"},"mainImageUrl":{"description":"URL of the main product image (original blob). **Legacy field** — kept for backward compatibility with clients written before issue #80. New integrations should prefer `mainImage.originalUrl` (identical value) alongside `mainImage.lqip` / `mainImage.thumbUrl` / `mainImage.cardUrl` / `mainImage.heroUrl` / `mainImage.zoomUrl` for progressive rendering.","examples":["https://storage.xhp.cz/..."],"type":"string"},"mainImage":{"nullable":true,"anyOf":[{"description":"Full main-image payload with all pre-rendered variants (issue #80).\n\n**Rendering contract for the FE:** always paint `lqip` immediately as a CSS background, then progressively enhance with whichever sharp variant matches the intended display size — `thumbUrl` (≤ 128 px), `cardUrl` (≤ 480 px), `heroUrl` (≤ 1280 px), `zoomUrl` (≤ 2048 px). Fall back to `originalUrl` only for lightbox / download-as-image cases where the pre-rendered variants are insufficient.\n\n**Nullable slots vs. progressive rendering:** every variant slot is present on the wire; `null` means scout hasn't rendered that particular size yet. The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return the URLs — usually within seconds of a fresh upload, longer under scout backlog. Never fall back to `originalUrl` for a null variant in list UIs — that would defeat the whole point of pre-generating right-sized derivatives.","type":"object","required":["id","originalUrl","lqip","thumbUrl","cardUrl","heroUrl","zoomUrl"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"External blob token of the source image (stable across variant regenerations). Use this to correlate frontend cache keys and re-request the payload after an update.","type":"string"},"originalUrl":{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.jpg"],"description":"Public CDN URL of the original upload — always present when the product has a main image.\n\n**Format:** whatever the operator uploaded (typically JPEG or PNG, occasionally WebP or AVIF). Dimensions and byte size are unbounded and depend on the source; expect anywhere from 200 KB to several MB.\n\n**Use cases:**\n- Lightbox / zoom UI that needs the highest fidelity available (fallback for zoom variant).\n- Downloadable \"original\" link.\n- Feeds for third parties that expect an unmodified source.\n\n**Do not** use the original for above-the-fold rendering or list thumbnails — the pipeline exists precisely so those cases can bind to a pre-rendered, right-sized WebP variant instead.","type":"string"},"lqip":{"examples":["data:image/webp;base64,UklGRi4AAABXRUJQVlA4ICI…"],"description":"**Low-Quality Image Placeholder** — a 32×32 WebP q40 blur encoded as a base64 data URI. Populated inline the moment the image is uploaded, so it is always present when a main image exists.\n\n**Byte range:** typically 400–1400 bytes. Ships inside the JSON payload — no extra HTTP request needed to render it.\n\n**Intended use:** paint immediately as a CSS `background-image` on the wrapper element. Once one of the sharp variants (`thumbUrl`, `cardUrl`, `heroUrl`, `zoomUrl`) finishes loading, fade it in on top; the LQIP remains behind and covers any transparent pixels.\n\n**Edge case:** an empty string is possible only if the source blob was unreadable when the LQIP was generated (sharp threw and no fallback was stored). Treat empty as \"no LQIP available\" and skip the background paint.","type":"string"},"thumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"cardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"heroUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.hero-webp.webp"],"description":"Scout-generated **1280×1280 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 1280×1280 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~50–150 KB per file.\n\n**Intended use:** large product previews — desktop product-detail hero image (520–1280 px), homepage feature slots, campaign landing pages, retina 2× rendering for card-sized cells.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If falling back, prefer `cardUrl` over `thumbUrl` when the intended display size is > ~480 px.","type":"string"},{"type":"null"}]},"zoomUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.zoom-webp.webp"],"description":"Scout-generated **2048×2048 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 2048×2048 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~150–400 KB per file.\n\n**Intended use:** lightbox / product-image zoom UI, retina 2× rendering for hero-sized cells, download-as-image feature. The largest pre-rendered variant — for anything sharper, fall back to `originalUrl` (unbounded, unmodified source).\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If a lightbox request comes in before `zoomUrl` is ready, use `originalUrl` as an interim fallback so the feature still works.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"mainImageThumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"mainImageCardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"galleryItems":{"description":"List of product gallery media items.","type":"array","items":{"description":"Product gallery media item.","type":"object","required":["type","id","url"],"properties":{"type":{"default":"image","description":"Media type of the gallery item.","type":"string","enum":["image","video"]},"id":{"description":"Gallery item ID.","type":"number"},"url":{"description":"Public URL of the media file.","examples":["https://storage.xhp.cz/..."],"type":"string"},"title":{"description":"Optional title of the gallery item.","type":"string"},"tag":{"description":"Optional tag for grouping or filtering.","type":"string"}}}},"galleryItemsCount":{"description":"Total count of gallery items.","type":"number"},"isVariantProduct":{"description":"Whether the product has variants.","type":"boolean"},"variantItems":{"description":"List of product variants (only non-sold-out).","type":"array","items":{"description":"Product variant item.","type":"object","required":["id","code","name","price"],"properties":{"id":{"description":"Variant relation hash.","examples":["abc123"],"type":"string"},"code":{"description":"Variant code identifier.","examples":["cheese-burger"],"type":"string"},"name":{"description":"Variant display name.","examples":["Cheese Burger"],"type":"string"},"ean":{"description":"EAN barcode.","examples":["8594000000001"],"type":"string"},"price":{"description":"Variant price (base product price + variant addition).","examples":[250],"type":"number"},"warehouseAllQuantity":{"description":"Available warehouse quantity for this variant.","type":"number"}}}},"active":{"description":"Whether the product is active and visible.","type":"boolean"},"b2b":{"description":"Whether this is a B2B-only product.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in public feed.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"position":{"description":"Display position for sorting.","examples":[1],"type":"number"},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"categoryPathItems":{"description":"Breadcrumb path from root to main category.","type":"array","items":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}}},"categoryItems":{"description":"All categories the product belongs to.","type":"array","items":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}}},"brandId":{"description":"Associated brand ID.","type":"number"},"price":{"description":"Final product price including VAT.","examples":[250],"type":"number"},"regularPrice":{"nullable":true,"anyOf":[{"description":"Crossed-out price incl. VAT while a sale runs (in the response currency); null / missing = no sale. Show `lowestPrice30Days` next to it: by law the discount is measured from that one.","examples":[599],"type":"number"},{"type":"null"}]},"saleValidTo":{"nullable":true,"anyOf":[{"description":"ISO date-time the running sale ends; null / missing = no sale.","type":"string"},{"type":"null"}]},"lowestPrice30Days":{"nullable":true,"anyOf":[{"description":"Lowest price incl. VAT of the last 30 days in the response currency, the current price included (Czech consumer law / Omnibus directive: show it next to a discount). Manual currency prices where set, otherwise the default price converted at today's rate. Product level; variants are not covered. During a sale: the 30 days before it started. Feed: with `properties=lowestPrice30Days`, and always for products on sale.","examples":[449],"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency of every price in this object (BIZKIT-90). Equals the `currency` query parameter, or the organisation default currency.","examples":["CZK","EUR"],"type":"string"},"isRequestedLocale":{"description":"True when the product has a translation in the requested `locale`; false when a fallback language is served.","type":"boolean"},"priceWithoutVat":{"description":"Product price excluding VAT.","examples":[206.61],"type":"number"},"vat":{"description":"VAT percentage rate.","examples":[21],"type":"number"},"standardPricePercentage":{"description":"Standard price percentage (e.g. for discounts).","type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","type":"number"},"weightGrams":{"description":"Product weight in grams.","type":"number"},"warehouseAllQuantity":{"description":"Total available warehouse quantity.","type":"number"},"warehouseLimit":{"description":"Minimum warehouse quantity threshold.","type":"number"},"event":{"description":"Calendar event linked to the product.","type":"object","required":["id","startTime","endTime","isAllDay","isBlocking","title"],"properties":{"id":{"description":"Event code identifier.","type":"string"},"startTime":{"description":"Event start date and time.","anyOf":[{"description":"Event start date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end date and time.","anyOf":[{"description":"Event end date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks other bookings.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"description":{"description":"Event description text.","type":"string"},"agenda":{"description":"Event agenda or schedule.","type":"string"},"url":{"description":"External URL for the event.","type":"string"},"locationTitle":{"description":"Name of the event location.","type":"string"}}},"advance":{"description":"Advanced product data.","type":"object","required":["relatedCustomers"],"properties":{"relatedCustomers":{"description":"External IDs of related customers.","type":"array","items":{"type":"string"}}}},"relatedProducts":{"description":"List of related products.","type":"array","items":{"description":"Related product reference.","type":"object","required":["slug","name","price"],"properties":{"slug":{"description":"URL slug of the related product.","type":"string"},"name":{"description":"Related product name.","type":"string"},"mainImageUrl":{"description":"URL of the main image.","type":"string"},"price":{"description":"Product price.","type":"number"},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"shortDescription":{"description":"Short HTML description. Returned as sanitized HTML string.","type":"string"}}}},"customFields":{"description":"Custom key-value fields defined by the organisation.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"lastUpdate":{"description":"Timestamp of the last read model update.","anyOf":[{"description":"Timestamp of the last read model update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderStatistics":{"description":"Aggregated order statistics for the product.","type":"object","required":["totalQuantitySold","statusNew","statusProcessing","statusStorno","statusDone"],"properties":{"totalQuantitySold":{"description":"Total quantity sold across all order statuses.","type":"number"},"statusNew":{"description":"Quantity in new orders.","type":"number"},"statusProcessing":{"description":"Quantity in processing orders.","type":"number"},"statusStorno":{"description":"Quantity in canceled orders.","type":"number"},"statusDone":{"description":"Quantity in completed orders.","type":"number"}}}},"required":["id","code","name","slug","shortDescription","longDescription","mainImage","galleryItems","galleryItemsCount","isVariantProduct","variantItems","active","b2b","showInFeed","soldOut","position","categoryPathItems","categoryItems","price","priceWithoutVat","vat","advance","relatedProducts","customFields","lastUpdate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Product code identifier.","examples":["burger"],"type":"string"},"code":{"description":"Product code identifier (same as id).","examples":["burger"],"type":"string"},"name":{"description":"Localized product name.","examples":["Cheese Burger"],"type":"string"},"slug":{"description":"URL-friendly product identifier.","examples":["cheese-burger"],"type":"string"},"shortDescription":{"description":"Short HTML description for listings. Returned as sanitized HTML string.","type":"string"},"longDescription":{"description":"Full HTML description for product detail page. Returned as sanitized HTML string.","type":"string"},"mainImageUrl":{"description":"URL of the main product image (original blob). **Legacy field** — kept for backward compatibility with clients written before issue #80. New integrations should prefer `mainImage.originalUrl` (identical value) alongside `mainImage.lqip` / `mainImage.thumbUrl` / `mainImage.cardUrl` / `mainImage.heroUrl` / `mainImage.zoomUrl` for progressive rendering.","examples":["https://storage.xhp.cz/..."],"type":"string"},"mainImage":{"nullable":true,"anyOf":[{"description":"Full main-image payload with all pre-rendered variants (issue #80).\n\n**Rendering contract for the FE:** always paint `lqip` immediately as a CSS background, then progressively enhance with whichever sharp variant matches the intended display size — `thumbUrl` (≤ 128 px), `cardUrl` (≤ 480 px), `heroUrl` (≤ 1280 px), `zoomUrl` (≤ 2048 px). Fall back to `originalUrl` only for lightbox / download-as-image cases where the pre-rendered variants are insufficient.\n\n**Nullable slots vs. progressive rendering:** every variant slot is present on the wire; `null` means scout hasn't rendered that particular size yet. The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return the URLs — usually within seconds of a fresh upload, longer under scout backlog. Never fall back to `originalUrl` for a null variant in list UIs — that would defeat the whole point of pre-generating right-sized derivatives.","type":"object","required":["id","originalUrl","lqip","thumbUrl","cardUrl","heroUrl","zoomUrl"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"External blob token of the source image (stable across variant regenerations). Use this to correlate frontend cache keys and re-request the payload after an update.","type":"string"},"originalUrl":{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.jpg"],"description":"Public CDN URL of the original upload — always present when the product has a main image.\n\n**Format:** whatever the operator uploaded (typically JPEG or PNG, occasionally WebP or AVIF). Dimensions and byte size are unbounded and depend on the source; expect anywhere from 200 KB to several MB.\n\n**Use cases:**\n- Lightbox / zoom UI that needs the highest fidelity available (fallback for zoom variant).\n- Downloadable \"original\" link.\n- Feeds for third parties that expect an unmodified source.\n\n**Do not** use the original for above-the-fold rendering or list thumbnails — the pipeline exists precisely so those cases can bind to a pre-rendered, right-sized WebP variant instead.","type":"string"},"lqip":{"examples":["data:image/webp;base64,UklGRi4AAABXRUJQVlA4ICI…"],"description":"**Low-Quality Image Placeholder** — a 32×32 WebP q40 blur encoded as a base64 data URI. Populated inline the moment the image is uploaded, so it is always present when a main image exists.\n\n**Byte range:** typically 400–1400 bytes. Ships inside the JSON payload — no extra HTTP request needed to render it.\n\n**Intended use:** paint immediately as a CSS `background-image` on the wrapper element. Once one of the sharp variants (`thumbUrl`, `cardUrl`, `heroUrl`, `zoomUrl`) finishes loading, fade it in on top; the LQIP remains behind and covers any transparent pixels.\n\n**Edge case:** an empty string is possible only if the source blob was unreadable when the LQIP was generated (sharp threw and no fallback was stored). Treat empty as \"no LQIP available\" and skip the background paint.","type":"string"},"thumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"cardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"heroUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.hero-webp.webp"],"description":"Scout-generated **1280×1280 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 1280×1280 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~50–150 KB per file.\n\n**Intended use:** large product previews — desktop product-detail hero image (520–1280 px), homepage feature slots, campaign landing pages, retina 2× rendering for card-sized cells.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If falling back, prefer `cardUrl` over `thumbUrl` when the intended display size is > ~480 px.","type":"string"},{"type":"null"}]},"zoomUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.zoom-webp.webp"],"description":"Scout-generated **2048×2048 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 2048×2048 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~150–400 KB per file.\n\n**Intended use:** lightbox / product-image zoom UI, retina 2× rendering for hero-sized cells, download-as-image feature. The largest pre-rendered variant — for anything sharper, fall back to `originalUrl` (unbounded, unmodified source).\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If a lightbox request comes in before `zoomUrl` is ready, use `originalUrl` as an interim fallback so the feature still works.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"mainImageThumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"mainImageCardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"galleryItems":{"description":"List of product gallery media items.","type":"array","items":{"description":"Product gallery media item.","type":"object","required":["type","id","url"],"properties":{"type":{"default":"image","description":"Media type of the gallery item.","type":"string","enum":["image","video"]},"id":{"description":"Gallery item ID.","type":"number"},"url":{"description":"Public URL of the media file.","examples":["https://storage.xhp.cz/..."],"type":"string"},"title":{"description":"Optional title of the gallery item.","type":"string"},"tag":{"description":"Optional tag for grouping or filtering.","type":"string"}}}},"galleryItemsCount":{"description":"Total count of gallery items.","type":"number"},"isVariantProduct":{"description":"Whether the product has variants.","type":"boolean"},"variantItems":{"description":"List of product variants (only non-sold-out).","type":"array","items":{"description":"Product variant item.","type":"object","required":["id","code","name","price"],"properties":{"id":{"description":"Variant relation hash.","examples":["abc123"],"type":"string"},"code":{"description":"Variant code identifier.","examples":["cheese-burger"],"type":"string"},"name":{"description":"Variant display name.","examples":["Cheese Burger"],"type":"string"},"ean":{"description":"EAN barcode.","examples":["8594000000001"],"type":"string"},"price":{"description":"Variant price (base product price + variant addition).","examples":[250],"type":"number"},"warehouseAllQuantity":{"description":"Available warehouse quantity for this variant.","type":"number"}}}},"active":{"description":"Whether the product is active and visible.","type":"boolean"},"b2b":{"description":"Whether this is a B2B-only product.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in public feed.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"position":{"description":"Display position for sorting.","examples":[1],"type":"number"},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"categoryPathItems":{"description":"Breadcrumb path from root to main category.","type":"array","items":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}}},"categoryItems":{"description":"All categories the product belongs to.","type":"array","items":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}}},"brandId":{"description":"Associated brand ID.","type":"number"},"price":{"description":"Final product price including VAT.","examples":[250],"type":"number"},"regularPrice":{"nullable":true,"anyOf":[{"description":"Crossed-out price incl. VAT while a sale runs (in the response currency); null / missing = no sale. Show `lowestPrice30Days` next to it: by law the discount is measured from that one.","examples":[599],"type":"number"},{"type":"null"}]},"saleValidTo":{"nullable":true,"anyOf":[{"description":"ISO date-time the running sale ends; null / missing = no sale.","type":"string"},{"type":"null"}]},"lowestPrice30Days":{"nullable":true,"anyOf":[{"description":"Lowest price incl. VAT of the last 30 days in the response currency, the current price included (Czech consumer law / Omnibus directive: show it next to a discount). Manual currency prices where set, otherwise the default price converted at today's rate. Product level; variants are not covered. During a sale: the 30 days before it started. Feed: with `properties=lowestPrice30Days`, and always for products on sale.","examples":[449],"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency of every price in this object (BIZKIT-90). Equals the `currency` query parameter, or the organisation default currency.","examples":["CZK","EUR"],"type":"string"},"isRequestedLocale":{"description":"True when the product has a translation in the requested `locale`; false when a fallback language is served.","type":"boolean"},"priceWithoutVat":{"description":"Product price excluding VAT.","examples":[206.61],"type":"number"},"vat":{"description":"VAT percentage rate.","examples":[21],"type":"number"},"standardPricePercentage":{"description":"Standard price percentage (e.g. for discounts).","type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","type":"number"},"weightGrams":{"description":"Product weight in grams.","type":"number"},"warehouseAllQuantity":{"description":"Total available warehouse quantity.","type":"number"},"warehouseLimit":{"description":"Minimum warehouse quantity threshold.","type":"number"},"event":{"description":"Calendar event linked to the product.","type":"object","required":["id","startTime","endTime","isAllDay","isBlocking","title"],"properties":{"id":{"description":"Event code identifier.","type":"string"},"startTime":{"description":"Event start date and time.","anyOf":[{"description":"Event start date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end date and time.","anyOf":[{"description":"Event end date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks other bookings.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"description":{"description":"Event description text.","type":"string"},"agenda":{"description":"Event agenda or schedule.","type":"string"},"url":{"description":"External URL for the event.","type":"string"},"locationTitle":{"description":"Name of the event location.","type":"string"}}},"advance":{"description":"Advanced product data.","type":"object","required":["relatedCustomers"],"properties":{"relatedCustomers":{"description":"External IDs of related customers.","type":"array","items":{"type":"string"}}}},"relatedProducts":{"description":"List of related products.","type":"array","items":{"description":"Related product reference.","type":"object","required":["slug","name","price"],"properties":{"slug":{"description":"URL slug of the related product.","type":"string"},"name":{"description":"Related product name.","type":"string"},"mainImageUrl":{"description":"URL of the main image.","type":"string"},"price":{"description":"Product price.","type":"number"},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"shortDescription":{"description":"Short HTML description. Returned as sanitized HTML string.","type":"string"}}}},"customFields":{"description":"Custom key-value fields defined by the organisation.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"lastUpdate":{"description":"Timestamp of the last read model update.","anyOf":[{"description":"Timestamp of the last read model update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderStatistics":{"description":"Aggregated order statistics for the product.","type":"object","required":["totalQuantitySold","statusNew","statusProcessing","statusStorno","statusDone"],"properties":{"totalQuantitySold":{"description":"Total quantity sold across all order statuses.","type":"number"},"statusNew":{"description":"Quantity in new orders.","type":"number"},"statusProcessing":{"description":"Quantity in processing orders.","type":"number"},"statusStorno":{"description":"Quantity in canceled orders.","type":"number"},"statusDone":{"description":"Quantity in completed orders.","type":"number"}}}},"required":["id","code","name","slug","shortDescription","longDescription","mainImage","galleryItems","galleryItemsCount","isVariantProduct","variantItems","active","b2b","showInFeed","soldOut","position","categoryPathItems","categoryItems","price","priceWithoutVat","vat","advance","relatedProducts","customFields","lastUpdate"]}}}}},"operationId":"getApiV1ProductDetail","tags":["product"]}},"/api/v1/product/feed":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Search query","examples":["iphone"],"schema":{"type":"string"},"in":"query","name":"query","required":false},{"description":"ISO 4217 currency of returned prices (`CZK`, `EUR`, `USD`). Default = organisation currency. Each price is the manual price set on the product / variant for that currency, otherwise the default price converted by the organisation rate (fixed price-list rate, or the daily CNB/ECB rate) and rounded by the organisation rounding rule. Applies to `price`, `priceWithoutVat`, `variantItems[].price` and `relatedProducts[].price`; the response carries `currency`.","examples":["EUR"],"schema":{"type":"string"},"in":"query","name":"currency","required":false},{"description":"Locale code (e.g. \"cs\", \"en\"). Returns translated read models for the given locale with fallback to default.","examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"description":"Order by indexed internal field.\n\nSupported values: `position`, `price`, `priceDesc`, `eventDate`.","examples":["position","price","priceDesc","eventDate"],"schema":{"type":"string","default":"position"},"in":"query","name":"orderBy","required":false},{"description":"Filter by category slug. Returns every product assigned to the category or to any of its descendant categories, both as the main category and as a secondary category. Each product is returned at most once; `totalCount` reflects the same filter.","examples":["smartphone"],"schema":{"type":"string"},"in":"query","name":"category","required":false},{"description":"Filter by related product slug. Returns only products linked to the product with this slug in \"Related products\" (either direction). Combine with `category`, e.g. `category=lednice&relatedTo=plzen-skvrnany` = fridge products of one branch. An unknown slug returns an empty list.","examples":["plzen-skvrnany"],"schema":{"type":"string"},"in":"query","name":"relatedTo","required":false},{"schema":{"type":"string","default":"1"},"in":"query","name":"page","required":false},{"schema":{"type":"string","default":"32"},"in":"query","name":"limit","required":false},{"description":"Add extra on demand properties separated by semicolon.\n\nSupported values:\n\n| Property | Description |\n|----------|-------------|\n| `orderStatistics` | Extra statistics data like `totalQuantitySold` and count of orders in states. |\n| `galleryItemsCount` | Count of public images in product detail. |\n| `lowestPrice30Days` | Lowest price of the last 30 days in the response currency (`lowestPrice30Days`), for showing next to a discount (Omnibus directive). Always present in product detail. |","examples":["orderStatistics;galleryItemsCount","galleryItemsCount"],"schema":{"type":"string"},"in":"query","name":"properties","required":false}],"responses":{"200":{"description":"Paginated product feed response.","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"description":"Number of items returned on this page. For the total number of items matching the filter across all pages use `totalCount`.","type":"number"},"totalCount":{"description":"Total number of products matching the filter (query + category), independent of page and limit. Use `Math.ceil(totalCount / limit)` to compute the page count.","type":"number"},"items":{"description":"List of product feed items.","type":"array","items":{"additionalProperties":true,"description":"Product feed item. Returned properties depend on the properties query parameter.","type":"object","required":["id","name","slug","price","position","active","soldOut"],"properties":{"id":{"description":"Internal product ID.","examples":[42],"type":"number"},"name":{"description":"Localized product name.","examples":["Cheese Burger"],"type":"string"},"slug":{"description":"URL-friendly product identifier.","examples":["cheese-burger"],"type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"mainImageUrl":{"description":"URL of the main product image (original blob). Always present when the product has a main image. For sized rendering prefer `mainImageThumbUrl` (128 px) or `mainImageCardUrl` (480 px).","type":"string"},"mainImageThumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"mainImageCardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"price":{"description":"Product price including VAT.","examples":[250],"type":"number"},"regularPrice":{"nullable":true,"anyOf":[{"description":"Crossed-out price incl. VAT while a sale runs (in the response currency); null / missing = no sale. Show `lowestPrice30Days` next to it: by law the discount is measured from that one.","examples":[599],"type":"number"},{"type":"null"}]},"saleValidTo":{"nullable":true,"anyOf":[{"description":"ISO date-time the running sale ends; null / missing = no sale.","type":"string"},{"type":"null"}]},"lowestPrice30Days":{"nullable":true,"anyOf":[{"description":"Lowest price incl. VAT of the last 30 days in the response currency, the current price included (Czech consumer law / Omnibus directive: show it next to a discount). Manual currency prices where set, otherwise the default price converted at today's rate. Product level; variants are not covered. During a sale: the 30 days before it started. Feed: with `properties=lowestPrice30Days`, and always for products on sale.","examples":[449],"type":"number"},{"type":"null"}]},"priceWithoutVat":{"description":"Product price excluding VAT.","type":"number"},"currency":{"description":"ISO 4217 currency of every price in this object (BIZKIT-90). Equals the `currency` query parameter, or the organisation default currency.","examples":["CZK","EUR"],"type":"string"},"isRequestedLocale":{"description":"True when the product has a translation in the requested `locale`; false when a fallback language is served.","type":"boolean"},"vat":{"description":"VAT percentage rate.","type":"number"},"position":{"description":"Display position for sorting.","examples":[1],"type":"number"},"active":{"description":"Whether the product is active.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"warehouseAllQuantity":{"description":"Total available warehouse quantity.","type":"number"},"warehouseLimit":{"description":"Minimum warehouse quantity threshold.","type":"number"},"customFields":{"description":"Custom key-value fields.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"event":{"description":"Calendar event linked to the product.","type":"object","required":["id","startTime","endTime","isAllDay","isBlocking","title"],"properties":{"id":{"description":"Event code identifier.","type":"string"},"startTime":{"description":"Event start date and time.","anyOf":[{"description":"Event start date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end date and time.","anyOf":[{"description":"Event end date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks other bookings.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"description":{"description":"Event description text.","type":"string"},"agenda":{"description":"Event agenda or schedule.","type":"string"},"url":{"description":"External URL for the event.","type":"string"},"locationTitle":{"description":"Name of the event location.","type":"string"}}},"orderStatistics":{"description":"Aggregated order statistics for the product.","type":"object","required":["totalQuantitySold","statusNew","statusProcessing","statusStorno","statusDone"],"properties":{"totalQuantitySold":{"description":"Total quantity sold across all order statuses.","type":"number"},"statusNew":{"description":"Quantity in new orders.","type":"number"},"statusProcessing":{"description":"Quantity in processing orders.","type":"number"},"statusStorno":{"description":"Quantity in canceled orders.","type":"number"},"statusDone":{"description":"Quantity in completed orders.","type":"number"}}},"galleryItemsCount":{"description":"Count of public images in product detail.","type":"number"}}}}},"required":["count","totalCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"count":{"description":"Number of items returned on this page. For the total number of items matching the filter across all pages use `totalCount`.","type":"number"},"totalCount":{"description":"Total number of products matching the filter (query + category), independent of page and limit. Use `Math.ceil(totalCount / limit)` to compute the page count.","type":"number"},"items":{"description":"List of product feed items.","type":"array","items":{"additionalProperties":true,"description":"Product feed item. Returned properties depend on the properties query parameter.","type":"object","required":["id","name","slug","price","position","active","soldOut"],"properties":{"id":{"description":"Internal product ID.","examples":[42],"type":"number"},"name":{"description":"Localized product name.","examples":["Cheese Burger"],"type":"string"},"slug":{"description":"URL-friendly product identifier.","examples":["cheese-burger"],"type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"mainImageUrl":{"description":"URL of the main product image (original blob). Always present when the product has a main image. For sized rendering prefer `mainImageThumbUrl` (128 px) or `mainImageCardUrl` (480 px).","type":"string"},"mainImageThumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"mainImageCardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"price":{"description":"Product price including VAT.","examples":[250],"type":"number"},"regularPrice":{"nullable":true,"anyOf":[{"description":"Crossed-out price incl. VAT while a sale runs (in the response currency); null / missing = no sale. Show `lowestPrice30Days` next to it: by law the discount is measured from that one.","examples":[599],"type":"number"},{"type":"null"}]},"saleValidTo":{"nullable":true,"anyOf":[{"description":"ISO date-time the running sale ends; null / missing = no sale.","type":"string"},{"type":"null"}]},"lowestPrice30Days":{"nullable":true,"anyOf":[{"description":"Lowest price incl. VAT of the last 30 days in the response currency, the current price included (Czech consumer law / Omnibus directive: show it next to a discount). Manual currency prices where set, otherwise the default price converted at today's rate. Product level; variants are not covered. During a sale: the 30 days before it started. Feed: with `properties=lowestPrice30Days`, and always for products on sale.","examples":[449],"type":"number"},{"type":"null"}]},"priceWithoutVat":{"description":"Product price excluding VAT.","type":"number"},"currency":{"description":"ISO 4217 currency of every price in this object (BIZKIT-90). Equals the `currency` query parameter, or the organisation default currency.","examples":["CZK","EUR"],"type":"string"},"isRequestedLocale":{"description":"True when the product has a translation in the requested `locale`; false when a fallback language is served.","type":"boolean"},"vat":{"description":"VAT percentage rate.","type":"number"},"position":{"description":"Display position for sorting.","examples":[1],"type":"number"},"active":{"description":"Whether the product is active.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"warehouseAllQuantity":{"description":"Total available warehouse quantity.","type":"number"},"warehouseLimit":{"description":"Minimum warehouse quantity threshold.","type":"number"},"customFields":{"description":"Custom key-value fields.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"event":{"description":"Calendar event linked to the product.","type":"object","required":["id","startTime","endTime","isAllDay","isBlocking","title"],"properties":{"id":{"description":"Event code identifier.","type":"string"},"startTime":{"description":"Event start date and time.","anyOf":[{"description":"Event start date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end date and time.","anyOf":[{"description":"Event end date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks other bookings.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"description":{"description":"Event description text.","type":"string"},"agenda":{"description":"Event agenda or schedule.","type":"string"},"url":{"description":"External URL for the event.","type":"string"},"locationTitle":{"description":"Name of the event location.","type":"string"}}},"orderStatistics":{"description":"Aggregated order statistics for the product.","type":"object","required":["totalQuantitySold","statusNew","statusProcessing","statusStorno","statusDone"],"properties":{"totalQuantitySold":{"description":"Total quantity sold across all order statuses.","type":"number"},"statusNew":{"description":"Quantity in new orders.","type":"number"},"statusProcessing":{"description":"Quantity in processing orders.","type":"number"},"statusStorno":{"description":"Quantity in canceled orders.","type":"number"},"statusDone":{"description":"Quantity in completed orders.","type":"number"}}},"galleryItemsCount":{"description":"Count of public images in product detail.","type":"number"}}}}},"required":["count","totalCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"count":{"description":"Number of items returned on this page. For the total number of items matching the filter across all pages use `totalCount`.","type":"number"},"totalCount":{"description":"Total number of products matching the filter (query + category), independent of page and limit. Use `Math.ceil(totalCount / limit)` to compute the page count.","type":"number"},"items":{"description":"List of product feed items.","type":"array","items":{"additionalProperties":true,"description":"Product feed item. Returned properties depend on the properties query parameter.","type":"object","required":["id","name","slug","price","position","active","soldOut"],"properties":{"id":{"description":"Internal product ID.","examples":[42],"type":"number"},"name":{"description":"Localized product name.","examples":["Cheese Burger"],"type":"string"},"slug":{"description":"URL-friendly product identifier.","examples":["cheese-burger"],"type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"mainImageUrl":{"description":"URL of the main product image (original blob). Always present when the product has a main image. For sized rendering prefer `mainImageThumbUrl` (128 px) or `mainImageCardUrl` (480 px).","type":"string"},"mainImageThumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"mainImageCardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"mainCategory":{"description":"Product category reference.","type":"object","required":["slug","code","name"],"properties":{"slug":{"description":"URL-friendly category identifier.","examples":["smartphone"],"type":"string"},"code":{"description":"Internal category code.","examples":["CAT-001"],"type":"string"},"name":{"description":"Localized category name.","examples":["Smartphones"],"type":"string"}}},"price":{"description":"Product price including VAT.","examples":[250],"type":"number"},"regularPrice":{"nullable":true,"anyOf":[{"description":"Crossed-out price incl. VAT while a sale runs (in the response currency); null / missing = no sale. Show `lowestPrice30Days` next to it: by law the discount is measured from that one.","examples":[599],"type":"number"},{"type":"null"}]},"saleValidTo":{"nullable":true,"anyOf":[{"description":"ISO date-time the running sale ends; null / missing = no sale.","type":"string"},{"type":"null"}]},"lowestPrice30Days":{"nullable":true,"anyOf":[{"description":"Lowest price incl. VAT of the last 30 days in the response currency, the current price included (Czech consumer law / Omnibus directive: show it next to a discount). Manual currency prices where set, otherwise the default price converted at today's rate. Product level; variants are not covered. During a sale: the 30 days before it started. Feed: with `properties=lowestPrice30Days`, and always for products on sale.","examples":[449],"type":"number"},{"type":"null"}]},"priceWithoutVat":{"description":"Product price excluding VAT.","type":"number"},"currency":{"description":"ISO 4217 currency of every price in this object (BIZKIT-90). Equals the `currency` query parameter, or the organisation default currency.","examples":["CZK","EUR"],"type":"string"},"isRequestedLocale":{"description":"True when the product has a translation in the requested `locale`; false when a fallback language is served.","type":"boolean"},"vat":{"description":"VAT percentage rate.","type":"number"},"position":{"description":"Display position for sorting.","examples":[1],"type":"number"},"active":{"description":"Whether the product is active.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"warehouseAllQuantity":{"description":"Total available warehouse quantity.","type":"number"},"warehouseLimit":{"description":"Minimum warehouse quantity threshold.","type":"number"},"customFields":{"description":"Custom key-value fields.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"event":{"description":"Calendar event linked to the product.","type":"object","required":["id","startTime","endTime","isAllDay","isBlocking","title"],"properties":{"id":{"description":"Event code identifier.","type":"string"},"startTime":{"description":"Event start date and time.","anyOf":[{"description":"Event start date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end date and time.","anyOf":[{"description":"Event end date and time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks other bookings.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"description":{"description":"Event description text.","type":"string"},"agenda":{"description":"Event agenda or schedule.","type":"string"},"url":{"description":"External URL for the event.","type":"string"},"locationTitle":{"description":"Name of the event location.","type":"string"}}},"orderStatistics":{"description":"Aggregated order statistics for the product.","type":"object","required":["totalQuantitySold","statusNew","statusProcessing","statusStorno","statusDone"],"properties":{"totalQuantitySold":{"description":"Total quantity sold across all order statuses.","type":"number"},"statusNew":{"description":"Quantity in new orders.","type":"number"},"statusProcessing":{"description":"Quantity in processing orders.","type":"number"},"statusStorno":{"description":"Quantity in canceled orders.","type":"number"},"statusDone":{"description":"Quantity in completed orders.","type":"number"}}},"galleryItemsCount":{"description":"Count of public images in product detail.","type":"number"}}}}},"required":["count","totalCount","items"]}}}}},"operationId":"getApiV1ProductFeed","tags":["product"],"description":"Load full list of products from organisation database. By default, we only return basic properties for all products. If you want to return entire products, you need to specify additional properties.\n\nDefault properties (contains in all returned products): `id`, `name`, `slug`, `shortDescription`, `mainImageUrl`, `mainImageThumbUrl`, `mainImageCardUrl`, `mainCategory`, `price`, `priceWithoutVat`, `vat`, `position`, `active`, `soldOut`, `warehouseAllQuantity`, `warehouseLimit`, `customFields`, `event`."}},"/api/v1/product/import-from-url":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","code","slug","reused"],"properties":{"state":{"const":"ok","type":"string"},"code":{"description":"Generated product code (use for /product/detail?slug=…).","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"},"reused":{"description":"True when the product already existed and was not re-imported.","type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","code","slug","reused"],"properties":{"state":{"const":"ok","type":"string"},"code":{"description":"Generated product code (use for /product/detail?slug=…).","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"},"reused":{"description":"True when the product already existed and was not re-imported.","type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","code","slug","reused"],"properties":{"state":{"const":"ok","type":"string"},"code":{"description":"Generated product code (use for /product/detail?slug=…).","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"},"reused":{"description":"True when the product already existed and was not re-imported.","type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","code","slug","reused"],"properties":{"state":{"const":"ok","type":"string"},"code":{"description":"Generated product code (use for /product/detail?slug=…).","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"},"reused":{"description":"True when the product already existed and was not re-imported.","type":"boolean"}}},{"type":"object","required":["state","message","code","hint"],"properties":{"state":{"const":"error","type":"string"},"message":{"type":"string"},"code":{"const":200,"type":"number"},"hint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"postApiV1ProductImport-from-url","tags":["product"],"summary":"Import product from external URL","description":"Fetches the URL, runs an LLM to extract structured product data (name, description, price, images, attributes), creates a new `shop__product` row with a generated code/slug and queues its images for async blob storage. Deduplicated by (vendor, external_id) — repeated calls with the same listing return the existing product with `reused: true`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":8,"examples":["https://www.sreality.cz/detail/pronajem/komercni/obchodni-prostor/brno/310894668"],"description":"Absolute http(s) URL of the source product/listing page.","type":"string"},"mainCategoryCode":{"examples":["real-estate"],"description":"Optional product category code to pre-assign to the imported product.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":8,"examples":["https://www.sreality.cz/detail/pronajem/komercni/obchodni-prostor/brno/310894668"],"description":"Absolute http(s) URL of the source product/listing page.","type":"string"},"mainCategoryCode":{"examples":["real-estate"],"description":"Optional product category code to pre-assign to the imported product.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":8,"examples":["https://www.sreality.cz/detail/pronajem/komercni/obchodni-prostor/brno/310894668"],"description":"Absolute http(s) URL of the source product/listing page.","type":"string"},"mainCategoryCode":{"examples":["real-estate"],"description":"Optional product category code to pre-assign to the imported product.","type":"string"}}}}}}}},"/api/v1/product-category/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"URL slug of the product category.","examples":["electronics"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"responses":{"200":{"anyOf":[{"description":"Category detail.","type":"object","required":["id","name","slug","b2b"],"properties":{"id":{"description":"Category code (unique identifier).","examples":["cat_electronics"],"type":"string"},"name":{"description":"Display name of the category.","examples":["Electronics"],"type":"string"},"slug":{"description":"URL-friendly slug.","examples":["electronics"],"type":"string"},"description":{"description":"HTML description formatted for frontend display.","type":"string"},"b2b":{"description":"Whether the category is B2B-only.","type":"boolean"}}},{"description":"Error response when category does not exist.","type":"object","required":["state","code","message"],"properties":{"state":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"description":"Category detail.","type":"object","required":["id","name","slug","b2b"],"properties":{"id":{"description":"Category code (unique identifier).","examples":["cat_electronics"],"type":"string"},"name":{"description":"Display name of the category.","examples":["Electronics"],"type":"string"},"slug":{"description":"URL-friendly slug.","examples":["electronics"],"type":"string"},"description":{"description":"HTML description formatted for frontend display.","type":"string"},"b2b":{"description":"Whether the category is B2B-only.","type":"boolean"}}},{"description":"Error response when category does not exist.","type":"object","required":["state","code","message"],"properties":{"state":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"description":"Category detail.","type":"object","required":["id","name","slug","b2b"],"properties":{"id":{"description":"Category code (unique identifier).","examples":["cat_electronics"],"type":"string"},"name":{"description":"Display name of the category.","examples":["Electronics"],"type":"string"},"slug":{"description":"URL-friendly slug.","examples":["electronics"],"type":"string"},"description":{"description":"HTML description formatted for frontend display.","type":"string"},"b2b":{"description":"Whether the category is B2B-only.","type":"boolean"}}},{"description":"Error response when category does not exist.","type":"object","required":["state","code","message"],"properties":{"state":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"description":"Category detail.","type":"object","required":["id","name","slug","b2b"],"properties":{"id":{"description":"Category code (unique identifier).","examples":["cat_electronics"],"type":"string"},"name":{"description":"Display name of the category.","examples":["Electronics"],"type":"string"},"slug":{"description":"URL-friendly slug.","examples":["electronics"],"type":"string"},"description":{"description":"HTML description formatted for frontend display.","type":"string"},"b2b":{"description":"Whether the category is B2B-only.","type":"boolean"}}},{"description":"Error response when category does not exist.","type":"object","required":["state","code","message"],"properties":{"state":{"type":"string"},"code":{"type":"number"},"message":{"type":"string"}}}]}}}}},"operationId":"getApiV1Product-categoryDetail","tags":["productCategory"],"summary":"Get product category detail","description":"Returns detail of a single product category identified by its URL slug. Returns error PUBLIC_CATEGORY_DOES_NOT_EXIST if the category is deleted, internal, or not found."}},"/api/v1/product-category/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Slug of the parent category to filter children. Omit for root categories.","schema":{"type":"string"},"in":"query","name":"parentSlug","required":false}],"responses":{"200":{"description":"Paginated list of product categories.","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"description":"Total number of categories matching the filter.","type":"number"},"items":{"description":"Array of category items.","type":"array","items":{"type":"object","required":["id","name","slug"],"properties":{"id":{"description":"Category code.","type":"string"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"URL-friendly slug.","type":"string"}}}}},"required":["count","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"count":{"description":"Total number of categories matching the filter.","type":"number"},"items":{"description":"Array of category items.","type":"array","items":{"type":"object","required":["id","name","slug"],"properties":{"id":{"description":"Category code.","type":"string"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"URL-friendly slug.","type":"string"}}}}},"required":["count","items"]}},"text/plain":{"schema":{"type":"object","properties":{"count":{"description":"Total number of categories matching the filter.","type":"number"},"items":{"description":"Array of category items.","type":"array","items":{"type":"object","required":["id","name","slug"],"properties":{"id":{"description":"Category code.","type":"string"},"name":{"description":"Display name.","type":"string"},"slug":{"description":"URL-friendly slug.","type":"string"}}}}},"required":["count","items"]}}}}},"operationId":"getApiV1Product-categoryList","tags":["productCategory"],"summary":"List product categories","description":"Returns a list of product categories for the organisation. Optionally filter by parent category slug to get only direct children."}},"/api/v1/product-category/tree":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Maximum tree depth, counted inclusively from the root. `1` returns only roots, `2` returns roots and their direct children (default), up to 10. Nodes at the maximum depth always have `children: []`.","schema":{"minimum":1,"maximum":10,"default":2,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":10,"default":2,"description":"Maximum tree depth, counted inclusively from the root. `1` returns only roots, `2` returns roots and their direct children (default), up to 10. Nodes at the maximum depth always have `children: []`.","type":"integer"}]},"in":"query","name":"maxDepth","required":false}],"responses":{"200":{"description":"Product category tree.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Root categories with nested descendants up to maxDepth levels.","type":"array","items":{"$id":"T0","type":"object","required":["id","name","slug","b2b","children"],"properties":{"id":{"description":"Category code (unique identifier).","examples":["cat_lighting"],"type":"string"},"name":{"description":"Display name of the category.","examples":["Lighting"],"type":"string"},"slug":{"description":"URL-friendly slug.","examples":["lighting"],"type":"string"},"description":{"description":"HTML description formatted for frontend display (only present when filled in admin).","type":"string"},"b2b":{"description":"Whether the category is B2B-only.","type":"boolean"},"children":{"description":"Direct child categories. Always present as an array (empty when no children or at maxDepth).","type":"array","items":{"$ref":"T0"}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Root categories with nested descendants up to maxDepth levels.","type":"array","items":{"$id":"T0","type":"object","required":["id","name","slug","b2b","children"],"properties":{"id":{"description":"Category code (unique identifier).","examples":["cat_lighting"],"type":"string"},"name":{"description":"Display name of the category.","examples":["Lighting"],"type":"string"},"slug":{"description":"URL-friendly slug.","examples":["lighting"],"type":"string"},"description":{"description":"HTML description formatted for frontend display (only present when filled in admin).","type":"string"},"b2b":{"description":"Whether the category is B2B-only.","type":"boolean"},"children":{"description":"Direct child categories. Always present as an array (empty when no children or at maxDepth).","type":"array","items":{"$ref":"T0"}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Root categories with nested descendants up to maxDepth levels.","type":"array","items":{"$id":"T0","type":"object","required":["id","name","slug","b2b","children"],"properties":{"id":{"description":"Category code (unique identifier).","examples":["cat_lighting"],"type":"string"},"name":{"description":"Display name of the category.","examples":["Lighting"],"type":"string"},"slug":{"description":"URL-friendly slug.","examples":["lighting"],"type":"string"},"description":{"description":"HTML description formatted for frontend display (only present when filled in admin).","type":"string"},"b2b":{"description":"Whether the category is B2B-only.","type":"boolean"},"children":{"description":"Direct child categories. Always present as an array (empty when no children or at maxDepth).","type":"array","items":{"$ref":"T0"}}}}}},"required":["items"]}}}}},"operationId":"getApiV1Product-categoryTree","tags":["productCategory"],"summary":"Get full product category tree","description":"Returns the full category tree for the organisation in a single call, suitable for rendering navigation menus during server-side rendering. Root categories appear in `items`; their descendants are nested under `children` up to `maxDepth` levels deep. Deleted, inactive, and internal categories are excluded. Within each level items are ordered by `position`."}},"/api/v1/rate-limit-status/":{"get":{"responses":{"200":{"description":"Rate limit status.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the request would be allowed under the current rate limit.","type":"boolean"},"limit":{"description":"Maximum number of requests allowed in the window.","examples":[100],"type":"number"},"remaining":{"description":"Number of requests remaining in the current window.","examples":[97],"type":"number"},"reset":{"description":"Unix timestamp (ms) when the rate limit window resets.","type":"number"}},"required":["success","limit","remaining","reset"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the request would be allowed under the current rate limit.","type":"boolean"},"limit":{"description":"Maximum number of requests allowed in the window.","examples":[100],"type":"number"},"remaining":{"description":"Number of requests remaining in the current window.","examples":[97],"type":"number"},"reset":{"description":"Unix timestamp (ms) when the rate limit window resets.","type":"number"}},"required":["success","limit","remaining","reset"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the request would be allowed under the current rate limit.","type":"boolean"},"limit":{"description":"Maximum number of requests allowed in the window.","examples":[100],"type":"number"},"remaining":{"description":"Number of requests remaining in the current window.","examples":[97],"type":"number"},"reset":{"description":"Unix timestamp (ms) when the rate limit window resets.","type":"number"}},"required":["success","limit","remaining","reset"]}}}}},"operationId":"getApiV1Rate-limit-status","tags":["rateLimitStatus"],"summary":"Check rate limit status","description":"Returns the current rate limit state for a test endpoint. Useful for debugging and monitoring rate limit configuration."}},"/api/v1/referral/referred-customers":{"get":{"parameters":[{"description":"cuRefNo = customer reference number.","examples":["1cGIHvFoQDGLAbcA"],"schema":{"type":"string","maxLength":16,"minLength":16},"in":"query","name":"cuRefNo","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["cuRefNo","email","insertedDate","lastActivityDate"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["cuRefNo","email","insertedDate","lastActivityDate"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["cuRefNo","email","insertedDate","lastActivityDate"],"properties":{"cuRefNo":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["items"]}}}}},"operationId":"getApiV1ReferralReferred-customers","tags":["referral"],"summary":"List referred customers","description":"Returns a list of customers referred by the given customer (identified by cuRefNo)."}},"/api/v1/routing/route":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"URL slug to resolve.","examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["route"],"properties":{"route":{"type":"object","required":["slug","type","canonical","related_entity_id","inserted_date","error"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"type":{"examples":["product-detail","article","post-category","tag","glossary-term","glossary-category","author"],"description":"Route type. Possible values: `product-detail`, `article`, `post-category`, `tag`, `glossary-term`, `glossary-category`, `author`.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"},"related_entity_id":{"examples":["570"],"type":"string"},"inserted_date":{"examples":["2025-11-05T15:54:44.493Z"],"anyOf":[{"examples":["2025-11-05T15:54:44.493Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"error":{"examples":[false],"type":"boolean"},"link":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"redirectTo":{"description":"Present only when the matched slug is historical (`canonical: false`) and a canonical replacement exists. The other fields (`slug`, `type`, `locale`, `canonical`, `related_entity_id`, `inserted_date`, `link`) still describe the historical row that was matched.","type":"object","required":["slug","canonical","status"],"properties":{"slug":{"examples":["kyber-cena-roku-2025"],"description":"Current canonical slug for the same entity + locale. Emit an HTTP 301 to this slug.","type":"string"},"canonical":{"description":"Always `true` — `redirectTo` only points at the canonical row.","const":true,"type":"boolean"},"status":{"description":"Routing hint for the caller — emit an HTTP 301 (Moved Permanently). The transport status of this API response stays 200.","const":301,"type":"number"}}}}}}},{"type":"object","required":["route"],"properties":{"route":{"type":"object","required":["error"],"properties":{"error":{"examples":[true],"type":"boolean"}}}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["route"],"properties":{"route":{"type":"object","required":["slug","type","canonical","related_entity_id","inserted_date","error"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"type":{"examples":["product-detail","article","post-category","tag","glossary-term","glossary-category","author"],"description":"Route type. Possible values: `product-detail`, `article`, `post-category`, `tag`, `glossary-term`, `glossary-category`, `author`.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"},"related_entity_id":{"examples":["570"],"type":"string"},"inserted_date":{"examples":["2025-11-05T15:54:44.493Z"],"anyOf":[{"examples":["2025-11-05T15:54:44.493Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"error":{"examples":[false],"type":"boolean"},"link":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"redirectTo":{"description":"Present only when the matched slug is historical (`canonical: false`) and a canonical replacement exists. The other fields (`slug`, `type`, `locale`, `canonical`, `related_entity_id`, `inserted_date`, `link`) still describe the historical row that was matched.","type":"object","required":["slug","canonical","status"],"properties":{"slug":{"examples":["kyber-cena-roku-2025"],"description":"Current canonical slug for the same entity + locale. Emit an HTTP 301 to this slug.","type":"string"},"canonical":{"description":"Always `true` — `redirectTo` only points at the canonical row.","const":true,"type":"boolean"},"status":{"description":"Routing hint for the caller — emit an HTTP 301 (Moved Permanently). The transport status of this API response stays 200.","const":301,"type":"number"}}}}}}},{"type":"object","required":["route"],"properties":{"route":{"type":"object","required":["error"],"properties":{"error":{"examples":[true],"type":"boolean"}}}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["route"],"properties":{"route":{"type":"object","required":["slug","type","canonical","related_entity_id","inserted_date","error"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"type":{"examples":["product-detail","article","post-category","tag","glossary-term","glossary-category","author"],"description":"Route type. Possible values: `product-detail`, `article`, `post-category`, `tag`, `glossary-term`, `glossary-category`, `author`.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"},"related_entity_id":{"examples":["570"],"type":"string"},"inserted_date":{"examples":["2025-11-05T15:54:44.493Z"],"anyOf":[{"examples":["2025-11-05T15:54:44.493Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"error":{"examples":[false],"type":"boolean"},"link":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"redirectTo":{"description":"Present only when the matched slug is historical (`canonical: false`) and a canonical replacement exists. The other fields (`slug`, `type`, `locale`, `canonical`, `related_entity_id`, `inserted_date`, `link`) still describe the historical row that was matched.","type":"object","required":["slug","canonical","status"],"properties":{"slug":{"examples":["kyber-cena-roku-2025"],"description":"Current canonical slug for the same entity + locale. Emit an HTTP 301 to this slug.","type":"string"},"canonical":{"description":"Always `true` — `redirectTo` only points at the canonical row.","const":true,"type":"boolean"},"status":{"description":"Routing hint for the caller — emit an HTTP 301 (Moved Permanently). The transport status of this API response stays 200.","const":301,"type":"number"}}}}}}},{"type":"object","required":["route"],"properties":{"route":{"type":"object","required":["error"],"properties":{"error":{"examples":[true],"type":"boolean"}}}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["route"],"properties":{"route":{"type":"object","required":["slug","type","canonical","related_entity_id","inserted_date","error"],"properties":{"slug":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"type":{"examples":["product-detail","article","post-category","tag","glossary-term","glossary-category","author"],"description":"Route type. Possible values: `product-detail`, `article`, `post-category`, `tag`, `glossary-term`, `glossary-category`, `author`.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"canonical":{"type":"boolean"},"related_entity_id":{"examples":["570"],"type":"string"},"inserted_date":{"examples":["2025-11-05T15:54:44.493Z"],"anyOf":[{"examples":["2025-11-05T15:54:44.493Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"error":{"examples":[false],"type":"boolean"},"link":{"examples":["kyber-cena-roku-2025-nejvetsi-vecer-ceske-kyberbezpecnosti-letos"],"type":"string"},"redirectTo":{"description":"Present only when the matched slug is historical (`canonical: false`) and a canonical replacement exists. The other fields (`slug`, `type`, `locale`, `canonical`, `related_entity_id`, `inserted_date`, `link`) still describe the historical row that was matched.","type":"object","required":["slug","canonical","status"],"properties":{"slug":{"examples":["kyber-cena-roku-2025"],"description":"Current canonical slug for the same entity + locale. Emit an HTTP 301 to this slug.","type":"string"},"canonical":{"description":"Always `true` — `redirectTo` only points at the canonical row.","const":true,"type":"boolean"},"status":{"description":"Routing hint for the caller — emit an HTTP 301 (Moved Permanently). The transport status of this API response stays 200.","const":301,"type":"number"}}}}}}},{"type":"object","required":["route"],"properties":{"route":{"type":"object","required":["error"],"properties":{"error":{"examples":[true],"type":"boolean"}}}}}]}}}}},"operationId":"getApiV1RoutingRoute","tags":["routing"],"summary":"Resolve URL route","description":"Resolves a URL slug to its corresponding route, returning the entity type, ID, and locale. Returns error: true if the slug is invalid or not found.\n\nIf the slug is historical (i.e. `canonical: false`), the response also includes a `redirectTo` object with the current canonical slug — frontends should emit an HTTP 301 redirect to it. The transport status stays 200; `redirectTo.status: 301` is a routing hint carried in the JSON body."}},"/api/v1/localization/editions":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"languages":{"type":"array","items":{"type":"object","required":["code","isDefault","position"],"properties":{"code":{"examples":["de"],"description":"ISO 639-1 language code.","type":"string"},"isDefault":{"description":"Organisation primary locale (informational).","type":"boolean"},"position":{"type":"number"}}}},"regional":{"type":"array","items":{"type":"object","required":["key","languageCode","countryCode","countryName","continentCode","officialStatus","populationPercent","postCount"],"properties":{"key":{"examples":["de-ch"],"description":"URL key `{language}-{country}`, lowercase.","type":"string"},"languageCode":{"examples":["de"],"type":"string"},"countryCode":{"examples":["CH"],"description":"ISO 3166-1 alpha-2, uppercase.","type":"string"},"countryName":{"examples":["Switzerland"],"type":"string"},"continentCode":{"examples":["EU"],"type":"string"},"officialStatus":{"examples":["official"],"description":"CLDR status: `official`, `de_facto_official` or `official_regional`.","type":"string"},"populationPercent":{"examples":[76],"description":"Share of speakers (CLDR estimate).","type":"number"},"postCount":{"examples":[3],"description":"Public posts restricted to this country (directly or via its continent). Zero = the edition only mirrors the international one: canonicalize its listings there and do not advertise it.","type":"number"}}}}},"required":["languages","regional"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"languages":{"type":"array","items":{"type":"object","required":["code","isDefault","position"],"properties":{"code":{"examples":["de"],"description":"ISO 639-1 language code.","type":"string"},"isDefault":{"description":"Organisation primary locale (informational).","type":"boolean"},"position":{"type":"number"}}}},"regional":{"type":"array","items":{"type":"object","required":["key","languageCode","countryCode","countryName","continentCode","officialStatus","populationPercent","postCount"],"properties":{"key":{"examples":["de-ch"],"description":"URL key `{language}-{country}`, lowercase.","type":"string"},"languageCode":{"examples":["de"],"type":"string"},"countryCode":{"examples":["CH"],"description":"ISO 3166-1 alpha-2, uppercase.","type":"string"},"countryName":{"examples":["Switzerland"],"type":"string"},"continentCode":{"examples":["EU"],"type":"string"},"officialStatus":{"examples":["official"],"description":"CLDR status: `official`, `de_facto_official` or `official_regional`.","type":"string"},"populationPercent":{"examples":[76],"description":"Share of speakers (CLDR estimate).","type":"number"},"postCount":{"examples":[3],"description":"Public posts restricted to this country (directly or via its continent). Zero = the edition only mirrors the international one: canonicalize its listings there and do not advertise it.","type":"number"}}}}},"required":["languages","regional"]}},"text/plain":{"schema":{"type":"object","properties":{"languages":{"type":"array","items":{"type":"object","required":["code","isDefault","position"],"properties":{"code":{"examples":["de"],"description":"ISO 639-1 language code.","type":"string"},"isDefault":{"description":"Organisation primary locale (informational).","type":"boolean"},"position":{"type":"number"}}}},"regional":{"type":"array","items":{"type":"object","required":["key","languageCode","countryCode","countryName","continentCode","officialStatus","populationPercent","postCount"],"properties":{"key":{"examples":["de-ch"],"description":"URL key `{language}-{country}`, lowercase.","type":"string"},"languageCode":{"examples":["de"],"type":"string"},"countryCode":{"examples":["CH"],"description":"ISO 3166-1 alpha-2, uppercase.","type":"string"},"countryName":{"examples":["Switzerland"],"type":"string"},"continentCode":{"examples":["EU"],"type":"string"},"officialStatus":{"examples":["official"],"description":"CLDR status: `official`, `de_facto_official` or `official_regional`.","type":"string"},"populationPercent":{"examples":[76],"description":"Share of speakers (CLDR estimate).","type":"number"},"postCount":{"examples":[3],"description":"Public posts restricted to this country (directly or via its continent). Zero = the edition only mirrors the international one: canonicalize its listings there and do not advertise it.","type":"number"}}}}},"required":["languages","regional"]}}}}},"operationId":"getApiV1LocalizationEditions","tags":["localization"],"summary":"List publication editions (language × optional country)","description":"Editions a multi-region publication can serve, derived from the languages enabled for the organisation and the real-world country × language matrix (`core__country_language`, Unicode CLDR).\n\n- `languages` — one **international edition** per enabled language (URL `/en`, `/cs`). It lists posts without any country / continent rule (`/post/feed?country=INT`).\n- `regional` — one **regional edition** per country where an enabled language is official (URL `/de-ch`, `/it-ch`). It lists the unrestricted posts plus those restricted to the country or its continent (`/post/feed?country=CH`).\n\nThere is no default edition; `isDefault` only marks the organisation primary locale as a last-resort fallback. Safe to cache for minutes."}},"/api/v1/security/captcha":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"examples":["mfuunpqsqa1rw8ft"],"type":"string"},"imageBase64":{"examples":["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAAC..."],"type":"string"}},"required":["token","imageBase64"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"token":{"examples":["mfuunpqsqa1rw8ft"],"type":"string"},"imageBase64":{"examples":["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAAC..."],"type":"string"}},"required":["token","imageBase64"]}},"text/plain":{"schema":{"type":"object","properties":{"token":{"examples":["mfuunpqsqa1rw8ft"],"type":"string"},"imageBase64":{"examples":["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAAC..."],"type":"string"}},"required":["token","imageBase64"]}}}}},"operationId":"getApiV1SecurityCaptcha","tags":["security"],"summary":"Generate captcha","description":"Render a random captcha image as base64.\n\nExample:\n\n![captcha](https://cdn.bizkithub.com/images/captcha-nu3bx.webp)"}},"/api/v1/security/captcha-verify":{"get":{"parameters":[{"description":"Captcha token returned by the /captcha endpoint.","examples":["mfuunpqsqa1rw8ft"],"schema":{"type":"string"},"in":"query","name":"token","required":true},{"description":"User-entered captcha code.","examples":["NU3BX"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"examples":["mfuunpqsqa1rw8ft"],"description":"The token that was verified.","type":"string"},"code":{"examples":["NU3BX"],"description":"The code that was submitted.","type":"string"},"status":{"examples":["match","miss","expired-token"],"description":"Verification result.","type":"string"}},"required":["token","code","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"token":{"examples":["mfuunpqsqa1rw8ft"],"description":"The token that was verified.","type":"string"},"code":{"examples":["NU3BX"],"description":"The code that was submitted.","type":"string"},"status":{"examples":["match","miss","expired-token"],"description":"Verification result.","type":"string"}},"required":["token","code","status"]}},"text/plain":{"schema":{"type":"object","properties":{"token":{"examples":["mfuunpqsqa1rw8ft"],"description":"The token that was verified.","type":"string"},"code":{"examples":["NU3BX"],"description":"The code that was submitted.","type":"string"},"status":{"examples":["match","miss","expired-token"],"description":"Verification result.","type":"string"}},"required":["token","code","status"]}}}}},"operationId":"getApiV1SecurityCaptcha-verify","tags":["security"],"summary":"Verify captcha code","description":"Verifies whether the user-entered captcha code matches the generated one. Returns status: \"match\" (correct), \"miss\" (wrong code), or \"expired-token\" (token no longer valid)."}},"/api/v1/service-status/":{"get":{"parameters":[{"examples":["php.baraja.cz"],"schema":{"type":"string"},"in":"query","name":"domain","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"host":{"examples":["baraja.cz"],"type":"string"},"domain":{"examples":["php.baraja.cz"],"type":"string"},"status":{"examples":["ok"],"anyOf":[{"const":"ok","type":"string"},{"const":"error","type":"string"}]},"message":{"examples":["Vše v pořádku."],"type":"string"},"color":{"examples":["#4CAF50"],"type":"string"},"httpCode":{"examples":[200],"type":"number"},"lastCheckDate":{"examples":["2024-05-01T10:00:00.000Z"],"anyOf":[{"examples":["2024-05-01T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"statusPageUrl":{"examples":["https://status.baraja.cz"],"type":"string"}},"required":["host","domain","status","message","color","statusPageUrl"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"host":{"examples":["baraja.cz"],"type":"string"},"domain":{"examples":["php.baraja.cz"],"type":"string"},"status":{"examples":["ok"],"anyOf":[{"const":"ok","type":"string"},{"const":"error","type":"string"}]},"message":{"examples":["Vše v pořádku."],"type":"string"},"color":{"examples":["#4CAF50"],"type":"string"},"httpCode":{"examples":[200],"type":"number"},"lastCheckDate":{"examples":["2024-05-01T10:00:00.000Z"],"anyOf":[{"examples":["2024-05-01T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"statusPageUrl":{"examples":["https://status.baraja.cz"],"type":"string"}},"required":["host","domain","status","message","color","statusPageUrl"]}},"text/plain":{"schema":{"type":"object","properties":{"host":{"examples":["baraja.cz"],"type":"string"},"domain":{"examples":["php.baraja.cz"],"type":"string"},"status":{"examples":["ok"],"anyOf":[{"const":"ok","type":"string"},{"const":"error","type":"string"}]},"message":{"examples":["Vše v pořádku."],"type":"string"},"color":{"examples":["#4CAF50"],"type":"string"},"httpCode":{"examples":[200],"type":"number"},"lastCheckDate":{"examples":["2024-05-01T10:00:00.000Z"],"anyOf":[{"examples":["2024-05-01T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"statusPageUrl":{"examples":["https://status.baraja.cz"],"type":"string"}},"required":["host","domain","status","message","color","statusPageUrl"]}}}}},"operationId":"getApiV1Service-status","tags":["serviceStatus"],"description":"The service retrieves information about the domain's availability based on regular crawler scans. If the domain is not already tracked, it will be automatically included for crawling.\n\nThe crawling rules are described on the page [VikiTron Bot](https://vikitron.com/bot).\n\nDomain availability scanning is not subject to robots.txt rules, and we can crawl all domains on the internet. We use multiple signals for scanning, such as downloading the homepage via HTTP request, checking DNS records, requesting HTTP headers, completely loading and rendering the page in Handles Chrome, and more.."}},"/api/v1/shop/order/create":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"links":{"type":"object","required":["orderPageLink","payLink"],"properties":{"orderPageLink":{"examples":["https://bizkithub.com/order?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"payLink":{"examples":["https://bizkithub.com/order/pay?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}},"required":["orderNumber","hash","links","riskScore"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"links":{"type":"object","required":["orderPageLink","payLink"],"properties":{"orderPageLink":{"examples":["https://bizkithub.com/order?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"payLink":{"examples":["https://bizkithub.com/order/pay?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}},"required":["orderNumber","hash","links","riskScore"]}},"text/plain":{"schema":{"type":"object","properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"links":{"type":"object","required":["orderPageLink","payLink"],"properties":{"orderPageLink":{"examples":["https://bizkithub.com/order?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"payLink":{"examples":["https://bizkithub.com/order/pay?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}},"required":["orderNumber","hash","links","riskScore"]}}}}},"operationId":"postApiV1ShopOrderCreate","tags":["order"],"description":"Create a new order. After create a order, please redirect customer to `links.orderPageLink`.\n\n`customer` is the payer; `issuerCustomer` (optional) is the issuer — if omitted, the issuer is the organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customer","items"],"properties":{"customer":{"description":"Paying customer (payer). This customer pays the order and is used as the primary billing entity. If the specified customer account does not exist, the system will automatically create a new customer and link it to the order.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}},"billingAddress":{"description":"Optional billing address, when it differs from the customer address (which is then the delivery address). The invoice is issued to this address. First and last name default to the customer. Omit it when both addresses are the same. The address is also saved to the customer contact, without changing its primary address.","type":"object","properties":{"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["Václavské náměstí 1"],"type":"string"},"city":{"examples":["Praha"],"type":"string"},"cityPart":{"examples":["Nové Město"],"type":"string"},"stateRegion":{"examples":["Hlavní město Praha"],"type":"string"},"postalCode":{"examples":["110 00"],"type":"string"},"country":{"examples":["CZ"],"type":"string"}}},"issuerCustomer":{"description":"Order issuer. The party that issues the order (e.g. delegated purchase or invoicing). Use only when the order is issued by a specific customer. For common e-shop orders, this field should be omitted — the issuer is the organisation by default. If the specified customer does not exist, the system will automatically create one.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}},"copyCustomers":{"description":"List of alternative e-mails of customers for e-mail copy.","type":"array","items":{"examples":["janbarasek@gmail.com"],"type":"string"}},"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["label"],"properties":{"label":{"examples":["Cheese burger"],"description":"Main order items label used in order detail and as invoice line.","type":"string"},"price":{"examples":250,"description":"Absolute value in order-defined currency.\n\nThe item price can be zero. Enter the price as a real value and do not use multiplication. We also accept decimal numbers and handle them safely with a precision of up to two decimal places.\n\nThe price value is determined dynamically based on hierarchy. First, the price you set is used. If no price is set, we attempt to retrieve it from the product variant or the core product. If no price is found there either, the price will be zero.","type":"number"},"vat":{"examples":21,"description":"Percentage VAT rate.","type":"number"},"count":{"examples":1,"description":"Integer value. Quantity, count, hours, ...","type":"number"},"sale":{"examples":[10],"description":"Absolute value in order-defined currency.","type":"number"},"unit":{"examples":["ks","h","m","kg"],"type":"string"},"productCode":{"examples":["burger"],"description":"Link order item to product when product code has been defined.","type":"string"},"variantCode":{"examples":["cheese-burger"],"description":"Link order item to product variant when product code AND variant code has been defined.","type":"string"},"eventCode":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"description":"Link order item to calendar event when event code has been defined.","type":"string"},"creditAmount":{"examples":[100],"description":"How many credits should be added to customer account when order will be paid?","type":"number"},"specialActions":{"examples":["create-voucher:fixed:500;add-credit:15"],"anyOf":[{"examples":["create-voucher:fixed:500"],"type":"string"},{"examples":[["create-voucher:fixed:500","add-credit:20"]],"type":"array","items":{"type":"string"}}]},"branch":{"examples":["gymroom-plzen"],"description":"Slug of the branch (pobočka) that processed this line item. When set, the item is bound to the branch via shop__order_item.branch_id and any credit grant/debit derived from this item is attributed to the branch (shop__contact_credit.payer_branch_id). Omit to leave the item at organisation level.","type":"string"}}}},"orderGroupId":{"examples":["branch-vinohrady"],"description":"Organisation defined order group code.","type":"string"},"kind":{"default":"commerce","description":"Behavioral category of the order. Decides which automatic workflows apply:\n- `commerce` (default): standard order; invoice/receipt is auto-issued by the status rule engine when the chosen status configures it. The customer receives the standard order-status notification.\n- `registration`: order represents a sign-up for an event / form-style admission. No tax document is ever auto-issued (manual admin action via BFF can still issue one): the status rule engine skips `create_invoice` / `create_receipt` for this order. A status with `mark_as_paid` still records the payment date. Whether a zero-total registration is marked as paid right after creation follows the organisation setting `order_zero_total_auto_pay` (default: yes; set it to `commerce` to keep registrations unpaid) or the explicit `preventAutoPayment` flag. The customer receives a registration-confirmation email when the per-group or kind-specific notification template is configured (falls back to standard order-status template if not). Typically combined with all items priced at 0 and a dedicated organisation-defined order group for pairing.","type":"string","enum":["commerce","registration"]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.\n\nOrder currency (BIZKIT-90): explicit `currency` → currency of the cart (`cartId`) → organisation default. When `cartId` is in another currency than the explicit `currency`, the cart is re-priced into `currency` first (manual product / variant currency price, otherwise converted by the organisation rate and rounding). `items[].price`, `deliveryPrice` and `paymentPrice` are always taken as sent, in the order currency; an item without `price` gets its catalogue price in the order currency. Fixed-amount vouchers are defined in the organisation default currency and converted the same way. Note: `items[]` and cart items are both added to the order, so do not send the same products in both.","type":"string"},"sale":{"examples":0,"description":"Absolute value in order-defined currency.","type":"number"},"voucherList":{"description":"List of voucher codes to apply to the order.","type":"array","items":{"examples":["SUMMER-15"],"type":"string"}},"paymentMethod":{"default":"credits","description":"Payment strategy.\n- `credits` (default): Uses customer credits first, remaining amount is paid with money.\n- `money`: Forces full payment with money only; customer credits are ignored.","type":"string","enum":["credits","money"]},"deliveryPrice":{"examples":[10],"description":"Absolute value in order-defined currency.","type":"number"},"paymentPrice":{"examples":[0],"description":"Absolute value in order-defined currency.","type":"number"},"deliveryCode":{"examples":["zasilkovna-pickup"],"description":"Code of the shipping method the customer chose (admin → Doprava, `shop__order_delivery.code`). Stored on the order so a shipment can later be created with the carrier account and service configured on that method. The delivery fee is then computed by BizKitHub (price rules, free-shipping threshold) and added as an order line; `deliveryPrice` is ignored. An unknown code rejects the order with 404.","type":"string"},"deliveryPointId":{"maxLength":64,"examples":["12345"],"description":"Pickup point / parcel shop id returned by the carrier widget (e.g. Zásilkovna point id). Used as the destination when the shipment is created.","type":"string"},"paymentCode":{"examples":["comgate"],"description":"Code of the payment method the customer chose (admin → Platby, `shop__order_payment_method.code`). Stored on the order; a fee above 0 is added as an order line. An unknown or inactive code rejects the order with 404.","type":"string"},"expirationDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"type":"string"},"dueDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"type":"string"},"internalNotice":{"description":"Your internal notice for organisation members. Customer should never see this notice.","type":"string"},"publicNotice":{"description":"Public notice defined by customer in cart. This notice can be displayed in e-mail and order detail page.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"description":"Postponed shipping (\"odložené odeslání\"): do not ship the order before this day. Plain day `YYYY-MM-DD` (Europe/Prague calendar day) or an ISO date-time (converted to its Prague day). Until the day arrives the order stays out of the fulfillment (packing) queue; on that day it returns to the queue automatically and the organisation is notified. The order status is not changed. Empty / `null` = ship as usual. Days more than 400 days ahead are rejected with 422.\n\nWhen omitted and the organisation enabled the AI note reader (settings → Orders), BizKitHub reads `publicNotice` (\"poslat až 10. 12.\") and may set the day itself. Change or clear it later with `POST /order/set-ship-not-before`.","type":"string"},{"type":"null"}]},"tags":{"type":"object","patternProperties":{"^(.*)$":{}}},"returnUrl":{"examples":["https://gymroom.cz/rezervace/dekujeme"],"description":"Storefront page the customer ends on. By default the payment gateway returns the customer to bizkithub.com/order, which moves a paid customer on here. With the organisation setting `payment_return_to_shop` the gateway returns the customer here directly for every outcome, with `?hash=<order hash>&payment=paid|cancelled|pending` (`payment` is missing for GoPay). `payment` is a display hint only: confirm the real state via `POST /check-payment-status` and `GET /detail?hash=` before showing the order as paid; offer `POST /create-payment` to pay again while the order is not expired.","type":"string"},"notificationUrl":{"type":"string"},"formData":{"type":"object","required":["code","data"],"properties":{"code":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"forceIgnoreNegativeCreditBalance":{"default":false,"description":"Mark the order as paid immediately. The customer can go into negative credit. Payment will not be processed.","type":"boolean"},"forceIssueInvoice":{"default":false,"type":"boolean"},"preventAutoPayment":{"examples":[true],"description":"Controls the automatic \"paid\" mark for orders whose total is zero or negative after creation (free items, 100 % voucher, fully covered by credit).\n- omitted (default): follows the organisation setting `order_zero_total_auto_pay` (default `all` = zero-total orders are marked as paid immediately).\n- `true`: the order stays unpaid (`isPaid: false`) in its initial status, no tax document is issued and later priced items make it a regular unpaid order. Use for inquiries / deal records whose price is filled in later.\n- `false`: always auto-pay a zero-total order, regardless of the organisation setting.\nHas no effect on orders with a positive total. `forceIgnoreNegativeCreditBalance: true` still marks the order as paid unless `preventAutoPayment` is `true`.","type":"boolean"},"assignee":{"description":"Nominate the contact that will handle this order manually (consultation, real-estate, delegated fulfilment).\n\nThe assignee is optional and can also be set/updated later from the admin. On payment the assignee receives an internal e-mail notifying them that the order is now paid and ready to be processed.\n\nProvide `cuRefNo` (16-char customer reference number) OR `email`. Either resolves to the same contact record — an existing e-mail is reused, an unknown e-mail creates a fresh contact. When neither identifier resolves to a valid contact the field is ignored (no error, no assignee).","type":"object","properties":{"cuRefNo":{"minLength":16,"maxLength":16,"examples":["A1b2C3d4E5f6G7h8"],"description":"Customer reference number (`cuRefNo`) of the contact that will handle this order manually. When both `cuRefNo` and `email` are provided, `cuRefNo` wins. Unknown or malformed values are silently ignored.","type":"string"},"email":{"examples":["agent@example.com"],"description":"Contact e-mail of the manual-handling assignee. If a matching contact exists it is reused, otherwise a new contact is created for this e-mail. Invalid values are silently ignored.","type":"string"}}},"parentId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Hash of the parent order. The parent order must belong to the same organisation.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attribution":{"description":"Optional marketing attribution captured by the shop frontend. BizKitHub does not send it anywhere: it is stored with the order and returned as `attribution` by `GET /order/detail`, so your server can enrich its own conversion events (e.g. Meta Conversions API `Purchase`) after payment.\n\nValues are not strictly validated: empty, oversized or malformed values are silently dropped (`fbc`/`fbp` must look like `fb.<n>.<ms>.<id>`, `eventSourceUrl` must be http(s)). The order is never rejected because of them.","type":"object","properties":{"fbc":{"examples":["fb.1.1730530000000.IwAR2abc"],"description":"Meta click ID (`_fbc` cookie or `fb.1.<ms>.<fbclid>` built from the landing URL).","type":"string"},"fbp":{"examples":["fb.1.1730530000000.123456789"],"description":"Meta browser ID (`_fbp` cookie).","type":"string"},"eventSourceUrl":{"examples":["https://gymroom.cz/rezervace/smichov"],"description":"Absolute http(s) URL of the page where the order was placed.","type":"string"},"clientUserAgent":{"examples":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"],"description":"Browser user agent.","type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["customer","items"],"properties":{"customer":{"description":"Paying customer (payer). This customer pays the order and is used as the primary billing entity. If the specified customer account does not exist, the system will automatically create a new customer and link it to the order.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}},"billingAddress":{"description":"Optional billing address, when it differs from the customer address (which is then the delivery address). The invoice is issued to this address. First and last name default to the customer. Omit it when both addresses are the same. The address is also saved to the customer contact, without changing its primary address.","type":"object","properties":{"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["Václavské náměstí 1"],"type":"string"},"city":{"examples":["Praha"],"type":"string"},"cityPart":{"examples":["Nové Město"],"type":"string"},"stateRegion":{"examples":["Hlavní město Praha"],"type":"string"},"postalCode":{"examples":["110 00"],"type":"string"},"country":{"examples":["CZ"],"type":"string"}}},"issuerCustomer":{"description":"Order issuer. The party that issues the order (e.g. delegated purchase or invoicing). Use only when the order is issued by a specific customer. For common e-shop orders, this field should be omitted — the issuer is the organisation by default. If the specified customer does not exist, the system will automatically create one.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}},"copyCustomers":{"description":"List of alternative e-mails of customers for e-mail copy.","type":"array","items":{"examples":["janbarasek@gmail.com"],"type":"string"}},"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["label"],"properties":{"label":{"examples":["Cheese burger"],"description":"Main order items label used in order detail and as invoice line.","type":"string"},"price":{"examples":250,"description":"Absolute value in order-defined currency.\n\nThe item price can be zero. Enter the price as a real value and do not use multiplication. We also accept decimal numbers and handle them safely with a precision of up to two decimal places.\n\nThe price value is determined dynamically based on hierarchy. First, the price you set is used. If no price is set, we attempt to retrieve it from the product variant or the core product. If no price is found there either, the price will be zero.","type":"number"},"vat":{"examples":21,"description":"Percentage VAT rate.","type":"number"},"count":{"examples":1,"description":"Integer value. Quantity, count, hours, ...","type":"number"},"sale":{"examples":[10],"description":"Absolute value in order-defined currency.","type":"number"},"unit":{"examples":["ks","h","m","kg"],"type":"string"},"productCode":{"examples":["burger"],"description":"Link order item to product when product code has been defined.","type":"string"},"variantCode":{"examples":["cheese-burger"],"description":"Link order item to product variant when product code AND variant code has been defined.","type":"string"},"eventCode":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"description":"Link order item to calendar event when event code has been defined.","type":"string"},"creditAmount":{"examples":[100],"description":"How many credits should be added to customer account when order will be paid?","type":"number"},"specialActions":{"examples":["create-voucher:fixed:500;add-credit:15"],"anyOf":[{"examples":["create-voucher:fixed:500"],"type":"string"},{"examples":[["create-voucher:fixed:500","add-credit:20"]],"type":"array","items":{"type":"string"}}]},"branch":{"examples":["gymroom-plzen"],"description":"Slug of the branch (pobočka) that processed this line item. When set, the item is bound to the branch via shop__order_item.branch_id and any credit grant/debit derived from this item is attributed to the branch (shop__contact_credit.payer_branch_id). Omit to leave the item at organisation level.","type":"string"}}}},"orderGroupId":{"examples":["branch-vinohrady"],"description":"Organisation defined order group code.","type":"string"},"kind":{"default":"commerce","description":"Behavioral category of the order. Decides which automatic workflows apply:\n- `commerce` (default): standard order; invoice/receipt is auto-issued by the status rule engine when the chosen status configures it. The customer receives the standard order-status notification.\n- `registration`: order represents a sign-up for an event / form-style admission. No tax document is ever auto-issued (manual admin action via BFF can still issue one): the status rule engine skips `create_invoice` / `create_receipt` for this order. A status with `mark_as_paid` still records the payment date. Whether a zero-total registration is marked as paid right after creation follows the organisation setting `order_zero_total_auto_pay` (default: yes; set it to `commerce` to keep registrations unpaid) or the explicit `preventAutoPayment` flag. The customer receives a registration-confirmation email when the per-group or kind-specific notification template is configured (falls back to standard order-status template if not). Typically combined with all items priced at 0 and a dedicated organisation-defined order group for pairing.","type":"string","enum":["commerce","registration"]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.\n\nOrder currency (BIZKIT-90): explicit `currency` → currency of the cart (`cartId`) → organisation default. When `cartId` is in another currency than the explicit `currency`, the cart is re-priced into `currency` first (manual product / variant currency price, otherwise converted by the organisation rate and rounding). `items[].price`, `deliveryPrice` and `paymentPrice` are always taken as sent, in the order currency; an item without `price` gets its catalogue price in the order currency. Fixed-amount vouchers are defined in the organisation default currency and converted the same way. Note: `items[]` and cart items are both added to the order, so do not send the same products in both.","type":"string"},"sale":{"examples":0,"description":"Absolute value in order-defined currency.","type":"number"},"voucherList":{"description":"List of voucher codes to apply to the order.","type":"array","items":{"examples":["SUMMER-15"],"type":"string"}},"paymentMethod":{"default":"credits","description":"Payment strategy.\n- `credits` (default): Uses customer credits first, remaining amount is paid with money.\n- `money`: Forces full payment with money only; customer credits are ignored.","type":"string","enum":["credits","money"]},"deliveryPrice":{"examples":[10],"description":"Absolute value in order-defined currency.","type":"number"},"paymentPrice":{"examples":[0],"description":"Absolute value in order-defined currency.","type":"number"},"deliveryCode":{"examples":["zasilkovna-pickup"],"description":"Code of the shipping method the customer chose (admin → Doprava, `shop__order_delivery.code`). Stored on the order so a shipment can later be created with the carrier account and service configured on that method. The delivery fee is then computed by BizKitHub (price rules, free-shipping threshold) and added as an order line; `deliveryPrice` is ignored. An unknown code rejects the order with 404.","type":"string"},"deliveryPointId":{"maxLength":64,"examples":["12345"],"description":"Pickup point / parcel shop id returned by the carrier widget (e.g. Zásilkovna point id). Used as the destination when the shipment is created.","type":"string"},"paymentCode":{"examples":["comgate"],"description":"Code of the payment method the customer chose (admin → Platby, `shop__order_payment_method.code`). Stored on the order; a fee above 0 is added as an order line. An unknown or inactive code rejects the order with 404.","type":"string"},"expirationDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"type":"string"},"dueDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"type":"string"},"internalNotice":{"description":"Your internal notice for organisation members. Customer should never see this notice.","type":"string"},"publicNotice":{"description":"Public notice defined by customer in cart. This notice can be displayed in e-mail and order detail page.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"description":"Postponed shipping (\"odložené odeslání\"): do not ship the order before this day. Plain day `YYYY-MM-DD` (Europe/Prague calendar day) or an ISO date-time (converted to its Prague day). Until the day arrives the order stays out of the fulfillment (packing) queue; on that day it returns to the queue automatically and the organisation is notified. The order status is not changed. Empty / `null` = ship as usual. Days more than 400 days ahead are rejected with 422.\n\nWhen omitted and the organisation enabled the AI note reader (settings → Orders), BizKitHub reads `publicNotice` (\"poslat až 10. 12.\") and may set the day itself. Change or clear it later with `POST /order/set-ship-not-before`.","type":"string"},{"type":"null"}]},"tags":{"type":"object","patternProperties":{"^(.*)$":{}}},"returnUrl":{"examples":["https://gymroom.cz/rezervace/dekujeme"],"description":"Storefront page the customer ends on. By default the payment gateway returns the customer to bizkithub.com/order, which moves a paid customer on here. With the organisation setting `payment_return_to_shop` the gateway returns the customer here directly for every outcome, with `?hash=<order hash>&payment=paid|cancelled|pending` (`payment` is missing for GoPay). `payment` is a display hint only: confirm the real state via `POST /check-payment-status` and `GET /detail?hash=` before showing the order as paid; offer `POST /create-payment` to pay again while the order is not expired.","type":"string"},"notificationUrl":{"type":"string"},"formData":{"type":"object","required":["code","data"],"properties":{"code":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"forceIgnoreNegativeCreditBalance":{"default":false,"description":"Mark the order as paid immediately. The customer can go into negative credit. Payment will not be processed.","type":"boolean"},"forceIssueInvoice":{"default":false,"type":"boolean"},"preventAutoPayment":{"examples":[true],"description":"Controls the automatic \"paid\" mark for orders whose total is zero or negative after creation (free items, 100 % voucher, fully covered by credit).\n- omitted (default): follows the organisation setting `order_zero_total_auto_pay` (default `all` = zero-total orders are marked as paid immediately).\n- `true`: the order stays unpaid (`isPaid: false`) in its initial status, no tax document is issued and later priced items make it a regular unpaid order. Use for inquiries / deal records whose price is filled in later.\n- `false`: always auto-pay a zero-total order, regardless of the organisation setting.\nHas no effect on orders with a positive total. `forceIgnoreNegativeCreditBalance: true` still marks the order as paid unless `preventAutoPayment` is `true`.","type":"boolean"},"assignee":{"description":"Nominate the contact that will handle this order manually (consultation, real-estate, delegated fulfilment).\n\nThe assignee is optional and can also be set/updated later from the admin. On payment the assignee receives an internal e-mail notifying them that the order is now paid and ready to be processed.\n\nProvide `cuRefNo` (16-char customer reference number) OR `email`. Either resolves to the same contact record — an existing e-mail is reused, an unknown e-mail creates a fresh contact. When neither identifier resolves to a valid contact the field is ignored (no error, no assignee).","type":"object","properties":{"cuRefNo":{"minLength":16,"maxLength":16,"examples":["A1b2C3d4E5f6G7h8"],"description":"Customer reference number (`cuRefNo`) of the contact that will handle this order manually. When both `cuRefNo` and `email` are provided, `cuRefNo` wins. Unknown or malformed values are silently ignored.","type":"string"},"email":{"examples":["agent@example.com"],"description":"Contact e-mail of the manual-handling assignee. If a matching contact exists it is reused, otherwise a new contact is created for this e-mail. Invalid values are silently ignored.","type":"string"}}},"parentId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Hash of the parent order. The parent order must belong to the same organisation.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attribution":{"description":"Optional marketing attribution captured by the shop frontend. BizKitHub does not send it anywhere: it is stored with the order and returned as `attribution` by `GET /order/detail`, so your server can enrich its own conversion events (e.g. Meta Conversions API `Purchase`) after payment.\n\nValues are not strictly validated: empty, oversized or malformed values are silently dropped (`fbc`/`fbp` must look like `fb.<n>.<ms>.<id>`, `eventSourceUrl` must be http(s)). The order is never rejected because of them.","type":"object","properties":{"fbc":{"examples":["fb.1.1730530000000.IwAR2abc"],"description":"Meta click ID (`_fbc` cookie or `fb.1.<ms>.<fbclid>` built from the landing URL).","type":"string"},"fbp":{"examples":["fb.1.1730530000000.123456789"],"description":"Meta browser ID (`_fbp` cookie).","type":"string"},"eventSourceUrl":{"examples":["https://gymroom.cz/rezervace/smichov"],"description":"Absolute http(s) URL of the page where the order was placed.","type":"string"},"clientUserAgent":{"examples":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"],"description":"Browser user agent.","type":"string"}}}}}},"text/plain":{"schema":{"type":"object","required":["customer","items"],"properties":{"customer":{"description":"Paying customer (payer). This customer pays the order and is used as the primary billing entity. If the specified customer account does not exist, the system will automatically create a new customer and link it to the order.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}},"billingAddress":{"description":"Optional billing address, when it differs from the customer address (which is then the delivery address). The invoice is issued to this address. First and last name default to the customer. Omit it when both addresses are the same. The address is also saved to the customer contact, without changing its primary address.","type":"object","properties":{"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["Václavské náměstí 1"],"type":"string"},"city":{"examples":["Praha"],"type":"string"},"cityPart":{"examples":["Nové Město"],"type":"string"},"stateRegion":{"examples":["Hlavní město Praha"],"type":"string"},"postalCode":{"examples":["110 00"],"type":"string"},"country":{"examples":["CZ"],"type":"string"}}},"issuerCustomer":{"description":"Order issuer. The party that issues the order (e.g. delegated purchase or invoicing). Use only when the order is issued by a specific customer. For common e-shop orders, this field should be omitted — the issuer is the organisation by default. If the specified customer does not exist, the system will automatically create one.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"examples":["Jan Barášek"],"type":"string"},"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["R. Novotného 1505"],"type":"string"},"city":{"examples":["Kladno"],"type":"string"},"cityPart":{"examples":["Kročehlavy"],"type":"string"},"stateRegion":{"examples":["Středočeský kraj"],"type":"string"},"postalCode":{"examples":["272 01"],"type":"string"},"country":{"examples":["CZ","Česká republika","Czechia","Czech"],"type":"string"},"newsletter":{"default":false,"type":"boolean"},"primaryLocale":{"examples":["cs"],"type":"string"},"groups":{"type":"array","items":{"type":"string"}},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"referralId":{"examples":["1cGIHvFoQDGLAbcA"],"description":"cuRefNo = customer reference number.","maxLength":16,"minLength":16,"type":"string"}}},"copyCustomers":{"description":"List of alternative e-mails of customers for e-mail copy.","type":"array","items":{"examples":["janbarasek@gmail.com"],"type":"string"}},"cartId":{"examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["label"],"properties":{"label":{"examples":["Cheese burger"],"description":"Main order items label used in order detail and as invoice line.","type":"string"},"price":{"examples":250,"description":"Absolute value in order-defined currency.\n\nThe item price can be zero. Enter the price as a real value and do not use multiplication. We also accept decimal numbers and handle them safely with a precision of up to two decimal places.\n\nThe price value is determined dynamically based on hierarchy. First, the price you set is used. If no price is set, we attempt to retrieve it from the product variant or the core product. If no price is found there either, the price will be zero.","type":"number"},"vat":{"examples":21,"description":"Percentage VAT rate.","type":"number"},"count":{"examples":1,"description":"Integer value. Quantity, count, hours, ...","type":"number"},"sale":{"examples":[10],"description":"Absolute value in order-defined currency.","type":"number"},"unit":{"examples":["ks","h","m","kg"],"type":"string"},"productCode":{"examples":["burger"],"description":"Link order item to product when product code has been defined.","type":"string"},"variantCode":{"examples":["cheese-burger"],"description":"Link order item to product variant when product code AND variant code has been defined.","type":"string"},"eventCode":{"examples":["2WRp6X5rSqQa321EjHB2mxZz74u74H84"],"description":"Link order item to calendar event when event code has been defined.","type":"string"},"creditAmount":{"examples":[100],"description":"How many credits should be added to customer account when order will be paid?","type":"number"},"specialActions":{"examples":["create-voucher:fixed:500;add-credit:15"],"anyOf":[{"examples":["create-voucher:fixed:500"],"type":"string"},{"examples":[["create-voucher:fixed:500","add-credit:20"]],"type":"array","items":{"type":"string"}}]},"branch":{"examples":["gymroom-plzen"],"description":"Slug of the branch (pobočka) that processed this line item. When set, the item is bound to the branch via shop__order_item.branch_id and any credit grant/debit derived from this item is attributed to the branch (shop__contact_credit.payer_branch_id). Omit to leave the item at organisation level.","type":"string"}}}},"orderGroupId":{"examples":["branch-vinohrady"],"description":"Organisation defined order group code.","type":"string"},"kind":{"default":"commerce","description":"Behavioral category of the order. Decides which automatic workflows apply:\n- `commerce` (default): standard order; invoice/receipt is auto-issued by the status rule engine when the chosen status configures it. The customer receives the standard order-status notification.\n- `registration`: order represents a sign-up for an event / form-style admission. No tax document is ever auto-issued (manual admin action via BFF can still issue one): the status rule engine skips `create_invoice` / `create_receipt` for this order. A status with `mark_as_paid` still records the payment date. Whether a zero-total registration is marked as paid right after creation follows the organisation setting `order_zero_total_auto_pay` (default: yes; set it to `commerce` to keep registrations unpaid) or the explicit `preventAutoPayment` flag. The customer receives a registration-confirmation email when the per-group or kind-specific notification template is configured (falls back to standard order-status template if not). Typically combined with all items priced at 0 and a dedicated organisation-defined order group for pairing.","type":"string","enum":["commerce","registration"]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.\n\nOrder currency (BIZKIT-90): explicit `currency` → currency of the cart (`cartId`) → organisation default. When `cartId` is in another currency than the explicit `currency`, the cart is re-priced into `currency` first (manual product / variant currency price, otherwise converted by the organisation rate and rounding). `items[].price`, `deliveryPrice` and `paymentPrice` are always taken as sent, in the order currency; an item without `price` gets its catalogue price in the order currency. Fixed-amount vouchers are defined in the organisation default currency and converted the same way. Note: `items[]` and cart items are both added to the order, so do not send the same products in both.","type":"string"},"sale":{"examples":0,"description":"Absolute value in order-defined currency.","type":"number"},"voucherList":{"description":"List of voucher codes to apply to the order.","type":"array","items":{"examples":["SUMMER-15"],"type":"string"}},"paymentMethod":{"default":"credits","description":"Payment strategy.\n- `credits` (default): Uses customer credits first, remaining amount is paid with money.\n- `money`: Forces full payment with money only; customer credits are ignored.","type":"string","enum":["credits","money"]},"deliveryPrice":{"examples":[10],"description":"Absolute value in order-defined currency.","type":"number"},"paymentPrice":{"examples":[0],"description":"Absolute value in order-defined currency.","type":"number"},"deliveryCode":{"examples":["zasilkovna-pickup"],"description":"Code of the shipping method the customer chose (admin → Doprava, `shop__order_delivery.code`). Stored on the order so a shipment can later be created with the carrier account and service configured on that method. The delivery fee is then computed by BizKitHub (price rules, free-shipping threshold) and added as an order line; `deliveryPrice` is ignored. An unknown code rejects the order with 404.","type":"string"},"deliveryPointId":{"maxLength":64,"examples":["12345"],"description":"Pickup point / parcel shop id returned by the carrier widget (e.g. Zásilkovna point id). Used as the destination when the shipment is created.","type":"string"},"paymentCode":{"examples":["comgate"],"description":"Code of the payment method the customer chose (admin → Platby, `shop__order_payment_method.code`). Stored on the order; a fee above 0 is added as an order line. An unknown or inactive code rejects the order with 404.","type":"string"},"expirationDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"type":"string"},"dueDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"type":"string"},"internalNotice":{"description":"Your internal notice for organisation members. Customer should never see this notice.","type":"string"},"publicNotice":{"description":"Public notice defined by customer in cart. This notice can be displayed in e-mail and order detail page.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"description":"Postponed shipping (\"odložené odeslání\"): do not ship the order before this day. Plain day `YYYY-MM-DD` (Europe/Prague calendar day) or an ISO date-time (converted to its Prague day). Until the day arrives the order stays out of the fulfillment (packing) queue; on that day it returns to the queue automatically and the organisation is notified. The order status is not changed. Empty / `null` = ship as usual. Days more than 400 days ahead are rejected with 422.\n\nWhen omitted and the organisation enabled the AI note reader (settings → Orders), BizKitHub reads `publicNotice` (\"poslat až 10. 12.\") and may set the day itself. Change or clear it later with `POST /order/set-ship-not-before`.","type":"string"},{"type":"null"}]},"tags":{"type":"object","patternProperties":{"^(.*)$":{}}},"returnUrl":{"examples":["https://gymroom.cz/rezervace/dekujeme"],"description":"Storefront page the customer ends on. By default the payment gateway returns the customer to bizkithub.com/order, which moves a paid customer on here. With the organisation setting `payment_return_to_shop` the gateway returns the customer here directly for every outcome, with `?hash=<order hash>&payment=paid|cancelled|pending` (`payment` is missing for GoPay). `payment` is a display hint only: confirm the real state via `POST /check-payment-status` and `GET /detail?hash=` before showing the order as paid; offer `POST /create-payment` to pay again while the order is not expired.","type":"string"},"notificationUrl":{"type":"string"},"formData":{"type":"object","required":["code","data"],"properties":{"code":{"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"forceIgnoreNegativeCreditBalance":{"default":false,"description":"Mark the order as paid immediately. The customer can go into negative credit. Payment will not be processed.","type":"boolean"},"forceIssueInvoice":{"default":false,"type":"boolean"},"preventAutoPayment":{"examples":[true],"description":"Controls the automatic \"paid\" mark for orders whose total is zero or negative after creation (free items, 100 % voucher, fully covered by credit).\n- omitted (default): follows the organisation setting `order_zero_total_auto_pay` (default `all` = zero-total orders are marked as paid immediately).\n- `true`: the order stays unpaid (`isPaid: false`) in its initial status, no tax document is issued and later priced items make it a regular unpaid order. Use for inquiries / deal records whose price is filled in later.\n- `false`: always auto-pay a zero-total order, regardless of the organisation setting.\nHas no effect on orders with a positive total. `forceIgnoreNegativeCreditBalance: true` still marks the order as paid unless `preventAutoPayment` is `true`.","type":"boolean"},"assignee":{"description":"Nominate the contact that will handle this order manually (consultation, real-estate, delegated fulfilment).\n\nThe assignee is optional and can also be set/updated later from the admin. On payment the assignee receives an internal e-mail notifying them that the order is now paid and ready to be processed.\n\nProvide `cuRefNo` (16-char customer reference number) OR `email`. Either resolves to the same contact record — an existing e-mail is reused, an unknown e-mail creates a fresh contact. When neither identifier resolves to a valid contact the field is ignored (no error, no assignee).","type":"object","properties":{"cuRefNo":{"minLength":16,"maxLength":16,"examples":["A1b2C3d4E5f6G7h8"],"description":"Customer reference number (`cuRefNo`) of the contact that will handle this order manually. When both `cuRefNo` and `email` are provided, `cuRefNo` wins. Unknown or malformed values are silently ignored.","type":"string"},"email":{"examples":["agent@example.com"],"description":"Contact e-mail of the manual-handling assignee. If a matching contact exists it is reused, otherwise a new contact is created for this e-mail. Invalid values are silently ignored.","type":"string"}}},"parentId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Hash of the parent order. The parent order must belong to the same organisation.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attribution":{"description":"Optional marketing attribution captured by the shop frontend. BizKitHub does not send it anywhere: it is stored with the order and returned as `attribution` by `GET /order/detail`, so your server can enrich its own conversion events (e.g. Meta Conversions API `Purchase`) after payment.\n\nValues are not strictly validated: empty, oversized or malformed values are silently dropped (`fbc`/`fbp` must look like `fb.<n>.<ms>.<id>`, `eventSourceUrl` must be http(s)). The order is never rejected because of them.","type":"object","properties":{"fbc":{"examples":["fb.1.1730530000000.IwAR2abc"],"description":"Meta click ID (`_fbc` cookie or `fb.1.<ms>.<fbclid>` built from the landing URL).","type":"string"},"fbp":{"examples":["fb.1.1730530000000.123456789"],"description":"Meta browser ID (`_fbp` cookie).","type":"string"},"eventSourceUrl":{"examples":["https://gymroom.cz/rezervace/smichov"],"description":"Absolute http(s) URL of the page where the order was placed.","type":"string"},"clientUserAgent":{"examples":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"],"description":"Browser user agent.","type":"string"}}}}}}}}}},"/api/v1/shop/order/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":false},{"description":"Order group code.","examples":["nabidky"],"schema":{"type":"string"},"in":"query","name":"groupCode","required":false},{"description":"E-mail of the assignee (`assignee` at creation). Case-insensitive exact match.","examples":["petrhlavaty@divadelnisluzby.cz"],"schema":{"type":"string"},"in":"query","name":"assigneeEmail","required":false},{"description":"E-mail of the customer. Case-insensitive.","examples":["jan@example.com"],"schema":{"type":"string"},"in":"query","name":"customerEmail","required":false},{"description":"Only these status codes (comma-separated).","examples":["nabidka-odeslana,nabidka-prijata"],"schema":{"type":"string"},"in":"query","name":"statusCode","required":false},{"description":"Hide these status codes (comma-separated).","examples":["nabidka-nahrazena"],"schema":{"type":"string"},"in":"query","name":"excludeStatusCode","required":false},{"description":"Tag filter `key:value`, comma-separated for several (the order must carry all of them). Normalised like on write, so the casing does not matter.","examples":["nabidka:NAB-2026-0987"],"schema":{"type":"string"},"in":"query","name":"tag","required":false},{"schema":{"type":"string","default":"1"},"in":"query","name":"page","required":false},{"description":"Page size, at most 100.","schema":{"type":"string","default":"20"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"description":"Items on this page.","type":"number"},"totalCount":{"description":"All orders matching the filters.","type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","hash","kind","status","group","customer","price","isPaid","payDate","insertedDate","updatedDate","assignee","tags","parentHash","shipNotBefore"],"properties":{"id":{"examples":["26000005"],"description":"Order number.","type":"string"},"hash":{"examples":["DIeJ1W5NBF0KEXtamL9zpx5Hk3s79008"],"description":"Unique order hash.","type":"string"},"kind":{"examples":["commerce"],"description":"Order kind (`commerce` | `registration`).","type":"string"},"status":{"type":"object","required":["code","label","type"],"properties":{"code":{"examples":["nabidka-odeslana"],"description":"Organisation-defined status code.","type":"string"},"label":{"examples":["Nabídka odeslána"],"description":"Status name shown in the administration.","type":"string"},"type":{"examples":["new"],"description":"Status type: `new` | `processing` | `done` | `storno`.","type":"string"}}},"group":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["nabidky"],"type":"string"},"name":{"examples":["Nabídky"],"type":"string"}}},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","name","companyName","email","phone"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["Jan Novák"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"examples":["Divadlo J. K. Tyla"],"type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"examples":["+420777123456"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"price":{"type":"object","required":["withVat","withoutVat","currency"],"properties":{"withVat":{"examples":[121000],"description":"Order total including VAT.","type":"number"},"withoutVat":{"examples":[100000],"description":"Order total excluding VAT, computed per item from its own VAT rate.","type":"number"},"currency":{"examples":["CZK"],"type":"string"}}},"isPaid":{"type":"boolean"},"payDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"insertedDate":{"format":"date-time","type":"string"},"updatedDate":{"format":"date-time","type":"string"},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","email","name"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"description":"Contact reference number (16 chars).","type":"string"},"email":{"nullable":true,"anyOf":[{"examples":["petrhlavaty@divadelnisluzby.cz"],"type":"string"},{"type":"null"}]},"name":{"nullable":true,"anyOf":[{"examples":["Petr Hlavatý"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tags":{"description":"Tags as stored (keys snake_case, values lower-cased).","type":"array","items":{"type":"object","required":["code","key","value"],"properties":{"code":{"examples":["nabidka:nab-2026-0987"],"type":"string"},"key":{"examples":["nabidka"],"type":"string"},"value":{"examples":["nab-2026-0987"],"type":"string"}}}},"parentHash":{"nullable":true,"anyOf":[{"examples":["N34N21Zs0my8w1Li1BKpiBzhuuhknTqQ"],"description":"Hash of the parent order (`parentId` at creation), e.g. the previous version of an offer.","type":"string"},{"type":"null"}]},"shipNotBefore":{"nullable":true,"anyOf":[{"format":"date","examples":["2026-12-15"],"description":"Postponed shipping: the order must not ship before this day (Europe/Prague calendar day). `null` = ship as usual.","type":"string"},{"type":"null"}]}}}}},"required":["count","totalCount","page","limit","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"count":{"description":"Items on this page.","type":"number"},"totalCount":{"description":"All orders matching the filters.","type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","hash","kind","status","group","customer","price","isPaid","payDate","insertedDate","updatedDate","assignee","tags","parentHash","shipNotBefore"],"properties":{"id":{"examples":["26000005"],"description":"Order number.","type":"string"},"hash":{"examples":["DIeJ1W5NBF0KEXtamL9zpx5Hk3s79008"],"description":"Unique order hash.","type":"string"},"kind":{"examples":["commerce"],"description":"Order kind (`commerce` | `registration`).","type":"string"},"status":{"type":"object","required":["code","label","type"],"properties":{"code":{"examples":["nabidka-odeslana"],"description":"Organisation-defined status code.","type":"string"},"label":{"examples":["Nabídka odeslána"],"description":"Status name shown in the administration.","type":"string"},"type":{"examples":["new"],"description":"Status type: `new` | `processing` | `done` | `storno`.","type":"string"}}},"group":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["nabidky"],"type":"string"},"name":{"examples":["Nabídky"],"type":"string"}}},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","name","companyName","email","phone"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["Jan Novák"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"examples":["Divadlo J. K. Tyla"],"type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"examples":["+420777123456"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"price":{"type":"object","required":["withVat","withoutVat","currency"],"properties":{"withVat":{"examples":[121000],"description":"Order total including VAT.","type":"number"},"withoutVat":{"examples":[100000],"description":"Order total excluding VAT, computed per item from its own VAT rate.","type":"number"},"currency":{"examples":["CZK"],"type":"string"}}},"isPaid":{"type":"boolean"},"payDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"insertedDate":{"format":"date-time","type":"string"},"updatedDate":{"format":"date-time","type":"string"},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","email","name"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"description":"Contact reference number (16 chars).","type":"string"},"email":{"nullable":true,"anyOf":[{"examples":["petrhlavaty@divadelnisluzby.cz"],"type":"string"},{"type":"null"}]},"name":{"nullable":true,"anyOf":[{"examples":["Petr Hlavatý"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tags":{"description":"Tags as stored (keys snake_case, values lower-cased).","type":"array","items":{"type":"object","required":["code","key","value"],"properties":{"code":{"examples":["nabidka:nab-2026-0987"],"type":"string"},"key":{"examples":["nabidka"],"type":"string"},"value":{"examples":["nab-2026-0987"],"type":"string"}}}},"parentHash":{"nullable":true,"anyOf":[{"examples":["N34N21Zs0my8w1Li1BKpiBzhuuhknTqQ"],"description":"Hash of the parent order (`parentId` at creation), e.g. the previous version of an offer.","type":"string"},{"type":"null"}]},"shipNotBefore":{"nullable":true,"anyOf":[{"format":"date","examples":["2026-12-15"],"description":"Postponed shipping: the order must not ship before this day (Europe/Prague calendar day). `null` = ship as usual.","type":"string"},{"type":"null"}]}}}}},"required":["count","totalCount","page","limit","items"]}},"text/plain":{"schema":{"type":"object","properties":{"count":{"description":"Items on this page.","type":"number"},"totalCount":{"description":"All orders matching the filters.","type":"number"},"page":{"type":"number"},"limit":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","hash","kind","status","group","customer","price","isPaid","payDate","insertedDate","updatedDate","assignee","tags","parentHash","shipNotBefore"],"properties":{"id":{"examples":["26000005"],"description":"Order number.","type":"string"},"hash":{"examples":["DIeJ1W5NBF0KEXtamL9zpx5Hk3s79008"],"description":"Unique order hash.","type":"string"},"kind":{"examples":["commerce"],"description":"Order kind (`commerce` | `registration`).","type":"string"},"status":{"type":"object","required":["code","label","type"],"properties":{"code":{"examples":["nabidka-odeslana"],"description":"Organisation-defined status code.","type":"string"},"label":{"examples":["Nabídka odeslána"],"description":"Status name shown in the administration.","type":"string"},"type":{"examples":["new"],"description":"Status type: `new` | `processing` | `done` | `storno`.","type":"string"}}},"group":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["nabidky"],"type":"string"},"name":{"examples":["Nabídky"],"type":"string"}}},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","name","companyName","email","phone"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["Jan Novák"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"examples":["Divadlo J. K. Tyla"],"type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"examples":["+420777123456"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"price":{"type":"object","required":["withVat","withoutVat","currency"],"properties":{"withVat":{"examples":[121000],"description":"Order total including VAT.","type":"number"},"withoutVat":{"examples":[100000],"description":"Order total excluding VAT, computed per item from its own VAT rate.","type":"number"},"currency":{"examples":["CZK"],"type":"string"}}},"isPaid":{"type":"boolean"},"payDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"insertedDate":{"format":"date-time","type":"string"},"updatedDate":{"format":"date-time","type":"string"},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","email","name"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"description":"Contact reference number (16 chars).","type":"string"},"email":{"nullable":true,"anyOf":[{"examples":["petrhlavaty@divadelnisluzby.cz"],"type":"string"},{"type":"null"}]},"name":{"nullable":true,"anyOf":[{"examples":["Petr Hlavatý"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tags":{"description":"Tags as stored (keys snake_case, values lower-cased).","type":"array","items":{"type":"object","required":["code","key","value"],"properties":{"code":{"examples":["nabidka:nab-2026-0987"],"type":"string"},"key":{"examples":["nabidka"],"type":"string"},"value":{"examples":["nab-2026-0987"],"type":"string"}}}},"parentHash":{"nullable":true,"anyOf":[{"examples":["N34N21Zs0my8w1Li1BKpiBzhuuhknTqQ"],"description":"Hash of the parent order (`parentId` at creation), e.g. the previous version of an offer.","type":"string"},{"type":"null"}]},"shipNotBefore":{"nullable":true,"anyOf":[{"format":"date","examples":["2026-12-15"],"description":"Postponed shipping: the order must not ship before this day (Europe/Prague calendar day). `null` = ship as usual.","type":"string"},{"type":"null"}]}}}}},"required":["count","totalCount","page","limit","items"]}}}}},"operationId":"getApiV1ShopOrderList","tags":["order"],"summary":"List orders of the organisation","description":"Lists orders of the organisation that owns the API key, newest change first (`updatedDate` desc). Never returns orders of another organisation. `formData` is not part of the list; load it per order via `GET /order/detail-full`."}},"/api/v1/shop/order/detail-full":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":false},{"description":"Order hash.","examples":["DIeJ1W5NBF0KEXtamL9zpx5Hk3s79008"],"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"examples":["26000005"],"description":"Order number.","type":"string"},"hash":{"examples":["DIeJ1W5NBF0KEXtamL9zpx5Hk3s79008"],"description":"Unique order hash.","type":"string"},"kind":{"examples":["commerce"],"description":"Order kind (`commerce` | `registration`).","type":"string"},"status":{"type":"object","required":["code","label","type"],"properties":{"code":{"examples":["nabidka-odeslana"],"description":"Organisation-defined status code.","type":"string"},"label":{"examples":["Nabídka odeslána"],"description":"Status name shown in the administration.","type":"string"},"type":{"examples":["new"],"description":"Status type: `new` | `processing` | `done` | `storno`.","type":"string"}}},"group":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["nabidky"],"type":"string"},"name":{"examples":["Nabídky"],"type":"string"}}},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","name","companyName","email","phone"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["Jan Novák"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"examples":["Divadlo J. K. Tyla"],"type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"examples":["+420777123456"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"price":{"type":"object","required":["withVat","withoutVat","currency"],"properties":{"withVat":{"examples":[121000],"description":"Order total including VAT.","type":"number"},"withoutVat":{"examples":[100000],"description":"Order total excluding VAT, computed per item from its own VAT rate.","type":"number"},"currency":{"examples":["CZK"],"type":"string"}}},"isPaid":{"type":"boolean"},"payDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"insertedDate":{"format":"date-time","type":"string"},"updatedDate":{"format":"date-time","type":"string"},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","email","name"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"description":"Contact reference number (16 chars).","type":"string"},"email":{"nullable":true,"anyOf":[{"examples":["petrhlavaty@divadelnisluzby.cz"],"type":"string"},{"type":"null"}]},"name":{"nullable":true,"anyOf":[{"examples":["Petr Hlavatý"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tags":{"description":"Tags as stored (keys snake_case, values lower-cased).","type":"array","items":{"type":"object","required":["code","key","value"],"properties":{"code":{"examples":["nabidka:nab-2026-0987"],"type":"string"},"key":{"examples":["nabidka"],"type":"string"},"value":{"examples":["nab-2026-0987"],"type":"string"}}}},"parentHash":{"nullable":true,"anyOf":[{"examples":["N34N21Zs0my8w1Li1BKpiBzhuuhknTqQ"],"description":"Hash of the parent order (`parentId` at creation), e.g. the previous version of an offer.","type":"string"},{"type":"null"}]},"shipNotBefore":{"nullable":true,"anyOf":[{"format":"date","examples":["2026-12-15"],"description":"Postponed shipping: the order must not ship before this day (Europe/Prague calendar day). `null` = ship as usual.","type":"string"},{"type":"null"}]},"formData":{"nullable":true,"anyOf":[{"description":"The `formData` sent to `POST /order/create`, returned exactly as submitted. `null` when none was sent.","type":"object","required":["code","data"],"properties":{"code":{"examples":["nabidkovac"],"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"description":"Organisation-internal note.","type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"expirationDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["label","count","unitPriceWithVat","sale","vat","isStorno"],"properties":{"label":{"type":"string"},"count":{"type":"number"},"unitPriceWithVat":{"type":"number"},"sale":{"description":"Discount per unit including VAT.","type":"number"},"vat":{"description":"VAT rate in percent.","type":"number"},"isStorno":{"type":"boolean"}}}}},"required":["id","hash","kind","status","group","customer","price","isPaid","payDate","insertedDate","updatedDate","assignee","tags","parentHash","shipNotBefore","formData","internalNotice","publicNotice","dueDate","expirationDate","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"examples":["26000005"],"description":"Order number.","type":"string"},"hash":{"examples":["DIeJ1W5NBF0KEXtamL9zpx5Hk3s79008"],"description":"Unique order hash.","type":"string"},"kind":{"examples":["commerce"],"description":"Order kind (`commerce` | `registration`).","type":"string"},"status":{"type":"object","required":["code","label","type"],"properties":{"code":{"examples":["nabidka-odeslana"],"description":"Organisation-defined status code.","type":"string"},"label":{"examples":["Nabídka odeslána"],"description":"Status name shown in the administration.","type":"string"},"type":{"examples":["new"],"description":"Status type: `new` | `processing` | `done` | `storno`.","type":"string"}}},"group":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["nabidky"],"type":"string"},"name":{"examples":["Nabídky"],"type":"string"}}},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","name","companyName","email","phone"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["Jan Novák"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"examples":["Divadlo J. K. Tyla"],"type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"examples":["+420777123456"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"price":{"type":"object","required":["withVat","withoutVat","currency"],"properties":{"withVat":{"examples":[121000],"description":"Order total including VAT.","type":"number"},"withoutVat":{"examples":[100000],"description":"Order total excluding VAT, computed per item from its own VAT rate.","type":"number"},"currency":{"examples":["CZK"],"type":"string"}}},"isPaid":{"type":"boolean"},"payDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"insertedDate":{"format":"date-time","type":"string"},"updatedDate":{"format":"date-time","type":"string"},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","email","name"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"description":"Contact reference number (16 chars).","type":"string"},"email":{"nullable":true,"anyOf":[{"examples":["petrhlavaty@divadelnisluzby.cz"],"type":"string"},{"type":"null"}]},"name":{"nullable":true,"anyOf":[{"examples":["Petr Hlavatý"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tags":{"description":"Tags as stored (keys snake_case, values lower-cased).","type":"array","items":{"type":"object","required":["code","key","value"],"properties":{"code":{"examples":["nabidka:nab-2026-0987"],"type":"string"},"key":{"examples":["nabidka"],"type":"string"},"value":{"examples":["nab-2026-0987"],"type":"string"}}}},"parentHash":{"nullable":true,"anyOf":[{"examples":["N34N21Zs0my8w1Li1BKpiBzhuuhknTqQ"],"description":"Hash of the parent order (`parentId` at creation), e.g. the previous version of an offer.","type":"string"},{"type":"null"}]},"shipNotBefore":{"nullable":true,"anyOf":[{"format":"date","examples":["2026-12-15"],"description":"Postponed shipping: the order must not ship before this day (Europe/Prague calendar day). `null` = ship as usual.","type":"string"},{"type":"null"}]},"formData":{"nullable":true,"anyOf":[{"description":"The `formData` sent to `POST /order/create`, returned exactly as submitted. `null` when none was sent.","type":"object","required":["code","data"],"properties":{"code":{"examples":["nabidkovac"],"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"description":"Organisation-internal note.","type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"expirationDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["label","count","unitPriceWithVat","sale","vat","isStorno"],"properties":{"label":{"type":"string"},"count":{"type":"number"},"unitPriceWithVat":{"type":"number"},"sale":{"description":"Discount per unit including VAT.","type":"number"},"vat":{"description":"VAT rate in percent.","type":"number"},"isStorno":{"type":"boolean"}}}}},"required":["id","hash","kind","status","group","customer","price","isPaid","payDate","insertedDate","updatedDate","assignee","tags","parentHash","shipNotBefore","formData","internalNotice","publicNotice","dueDate","expirationDate","items"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"examples":["26000005"],"description":"Order number.","type":"string"},"hash":{"examples":["DIeJ1W5NBF0KEXtamL9zpx5Hk3s79008"],"description":"Unique order hash.","type":"string"},"kind":{"examples":["commerce"],"description":"Order kind (`commerce` | `registration`).","type":"string"},"status":{"type":"object","required":["code","label","type"],"properties":{"code":{"examples":["nabidka-odeslana"],"description":"Organisation-defined status code.","type":"string"},"label":{"examples":["Nabídka odeslána"],"description":"Status name shown in the administration.","type":"string"},"type":{"examples":["new"],"description":"Status type: `new` | `processing` | `done` | `storno`.","type":"string"}}},"group":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["nabidky"],"type":"string"},"name":{"examples":["Nabídky"],"type":"string"}}},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","name","companyName","email","phone"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["Jan Novák"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"examples":["Divadlo J. K. Tyla"],"type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"phone":{"nullable":true,"anyOf":[{"examples":["+420777123456"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"price":{"type":"object","required":["withVat","withoutVat","currency"],"properties":{"withVat":{"examples":[121000],"description":"Order total including VAT.","type":"number"},"withoutVat":{"examples":[100000],"description":"Order total excluding VAT, computed per item from its own VAT rate.","type":"number"},"currency":{"examples":["CZK"],"type":"string"}}},"isPaid":{"type":"boolean"},"payDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"insertedDate":{"format":"date-time","type":"string"},"updatedDate":{"format":"date-time","type":"string"},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["cuRefNo","email","name"],"properties":{"cuRefNo":{"examples":["A1b2C3d4E5f6G7h8"],"description":"Contact reference number (16 chars).","type":"string"},"email":{"nullable":true,"anyOf":[{"examples":["petrhlavaty@divadelnisluzby.cz"],"type":"string"},{"type":"null"}]},"name":{"nullable":true,"anyOf":[{"examples":["Petr Hlavatý"],"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tags":{"description":"Tags as stored (keys snake_case, values lower-cased).","type":"array","items":{"type":"object","required":["code","key","value"],"properties":{"code":{"examples":["nabidka:nab-2026-0987"],"type":"string"},"key":{"examples":["nabidka"],"type":"string"},"value":{"examples":["nab-2026-0987"],"type":"string"}}}},"parentHash":{"nullable":true,"anyOf":[{"examples":["N34N21Zs0my8w1Li1BKpiBzhuuhknTqQ"],"description":"Hash of the parent order (`parentId` at creation), e.g. the previous version of an offer.","type":"string"},{"type":"null"}]},"shipNotBefore":{"nullable":true,"anyOf":[{"format":"date","examples":["2026-12-15"],"description":"Postponed shipping: the order must not ship before this day (Europe/Prague calendar day). `null` = ship as usual.","type":"string"},{"type":"null"}]},"formData":{"nullable":true,"anyOf":[{"description":"The `formData` sent to `POST /order/create`, returned exactly as submitted. `null` when none was sent.","type":"object","required":["code","data"],"properties":{"code":{"examples":["nabidkovac"],"type":"string"},"data":{"type":"object","patternProperties":{"^(.*)$":{}}}}},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"description":"Organisation-internal note.","type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"expirationDate":{"nullable":true,"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["label","count","unitPriceWithVat","sale","vat","isStorno"],"properties":{"label":{"type":"string"},"count":{"type":"number"},"unitPriceWithVat":{"type":"number"},"sale":{"description":"Discount per unit including VAT.","type":"number"},"vat":{"description":"VAT rate in percent.","type":"number"},"isStorno":{"type":"boolean"}}}}},"required":["id","hash","kind","status","group","customer","price","isPaid","payDate","insertedDate","updatedDate","assignee","tags","parentHash","shipNotBefore","formData","internalNotice","publicNotice","dueDate","expirationDate","items"]}}}}},"operationId":"getApiV1ShopOrderDetail-full","tags":["order"],"summary":"Order detail including internal data (API key only)","description":"Full order detail for the organisation that owns the API key: the list fields plus `formData` exactly as submitted to `POST /order/create`, the internal notice and the items. Requires the API key; an order of another organisation returns 404. The public `GET /order/detail` (by hash, for customers) never returns `formData`."}},"/api/v1/shop/order/detail":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["exist","id","hash","locale","kind","status","variableSymbol","insertedDate","updatedDate","price","sale","paidAmount","items","vouchers","tags","documents","shipments","events","links"],"properties":{"exist":{"description":"Indicator of whether the order exists.","const":true,"type":"boolean"},"id":{"examples":["25000087"],"description":"Order number for system identification.","type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Unique hash of the order.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"kind":{"default":"commerce","description":"Behavioral category of the order (see `POST /order/create`). `commerce` for a standard order, `registration` for a sign-up / event admission. Lets the frontend swap copy and CTAs.","type":"string","enum":["commerce","registration"]},"groupCode":{"examples":["branch-vinohrady"],"description":"Organisation-defined order group code (`shop__order_group.code`).","type":"string"},"payDate":{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of order payment.","anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of order payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"examples":["2025-01-24T00:00:00.000Z"],"description":"Due date for payment. Used for bank-transfer flows and displayed on the order detail.","anyOf":[{"examples":["2025-01-24T00:00:00.000Z"],"description":"Due date for payment. Used for bank-transfer flows and displayed on the order detail.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"object","required":["label","color","onlinePaymentChecking"],"properties":{"label":{"examples":["Paid"],"description":"Public status label defined by the organization and order group.","type":"string"},"color":{"examples":["#1e90ff"],"type":"string"},"onlinePaymentStatus":{"examples":["CREATED","PAID","CANCELED","PAYMENT_METHOD_CHOSEN","TIMEOUTED","AUTHORIZED","REFUNDED","PARTIALLY_REFUNDED"],"type":"string"},"onlinePaymentStatusLabel":{"examples":["Platba vytvořena","Platba uhrazena","Platba zamítnuta","Platební metoda potvrzena","Platbě vypršela životnost","Platba předautorizována","Platba vrácena","Platba částečně vrácena"],"type":"string"},"onlinePaymentChecking":{"examples":[false],"description":"Indicator of whether online payment checking is in progress.","type":"boolean"}}},"variableSymbol":{"examples":["25000087"],"description":"Unique bank/invoice variable symbol across all organisation.","type":"string"},"internalNotice":{"examples":["Priorita, dohodnuto s klientem po telefonu."],"description":"Organisation-internal note attached to the order. Never surfaced to the paying customer — the endpoint is public by hash, so a frontend that shows this must gate it behind an operator role.","type":"string"},"publicNotice":{"examples":["Thank you for your order."],"description":"Public note for the order.","type":"string"},"shipNotBefore":{"examples":["2026-12-15"],"description":"Postponed shipping: the order ships no earlier than this day (`YYYY-MM-DD`, Europe/Prague). Absent = ships as usual. Safe to show to the customer.","type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"description":"Date and time the order was created.","anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"description":"Date and time the order was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:30:07.172Z"],"description":"Date and time the order was last updated.","anyOf":[{"examples":["2025-01-10T16:30:07.172Z"],"description":"Date and time the order was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"examples":["2025-01-12T16:19:40.150Z"],"description":"Date and time of order expiration. If this time is reached and the order is not paid, it will be automatically canceled.","anyOf":[{"examples":["2025-01-12T16:19:40.150Z"],"description":"Date and time of order expiration. If this time is reached and the order is not paid, it will be automatically canceled.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"sale":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"deliveryPrice":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"paymentPrice":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"paidAmount":{"description":"Screen-friendly summary of the paid / refunded / remaining amounts.","type":"object","required":["totalReceived","refunded","remaining"],"properties":{"totalReceived":{"examples":[1200],"description":"Cumulative amount already received.","type":"number"},"refunded":{"examples":[0],"description":"Total amount refunded to the customer.","type":"number"},"remaining":{"examples":[0],"description":"Remaining amount to be paid (order price − totalReceived, clamped to 0).","type":"number"}}},"customer":{"type":"object","required":["premium"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Customer phone number.","type":"string"},"firstName":{"examples":["Jan"],"description":"Customer first name.","type":"string"},"lastName":{"examples":["Barášek"],"description":"Customer last name.","type":"string"},"companyName":{"examples":["Company Ltd."],"description":"Name of the customer's company.","type":"string"},"ic":{"examples":["12345678"],"description":"Company registration number (IČO).","type":"string"},"dic":{"examples":["CZ12345678"],"description":"Tax identification number (DIČ).","type":"string"},"premium":{"examples":[false],"description":"Indicator of whether the customer is premium.","type":"boolean"},"externalIdSha256":{"examples":["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"],"description":"Lowercase hex SHA-256 of the customer reference number (`cuRefNo`). Stable per customer and organisation; ready to send as Meta CAPI `user_data.external_id` without further hashing.","type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["id","isStorno","label","count","price","unit","creditAmount"],"properties":{"id":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"description":"Order item ID.","type":"string"},"isStorno":{"examples":[false],"description":"Indicator of whether the item is canceled.","type":"boolean"},"label":{"examples":["GymRoom reservation"],"description":"Order item description as HTML.","type":"string"},"count":{"examples":[1],"description":"Number of items.","type":"number"},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"unit":{"examples":["ks"],"description":"Item units.","type":"string"},"vat":{"type":"number"},"creditAmount":{"examples":[0],"description":"Credit value of the item.","type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"productMainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"variantCode":{"type":"string"},"variantName":{"type":"string"},"eventCalendarCode":{"type":"string"},"eventCode":{"type":"string"},"eventTitle":{"type":"string"},"branch":{"examples":["gymroom-plzen"],"description":"Slug of the branch (pobočka) this line item was attributed to.","type":"string"},"bundleItems":{"description":"Present only when this line is a product bundle (sada): the components it was expanded into. The bundle line carries the price; components are informational (price 0) and are the lines that get reserved and shipped from the warehouse.","type":"array","items":{"type":"object","required":["id","isStorno","label","count"],"properties":{"id":{"description":"Order item ID of the component line.","type":"string"},"isStorno":{"description":"Storno state (always equal to the bundle line).","type":"boolean"},"label":{"examples":["Protein shaker"],"description":"Component description as HTML.","type":"string"},"count":{"examples":[2],"description":"Units of the component (bundle count × quantity).","type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"variantCode":{"type":"string"},"variantName":{"type":"string"}}}}}}},"vouchers":{"description":"Vouchers redeemed on this order. Their monetary effect (if any) is already reflected in `items` as a negative-priced row; this field is the canonical audit list of the codes themselves.","type":"array","items":{"type":"object","required":["code","type","value","isOrderSingleton","currency"],"properties":{"code":{"examples":["SUMMER-15"],"description":"Voucher code that was redeemed on the order.","type":"string"},"type":{"default":"fixed","description":"Voucher type. `fixed` / `percentage` discount the order total (visible as a negative line item); `free-credit` grants credits to the customer account; `free-product` grants a product line item.","type":"string","enum":["fixed","percentage","free-credit","free-product"]},"value":{"examples":["150","10","3000"],"description":"Type-dependent payload value. For `fixed` the discount amount in order currency, for `percentage` the percentage rate, for `free-credit` the credit amount.","type":"string"},"isOrderSingleton":{"examples":[false],"description":"Whether this voucher cannot be combined with other vouchers on the same order.","type":"boolean"},"currency":{"examples":["CZK"],"type":"string"}}}},"tags":{"type":"object","patternProperties":{"^(.*)$":{}}},"attribution":{"description":"Checkout attribution sent in `POST /order/create` (`attribution`). Present only when at least one value was stored. Use it server-side to enrich conversion events such as Meta CAPI `Purchase`.","type":"object","properties":{"fbc":{"examples":["fb.1.1730530000000.IwAR2abc"],"description":"Meta click ID (`_fbc` cookie or `fb.1.<ms>.<fbclid>` built from the landing URL).","type":"string"},"fbp":{"examples":["fb.1.1730530000000.123456789"],"description":"Meta browser ID (`_fbp` cookie).","type":"string"},"eventSourceUrl":{"examples":["https://gymroom.cz/rezervace/smichov"],"description":"Absolute http(s) URL of the page where the order was placed.","type":"string"},"clientUserAgent":{"examples":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"],"description":"Browser user agent.","type":"string"}}},"documents":{"description":"All files attached to the order (`shop__order_file`) — accounting documents (invoices, receipts, proformas), calendar events (`.ics`), delivery notes and arbitrary operator uploads. Each row carries the download URL and blob metadata; accounting rows additionally carry invoice metadata (type, sequenceNumber, issueDate, dueDate, paidDate, total, currency).","type":"array","items":{"type":"object","required":["id","label","filename","downloadUrl","size","contentType","insertedDate"],"properties":{"id":{"examples":["Na60Mbk8LwJIGxsns1JK3TnSE268qVa1"],"description":"Blob token — URL-safe stable identifier of the underlying storage object.","type":"string"},"label":{"examples":["receipt-26000001.pdf"],"description":"Human-friendly label from `shop__order_file.label`; falls back to the blob filename.","type":"string"},"filename":{"examples":["receipt_26000001.pdf"],"type":"string"},"downloadUrl":{"examples":["https://storage.xhp.cz/org-slug/receipt/2026-01/26000001_....pdf"],"description":"Direct download link resolved via `resolveBlobList` (storage-slug scoped).","type":"string"},"size":{"examples":[52771],"description":"File size in bytes.","type":"number"},"contentType":{"examples":["application/pdf","text/calendar"],"type":"string"},"insertedDate":{"examples":["2026-06-10T08:03:21.571Z"],"description":"When the file was attached to the order.","anyOf":[{"examples":["2026-06-10T08:03:21.571Z"],"description":"When the file was attached to the order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"type":{"examples":["invoice","receipt","proforma"],"description":"Accounting document type (`shop__invoice_type.type`). Present only when this file is a rendered invoice / receipt / proforma; absent for arbitrary attachments (e.g. calendar `.ics`).","type":"string"},"sequenceNumber":{"examples":["2025-000123"],"description":"Organisation-scoped invoice sequence number. Present only for accounting documents.","type":"string"},"issueDate":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"examples":["2025-01-24T00:00:00.000Z"],"anyOf":[{"examples":["2025-01-24T00:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"paidDate":{"examples":["2025-01-12T09:00:00.000Z"],"anyOf":[{"examples":["2025-01-12T09:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"total":{"examples":[1210],"type":"number"},"currency":{"examples":["CZK"],"type":"string"}}}},"shipments":{"description":"Parcels shipped for the order (cancelled and draft parcels are omitted), newest first. Render them as a \"Track your parcel\" block.","type":"array","items":{"type":"object","required":["carrierName","state","insertedDate"],"properties":{"carrierName":{"examples":["GLS"],"type":"string"},"trackingNumber":{"examples":["5042379086"],"type":"string"},"trackingUrl":{"examples":["https://gls-group.com/CZ/cs/sledovani-zasilek?match=5042379086"],"description":"Carrier's public tracking page. Absent when the carrier has none.","type":"string"},"state":{"examples":["in_transit"],"description":"Current parcel state as last reported by the carrier: created, handed_over, in_transit, ready_for_pickup, delivered, returned, failed.","type":"string"},"insertedDate":{"examples":["2026-11-07T10:15:00.000Z"],"description":"When the parcel was created.","type":"string"}}}},"events":{"description":"Chronological order timeline (status transitions, payment attempts, bank matches, issued documents). Internal-only rows are stripped — safe to render as a public activity feed.","type":"array","items":{"type":"object","required":["type","label","date"],"properties":{"type":{"default":"statusHistory","description":"Timeline event kind (status flip, gateway callback, bank match, document issued).","type":"string","enum":["statusHistory","onlinePayment","bankTransaction","accountingDocument"]},"label":{"examples":["Order marked as paid"],"type":"string"},"description":{"examples":["Manual credit — cash on delivery."],"type":"string"},"date":{"examples":["2025-01-11T12:04:00.000Z"],"anyOf":[{"examples":["2025-01-11T12:04:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"color":{"default":"primary","type":"string","enum":["primary","error","info","success"]}}}},"links":{"type":"object","properties":{"onlinePaymentLink":{"examples":["https://bizkithub.com/order/pay?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Link to online payment of the order.","type":"string"},"returnUrl":{"examples":["https://gymroom.cz/eshop/dekujeme-eshop"],"description":"URL to which the customer is redirected after successful payment.","type":"string"}}}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["exist","id","hash","locale","kind","status","variableSymbol","insertedDate","updatedDate","price","sale","paidAmount","items","vouchers","tags","documents","shipments","events","links"],"properties":{"exist":{"description":"Indicator of whether the order exists.","const":true,"type":"boolean"},"id":{"examples":["25000087"],"description":"Order number for system identification.","type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Unique hash of the order.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"kind":{"default":"commerce","description":"Behavioral category of the order (see `POST /order/create`). `commerce` for a standard order, `registration` for a sign-up / event admission. Lets the frontend swap copy and CTAs.","type":"string","enum":["commerce","registration"]},"groupCode":{"examples":["branch-vinohrady"],"description":"Organisation-defined order group code (`shop__order_group.code`).","type":"string"},"payDate":{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of order payment.","anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of order payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"examples":["2025-01-24T00:00:00.000Z"],"description":"Due date for payment. Used for bank-transfer flows and displayed on the order detail.","anyOf":[{"examples":["2025-01-24T00:00:00.000Z"],"description":"Due date for payment. Used for bank-transfer flows and displayed on the order detail.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"object","required":["label","color","onlinePaymentChecking"],"properties":{"label":{"examples":["Paid"],"description":"Public status label defined by the organization and order group.","type":"string"},"color":{"examples":["#1e90ff"],"type":"string"},"onlinePaymentStatus":{"examples":["CREATED","PAID","CANCELED","PAYMENT_METHOD_CHOSEN","TIMEOUTED","AUTHORIZED","REFUNDED","PARTIALLY_REFUNDED"],"type":"string"},"onlinePaymentStatusLabel":{"examples":["Platba vytvořena","Platba uhrazena","Platba zamítnuta","Platební metoda potvrzena","Platbě vypršela životnost","Platba předautorizována","Platba vrácena","Platba částečně vrácena"],"type":"string"},"onlinePaymentChecking":{"examples":[false],"description":"Indicator of whether online payment checking is in progress.","type":"boolean"}}},"variableSymbol":{"examples":["25000087"],"description":"Unique bank/invoice variable symbol across all organisation.","type":"string"},"internalNotice":{"examples":["Priorita, dohodnuto s klientem po telefonu."],"description":"Organisation-internal note attached to the order. Never surfaced to the paying customer — the endpoint is public by hash, so a frontend that shows this must gate it behind an operator role.","type":"string"},"publicNotice":{"examples":["Thank you for your order."],"description":"Public note for the order.","type":"string"},"shipNotBefore":{"examples":["2026-12-15"],"description":"Postponed shipping: the order ships no earlier than this day (`YYYY-MM-DD`, Europe/Prague). Absent = ships as usual. Safe to show to the customer.","type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"description":"Date and time the order was created.","anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"description":"Date and time the order was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:30:07.172Z"],"description":"Date and time the order was last updated.","anyOf":[{"examples":["2025-01-10T16:30:07.172Z"],"description":"Date and time the order was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"examples":["2025-01-12T16:19:40.150Z"],"description":"Date and time of order expiration. If this time is reached and the order is not paid, it will be automatically canceled.","anyOf":[{"examples":["2025-01-12T16:19:40.150Z"],"description":"Date and time of order expiration. If this time is reached and the order is not paid, it will be automatically canceled.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"sale":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"deliveryPrice":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"paymentPrice":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"paidAmount":{"description":"Screen-friendly summary of the paid / refunded / remaining amounts.","type":"object","required":["totalReceived","refunded","remaining"],"properties":{"totalReceived":{"examples":[1200],"description":"Cumulative amount already received.","type":"number"},"refunded":{"examples":[0],"description":"Total amount refunded to the customer.","type":"number"},"remaining":{"examples":[0],"description":"Remaining amount to be paid (order price − totalReceived, clamped to 0).","type":"number"}}},"customer":{"type":"object","required":["premium"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Customer phone number.","type":"string"},"firstName":{"examples":["Jan"],"description":"Customer first name.","type":"string"},"lastName":{"examples":["Barášek"],"description":"Customer last name.","type":"string"},"companyName":{"examples":["Company Ltd."],"description":"Name of the customer's company.","type":"string"},"ic":{"examples":["12345678"],"description":"Company registration number (IČO).","type":"string"},"dic":{"examples":["CZ12345678"],"description":"Tax identification number (DIČ).","type":"string"},"premium":{"examples":[false],"description":"Indicator of whether the customer is premium.","type":"boolean"},"externalIdSha256":{"examples":["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"],"description":"Lowercase hex SHA-256 of the customer reference number (`cuRefNo`). Stable per customer and organisation; ready to send as Meta CAPI `user_data.external_id` without further hashing.","type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["id","isStorno","label","count","price","unit","creditAmount"],"properties":{"id":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"description":"Order item ID.","type":"string"},"isStorno":{"examples":[false],"description":"Indicator of whether the item is canceled.","type":"boolean"},"label":{"examples":["GymRoom reservation"],"description":"Order item description as HTML.","type":"string"},"count":{"examples":[1],"description":"Number of items.","type":"number"},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"unit":{"examples":["ks"],"description":"Item units.","type":"string"},"vat":{"type":"number"},"creditAmount":{"examples":[0],"description":"Credit value of the item.","type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"productMainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"variantCode":{"type":"string"},"variantName":{"type":"string"},"eventCalendarCode":{"type":"string"},"eventCode":{"type":"string"},"eventTitle":{"type":"string"},"branch":{"examples":["gymroom-plzen"],"description":"Slug of the branch (pobočka) this line item was attributed to.","type":"string"},"bundleItems":{"description":"Present only when this line is a product bundle (sada): the components it was expanded into. The bundle line carries the price; components are informational (price 0) and are the lines that get reserved and shipped from the warehouse.","type":"array","items":{"type":"object","required":["id","isStorno","label","count"],"properties":{"id":{"description":"Order item ID of the component line.","type":"string"},"isStorno":{"description":"Storno state (always equal to the bundle line).","type":"boolean"},"label":{"examples":["Protein shaker"],"description":"Component description as HTML.","type":"string"},"count":{"examples":[2],"description":"Units of the component (bundle count × quantity).","type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"variantCode":{"type":"string"},"variantName":{"type":"string"}}}}}}},"vouchers":{"description":"Vouchers redeemed on this order. Their monetary effect (if any) is already reflected in `items` as a negative-priced row; this field is the canonical audit list of the codes themselves.","type":"array","items":{"type":"object","required":["code","type","value","isOrderSingleton","currency"],"properties":{"code":{"examples":["SUMMER-15"],"description":"Voucher code that was redeemed on the order.","type":"string"},"type":{"default":"fixed","description":"Voucher type. `fixed` / `percentage` discount the order total (visible as a negative line item); `free-credit` grants credits to the customer account; `free-product` grants a product line item.","type":"string","enum":["fixed","percentage","free-credit","free-product"]},"value":{"examples":["150","10","3000"],"description":"Type-dependent payload value. For `fixed` the discount amount in order currency, for `percentage` the percentage rate, for `free-credit` the credit amount.","type":"string"},"isOrderSingleton":{"examples":[false],"description":"Whether this voucher cannot be combined with other vouchers on the same order.","type":"boolean"},"currency":{"examples":["CZK"],"type":"string"}}}},"tags":{"type":"object","patternProperties":{"^(.*)$":{}}},"attribution":{"description":"Checkout attribution sent in `POST /order/create` (`attribution`). Present only when at least one value was stored. Use it server-side to enrich conversion events such as Meta CAPI `Purchase`.","type":"object","properties":{"fbc":{"examples":["fb.1.1730530000000.IwAR2abc"],"description":"Meta click ID (`_fbc` cookie or `fb.1.<ms>.<fbclid>` built from the landing URL).","type":"string"},"fbp":{"examples":["fb.1.1730530000000.123456789"],"description":"Meta browser ID (`_fbp` cookie).","type":"string"},"eventSourceUrl":{"examples":["https://gymroom.cz/rezervace/smichov"],"description":"Absolute http(s) URL of the page where the order was placed.","type":"string"},"clientUserAgent":{"examples":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"],"description":"Browser user agent.","type":"string"}}},"documents":{"description":"All files attached to the order (`shop__order_file`) — accounting documents (invoices, receipts, proformas), calendar events (`.ics`), delivery notes and arbitrary operator uploads. Each row carries the download URL and blob metadata; accounting rows additionally carry invoice metadata (type, sequenceNumber, issueDate, dueDate, paidDate, total, currency).","type":"array","items":{"type":"object","required":["id","label","filename","downloadUrl","size","contentType","insertedDate"],"properties":{"id":{"examples":["Na60Mbk8LwJIGxsns1JK3TnSE268qVa1"],"description":"Blob token — URL-safe stable identifier of the underlying storage object.","type":"string"},"label":{"examples":["receipt-26000001.pdf"],"description":"Human-friendly label from `shop__order_file.label`; falls back to the blob filename.","type":"string"},"filename":{"examples":["receipt_26000001.pdf"],"type":"string"},"downloadUrl":{"examples":["https://storage.xhp.cz/org-slug/receipt/2026-01/26000001_....pdf"],"description":"Direct download link resolved via `resolveBlobList` (storage-slug scoped).","type":"string"},"size":{"examples":[52771],"description":"File size in bytes.","type":"number"},"contentType":{"examples":["application/pdf","text/calendar"],"type":"string"},"insertedDate":{"examples":["2026-06-10T08:03:21.571Z"],"description":"When the file was attached to the order.","anyOf":[{"examples":["2026-06-10T08:03:21.571Z"],"description":"When the file was attached to the order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"type":{"examples":["invoice","receipt","proforma"],"description":"Accounting document type (`shop__invoice_type.type`). Present only when this file is a rendered invoice / receipt / proforma; absent for arbitrary attachments (e.g. calendar `.ics`).","type":"string"},"sequenceNumber":{"examples":["2025-000123"],"description":"Organisation-scoped invoice sequence number. Present only for accounting documents.","type":"string"},"issueDate":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"examples":["2025-01-24T00:00:00.000Z"],"anyOf":[{"examples":["2025-01-24T00:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"paidDate":{"examples":["2025-01-12T09:00:00.000Z"],"anyOf":[{"examples":["2025-01-12T09:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"total":{"examples":[1210],"type":"number"},"currency":{"examples":["CZK"],"type":"string"}}}},"shipments":{"description":"Parcels shipped for the order (cancelled and draft parcels are omitted), newest first. Render them as a \"Track your parcel\" block.","type":"array","items":{"type":"object","required":["carrierName","state","insertedDate"],"properties":{"carrierName":{"examples":["GLS"],"type":"string"},"trackingNumber":{"examples":["5042379086"],"type":"string"},"trackingUrl":{"examples":["https://gls-group.com/CZ/cs/sledovani-zasilek?match=5042379086"],"description":"Carrier's public tracking page. Absent when the carrier has none.","type":"string"},"state":{"examples":["in_transit"],"description":"Current parcel state as last reported by the carrier: created, handed_over, in_transit, ready_for_pickup, delivered, returned, failed.","type":"string"},"insertedDate":{"examples":["2026-11-07T10:15:00.000Z"],"description":"When the parcel was created.","type":"string"}}}},"events":{"description":"Chronological order timeline (status transitions, payment attempts, bank matches, issued documents). Internal-only rows are stripped — safe to render as a public activity feed.","type":"array","items":{"type":"object","required":["type","label","date"],"properties":{"type":{"default":"statusHistory","description":"Timeline event kind (status flip, gateway callback, bank match, document issued).","type":"string","enum":["statusHistory","onlinePayment","bankTransaction","accountingDocument"]},"label":{"examples":["Order marked as paid"],"type":"string"},"description":{"examples":["Manual credit — cash on delivery."],"type":"string"},"date":{"examples":["2025-01-11T12:04:00.000Z"],"anyOf":[{"examples":["2025-01-11T12:04:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"color":{"default":"primary","type":"string","enum":["primary","error","info","success"]}}}},"links":{"type":"object","properties":{"onlinePaymentLink":{"examples":["https://bizkithub.com/order/pay?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Link to online payment of the order.","type":"string"},"returnUrl":{"examples":["https://gymroom.cz/eshop/dekujeme-eshop"],"description":"URL to which the customer is redirected after successful payment.","type":"string"}}}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["exist","id","hash","locale","kind","status","variableSymbol","insertedDate","updatedDate","price","sale","paidAmount","items","vouchers","tags","documents","shipments","events","links"],"properties":{"exist":{"description":"Indicator of whether the order exists.","const":true,"type":"boolean"},"id":{"examples":["25000087"],"description":"Order number for system identification.","type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Unique hash of the order.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"kind":{"default":"commerce","description":"Behavioral category of the order (see `POST /order/create`). `commerce` for a standard order, `registration` for a sign-up / event admission. Lets the frontend swap copy and CTAs.","type":"string","enum":["commerce","registration"]},"groupCode":{"examples":["branch-vinohrady"],"description":"Organisation-defined order group code (`shop__order_group.code`).","type":"string"},"payDate":{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of order payment.","anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of order payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"examples":["2025-01-24T00:00:00.000Z"],"description":"Due date for payment. Used for bank-transfer flows and displayed on the order detail.","anyOf":[{"examples":["2025-01-24T00:00:00.000Z"],"description":"Due date for payment. Used for bank-transfer flows and displayed on the order detail.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"object","required":["label","color","onlinePaymentChecking"],"properties":{"label":{"examples":["Paid"],"description":"Public status label defined by the organization and order group.","type":"string"},"color":{"examples":["#1e90ff"],"type":"string"},"onlinePaymentStatus":{"examples":["CREATED","PAID","CANCELED","PAYMENT_METHOD_CHOSEN","TIMEOUTED","AUTHORIZED","REFUNDED","PARTIALLY_REFUNDED"],"type":"string"},"onlinePaymentStatusLabel":{"examples":["Platba vytvořena","Platba uhrazena","Platba zamítnuta","Platební metoda potvrzena","Platbě vypršela životnost","Platba předautorizována","Platba vrácena","Platba částečně vrácena"],"type":"string"},"onlinePaymentChecking":{"examples":[false],"description":"Indicator of whether online payment checking is in progress.","type":"boolean"}}},"variableSymbol":{"examples":["25000087"],"description":"Unique bank/invoice variable symbol across all organisation.","type":"string"},"internalNotice":{"examples":["Priorita, dohodnuto s klientem po telefonu."],"description":"Organisation-internal note attached to the order. Never surfaced to the paying customer — the endpoint is public by hash, so a frontend that shows this must gate it behind an operator role.","type":"string"},"publicNotice":{"examples":["Thank you for your order."],"description":"Public note for the order.","type":"string"},"shipNotBefore":{"examples":["2026-12-15"],"description":"Postponed shipping: the order ships no earlier than this day (`YYYY-MM-DD`, Europe/Prague). Absent = ships as usual. Safe to show to the customer.","type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"description":"Date and time the order was created.","anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"description":"Date and time the order was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:30:07.172Z"],"description":"Date and time the order was last updated.","anyOf":[{"examples":["2025-01-10T16:30:07.172Z"],"description":"Date and time the order was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"examples":["2025-01-12T16:19:40.150Z"],"description":"Date and time of order expiration. If this time is reached and the order is not paid, it will be automatically canceled.","anyOf":[{"examples":["2025-01-12T16:19:40.150Z"],"description":"Date and time of order expiration. If this time is reached and the order is not paid, it will be automatically canceled.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"sale":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"deliveryPrice":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"paymentPrice":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"paidAmount":{"description":"Screen-friendly summary of the paid / refunded / remaining amounts.","type":"object","required":["totalReceived","refunded","remaining"],"properties":{"totalReceived":{"examples":[1200],"description":"Cumulative amount already received.","type":"number"},"refunded":{"examples":[0],"description":"Total amount refunded to the customer.","type":"number"},"remaining":{"examples":[0],"description":"Remaining amount to be paid (order price − totalReceived, clamped to 0).","type":"number"}}},"customer":{"type":"object","required":["premium"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Customer phone number.","type":"string"},"firstName":{"examples":["Jan"],"description":"Customer first name.","type":"string"},"lastName":{"examples":["Barášek"],"description":"Customer last name.","type":"string"},"companyName":{"examples":["Company Ltd."],"description":"Name of the customer's company.","type":"string"},"ic":{"examples":["12345678"],"description":"Company registration number (IČO).","type":"string"},"dic":{"examples":["CZ12345678"],"description":"Tax identification number (DIČ).","type":"string"},"premium":{"examples":[false],"description":"Indicator of whether the customer is premium.","type":"boolean"},"externalIdSha256":{"examples":["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"],"description":"Lowercase hex SHA-256 of the customer reference number (`cuRefNo`). Stable per customer and organisation; ready to send as Meta CAPI `user_data.external_id` without further hashing.","type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["id","isStorno","label","count","price","unit","creditAmount"],"properties":{"id":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"description":"Order item ID.","type":"string"},"isStorno":{"examples":[false],"description":"Indicator of whether the item is canceled.","type":"boolean"},"label":{"examples":["GymRoom reservation"],"description":"Order item description as HTML.","type":"string"},"count":{"examples":[1],"description":"Number of items.","type":"number"},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"unit":{"examples":["ks"],"description":"Item units.","type":"string"},"vat":{"type":"number"},"creditAmount":{"examples":[0],"description":"Credit value of the item.","type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"productMainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"variantCode":{"type":"string"},"variantName":{"type":"string"},"eventCalendarCode":{"type":"string"},"eventCode":{"type":"string"},"eventTitle":{"type":"string"},"branch":{"examples":["gymroom-plzen"],"description":"Slug of the branch (pobočka) this line item was attributed to.","type":"string"},"bundleItems":{"description":"Present only when this line is a product bundle (sada): the components it was expanded into. The bundle line carries the price; components are informational (price 0) and are the lines that get reserved and shipped from the warehouse.","type":"array","items":{"type":"object","required":["id","isStorno","label","count"],"properties":{"id":{"description":"Order item ID of the component line.","type":"string"},"isStorno":{"description":"Storno state (always equal to the bundle line).","type":"boolean"},"label":{"examples":["Protein shaker"],"description":"Component description as HTML.","type":"string"},"count":{"examples":[2],"description":"Units of the component (bundle count × quantity).","type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"variantCode":{"type":"string"},"variantName":{"type":"string"}}}}}}},"vouchers":{"description":"Vouchers redeemed on this order. Their monetary effect (if any) is already reflected in `items` as a negative-priced row; this field is the canonical audit list of the codes themselves.","type":"array","items":{"type":"object","required":["code","type","value","isOrderSingleton","currency"],"properties":{"code":{"examples":["SUMMER-15"],"description":"Voucher code that was redeemed on the order.","type":"string"},"type":{"default":"fixed","description":"Voucher type. `fixed` / `percentage` discount the order total (visible as a negative line item); `free-credit` grants credits to the customer account; `free-product` grants a product line item.","type":"string","enum":["fixed","percentage","free-credit","free-product"]},"value":{"examples":["150","10","3000"],"description":"Type-dependent payload value. For `fixed` the discount amount in order currency, for `percentage` the percentage rate, for `free-credit` the credit amount.","type":"string"},"isOrderSingleton":{"examples":[false],"description":"Whether this voucher cannot be combined with other vouchers on the same order.","type":"boolean"},"currency":{"examples":["CZK"],"type":"string"}}}},"tags":{"type":"object","patternProperties":{"^(.*)$":{}}},"attribution":{"description":"Checkout attribution sent in `POST /order/create` (`attribution`). Present only when at least one value was stored. Use it server-side to enrich conversion events such as Meta CAPI `Purchase`.","type":"object","properties":{"fbc":{"examples":["fb.1.1730530000000.IwAR2abc"],"description":"Meta click ID (`_fbc` cookie or `fb.1.<ms>.<fbclid>` built from the landing URL).","type":"string"},"fbp":{"examples":["fb.1.1730530000000.123456789"],"description":"Meta browser ID (`_fbp` cookie).","type":"string"},"eventSourceUrl":{"examples":["https://gymroom.cz/rezervace/smichov"],"description":"Absolute http(s) URL of the page where the order was placed.","type":"string"},"clientUserAgent":{"examples":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"],"description":"Browser user agent.","type":"string"}}},"documents":{"description":"All files attached to the order (`shop__order_file`) — accounting documents (invoices, receipts, proformas), calendar events (`.ics`), delivery notes and arbitrary operator uploads. Each row carries the download URL and blob metadata; accounting rows additionally carry invoice metadata (type, sequenceNumber, issueDate, dueDate, paidDate, total, currency).","type":"array","items":{"type":"object","required":["id","label","filename","downloadUrl","size","contentType","insertedDate"],"properties":{"id":{"examples":["Na60Mbk8LwJIGxsns1JK3TnSE268qVa1"],"description":"Blob token — URL-safe stable identifier of the underlying storage object.","type":"string"},"label":{"examples":["receipt-26000001.pdf"],"description":"Human-friendly label from `shop__order_file.label`; falls back to the blob filename.","type":"string"},"filename":{"examples":["receipt_26000001.pdf"],"type":"string"},"downloadUrl":{"examples":["https://storage.xhp.cz/org-slug/receipt/2026-01/26000001_....pdf"],"description":"Direct download link resolved via `resolveBlobList` (storage-slug scoped).","type":"string"},"size":{"examples":[52771],"description":"File size in bytes.","type":"number"},"contentType":{"examples":["application/pdf","text/calendar"],"type":"string"},"insertedDate":{"examples":["2026-06-10T08:03:21.571Z"],"description":"When the file was attached to the order.","anyOf":[{"examples":["2026-06-10T08:03:21.571Z"],"description":"When the file was attached to the order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"type":{"examples":["invoice","receipt","proforma"],"description":"Accounting document type (`shop__invoice_type.type`). Present only when this file is a rendered invoice / receipt / proforma; absent for arbitrary attachments (e.g. calendar `.ics`).","type":"string"},"sequenceNumber":{"examples":["2025-000123"],"description":"Organisation-scoped invoice sequence number. Present only for accounting documents.","type":"string"},"issueDate":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"examples":["2025-01-24T00:00:00.000Z"],"anyOf":[{"examples":["2025-01-24T00:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"paidDate":{"examples":["2025-01-12T09:00:00.000Z"],"anyOf":[{"examples":["2025-01-12T09:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"total":{"examples":[1210],"type":"number"},"currency":{"examples":["CZK"],"type":"string"}}}},"shipments":{"description":"Parcels shipped for the order (cancelled and draft parcels are omitted), newest first. Render them as a \"Track your parcel\" block.","type":"array","items":{"type":"object","required":["carrierName","state","insertedDate"],"properties":{"carrierName":{"examples":["GLS"],"type":"string"},"trackingNumber":{"examples":["5042379086"],"type":"string"},"trackingUrl":{"examples":["https://gls-group.com/CZ/cs/sledovani-zasilek?match=5042379086"],"description":"Carrier's public tracking page. Absent when the carrier has none.","type":"string"},"state":{"examples":["in_transit"],"description":"Current parcel state as last reported by the carrier: created, handed_over, in_transit, ready_for_pickup, delivered, returned, failed.","type":"string"},"insertedDate":{"examples":["2026-11-07T10:15:00.000Z"],"description":"When the parcel was created.","type":"string"}}}},"events":{"description":"Chronological order timeline (status transitions, payment attempts, bank matches, issued documents). Internal-only rows are stripped — safe to render as a public activity feed.","type":"array","items":{"type":"object","required":["type","label","date"],"properties":{"type":{"default":"statusHistory","description":"Timeline event kind (status flip, gateway callback, bank match, document issued).","type":"string","enum":["statusHistory","onlinePayment","bankTransaction","accountingDocument"]},"label":{"examples":["Order marked as paid"],"type":"string"},"description":{"examples":["Manual credit — cash on delivery."],"type":"string"},"date":{"examples":["2025-01-11T12:04:00.000Z"],"anyOf":[{"examples":["2025-01-11T12:04:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"color":{"default":"primary","type":"string","enum":["primary","error","info","success"]}}}},"links":{"type":"object","properties":{"onlinePaymentLink":{"examples":["https://bizkithub.com/order/pay?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Link to online payment of the order.","type":"string"},"returnUrl":{"examples":["https://gymroom.cz/eshop/dekujeme-eshop"],"description":"URL to which the customer is redirected after successful payment.","type":"string"}}}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["exist","id","hash","locale","kind","status","variableSymbol","insertedDate","updatedDate","price","sale","paidAmount","items","vouchers","tags","documents","shipments","events","links"],"properties":{"exist":{"description":"Indicator of whether the order exists.","const":true,"type":"boolean"},"id":{"examples":["25000087"],"description":"Order number for system identification.","type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Unique hash of the order.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"kind":{"default":"commerce","description":"Behavioral category of the order (see `POST /order/create`). `commerce` for a standard order, `registration` for a sign-up / event admission. Lets the frontend swap copy and CTAs.","type":"string","enum":["commerce","registration"]},"groupCode":{"examples":["branch-vinohrady"],"description":"Organisation-defined order group code (`shop__order_group.code`).","type":"string"},"payDate":{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of order payment.","anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"description":"Date and time of order payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"examples":["2025-01-24T00:00:00.000Z"],"description":"Due date for payment. Used for bank-transfer flows and displayed on the order detail.","anyOf":[{"examples":["2025-01-24T00:00:00.000Z"],"description":"Due date for payment. Used for bank-transfer flows and displayed on the order detail.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"type":"object","required":["label","color","onlinePaymentChecking"],"properties":{"label":{"examples":["Paid"],"description":"Public status label defined by the organization and order group.","type":"string"},"color":{"examples":["#1e90ff"],"type":"string"},"onlinePaymentStatus":{"examples":["CREATED","PAID","CANCELED","PAYMENT_METHOD_CHOSEN","TIMEOUTED","AUTHORIZED","REFUNDED","PARTIALLY_REFUNDED"],"type":"string"},"onlinePaymentStatusLabel":{"examples":["Platba vytvořena","Platba uhrazena","Platba zamítnuta","Platební metoda potvrzena","Platbě vypršela životnost","Platba předautorizována","Platba vrácena","Platba částečně vrácena"],"type":"string"},"onlinePaymentChecking":{"examples":[false],"description":"Indicator of whether online payment checking is in progress.","type":"boolean"}}},"variableSymbol":{"examples":["25000087"],"description":"Unique bank/invoice variable symbol across all organisation.","type":"string"},"internalNotice":{"examples":["Priorita, dohodnuto s klientem po telefonu."],"description":"Organisation-internal note attached to the order. Never surfaced to the paying customer — the endpoint is public by hash, so a frontend that shows this must gate it behind an operator role.","type":"string"},"publicNotice":{"examples":["Thank you for your order."],"description":"Public note for the order.","type":"string"},"shipNotBefore":{"examples":["2026-12-15"],"description":"Postponed shipping: the order ships no earlier than this day (`YYYY-MM-DD`, Europe/Prague). Absent = ships as usual. Safe to show to the customer.","type":"string"},"insertedDate":{"examples":["2025-01-10T16:19:40.150Z"],"description":"Date and time the order was created.","anyOf":[{"examples":["2025-01-10T16:19:40.150Z"],"description":"Date and time the order was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"examples":["2025-01-10T16:30:07.172Z"],"description":"Date and time the order was last updated.","anyOf":[{"examples":["2025-01-10T16:30:07.172Z"],"description":"Date and time the order was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"examples":["2025-01-12T16:19:40.150Z"],"description":"Date and time of order expiration. If this time is reached and the order is not paid, it will be automatically canceled.","anyOf":[{"examples":["2025-01-12T16:19:40.150Z"],"description":"Date and time of order expiration. If this time is reached and the order is not paid, it will be automatically canceled.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"sale":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"deliveryPrice":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"paymentPrice":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"paidAmount":{"description":"Screen-friendly summary of the paid / refunded / remaining amounts.","type":"object","required":["totalReceived","refunded","remaining"],"properties":{"totalReceived":{"examples":[1200],"description":"Cumulative amount already received.","type":"number"},"refunded":{"examples":[0],"description":"Total amount refunded to the customer.","type":"number"},"remaining":{"examples":[0],"description":"Remaining amount to be paid (order price − totalReceived, clamped to 0).","type":"number"}}},"customer":{"type":"object","required":["premium"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Customer phone number.","type":"string"},"firstName":{"examples":["Jan"],"description":"Customer first name.","type":"string"},"lastName":{"examples":["Barášek"],"description":"Customer last name.","type":"string"},"companyName":{"examples":["Company Ltd."],"description":"Name of the customer's company.","type":"string"},"ic":{"examples":["12345678"],"description":"Company registration number (IČO).","type":"string"},"dic":{"examples":["CZ12345678"],"description":"Tax identification number (DIČ).","type":"string"},"premium":{"examples":[false],"description":"Indicator of whether the customer is premium.","type":"boolean"},"externalIdSha256":{"examples":["9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"],"description":"Lowercase hex SHA-256 of the customer reference number (`cuRefNo`). Stable per customer and organisation; ready to send as Meta CAPI `user_data.external_id` without further hashing.","type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["id","isStorno","label","count","price","unit","creditAmount"],"properties":{"id":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"description":"Order item ID.","type":"string"},"isStorno":{"examples":[false],"description":"Indicator of whether the item is canceled.","type":"boolean"},"label":{"examples":["GymRoom reservation"],"description":"Order item description as HTML.","type":"string"},"count":{"examples":[1],"description":"Number of items.","type":"number"},"price":{"type":"object","required":["priceWithVat","currency","priceWithoutVat","vat","currencyLocale"],"properties":{"priceWithVat":{"examples":[0],"description":"Cena s DPH.","type":"number"},"currency":{"examples":["CZK","EUR","USD"],"description":"Currency code. **Format:** 3-letter uppercase code (e.g. `CZK`).\n**Supported values:** `CZK`, `EUR`, `USD`.","type":"string"},"priceWithoutVat":{"examples":[0],"description":"Cena bez DPH.","type":"number"},"vat":{"examples":[21],"description":"Výše DPH v procentech.","type":"number"},"currencyLocale":{"examples":["Kč"],"description":"Místní označení měny.","type":"string"}}},"unit":{"examples":["ks"],"description":"Item units.","type":"string"},"vat":{"type":"number"},"creditAmount":{"examples":[0],"description":"Credit value of the item.","type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"productMainImageUrl":{"examples":["https://storage.xhp.cz/..."],"type":"string"},"variantCode":{"type":"string"},"variantName":{"type":"string"},"eventCalendarCode":{"type":"string"},"eventCode":{"type":"string"},"eventTitle":{"type":"string"},"branch":{"examples":["gymroom-plzen"],"description":"Slug of the branch (pobočka) this line item was attributed to.","type":"string"},"bundleItems":{"description":"Present only when this line is a product bundle (sada): the components it was expanded into. The bundle line carries the price; components are informational (price 0) and are the lines that get reserved and shipped from the warehouse.","type":"array","items":{"type":"object","required":["id","isStorno","label","count"],"properties":{"id":{"description":"Order item ID of the component line.","type":"string"},"isStorno":{"description":"Storno state (always equal to the bundle line).","type":"boolean"},"label":{"examples":["Protein shaker"],"description":"Component description as HTML.","type":"string"},"count":{"examples":[2],"description":"Units of the component (bundle count × quantity).","type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"variantCode":{"type":"string"},"variantName":{"type":"string"}}}}}}},"vouchers":{"description":"Vouchers redeemed on this order. Their monetary effect (if any) is already reflected in `items` as a negative-priced row; this field is the canonical audit list of the codes themselves.","type":"array","items":{"type":"object","required":["code","type","value","isOrderSingleton","currency"],"properties":{"code":{"examples":["SUMMER-15"],"description":"Voucher code that was redeemed on the order.","type":"string"},"type":{"default":"fixed","description":"Voucher type. `fixed` / `percentage` discount the order total (visible as a negative line item); `free-credit` grants credits to the customer account; `free-product` grants a product line item.","type":"string","enum":["fixed","percentage","free-credit","free-product"]},"value":{"examples":["150","10","3000"],"description":"Type-dependent payload value. For `fixed` the discount amount in order currency, for `percentage` the percentage rate, for `free-credit` the credit amount.","type":"string"},"isOrderSingleton":{"examples":[false],"description":"Whether this voucher cannot be combined with other vouchers on the same order.","type":"boolean"},"currency":{"examples":["CZK"],"type":"string"}}}},"tags":{"type":"object","patternProperties":{"^(.*)$":{}}},"attribution":{"description":"Checkout attribution sent in `POST /order/create` (`attribution`). Present only when at least one value was stored. Use it server-side to enrich conversion events such as Meta CAPI `Purchase`.","type":"object","properties":{"fbc":{"examples":["fb.1.1730530000000.IwAR2abc"],"description":"Meta click ID (`_fbc` cookie or `fb.1.<ms>.<fbclid>` built from the landing URL).","type":"string"},"fbp":{"examples":["fb.1.1730530000000.123456789"],"description":"Meta browser ID (`_fbp` cookie).","type":"string"},"eventSourceUrl":{"examples":["https://gymroom.cz/rezervace/smichov"],"description":"Absolute http(s) URL of the page where the order was placed.","type":"string"},"clientUserAgent":{"examples":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)"],"description":"Browser user agent.","type":"string"}}},"documents":{"description":"All files attached to the order (`shop__order_file`) — accounting documents (invoices, receipts, proformas), calendar events (`.ics`), delivery notes and arbitrary operator uploads. Each row carries the download URL and blob metadata; accounting rows additionally carry invoice metadata (type, sequenceNumber, issueDate, dueDate, paidDate, total, currency).","type":"array","items":{"type":"object","required":["id","label","filename","downloadUrl","size","contentType","insertedDate"],"properties":{"id":{"examples":["Na60Mbk8LwJIGxsns1JK3TnSE268qVa1"],"description":"Blob token — URL-safe stable identifier of the underlying storage object.","type":"string"},"label":{"examples":["receipt-26000001.pdf"],"description":"Human-friendly label from `shop__order_file.label`; falls back to the blob filename.","type":"string"},"filename":{"examples":["receipt_26000001.pdf"],"type":"string"},"downloadUrl":{"examples":["https://storage.xhp.cz/org-slug/receipt/2026-01/26000001_....pdf"],"description":"Direct download link resolved via `resolveBlobList` (storage-slug scoped).","type":"string"},"size":{"examples":[52771],"description":"File size in bytes.","type":"number"},"contentType":{"examples":["application/pdf","text/calendar"],"type":"string"},"insertedDate":{"examples":["2026-06-10T08:03:21.571Z"],"description":"When the file was attached to the order.","anyOf":[{"examples":["2026-06-10T08:03:21.571Z"],"description":"When the file was attached to the order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"type":{"examples":["invoice","receipt","proforma"],"description":"Accounting document type (`shop__invoice_type.type`). Present only when this file is a rendered invoice / receipt / proforma; absent for arbitrary attachments (e.g. calendar `.ics`).","type":"string"},"sequenceNumber":{"examples":["2025-000123"],"description":"Organisation-scoped invoice sequence number. Present only for accounting documents.","type":"string"},"issueDate":{"examples":["2025-01-10T16:19:41.675Z"],"anyOf":[{"examples":["2025-01-10T16:19:41.675Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"examples":["2025-01-24T00:00:00.000Z"],"anyOf":[{"examples":["2025-01-24T00:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"paidDate":{"examples":["2025-01-12T09:00:00.000Z"],"anyOf":[{"examples":["2025-01-12T09:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"total":{"examples":[1210],"type":"number"},"currency":{"examples":["CZK"],"type":"string"}}}},"shipments":{"description":"Parcels shipped for the order (cancelled and draft parcels are omitted), newest first. Render them as a \"Track your parcel\" block.","type":"array","items":{"type":"object","required":["carrierName","state","insertedDate"],"properties":{"carrierName":{"examples":["GLS"],"type":"string"},"trackingNumber":{"examples":["5042379086"],"type":"string"},"trackingUrl":{"examples":["https://gls-group.com/CZ/cs/sledovani-zasilek?match=5042379086"],"description":"Carrier's public tracking page. Absent when the carrier has none.","type":"string"},"state":{"examples":["in_transit"],"description":"Current parcel state as last reported by the carrier: created, handed_over, in_transit, ready_for_pickup, delivered, returned, failed.","type":"string"},"insertedDate":{"examples":["2026-11-07T10:15:00.000Z"],"description":"When the parcel was created.","type":"string"}}}},"events":{"description":"Chronological order timeline (status transitions, payment attempts, bank matches, issued documents). Internal-only rows are stripped — safe to render as a public activity feed.","type":"array","items":{"type":"object","required":["type","label","date"],"properties":{"type":{"default":"statusHistory","description":"Timeline event kind (status flip, gateway callback, bank match, document issued).","type":"string","enum":["statusHistory","onlinePayment","bankTransaction","accountingDocument"]},"label":{"examples":["Order marked as paid"],"type":"string"},"description":{"examples":["Manual credit — cash on delivery."],"type":"string"},"date":{"examples":["2025-01-11T12:04:00.000Z"],"anyOf":[{"examples":["2025-01-11T12:04:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"color":{"default":"primary","type":"string","enum":["primary","error","info","success"]}}}},"links":{"type":"object","properties":{"onlinePaymentLink":{"examples":["https://bizkithub.com/order/pay?hash=sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Link to online payment of the order.","type":"string"},"returnUrl":{"examples":["https://gymroom.cz/eshop/dekujeme-eshop"],"description":"URL to which the customer is redirected after successful payment.","type":"string"}}}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}}}}},"operationId":"getApiV1ShopOrderDetail","tags":["order"],"description":"Public order detail addressed by the 32-char order `hash`. **No API key is required** — anyone with the hash (typically an emailed link) can read this. The response is enriched with all context a frontend typically needs to render an order page: prices (base + delivery + payment), payment progress (`paidAmount`), issued accounting documents (`documents`), full order timeline (`events`), tags, customer identity/tax info, order kind and group code, plus both the public and internal notes.\n\n⚠ `internalNotice` carries organisation-internal context. Never display it to the paying customer — gate its rendering behind an operator role in the consuming frontend."}},"/api/v1/shop/order/create-payment":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"redirectUrl":{"type":"string"}},"required":["redirectUrl"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"redirectUrl":{"type":"string"}},"required":["redirectUrl"]}},"text/plain":{"schema":{"type":"object","properties":{"redirectUrl":{"type":"string"}},"required":["redirectUrl"]}}}}},"operationId":"postApiV1ShopOrderCreate-payment","tags":["order"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}}}}}}},"/api/v1/shop/order/check-payment-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"redirectUrl":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"redirectUrl":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"redirectUrl":{"type":"string"}}}}}}},"operationId":"postApiV1ShopOrderCheck-payment-status","tags":["order"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"}}}}}}}},"/api/v1/shop/order/storno":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"examples":["Customer does not exist."],"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"examples":["Customer does not exist."],"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"examples":["Customer does not exist."],"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"examples":["Customer does not exist."],"type":"string"}}}]}}}},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"const":"NOT_OWNER","type":"string"},"message":{"type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"const":"NOT_OWNER","type":"string"},"message":{"type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"const":"NOT_OWNER","type":"string"},"message":{"type":"string"}},"required":["success","code","message"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"anyOf":[{"const":"USE_LATE_CANCEL","type":"string"},{"const":"DEADLINE_PASSED","type":"string"},{"const":"ALREADY_CANCELLED","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["success","code","message","cancellation"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"anyOf":[{"const":"USE_LATE_CANCEL","type":"string"},{"const":"DEADLINE_PASSED","type":"string"},{"const":"ALREADY_CANCELLED","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["success","code","message","cancellation"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"anyOf":[{"const":"USE_LATE_CANCEL","type":"string"},{"const":"DEADLINE_PASSED","type":"string"},{"const":"ALREADY_CANCELLED","type":"string"}]},"message":{"type":"string"},"cancellation":{"description":"Server-computed cancellation state of a reservation line. The endpoints re-check it.","type":"object","required":["mode","reason","stornoUntil","lateCancelUntil","lateCancelledAt"],"properties":{"mode":{"description":"`storno` = standard storno with refund (/shop/order/storno), `late` = late cancellation without refund (/calendar/event-late-cancel), `none` = cannot be cancelled now.","anyOf":[{"const":"storno","type":"string"},{"const":"late","type":"string"},{"const":"none","type":"string"}]},"reason":{"description":"Why `mode` is `none`; null otherwise or when the line is already cancelled.","anyOf":[{"const":"TOO_LATE","type":"string"},{"const":"ACCESS_CODE_SENT","type":"string"},{"const":"LATE_CANCEL_DISABLED","type":"string"},{"type":"null"}]},"stornoUntil":{"examples":["2026-10-19T18:00:00+02:00"],"description":"Start minus onlineChangeDeadline.","type":"string"},"lateCancelUntil":{"description":"Start minus lateCancelMinBefore; null when late cancellation is disabled.","anyOf":[{"examples":["2026-10-20T16:00:00+02:00"],"type":"string"},{"type":"null"}]},"lateCancelledAt":{"anyOf":[{"examples":["2026-10-20T11:05:00+02:00"],"type":"string"},{"type":"null"}]}}}},"required":["success","code","message","cancellation"]}}}}},"operationId":"postApiV1ShopOrderStorno","tags":["order"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderId"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderItemId":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"type":"string"},"identityId":{"description":"Logged customer identity. When sent, the order must belong to this customer (403 NOT_OWNER otherwise). Will become required.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderId"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderItemId":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"type":"string"},"identityId":{"description":"Logged customer identity. When sent, the order must belong to this customer (403 NOT_OWNER otherwise). Will become required.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderId"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"orderItemId":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S_4186"],"type":"string"},"identityId":{"description":"Logged customer identity. When sent, the order must belong to this customer (403 NOT_OWNER otherwise). Will become required.","type":"string"}}}}}}}},"/api/v1/shop/order/set-status":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"examples":["Customer does not exist."],"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"examples":["Customer does not exist."],"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"examples":["Customer does not exist."],"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"examples":["Customer does not exist."],"type":"string"}}}]}}}}},"operationId":"postApiV1ShopOrderSet-status","tags":["order"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderId","statusCode"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"statusCode":{"examples":["paid"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderId","statusCode"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"statusCode":{"examples":["paid"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderId","statusCode"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"statusCode":{"examples":["paid"],"type":"string"}}}}}}}},"/api/v1/shop/order/set-ship-not-before":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"type":"string"},{"type":"null"}]},"isPending":{"description":"True while the order waits for the day (outside the packing queue).","type":"boolean"}},"required":["success","shipNotBefore","isPending"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"type":"string"},{"type":"null"}]},"isPending":{"description":"True while the order waits for the day (outside the packing queue).","type":"boolean"}},"required":["success","shipNotBefore","isPending"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"type":"string"},{"type":"null"}]},"isPending":{"description":"True while the order waits for the day (outside the packing queue).","type":"boolean"}},"required":["success","shipNotBefore","isPending"]}}}}},"operationId":"postApiV1ShopOrderSet-ship-not-before","tags":["order"],"description":"Set, change or cancel the postponed shipping day of an order. While the day is in the future the order stays out of the fulfillment queue; when it arrives the order returns to the queue automatically and the organisation gets one notification. The order status is never changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderId","shipNotBefore"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Order hash.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"description":"Do not ship before this day (`YYYY-MM-DD`, Europe/Prague). `null` or `\"\"` cancels the postponement. Today or a past day means \"ship now\" and triggers no notification.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderId","shipNotBefore"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Order hash.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"description":"Do not ship before this day (`YYYY-MM-DD`, Europe/Prague). `null` or `\"\"` cancels the postponement. Today or a past day means \"ship now\" and triggers no notification.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderId","shipNotBefore"],"properties":{"orderId":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Order hash.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"examples":["2026-12-15"],"description":"Do not ship before this day (`YYYY-MM-DD`, Europe/Prague). `null` or `\"\"` cancels the postponement. Today or a past day means \"ship now\" and triggers no notification.","type":"string"},{"type":"null"}]}}}}}}}},"/api/v1/shop/order/record-in-app-payment":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"paymentId":{"examples":["184233"],"type":"string"},"alreadyRecorded":{"description":"True when this transaction id was already recorded on the order.","type":"boolean"},"triggeredMarkAsPaid":{"description":"True when this call marked the order as paid.","type":"boolean"},"totalReceivedAfter":{"examples":[290],"type":"number"},"orderPrice":{"examples":[290],"type":"number"}},"required":["success","paymentId","alreadyRecorded","triggeredMarkAsPaid","totalReceivedAfter","orderPrice"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"paymentId":{"examples":["184233"],"type":"string"},"alreadyRecorded":{"description":"True when this transaction id was already recorded on the order.","type":"boolean"},"triggeredMarkAsPaid":{"description":"True when this call marked the order as paid.","type":"boolean"},"totalReceivedAfter":{"examples":[290],"type":"number"},"orderPrice":{"examples":[290],"type":"number"}},"required":["success","paymentId","alreadyRecorded","triggeredMarkAsPaid","totalReceivedAfter","orderPrice"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"paymentId":{"examples":["184233"],"type":"string"},"alreadyRecorded":{"description":"True when this transaction id was already recorded on the order.","type":"boolean"},"triggeredMarkAsPaid":{"description":"True when this call marked the order as paid.","type":"boolean"},"totalReceivedAfter":{"examples":[290],"type":"number"},"orderPrice":{"examples":[290],"type":"number"}},"required":["success","paymentId","alreadyRecorded","triggeredMarkAsPaid","totalReceivedAfter","orderPrice"]}}}}},"operationId":"postApiV1ShopOrderRecord-in-app-payment","tags":["order"],"summary":"Record in-app purchase payment","description":"Records a payment the shop collected through App Store or Google Play (payment kind `in_app`). Call it from your server after verifying the purchase with the store; never from a client app. When the recorded payments cover the order price, the order is marked as paid with the standard workflow (e-mails, reservations, lock codes).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderId","store","transactionId","price"],"properties":{"orderId":{"minLength":32,"maxLength":32,"description":"Order hash.","examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"identityId":{"description":"Customer identity (`/customer/login`). When set, the order must belong to this customer.","type":"string"},"store":{"description":"Store that collected the money.","examples":["app_store"],"anyOf":[{"const":"app_store","type":"string"},{"const":"google_play","type":"string"}]},"transactionId":{"minLength":1,"maxLength":64,"description":"Store transaction id (App Store `transactionId`, Google Play `orderId`). Unique: a retry with the same id returns the first result, the same id on another order is refused with 409.","examples":["2000000812345678","GPA.3312-4580-1234-56789"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Amount in the order currency.","examples":[290],"type":"number"},"note":{"maxLength":500,"description":"Free text stored with the payment row.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderId","store","transactionId","price"],"properties":{"orderId":{"minLength":32,"maxLength":32,"description":"Order hash.","examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"identityId":{"description":"Customer identity (`/customer/login`). When set, the order must belong to this customer.","type":"string"},"store":{"description":"Store that collected the money.","examples":["app_store"],"anyOf":[{"const":"app_store","type":"string"},{"const":"google_play","type":"string"}]},"transactionId":{"minLength":1,"maxLength":64,"description":"Store transaction id (App Store `transactionId`, Google Play `orderId`). Unique: a retry with the same id returns the first result, the same id on another order is refused with 409.","examples":["2000000812345678","GPA.3312-4580-1234-56789"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Amount in the order currency.","examples":[290],"type":"number"},"note":{"maxLength":500,"description":"Free text stored with the payment row.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderId","store","transactionId","price"],"properties":{"orderId":{"minLength":32,"maxLength":32,"description":"Order hash.","examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"identityId":{"description":"Customer identity (`/customer/login`). When set, the order must belong to this customer.","type":"string"},"store":{"description":"Store that collected the money.","examples":["app_store"],"anyOf":[{"const":"app_store","type":"string"},{"const":"google_play","type":"string"}]},"transactionId":{"minLength":1,"maxLength":64,"description":"Store transaction id (App Store `transactionId`, Google Play `orderId`). Unique: a retry with the same id returns the first result, the same id on another order is refused with 409.","examples":["2000000812345678","GPA.3312-4580-1234-56789"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Amount in the order currency.","examples":[290],"type":"number"},"note":{"maxLength":500,"description":"Free text stored with the payment row.","type":"string"}}}}}}}},"/api/v1/shop/order-group/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"When true, only groups that accept new orders are returned.","examples":[true],"schema":{"anyOf":[{"description":"When true, only groups that accept new orders are returned.","examples":[true],"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"onlyActive","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","name","active","default","position"],"properties":{"code":{"description":"Stable group code (slug, unique per organisation).","examples":["lednice-smichov"],"type":"string"},"name":{"description":"Display name.","examples":["Lednice Smíchov"],"type":"string"},"active":{"description":"Whether the group accepts new orders. Public sites should hide (404) anything bound to an inactive group.","type":"boolean"},"default":{"description":"Whether this is the organisation default group.","type":"boolean"},"position":{"description":"Sort order, unique 1..N within the organisation.","type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","name","active","default","position"],"properties":{"code":{"description":"Stable group code (slug, unique per organisation).","examples":["lednice-smichov"],"type":"string"},"name":{"description":"Display name.","examples":["Lednice Smíchov"],"type":"string"},"active":{"description":"Whether the group accepts new orders. Public sites should hide (404) anything bound to an inactive group.","type":"boolean"},"default":{"description":"Whether this is the organisation default group.","type":"boolean"},"position":{"description":"Sort order, unique 1..N within the organisation.","type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","name","active","default","position"],"properties":{"code":{"description":"Stable group code (slug, unique per organisation).","examples":["lednice-smichov"],"type":"string"},"name":{"description":"Display name.","examples":["Lednice Smíchov"],"type":"string"},"active":{"description":"Whether the group accepts new orders. Public sites should hide (404) anything bound to an inactive group.","type":"boolean"},"default":{"description":"Whether this is the organisation default group.","type":"boolean"},"position":{"description":"Sort order, unique 1..N within the organisation.","type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getApiV1ShopOrder-groupList","tags":["order"],"summary":"List order groups","description":"Returns the organisation order groups in display order. Use `active` to decide whether a public page bound to a group (e.g. `/lednice/{slug}`) may offer anything: order create into an inactive group is rejected."}},"/api/v1/shop/order-group/set-active":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1ShopOrder-groupSet-active","tags":["order"],"summary":"Activate or deactivate order group","description":"An inactive group accepts no new orders and is never re-activated by order-group auto-creation. Existing orders stay untouched. The default group cannot be deactivated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Code of the group.","examples":["lednice-smichov"],"type":"string"},"active":{"description":"true activates the group, false deactivates it.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Code of the group.","examples":["lednice-smichov"],"type":"string"},"active":{"description":"true activates the group, false deactivates it.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Code of the group.","examples":["lednice-smichov"],"type":"string"},"active":{"description":"true activates the group, false deactivates it.","type":"boolean"}}}}}}}},"/api/v1/shop/order-group/reorder":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1ShopOrder-groupReorder","tags":["order"],"summary":"Set the order of order groups","description":"Persists the given order as positions 1..N. Unknown or duplicate codes are rejected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["codes"],"properties":{"codes":{"minItems":1,"description":"Group codes in the desired order. Groups not listed keep their relative order after the listed ones; active groups always stay before inactive ones.","examples":[["rezervace-smichov","lednice-smichov","default"]],"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["codes"],"properties":{"codes":{"minItems":1,"description":"Group codes in the desired order. Groups not listed keep their relative order after the listed ones; active groups always stay before inactive ones.","examples":[["rezervace-smichov","lednice-smichov","default"]],"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["codes"],"properties":{"codes":{"minItems":1,"description":"Group codes in the desired order. Groups not listed keep their relative order after the listed ones; active groups always stay before inactive ones.","examples":[["rezervace-smichov","lednice-smichov","default"]],"type":"array","items":{"type":"string"}}}}}}}}},"/api/v1/shop/payment/create":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Unique order hash identifier.","examples":["a1b2c3d4e5f6"],"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"responses":{"200":{"description":"Payment gateway redirect URL.","content":{"application/json":{"schema":{"type":"object","properties":{"gatewayUrl":{"description":"URL to redirect the customer to the payment gateway. Undefined if payment could not be created.","examples":["https://payments.comgate.cz/client/instructions/index?id=ABC123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"gatewayUrl":{"description":"URL to redirect the customer to the payment gateway. Undefined if payment could not be created.","examples":["https://payments.comgate.cz/client/instructions/index?id=ABC123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"gatewayUrl":{"description":"URL to redirect the customer to the payment gateway. Undefined if payment could not be created.","examples":["https://payments.comgate.cz/client/instructions/index?id=ABC123"],"type":"string"}}}}}}},"operationId":"getApiV1ShopPaymentCreate","tags":["payment"],"summary":"Create payment gateway session","description":"Initializes a payment gateway session for the given order and returns a redirect URL where the customer completes the payment."}},"/api/v1/shop/payment/process-notification":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":false},{"description":"Payment gateway transaction ID.","examples":["TXN-123456"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Order hash identifier (same as used in /create).","examples":["a1b2c3d4e5f6"],"schema":{"type":"string"},"in":"query","name":"orderId","required":true}],"responses":{"200":{"description":"Payment status check result.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"description":"Payment status from the gateway.","examples":["PAID","PENDING","CANCELLED"],"type":"string"},"redirectUrl":{"description":"URL to redirect the customer after payment processing.","type":"string"}},"required":["status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"description":"Payment status from the gateway.","examples":["PAID","PENDING","CANCELLED"],"type":"string"},"redirectUrl":{"description":"URL to redirect the customer after payment processing.","type":"string"}},"required":["status"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"description":"Payment status from the gateway.","examples":["PAID","PENDING","CANCELLED"],"type":"string"},"redirectUrl":{"description":"URL to redirect the customer after payment processing.","type":"string"}},"required":["status"]}}}}},"operationId":"getApiV1ShopPaymentProcess-notification","tags":["payment"],"summary":"Process payment notification","description":"Processes a payment gateway callback/notification. Checks the current payment status with the gateway and returns the result with an optional redirect URL."}},"/api/v1/shop/payment/comgate-push":{"post":{"parameters":[],"responses":{"200":{"description":"Comgate acknowledgement in x-www-form-urlencoded format.","content":{"application/json":{"schema":{"description":"Comgate acknowledgement in x-www-form-urlencoded format.","type":"string"}},"multipart/form-data":{"schema":{"description":"Comgate acknowledgement in x-www-form-urlencoded format.","type":"string"}},"text/plain":{"schema":{"description":"Comgate acknowledgement in x-www-form-urlencoded format.","type":"string"}}}}},"operationId":"postApiV1ShopPaymentComgate-push","tags":["payment"],"summary":"Comgate payment result push","description":"Server-to-server notification sent by Comgate (configure it in the Comgate portal as \"Url pro předání výsledku platby\"). No API key: the request is authenticated by the shop connection password, and the payment status is always re-read from Comgate before any change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","required":["transId"],"properties":{"transId":{"description":"Comgate transaction ID.","examples":["AB12-CD34-EF56"],"type":"string"},"merchant":{"description":"Comgate shop connection identifier.","examples":["515898"],"type":"string"},"secret":{"description":"Shop connection password (verified against the gateway).","type":"string"},"status":{"description":"Status reported by Comgate.","examples":["PAID","CANCELLED"],"type":"string"}}}},"multipart/form-data":{"schema":{"additionalProperties":true,"type":"object","required":["transId"],"properties":{"transId":{"description":"Comgate transaction ID.","examples":["AB12-CD34-EF56"],"type":"string"},"merchant":{"description":"Comgate shop connection identifier.","examples":["515898"],"type":"string"},"secret":{"description":"Shop connection password (verified against the gateway).","type":"string"},"status":{"description":"Status reported by Comgate.","examples":["PAID","CANCELLED"],"type":"string"}}}},"text/plain":{"schema":{"additionalProperties":true,"type":"object","required":["transId"],"properties":{"transId":{"description":"Comgate transaction ID.","examples":["AB12-CD34-EF56"],"type":"string"},"merchant":{"description":"Comgate shop connection identifier.","examples":["515898"],"type":"string"},"secret":{"description":"Shop connection password (verified against the gateway).","type":"string"},"status":{"description":"Status reported by Comgate.","examples":["PAID","CANCELLED"],"type":"string"}}}}}}}},"/api/v1/shop/complaint/create":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Unique complaint external ID. Use this ID for subsequent operations (status changes, detail lookup).","type":"string"},"number":{"examples":["REK260001"],"description":"Human-readable complaint number for customer communication. Format is set per organisation (default REK{YY}{NNNN}).","type":"string"}},"required":["id","number"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Unique complaint external ID. Use this ID for subsequent operations (status changes, detail lookup).","type":"string"},"number":{"examples":["REK260001"],"description":"Human-readable complaint number for customer communication. Format is set per organisation (default REK{YY}{NNNN}).","type":"string"}},"required":["id","number"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Unique complaint external ID. Use this ID for subsequent operations (status changes, detail lookup).","type":"string"},"number":{"examples":["REK260001"],"description":"Human-readable complaint number for customer communication. Format is set per organisation (default REK{YY}{NNNN}).","type":"string"}},"required":["id","number"]}}}}},"operationId":"postApiV1ShopComplaintCreate","tags":["complaint"],"description":"Create a new complaint case.\n\nUse this endpoint to file a complaint, return request, or exchange request from your system. The complaint is automatically created with status `new` and an initial event is recorded in the timeline.\n\n**Typical flow:**\n1. Create complaint via this endpoint\n2. Poll status via `GET /detail`\n3. Optionally update status via `POST /set-status`\n\n**Linking to orders:** Provide `orderHash` to link the complaint to an existing order. The system will validate that the order belongs to your organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["variantCode","description","customerName"],"properties":{"variantCode":{"examples":["complaint","return","exchange"],"description":"Organisation-defined complaint variant code.\n\nEach organisation configures its own set of complaint types (e.g. `complaint`, `return`, `exchange`). The variant must exist and be active in the organisation settings before it can be used.","type":"string"},"orderHash":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Hash of the order this complaint is related to. The order must belong to the same organisation. If provided, the system automatically links the complaint to the order.","type":"string"},"orderNumber":{"examples":["25000087"],"description":"Human-readable order number for reference.\n\nUse this field when the order is external or when you want to store the order number without linking to an internal order. If `orderHash` is provided, this field is optional and will be used as a display label only.","type":"string"},"description":{"examples":["Product arrived damaged, visible scratch on the surface."],"description":"Customer-provided description and reason for the complaint.\n\nInclude as much detail as possible — product condition, circumstances, and what the customer expects. This text is visible to staff and can be shared with the customer.","type":"string"},"customerName":{"examples":["Jan Novák"],"description":"Full name of the customer filing the complaint.","type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Customer e-mail address for complaint communication.\n\nUsed for sending status updates and resolution notifications to the customer.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Customer phone number in international format.\n\n**Preferred format:** `+<country_code> <local_number>`\n**Example:** `+420 777123456`","type":"string"},"price":{"examples":[1500],"description":"Total claimed amount in the specified currency.\n\nThe claimed amount represents the value the customer is requesting as refund, credit, or compensation. Use decimal precision up to two places.","type":"number"},"currency":{"examples":["CZK","EUR"],"description":"ISO 4217 currency code for the claimed amount. Defaults to organisation currency if omitted.","type":"string"},"refundCountry":{"examples":["CZ","SK"],"description":"ISO 3166-1 alpha-2 country code for the refund bank account.","type":"string"},"refundBankAccount":{"examples":["123456789/0100"],"description":"Bank account number for refund transfer.\n\nUse the local bank account format (e.g. `123456789/0100` for CZ) or IBAN.","type":"string"},"refundVariableSymbol":{"examples":["25000087"],"description":"Variable symbol for the refund bank transfer. Typically the original order number.","type":"string"},"branchId":{"description":"Branch ID where the product should be sent for inspection or return.","type":"number"},"resolutionMethodCode":{"examples":["repair","exchange","refund"],"description":"Preferred resolution method code defined by the organisation.\n\nCommon values: `repair` (fix the product), `exchange` (replace with new), `refund` (return money), `credit` (issue store credit). The method must exist in the organisation settings.","type":"string"},"dueDate":{"format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"description":"Deadline for complaint resolution. If omitted, the organisation default applies.","type":"string"},"items":{"description":"List of items being complained about.\n\nEach item can optionally reference an original order item by ID. If the complaint covers the entire order, you can omit this field and set the total claimed amount in the `price` field instead.","type":"array","items":{"type":"object","required":["label"],"properties":{"orderItemId":{"description":"Internal order item ID to link the complained item to the original order line.","type":"number"},"label":{"examples":["Wireless headphones Model X"],"description":"Item description as displayed in the complaint.","type":"string"},"quantity":{"examples":[1],"description":"Number of items being complained about. Defaults to 1.","type":"number"},"price":{"examples":[2490],"description":"Claimed unit price of the item in the complaint currency.","type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["variantCode","description","customerName"],"properties":{"variantCode":{"examples":["complaint","return","exchange"],"description":"Organisation-defined complaint variant code.\n\nEach organisation configures its own set of complaint types (e.g. `complaint`, `return`, `exchange`). The variant must exist and be active in the organisation settings before it can be used.","type":"string"},"orderHash":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Hash of the order this complaint is related to. The order must belong to the same organisation. If provided, the system automatically links the complaint to the order.","type":"string"},"orderNumber":{"examples":["25000087"],"description":"Human-readable order number for reference.\n\nUse this field when the order is external or when you want to store the order number without linking to an internal order. If `orderHash` is provided, this field is optional and will be used as a display label only.","type":"string"},"description":{"examples":["Product arrived damaged, visible scratch on the surface."],"description":"Customer-provided description and reason for the complaint.\n\nInclude as much detail as possible — product condition, circumstances, and what the customer expects. This text is visible to staff and can be shared with the customer.","type":"string"},"customerName":{"examples":["Jan Novák"],"description":"Full name of the customer filing the complaint.","type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Customer e-mail address for complaint communication.\n\nUsed for sending status updates and resolution notifications to the customer.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Customer phone number in international format.\n\n**Preferred format:** `+<country_code> <local_number>`\n**Example:** `+420 777123456`","type":"string"},"price":{"examples":[1500],"description":"Total claimed amount in the specified currency.\n\nThe claimed amount represents the value the customer is requesting as refund, credit, or compensation. Use decimal precision up to two places.","type":"number"},"currency":{"examples":["CZK","EUR"],"description":"ISO 4217 currency code for the claimed amount. Defaults to organisation currency if omitted.","type":"string"},"refundCountry":{"examples":["CZ","SK"],"description":"ISO 3166-1 alpha-2 country code for the refund bank account.","type":"string"},"refundBankAccount":{"examples":["123456789/0100"],"description":"Bank account number for refund transfer.\n\nUse the local bank account format (e.g. `123456789/0100` for CZ) or IBAN.","type":"string"},"refundVariableSymbol":{"examples":["25000087"],"description":"Variable symbol for the refund bank transfer. Typically the original order number.","type":"string"},"branchId":{"description":"Branch ID where the product should be sent for inspection or return.","type":"number"},"resolutionMethodCode":{"examples":["repair","exchange","refund"],"description":"Preferred resolution method code defined by the organisation.\n\nCommon values: `repair` (fix the product), `exchange` (replace with new), `refund` (return money), `credit` (issue store credit). The method must exist in the organisation settings.","type":"string"},"dueDate":{"format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"description":"Deadline for complaint resolution. If omitted, the organisation default applies.","type":"string"},"items":{"description":"List of items being complained about.\n\nEach item can optionally reference an original order item by ID. If the complaint covers the entire order, you can omit this field and set the total claimed amount in the `price` field instead.","type":"array","items":{"type":"object","required":["label"],"properties":{"orderItemId":{"description":"Internal order item ID to link the complained item to the original order line.","type":"number"},"label":{"examples":["Wireless headphones Model X"],"description":"Item description as displayed in the complaint.","type":"string"},"quantity":{"examples":[1],"description":"Number of items being complained about. Defaults to 1.","type":"number"},"price":{"examples":[2490],"description":"Claimed unit price of the item in the complaint currency.","type":"number"}}}}}}},"text/plain":{"schema":{"type":"object","required":["variantCode","description","customerName"],"properties":{"variantCode":{"examples":["complaint","return","exchange"],"description":"Organisation-defined complaint variant code.\n\nEach organisation configures its own set of complaint types (e.g. `complaint`, `return`, `exchange`). The variant must exist and be active in the organisation settings before it can be used.","type":"string"},"orderHash":{"minLength":32,"maxLength":32,"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"description":"Hash of the order this complaint is related to. The order must belong to the same organisation. If provided, the system automatically links the complaint to the order.","type":"string"},"orderNumber":{"examples":["25000087"],"description":"Human-readable order number for reference.\n\nUse this field when the order is external or when you want to store the order number without linking to an internal order. If `orderHash` is provided, this field is optional and will be used as a display label only.","type":"string"},"description":{"examples":["Product arrived damaged, visible scratch on the surface."],"description":"Customer-provided description and reason for the complaint.\n\nInclude as much detail as possible — product condition, circumstances, and what the customer expects. This text is visible to staff and can be shared with the customer.","type":"string"},"customerName":{"examples":["Jan Novák"],"description":"Full name of the customer filing the complaint.","type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Customer e-mail address for complaint communication.\n\nUsed for sending status updates and resolution notifications to the customer.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Customer phone number in international format.\n\n**Preferred format:** `+<country_code> <local_number>`\n**Example:** `+420 777123456`","type":"string"},"price":{"examples":[1500],"description":"Total claimed amount in the specified currency.\n\nThe claimed amount represents the value the customer is requesting as refund, credit, or compensation. Use decimal precision up to two places.","type":"number"},"currency":{"examples":["CZK","EUR"],"description":"ISO 4217 currency code for the claimed amount. Defaults to organisation currency if omitted.","type":"string"},"refundCountry":{"examples":["CZ","SK"],"description":"ISO 3166-1 alpha-2 country code for the refund bank account.","type":"string"},"refundBankAccount":{"examples":["123456789/0100"],"description":"Bank account number for refund transfer.\n\nUse the local bank account format (e.g. `123456789/0100` for CZ) or IBAN.","type":"string"},"refundVariableSymbol":{"examples":["25000087"],"description":"Variable symbol for the refund bank transfer. Typically the original order number.","type":"string"},"branchId":{"description":"Branch ID where the product should be sent for inspection or return.","type":"number"},"resolutionMethodCode":{"examples":["repair","exchange","refund"],"description":"Preferred resolution method code defined by the organisation.\n\nCommon values: `repair` (fix the product), `exchange` (replace with new), `refund` (return money), `credit` (issue store credit). The method must exist in the organisation settings.","type":"string"},"dueDate":{"format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"description":"Deadline for complaint resolution. If omitted, the organisation default applies.","type":"string"},"items":{"description":"List of items being complained about.\n\nEach item can optionally reference an original order item by ID. If the complaint covers the entire order, you can omit this field and set the total claimed amount in the `price` field instead.","type":"array","items":{"type":"object","required":["label"],"properties":{"orderItemId":{"description":"Internal order item ID to link the complained item to the original order line.","type":"number"},"label":{"examples":["Wireless headphones Model X"],"description":"Item description as displayed in the complaint.","type":"string"},"quantity":{"examples":[1],"description":"Number of items being complained about. Defaults to 1.","type":"number"},"price":{"examples":[2490],"description":"Claimed unit price of the item in the complaint currency.","type":"number"}}}}}}}}}}},"/api/v1/shop/complaint/detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Complaint external ID returned from the create endpoint.","examples":["a1b2c3d4e5f6g7h8"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["exist","id","variant","status","isResolved","description","customerName","insertedDate","updatedDate","items","events"],"properties":{"exist":{"description":"Indicator of whether the complaint exists.","const":true,"type":"boolean"},"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Complaint external ID.","type":"string"},"number":{"examples":["REK260001"],"description":"Human-readable complaint number.","type":"string"},"orderNumber":{"examples":["25000087"],"description":"Linked order number.","type":"string"},"variant":{"type":"object","required":["id","code","label"],"properties":{"id":{"description":"Variant ID.","type":"number"},"code":{"examples":["complaint"],"description":"Variant code.","type":"string"},"label":{"examples":["Complaint"],"description":"Variant display label.","type":"string"}}},"status":{"examples":["new","open","wait","resolve","reject","closed"],"description":"Current complaint status.","type":"string"},"isResolved":{"examples":[false],"description":"Indicator of whether the complaint has been resolved.","type":"boolean"},"description":{"description":"Complaint description provided by the customer.","type":"string"},"customerName":{"examples":["Jan Novák"],"description":"Customer full name.","type":"string"},"email":{"description":"Customer e-mail.","type":"string"},"phone":{"description":"Customer phone number.","type":"string"},"refund":{"type":"object","properties":{"country":{"description":"Refund country code.","type":"string"},"bankAccount":{"description":"Refund bank account.","type":"string"},"variableSymbol":{"description":"Refund variable symbol.","type":"string"}}},"satisfaction":{"type":"object","required":["score"],"properties":{"score":{"examples":[8],"description":"Satisfaction score 1–10.","type":"number"},"message":{"description":"Customer feedback message.","type":"string"}}},"insertedDate":{"description":"Date and time the complaint was created.","anyOf":[{"description":"Date and time the complaint was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date and time the complaint was last updated.","anyOf":[{"description":"Date and time the complaint was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"description":"Deadline for complaint resolution.","anyOf":[{"description":"Deadline for complaint resolution.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"resolvedDate":{"description":"Date and time the complaint was resolved.","anyOf":[{"description":"Date and time the complaint was resolved.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"items":{"type":"array","items":{"type":"object","required":["id","label","quantity"],"properties":{"id":{"description":"Complaint item ID.","type":"number"},"label":{"description":"Item description.","type":"string"},"quantity":{"description":"Item quantity.","type":"number"},"price":{"description":"Claimed item price.","type":"number"}}}},"events":{"description":"Complaint timeline — status changes, internal notes, and customer-facing messages.","type":"array","items":{"type":"object","required":["id","shareWithCustomer","insertedDate"],"properties":{"id":{"description":"Event ID.","type":"number"},"status":{"description":"Status at the time of this event.","type":"string"},"shareWithCustomer":{"description":"Indicator of whether this event is visible to the customer.","type":"boolean"},"subject":{"description":"Event subject.","type":"string"},"message":{"description":"Event message body.","type":"string"},"insertedDate":{"description":"Date and time the event was created.","anyOf":[{"description":"Date and time the event was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},{"type":"object","required":["exist"],"properties":{"exist":{"description":"Complaint does not exist or does not belong to this organisation.","const":false,"type":"boolean"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["exist","id","variant","status","isResolved","description","customerName","insertedDate","updatedDate","items","events"],"properties":{"exist":{"description":"Indicator of whether the complaint exists.","const":true,"type":"boolean"},"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Complaint external ID.","type":"string"},"number":{"examples":["REK260001"],"description":"Human-readable complaint number.","type":"string"},"orderNumber":{"examples":["25000087"],"description":"Linked order number.","type":"string"},"variant":{"type":"object","required":["id","code","label"],"properties":{"id":{"description":"Variant ID.","type":"number"},"code":{"examples":["complaint"],"description":"Variant code.","type":"string"},"label":{"examples":["Complaint"],"description":"Variant display label.","type":"string"}}},"status":{"examples":["new","open","wait","resolve","reject","closed"],"description":"Current complaint status.","type":"string"},"isResolved":{"examples":[false],"description":"Indicator of whether the complaint has been resolved.","type":"boolean"},"description":{"description":"Complaint description provided by the customer.","type":"string"},"customerName":{"examples":["Jan Novák"],"description":"Customer full name.","type":"string"},"email":{"description":"Customer e-mail.","type":"string"},"phone":{"description":"Customer phone number.","type":"string"},"refund":{"type":"object","properties":{"country":{"description":"Refund country code.","type":"string"},"bankAccount":{"description":"Refund bank account.","type":"string"},"variableSymbol":{"description":"Refund variable symbol.","type":"string"}}},"satisfaction":{"type":"object","required":["score"],"properties":{"score":{"examples":[8],"description":"Satisfaction score 1–10.","type":"number"},"message":{"description":"Customer feedback message.","type":"string"}}},"insertedDate":{"description":"Date and time the complaint was created.","anyOf":[{"description":"Date and time the complaint was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date and time the complaint was last updated.","anyOf":[{"description":"Date and time the complaint was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"description":"Deadline for complaint resolution.","anyOf":[{"description":"Deadline for complaint resolution.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"resolvedDate":{"description":"Date and time the complaint was resolved.","anyOf":[{"description":"Date and time the complaint was resolved.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"items":{"type":"array","items":{"type":"object","required":["id","label","quantity"],"properties":{"id":{"description":"Complaint item ID.","type":"number"},"label":{"description":"Item description.","type":"string"},"quantity":{"description":"Item quantity.","type":"number"},"price":{"description":"Claimed item price.","type":"number"}}}},"events":{"description":"Complaint timeline — status changes, internal notes, and customer-facing messages.","type":"array","items":{"type":"object","required":["id","shareWithCustomer","insertedDate"],"properties":{"id":{"description":"Event ID.","type":"number"},"status":{"description":"Status at the time of this event.","type":"string"},"shareWithCustomer":{"description":"Indicator of whether this event is visible to the customer.","type":"boolean"},"subject":{"description":"Event subject.","type":"string"},"message":{"description":"Event message body.","type":"string"},"insertedDate":{"description":"Date and time the event was created.","anyOf":[{"description":"Date and time the event was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},{"type":"object","required":["exist"],"properties":{"exist":{"description":"Complaint does not exist or does not belong to this organisation.","const":false,"type":"boolean"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["exist","id","variant","status","isResolved","description","customerName","insertedDate","updatedDate","items","events"],"properties":{"exist":{"description":"Indicator of whether the complaint exists.","const":true,"type":"boolean"},"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Complaint external ID.","type":"string"},"number":{"examples":["REK260001"],"description":"Human-readable complaint number.","type":"string"},"orderNumber":{"examples":["25000087"],"description":"Linked order number.","type":"string"},"variant":{"type":"object","required":["id","code","label"],"properties":{"id":{"description":"Variant ID.","type":"number"},"code":{"examples":["complaint"],"description":"Variant code.","type":"string"},"label":{"examples":["Complaint"],"description":"Variant display label.","type":"string"}}},"status":{"examples":["new","open","wait","resolve","reject","closed"],"description":"Current complaint status.","type":"string"},"isResolved":{"examples":[false],"description":"Indicator of whether the complaint has been resolved.","type":"boolean"},"description":{"description":"Complaint description provided by the customer.","type":"string"},"customerName":{"examples":["Jan Novák"],"description":"Customer full name.","type":"string"},"email":{"description":"Customer e-mail.","type":"string"},"phone":{"description":"Customer phone number.","type":"string"},"refund":{"type":"object","properties":{"country":{"description":"Refund country code.","type":"string"},"bankAccount":{"description":"Refund bank account.","type":"string"},"variableSymbol":{"description":"Refund variable symbol.","type":"string"}}},"satisfaction":{"type":"object","required":["score"],"properties":{"score":{"examples":[8],"description":"Satisfaction score 1–10.","type":"number"},"message":{"description":"Customer feedback message.","type":"string"}}},"insertedDate":{"description":"Date and time the complaint was created.","anyOf":[{"description":"Date and time the complaint was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date and time the complaint was last updated.","anyOf":[{"description":"Date and time the complaint was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"description":"Deadline for complaint resolution.","anyOf":[{"description":"Deadline for complaint resolution.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"resolvedDate":{"description":"Date and time the complaint was resolved.","anyOf":[{"description":"Date and time the complaint was resolved.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"items":{"type":"array","items":{"type":"object","required":["id","label","quantity"],"properties":{"id":{"description":"Complaint item ID.","type":"number"},"label":{"description":"Item description.","type":"string"},"quantity":{"description":"Item quantity.","type":"number"},"price":{"description":"Claimed item price.","type":"number"}}}},"events":{"description":"Complaint timeline — status changes, internal notes, and customer-facing messages.","type":"array","items":{"type":"object","required":["id","shareWithCustomer","insertedDate"],"properties":{"id":{"description":"Event ID.","type":"number"},"status":{"description":"Status at the time of this event.","type":"string"},"shareWithCustomer":{"description":"Indicator of whether this event is visible to the customer.","type":"boolean"},"subject":{"description":"Event subject.","type":"string"},"message":{"description":"Event message body.","type":"string"},"insertedDate":{"description":"Date and time the event was created.","anyOf":[{"description":"Date and time the event was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},{"type":"object","required":["exist"],"properties":{"exist":{"description":"Complaint does not exist or does not belong to this organisation.","const":false,"type":"boolean"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["exist","id","variant","status","isResolved","description","customerName","insertedDate","updatedDate","items","events"],"properties":{"exist":{"description":"Indicator of whether the complaint exists.","const":true,"type":"boolean"},"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Complaint external ID.","type":"string"},"number":{"examples":["REK260001"],"description":"Human-readable complaint number.","type":"string"},"orderNumber":{"examples":["25000087"],"description":"Linked order number.","type":"string"},"variant":{"type":"object","required":["id","code","label"],"properties":{"id":{"description":"Variant ID.","type":"number"},"code":{"examples":["complaint"],"description":"Variant code.","type":"string"},"label":{"examples":["Complaint"],"description":"Variant display label.","type":"string"}}},"status":{"examples":["new","open","wait","resolve","reject","closed"],"description":"Current complaint status.","type":"string"},"isResolved":{"examples":[false],"description":"Indicator of whether the complaint has been resolved.","type":"boolean"},"description":{"description":"Complaint description provided by the customer.","type":"string"},"customerName":{"examples":["Jan Novák"],"description":"Customer full name.","type":"string"},"email":{"description":"Customer e-mail.","type":"string"},"phone":{"description":"Customer phone number.","type":"string"},"refund":{"type":"object","properties":{"country":{"description":"Refund country code.","type":"string"},"bankAccount":{"description":"Refund bank account.","type":"string"},"variableSymbol":{"description":"Refund variable symbol.","type":"string"}}},"satisfaction":{"type":"object","required":["score"],"properties":{"score":{"examples":[8],"description":"Satisfaction score 1–10.","type":"number"},"message":{"description":"Customer feedback message.","type":"string"}}},"insertedDate":{"description":"Date and time the complaint was created.","anyOf":[{"description":"Date and time the complaint was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date and time the complaint was last updated.","anyOf":[{"description":"Date and time the complaint was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"dueDate":{"description":"Deadline for complaint resolution.","anyOf":[{"description":"Deadline for complaint resolution.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"resolvedDate":{"description":"Date and time the complaint was resolved.","anyOf":[{"description":"Date and time the complaint was resolved.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"items":{"type":"array","items":{"type":"object","required":["id","label","quantity"],"properties":{"id":{"description":"Complaint item ID.","type":"number"},"label":{"description":"Item description.","type":"string"},"quantity":{"description":"Item quantity.","type":"number"},"price":{"description":"Claimed item price.","type":"number"}}}},"events":{"description":"Complaint timeline — status changes, internal notes, and customer-facing messages.","type":"array","items":{"type":"object","required":["id","shareWithCustomer","insertedDate"],"properties":{"id":{"description":"Event ID.","type":"number"},"status":{"description":"Status at the time of this event.","type":"string"},"shareWithCustomer":{"description":"Indicator of whether this event is visible to the customer.","type":"boolean"},"subject":{"description":"Event subject.","type":"string"},"message":{"description":"Event message body.","type":"string"},"insertedDate":{"description":"Date and time the event was created.","anyOf":[{"description":"Date and time the event was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}},{"type":"object","required":["exist"],"properties":{"exist":{"description":"Complaint does not exist or does not belong to this organisation.","const":false,"type":"boolean"}}}]}}}}},"operationId":"getApiV1ShopComplaintDetail","tags":["complaint"],"description":"Returns full complaint detail including items, events timeline, refund information, and satisfaction feedback.\n\nUse this endpoint to check the current status and history of a complaint. The `events` array contains the full timeline of status changes and messages."}},"/api/v1/shop/complaint/set-status":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1ShopComplaintSet-status","tags":["complaint"],"description":"Changes the complaint status.\n\nEach status transition is recorded in the complaint event timeline. Terminal statuses (`resolve`, `reject`, `closed`) mark the complaint as resolved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintId","status"],"properties":{"complaintId":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Complaint external ID to update.","type":"string"},"status":{"examples":["new","open","wait","resolve","reject","closed"],"description":"New complaint status.\n\n**Available statuses:**\n- `new` — Complaint has been filed, not yet reviewed\n- `open` — Complaint is being processed by staff\n- `wait` — Waiting for customer response or external input\n- `resolve` — Complaint has been resolved in favour of the customer\n- `reject` — Complaint has been rejected\n- `closed` — Complaint is closed (final state)\n\nSetting status to `resolve` or `closed` automatically marks the complaint as resolved and sets the `resolvedDate`.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintId","status"],"properties":{"complaintId":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Complaint external ID to update.","type":"string"},"status":{"examples":["new","open","wait","resolve","reject","closed"],"description":"New complaint status.\n\n**Available statuses:**\n- `new` — Complaint has been filed, not yet reviewed\n- `open` — Complaint is being processed by staff\n- `wait` — Waiting for customer response or external input\n- `resolve` — Complaint has been resolved in favour of the customer\n- `reject` — Complaint has been rejected\n- `closed` — Complaint is closed (final state)\n\nSetting status to `resolve` or `closed` automatically marks the complaint as resolved and sets the `resolvedDate`.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["complaintId","status"],"properties":{"complaintId":{"examples":["a1b2c3d4e5f6g7h8"],"description":"Complaint external ID to update.","type":"string"},"status":{"examples":["new","open","wait","resolve","reject","closed"],"description":"New complaint status.\n\n**Available statuses:**\n- `new` — Complaint has been filed, not yet reviewed\n- `open` — Complaint is being processed by staff\n- `wait` — Waiting for customer response or external input\n- `resolve` — Complaint has been resolved in favour of the customer\n- `reject` — Complaint has been rejected\n- `closed` — Complaint is closed (final state)\n\nSetting status to `resolve` or `closed` automatically marks the complaint as resolved and sets the `resolvedDate`.","type":"string"}}}}}}}},"/api/v1/shop/review/list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Slug of the product. Omit for a review of the shop itself.","examples":["set-start"],"schema":{"type":"string"},"in":"query","name":"productSlug","required":false},{"description":"Without productSlug: `shop` (default) = reviews of the shop, `products` = all product reviews.","schema":{"anyOf":[{"const":"shop","type":"string"},{"const":"products","type":"string"}]},"in":"query","name":"scope","required":false},{"examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"1–100, default 20.","examples":["20"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","author","initials","rating","date","isVerifiedPurchase"],"properties":{"id":{"description":"Public review id.","type":"string"},"author":{"description":"Author name as entered by the customer.","type":"string"},"initials":{"description":"One or two initials for an avatar.","type":"string"},"rating":{"description":"Stars, 1–5.","type":"number"},"text":{"type":"string"},"date":{"description":"ISO date of the review.","type":"string"},"reply":{"description":"Public reply of the shop.","type":"string"},"replyDate":{"type":"string"},"locale":{"description":"Language the review was written in, when known.","type":"string"},"productSlug":{"description":"Reviewed product (only with scope=products).","type":"string"},"isVerifiedPurchase":{"description":"The review is tied to a real order of the author.","type":"boolean"}}}},"summary":{"type":"object","required":["average","count","distribution"],"properties":{"average":{"nullable":true,"anyOf":[{"description":"Average rating rounded to one decimal; null without reviews.","type":"number"},{"type":"null"}]},"count":{"description":"Number of visible reviews.","type":"number"},"distribution":{"description":"Count per star: index 0 = 1 star … index 4 = 5 stars.","type":"array","items":{"type":"number"}}}},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","summary","page","limit"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","author","initials","rating","date","isVerifiedPurchase"],"properties":{"id":{"description":"Public review id.","type":"string"},"author":{"description":"Author name as entered by the customer.","type":"string"},"initials":{"description":"One or two initials for an avatar.","type":"string"},"rating":{"description":"Stars, 1–5.","type":"number"},"text":{"type":"string"},"date":{"description":"ISO date of the review.","type":"string"},"reply":{"description":"Public reply of the shop.","type":"string"},"replyDate":{"type":"string"},"locale":{"description":"Language the review was written in, when known.","type":"string"},"productSlug":{"description":"Reviewed product (only with scope=products).","type":"string"},"isVerifiedPurchase":{"description":"The review is tied to a real order of the author.","type":"boolean"}}}},"summary":{"type":"object","required":["average","count","distribution"],"properties":{"average":{"nullable":true,"anyOf":[{"description":"Average rating rounded to one decimal; null without reviews.","type":"number"},{"type":"null"}]},"count":{"description":"Number of visible reviews.","type":"number"},"distribution":{"description":"Count per star: index 0 = 1 star … index 4 = 5 stars.","type":"array","items":{"type":"number"}}}},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","summary","page","limit"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","author","initials","rating","date","isVerifiedPurchase"],"properties":{"id":{"description":"Public review id.","type":"string"},"author":{"description":"Author name as entered by the customer.","type":"string"},"initials":{"description":"One or two initials for an avatar.","type":"string"},"rating":{"description":"Stars, 1–5.","type":"number"},"text":{"type":"string"},"date":{"description":"ISO date of the review.","type":"string"},"reply":{"description":"Public reply of the shop.","type":"string"},"replyDate":{"type":"string"},"locale":{"description":"Language the review was written in, when known.","type":"string"},"productSlug":{"description":"Reviewed product (only with scope=products).","type":"string"},"isVerifiedPurchase":{"description":"The review is tied to a real order of the author.","type":"boolean"}}}},"summary":{"type":"object","required":["average","count","distribution"],"properties":{"average":{"nullable":true,"anyOf":[{"description":"Average rating rounded to one decimal; null without reviews.","type":"number"},{"type":"null"}]},"count":{"description":"Number of visible reviews.","type":"number"},"distribution":{"description":"Count per star: index 0 = 1 star … index 4 = 5 stars.","type":"array","items":{"type":"number"}}}},"page":{"type":"number"},"limit":{"type":"number"}},"required":["items","summary","page","limit"]}}}}},"operationId":"getApiV1ShopReviewList","tags":["review"],"summary":"List reviews","description":"Visible reviews newest first plus a summary (average, count, star distribution) over all visible reviews in scope. Reviews hidden in the admin are never returned."}},"/api/v1/shop/review/summary":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Comma-separated product slugs (max 200).","examples":["set-start,set-maxi"],"schema":{"type":"string"},"in":"query","name":"productSlugs","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["average","count","distribution"],"properties":{"average":{"nullable":true,"anyOf":[{"description":"Average rating rounded to one decimal; null without reviews.","type":"number"},{"type":"null"}]},"count":{"description":"Number of visible reviews.","type":"number"},"distribution":{"description":"Count per star: index 0 = 1 star … index 4 = 5 stars.","type":"array","items":{"type":"number"}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["average","count","distribution"],"properties":{"average":{"nullable":true,"anyOf":[{"description":"Average rating rounded to one decimal; null without reviews.","type":"number"},{"type":"null"}]},"count":{"description":"Number of visible reviews.","type":"number"},"distribution":{"description":"Count per star: index 0 = 1 star … index 4 = 5 stars.","type":"array","items":{"type":"number"}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["average","count","distribution"],"properties":{"average":{"nullable":true,"anyOf":[{"description":"Average rating rounded to one decimal; null without reviews.","type":"number"},{"type":"null"}]},"count":{"description":"Number of visible reviews.","type":"number"},"distribution":{"description":"Count per star: index 0 = 1 star … index 4 = 5 stars.","type":"array","items":{"type":"number"}}}}}}},"required":["items"]}}}}},"operationId":"getApiV1ShopReviewSummary","tags":["review"],"summary":"Rating summary per product","description":"For product cards and listings. Unknown slugs get count 0."}},"/api/v1/shop/review/allowance":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"Slug of the product. Omit for a review of the shop itself.","examples":["set-start"],"schema":{"type":"string"},"in":"query","name":"productSlug","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"canReview":{"type":"boolean"},"remaining":{"description":"How many reviews the customer can write now.","type":"number"},"pending":{"type":"number"},"reviewed":{"type":"number"},"delayDays":{"type":"number"},"maxTextLength":{"type":"number"},"suggestedAuthor":{"description":"Name from the customer profile, to prefill the form.","type":"string"}},"required":["canReview","remaining","pending","reviewed","delayDays","maxTextLength"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"canReview":{"type":"boolean"},"remaining":{"description":"How many reviews the customer can write now.","type":"number"},"pending":{"type":"number"},"reviewed":{"type":"number"},"delayDays":{"type":"number"},"maxTextLength":{"type":"number"},"suggestedAuthor":{"description":"Name from the customer profile, to prefill the form.","type":"string"}},"required":["canReview","remaining","pending","reviewed","delayDays","maxTextLength"]}},"text/plain":{"schema":{"type":"object","properties":{"canReview":{"type":"boolean"},"remaining":{"description":"How many reviews the customer can write now.","type":"number"},"pending":{"type":"number"},"reviewed":{"type":"number"},"delayDays":{"type":"number"},"maxTextLength":{"type":"number"},"suggestedAuthor":{"description":"Name from the customer profile, to prefill the form.","type":"string"}},"required":["canReview","remaining","pending","reviewed","delayDays","maxTextLength"]}}}}},"operationId":"getApiV1ShopReviewAllowance","tags":["review"],"summary":"Can the customer write a review","description":"Each delivered order entitles the customer to one shop review and one review per product in the order. An order counts once it has been delivered (status done) for `delayDays` days. Cancelled orders never count. `pending` = orders that will unlock a review later, `reviewed` = orders already used."}},"/api/v1/shop/review/create":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Public review id.","type":"string"},"author":{"description":"Author name as entered by the customer.","type":"string"},"initials":{"description":"One or two initials for an avatar.","type":"string"},"rating":{"description":"Stars, 1–5.","type":"number"},"text":{"type":"string"},"date":{"description":"ISO date of the review.","type":"string"},"reply":{"description":"Public reply of the shop.","type":"string"},"replyDate":{"type":"string"},"locale":{"description":"Language the review was written in, when known.","type":"string"},"productSlug":{"description":"Reviewed product (only with scope=products).","type":"string"},"isVerifiedPurchase":{"description":"The review is tied to a real order of the author.","type":"boolean"}},"required":["id","author","initials","rating","date","isVerifiedPurchase"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Public review id.","type":"string"},"author":{"description":"Author name as entered by the customer.","type":"string"},"initials":{"description":"One or two initials for an avatar.","type":"string"},"rating":{"description":"Stars, 1–5.","type":"number"},"text":{"type":"string"},"date":{"description":"ISO date of the review.","type":"string"},"reply":{"description":"Public reply of the shop.","type":"string"},"replyDate":{"type":"string"},"locale":{"description":"Language the review was written in, when known.","type":"string"},"productSlug":{"description":"Reviewed product (only with scope=products).","type":"string"},"isVerifiedPurchase":{"description":"The review is tied to a real order of the author.","type":"boolean"}},"required":["id","author","initials","rating","date","isVerifiedPurchase"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Public review id.","type":"string"},"author":{"description":"Author name as entered by the customer.","type":"string"},"initials":{"description":"One or two initials for an avatar.","type":"string"},"rating":{"description":"Stars, 1–5.","type":"number"},"text":{"type":"string"},"date":{"description":"ISO date of the review.","type":"string"},"reply":{"description":"Public reply of the shop.","type":"string"},"replyDate":{"type":"string"},"locale":{"description":"Language the review was written in, when known.","type":"string"},"productSlug":{"description":"Reviewed product (only with scope=products).","type":"string"},"isVerifiedPurchase":{"description":"The review is tied to a real order of the author.","type":"boolean"}},"required":["id","author","initials","rating","date","isVerifiedPurchase"]}}}}},"operationId":"postApiV1ShopReviewCreate","tags":["review"],"summary":"Write a review","description":"Creates a review of the shop (no productSlug) or of a product for the logged-in customer. The review is tied to their newest delivered order not reviewed yet and is published immediately (the shop can hide it in the admin). Fails with REVIEW_NOT_ALLOWED (403) when no order entitles the customer, REVIEW_INVALID (400) on bad input or spam.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityId","rating","authorName"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"productSlug":{"description":"Slug of the product. Omit for a review of the shop itself.","examples":["set-start"],"type":"string"},"rating":{"minimum":1,"maximum":5,"description":"Stars, 1–5.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":5,"description":"Stars, 1–5.","type":"integer"}]},"authorName":{"minLength":1,"maxLength":128,"description":"Name shown with the review.","type":"string"},"text":{"maxLength":1000,"description":"Review text (optional).","type":"string"},"locale":{"maxLength":8,"examples":["cs"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityId","rating","authorName"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"productSlug":{"description":"Slug of the product. Omit for a review of the shop itself.","examples":["set-start"],"type":"string"},"rating":{"minimum":1,"maximum":5,"description":"Stars, 1–5.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":5,"description":"Stars, 1–5.","type":"integer"}]},"authorName":{"minLength":1,"maxLength":128,"description":"Name shown with the review.","type":"string"},"text":{"maxLength":1000,"description":"Review text (optional).","type":"string"},"locale":{"maxLength":8,"examples":["cs"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityId","rating","authorName"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"productSlug":{"description":"Slug of the product. Omit for a review of the shop itself.","examples":["set-start"],"type":"string"},"rating":{"minimum":1,"maximum":5,"description":"Stars, 1–5.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":5,"description":"Stars, 1–5.","type":"integer"}]},"authorName":{"minLength":1,"maxLength":128,"description":"Name shown with the review.","type":"string"},"text":{"maxLength":1000,"description":"Review text (optional).","type":"string"},"locale":{"maxLength":8,"examples":["cs"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/subscription/active-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":true},{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["runningSubscriptionList"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["runningSubscriptionList"]}},"text/plain":{"schema":{"type":"object","properties":{"runningSubscriptionList":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"productSlug":{"examples":["predplatne-rocni"],"type":"string"},"productCode":{"examples":["predplatne-rocni"],"type":"string"},"orderNumber":{"examples":["25000001"],"type":"string"},"orderHash":{"examples":["CuS08iXV3cOwweQsQB3TwYXtDr67K4kW"],"type":"string"},"autoRenew":{"examples":[true],"type":"boolean"},"renewalDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["runningSubscriptionList"]}}}}},"operationId":"getApiV1SubscriptionActive-list","tags":["subscription"]}},"/api/v1/subscription/subscribable-product-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","interval","price","currencyCode"],"properties":{"productCode":{"examples":["kurz-mesicni"],"type":"string"},"productName":{"examples":["Monthly Course"],"type":"string"},"interval":{"examples":["1m"],"type":"string"},"price":{"examples":[490],"type":"number"},"currencyCode":{"examples":["CZK"],"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","interval","price","currencyCode"],"properties":{"productCode":{"examples":["kurz-mesicni"],"type":"string"},"productName":{"examples":["Monthly Course"],"type":"string"},"interval":{"examples":["1m"],"type":"string"},"price":{"examples":[490],"type":"number"},"currencyCode":{"examples":["CZK"],"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","interval","price","currencyCode"],"properties":{"productCode":{"examples":["kurz-mesicni"],"type":"string"},"productName":{"examples":["Monthly Course"],"type":"string"},"interval":{"examples":["1m"],"type":"string"},"price":{"examples":[490],"type":"number"},"currencyCode":{"examples":["CZK"],"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getApiV1SubscriptionSubscribable-product-list","tags":["subscription"],"summary":"List products with an attached subscription plan","description":"Returns every active product in the organisation that has a recurring subscription plan. Useful for building a \"choose plan\" picker when starting a subscription. Read-only."}},"/api/v1/subscription/set-state":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"alreadyInState":{"type":"boolean"}},"required":["success","state","alreadyInState"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"alreadyInState":{"type":"boolean"}},"required":["success","state","alreadyInState"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"alreadyInState":{"type":"boolean"}},"required":["success","state","alreadyInState"]}}}}},"operationId":"postApiV1SubscriptionSet-state","tags":["subscription"],"summary":"Set subscription state (cancelled | active)","description":"Cancel or re-instate a customer subscription with a single call. On `cancelled`: disables auto-renew, stops the retry cron on the pending renewal order, and sends the \"subscription-cancelled\" notification e-mail to the customer. Access stays valid until `activeToDate` — no immediate revocation. On `active`: re-enables auto-renew (no e-mail is sent). Idempotent — `alreadyInState=true` signals the subscription was already in the requested state.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityId","subscriptionId","state"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"subscriptionId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityId","subscriptionId","state"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"subscriptionId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityId","subscriptionId","state"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"subscriptionId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/subscription/cancel":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1SubscriptionCancel","tags":["subscription"],"summary":"Cancel subscription auto-renew (legacy alias for /set-state)","description":"Legacy alias — prefer POST /subscription/set-state with `state: \"cancelled\"`. Behaviour is identical: disables auto-renew, stops the retry cron on any pending renewal order and sends the \"subscription-cancelled\" notification. Access stays valid until `activeToDate`. Throws if the subscription does not belong to the customer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityId","subscriptionId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"subscriptionId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityId","subscriptionId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"subscriptionId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityId","subscriptionId"],"properties":{"identityId":{"examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","type":"string"},"subscriptionId":{"examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/support/contact-form":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"},"issueKey":{"examples":["BIZKIT-123"],"description":"Human-readable reference of the created ticket.","type":"string"},"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id. Grants read/reply access to the public ticket page, treat it like the link in the confirmation e-mail.","type":"string"},"ticketUrl":{"examples":["https://support.bizkithub.com/ticket/Qr0MZ0vYnp8xMYgs?locale=cs"],"description":"Canonical public ticket page. Redirect the submitter here after a successful submission.","type":"string"},"duplicate":{"description":"`true` when `idempotencyKey` matched a ticket created within the last 24 h; no new ticket was filed.","type":"boolean"}}},{"type":"object","required":["success","error","message"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"SUBMISSION_FAILED","type":"string"},{"const":"SUBMISSION_IN_PROGRESS","type":"string"},{"const":"TOO_MANY_ATTACHMENTS","type":"string"},{"const":"ATTACHMENT_TOO_LARGE","type":"string"},{"const":"ATTACHMENT_TOTAL_TOO_LARGE","type":"string"},{"const":"UNSUPPORTED_ATTACHMENT_TYPE","type":"string"}]},"message":{"description":"Human-readable explanation. `SUBMISSION_FAILED` is deliberately generic (anti-spam and infrastructure hiccups look identical from the outside). Attachment-related errors are specific so the UI can tell the reporter which file to drop. Show the string verbatim.","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"},"issueKey":{"examples":["BIZKIT-123"],"description":"Human-readable reference of the created ticket.","type":"string"},"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id. Grants read/reply access to the public ticket page, treat it like the link in the confirmation e-mail.","type":"string"},"ticketUrl":{"examples":["https://support.bizkithub.com/ticket/Qr0MZ0vYnp8xMYgs?locale=cs"],"description":"Canonical public ticket page. Redirect the submitter here after a successful submission.","type":"string"},"duplicate":{"description":"`true` when `idempotencyKey` matched a ticket created within the last 24 h; no new ticket was filed.","type":"boolean"}}},{"type":"object","required":["success","error","message"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"SUBMISSION_FAILED","type":"string"},{"const":"SUBMISSION_IN_PROGRESS","type":"string"},{"const":"TOO_MANY_ATTACHMENTS","type":"string"},{"const":"ATTACHMENT_TOO_LARGE","type":"string"},{"const":"ATTACHMENT_TOTAL_TOO_LARGE","type":"string"},{"const":"UNSUPPORTED_ATTACHMENT_TYPE","type":"string"}]},"message":{"description":"Human-readable explanation. `SUBMISSION_FAILED` is deliberately generic (anti-spam and infrastructure hiccups look identical from the outside). Attachment-related errors are specific so the UI can tell the reporter which file to drop. Show the string verbatim.","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"},"issueKey":{"examples":["BIZKIT-123"],"description":"Human-readable reference of the created ticket.","type":"string"},"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id. Grants read/reply access to the public ticket page, treat it like the link in the confirmation e-mail.","type":"string"},"ticketUrl":{"examples":["https://support.bizkithub.com/ticket/Qr0MZ0vYnp8xMYgs?locale=cs"],"description":"Canonical public ticket page. Redirect the submitter here after a successful submission.","type":"string"},"duplicate":{"description":"`true` when `idempotencyKey` matched a ticket created within the last 24 h; no new ticket was filed.","type":"boolean"}}},{"type":"object","required":["success","error","message"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"SUBMISSION_FAILED","type":"string"},{"const":"SUBMISSION_IN_PROGRESS","type":"string"},{"const":"TOO_MANY_ATTACHMENTS","type":"string"},{"const":"ATTACHMENT_TOO_LARGE","type":"string"},{"const":"ATTACHMENT_TOTAL_TOO_LARGE","type":"string"},{"const":"UNSUPPORTED_ATTACHMENT_TYPE","type":"string"}]},"message":{"description":"Human-readable explanation. `SUBMISSION_FAILED` is deliberately generic (anti-spam and infrastructure hiccups look identical from the outside). Attachment-related errors are specific so the UI can tell the reporter which file to drop. Show the string verbatim.","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"},"issueKey":{"examples":["BIZKIT-123"],"description":"Human-readable reference of the created ticket.","type":"string"},"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id. Grants read/reply access to the public ticket page, treat it like the link in the confirmation e-mail.","type":"string"},"ticketUrl":{"examples":["https://support.bizkithub.com/ticket/Qr0MZ0vYnp8xMYgs?locale=cs"],"description":"Canonical public ticket page. Redirect the submitter here after a successful submission.","type":"string"},"duplicate":{"description":"`true` when `idempotencyKey` matched a ticket created within the last 24 h; no new ticket was filed.","type":"boolean"}}},{"type":"object","required":["success","error","message"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"SUBMISSION_FAILED","type":"string"},{"const":"SUBMISSION_IN_PROGRESS","type":"string"},{"const":"TOO_MANY_ATTACHMENTS","type":"string"},{"const":"ATTACHMENT_TOO_LARGE","type":"string"},{"const":"ATTACHMENT_TOTAL_TOO_LARGE","type":"string"},{"const":"UNSUPPORTED_ATTACHMENT_TYPE","type":"string"}]},"message":{"description":"Human-readable explanation. `SUBMISSION_FAILED` is deliberately generic (anti-spam and infrastructure hiccups look identical from the outside). Attachment-related errors are specific so the UI can tell the reporter which file to drop. Show the string verbatim.","type":"string"}}}]}}}}},"operationId":"postApiV1SupportContact-form","tags":["support"],"summary":"Submit contact form","description":"Creates a support ticket from a contact form submission. The ticket body is exactly `message`; optional `technicalContext` is stored separately and shown only to the internal team. `idempotencyKey` prevents duplicate tickets on retries. Includes anti-spam geolocation check. Optionally registers the customer as a contact. Accepts up to 5 optional file attachments via `multipart/form-data` which are uploaded to blob storage and linked to the ticket. When called through a trusted proxy (e.g. support.bizkithub.com), pass the end-user IP via `?customerRealIp=…` so the geolocation resolves to the real reporter, not the proxy host.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"minLength":10,"maxLength":15000,"examples":["Hello, how are you?"],"description":"Message body from the customer. At least 10 characters (rejects one-word noise). At most 5000 characters for `messageFormat: text` and 15000 for `markdown` (formatting syntax and links take room); a full report fits, spam floods do not.","type":"string"},"subject":{"examples":["Request from Jan"],"description":"Subject line for the support ticket.","type":"string"},"notice":{"examples":["Internal notice"],"description":"Internal note (not visible to customer).","type":"string"},"sendToEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"categorySlug":{"examples":["offer"],"description":"Category slug for routing the ticket. By default the same slug is also assigned to the submitting contact as a contact group (new and existing contacts alike; a missing group is auto-created). If your website grants rights based on contact groups, pass `assignCategoryGroup: false` or use a category slug that is not used as a permission group.","type":"string"},"assignCategoryGroup":{"default":true,"description":"Whether `categorySlug` is also assigned to the contact as a contact group. Default `true` (historic behaviour). Pass `false` to only route the ticket and leave the contact groups untouched.","type":"boolean"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"customerPhone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"customerFirstName":{"examples":["Jan"],"type":"string"},"customerLastName":{"examples":["Barášek"],"type":"string"},"urgent":{"default":false,"description":"Reporter's felt-urgency flag. Pass `true` when the contact form exposes an 'urgent for me' checkbox and the visitor ticked it. Persisted to `pm__issue.user_urgency_hint` and forwarded to the AI triage classifier as a soft input (never authoritative — content still decides the final priority). Keep unset / false for automated submissions.","type":"boolean"},"attachments":{"maxItems":5,"description":"Optional file attachments uploaded alongside the ticket. Send as multipart/form-data with repeated `attachments` parts. Policy: up to 5 files, max 10 MB each, max 25 MB combined. Only images, PDFs, plain text/CSV, Office and OpenDocument files are accepted — archives and executables are rejected via magic-byte detection even when the extension is renamed. Each accepted file is stored privately in `core__blob` and linked to the created issue via `pm__issue_attachment`.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional file attachments uploaded alongside the ticket. Send as multipart/form-data with repeated `attachments` parts. Policy: up to 5 files, max 10 MB each, max 25 MB combined. Only images, PDFs, plain text/CSV, Office and OpenDocument files are accepted — archives and executables are rejected via magic-byte detection even when the extension is renamed. Each accepted file is stored privately in `core__blob` and linked to the created issue via `pm__issue_attachment`.","default":"Files","type":"string","format":"binary"}},"inlineImages":{"maxItems":10,"description":"Images embedded in a markdown `message` (`messageFormat: markdown`). The N-th part replaces the image source token `bkh-inline-image:N` in the message, e.g. `![Screenshot](bkh-inline-image:0)`. PNG, JPEG, WebP or GIF, max 5 MB each, max 10 images. Stored publicly (unguessable URL) so they render in the description everywhere, and also listed as ticket attachments. Unreferenced or failed images are dropped from the body.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":10,"description":"Images embedded in a markdown `message` (`messageFormat: markdown`). The N-th part replaces the image source token `bkh-inline-image:N` in the message, e.g. `![Screenshot](bkh-inline-image:0)`. PNG, JPEG, WebP or GIF, max 5 MB each, max 10 images. Stored publicly (unguessable URL) so they render in the description everywhere, and also listed as ticket attachments. Unreferenced or failed images are dropped from the body.","default":"Files","type":"string","format":"binary"}},"branchSlug":{"maxLength":255,"examples":["plzen-skvrnany"],"description":"Branch the request is about (slug from `/branch/list`), when the visitor picked one. The ticket then appears in `/support/my-issue-list` of the branch technicians (unless it is confidential). An unknown or inactive slug is silently ignored and the ticket is created without a branch.","type":"string"},"idempotencyKey":{"minLength":1,"maxLength":128,"examples":["6f1c2b8e-3d4a-4f5b-9c7d-1e2f3a4b5c6d"],"description":"Protection against duplicate tickets when the caller retries after a timeout. Send a fresh UUID v4 per submission and REUSE it for retries of the same submission. The same key from the same organisation within 24 h does not create a second ticket: the response carries the already created ticket and `duplicate: true`. When the first request is still being processed, the retry waits up to 10 s and then answers `SUBMISSION_IN_PROGRESS`.","type":"string"},"technicalContext":{"description":"Optional structured technical context of the reporter's environment (JSON object; in multipart requests a JSON string). Stored next to the ticket, NOT inside the message: the ticket starts with the plain `message` and BizKitHub renders the context at the end of the ticket for the internal team only. It is never shown to the reporter (e-mails, public ticket page). Every field is optional; unknown fields are dropped and a malformed context never blocks the ticket.\n\nSections: `page` {url, referrer, route, title, entity, entityUrl}, `client` {userAgent, language, languages, viewport, screen, devicePixelRatio, colorScheme, zoomPercent, reducedMotion, touch, localTime, timezone, utcOffsetMinutes}, `session` {authenticated, userId, accountId, username, name, email, emailVerified, role, roles, organisationId, organisationName, project, impersonating, impersonatedBy}, `network` {online, connectionType, effectiveType, downlinkMbps, rttMs, saveData, ttfbMs, domContentLoadedMs, loadMs, jsHeapUsedMb, jsHeapLimitMb, deviceMemoryGb, cpuCores}, `app` {name, version, build, commit, environment, uiLanguage, featureFlags}, `correlation` {requestId, tabId, sessionHash}, `diagnostics` {errors: [{message, stack, source, at}], failedRequests: [{method, url, status, durationMs, at}]} (last 10 each), `custom` {any key: string | number | boolean} for integrator-specific data (max 30 keys).\n\nPrivacy: never send cookies, localStorage / sessionStorage, tokens, passwords or form contents. Sensitive URL query parameters (token, code, password, key, secret, signature, …) are masked to `***` server-side, a raw `sessionId` is replaced by its hash. BizKitHub adds the client IP (from `customerRealIp`), geo, ASN, parsed browser / OS / device, server receive time and clock skew itself; send the raw `userAgent`, not a parsed one.","examples":[{"page":{"url":"https://bandzone.cz/kapela/123/edit","referrer":"https://bandzone.cz/","route":"band.edit","entity":"band#123"},"client":{"userAgent":"Mozilla/5.0 …","language":"cs-CZ","viewport":"1440x900","timezone":"Europe/Prague","localTime":"2026-11-27T10:00:00+01:00"},"session":{"authenticated":true,"accountId":"123","username":"jan","role":"member"},"app":{"name":"bandzone-web","version":"4.12.0","commit":"abc123","environment":"production"},"correlation":{"requestId":"req-9f8e7d","tabId":"a1b2c3d4"},"custom":{"bandId":123}}]},"messageFormat":{"default":"text","description":"`text` (default): plain text, line breaks preserved. `markdown`: GitHub-flavoured markdown from a rich editor (headings, lists, code, tables, links, images); rendered through the same sanitizer as every ticket body.","anyOf":[{"const":"text","type":"string"},{"const":"markdown","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["message"],"properties":{"message":{"minLength":10,"maxLength":15000,"examples":["Hello, how are you?"],"description":"Message body from the customer. At least 10 characters (rejects one-word noise). At most 5000 characters for `messageFormat: text` and 15000 for `markdown` (formatting syntax and links take room); a full report fits, spam floods do not.","type":"string"},"subject":{"examples":["Request from Jan"],"description":"Subject line for the support ticket.","type":"string"},"notice":{"examples":["Internal notice"],"description":"Internal note (not visible to customer).","type":"string"},"sendToEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"categorySlug":{"examples":["offer"],"description":"Category slug for routing the ticket. By default the same slug is also assigned to the submitting contact as a contact group (new and existing contacts alike; a missing group is auto-created). If your website grants rights based on contact groups, pass `assignCategoryGroup: false` or use a category slug that is not used as a permission group.","type":"string"},"assignCategoryGroup":{"default":true,"description":"Whether `categorySlug` is also assigned to the contact as a contact group. Default `true` (historic behaviour). Pass `false` to only route the ticket and leave the contact groups untouched.","type":"boolean"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"customerPhone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"customerFirstName":{"examples":["Jan"],"type":"string"},"customerLastName":{"examples":["Barášek"],"type":"string"},"urgent":{"default":false,"description":"Reporter's felt-urgency flag. Pass `true` when the contact form exposes an 'urgent for me' checkbox and the visitor ticked it. Persisted to `pm__issue.user_urgency_hint` and forwarded to the AI triage classifier as a soft input (never authoritative — content still decides the final priority). Keep unset / false for automated submissions.","type":"boolean"},"attachments":{"maxItems":5,"description":"Optional file attachments uploaded alongside the ticket. Send as multipart/form-data with repeated `attachments` parts. Policy: up to 5 files, max 10 MB each, max 25 MB combined. Only images, PDFs, plain text/CSV, Office and OpenDocument files are accepted — archives and executables are rejected via magic-byte detection even when the extension is renamed. Each accepted file is stored privately in `core__blob` and linked to the created issue via `pm__issue_attachment`.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional file attachments uploaded alongside the ticket. Send as multipart/form-data with repeated `attachments` parts. Policy: up to 5 files, max 10 MB each, max 25 MB combined. Only images, PDFs, plain text/CSV, Office and OpenDocument files are accepted — archives and executables are rejected via magic-byte detection even when the extension is renamed. Each accepted file is stored privately in `core__blob` and linked to the created issue via `pm__issue_attachment`.","default":"Files","type":"string","format":"binary"}},"inlineImages":{"maxItems":10,"description":"Images embedded in a markdown `message` (`messageFormat: markdown`). The N-th part replaces the image source token `bkh-inline-image:N` in the message, e.g. `![Screenshot](bkh-inline-image:0)`. PNG, JPEG, WebP or GIF, max 5 MB each, max 10 images. Stored publicly (unguessable URL) so they render in the description everywhere, and also listed as ticket attachments. Unreferenced or failed images are dropped from the body.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":10,"description":"Images embedded in a markdown `message` (`messageFormat: markdown`). The N-th part replaces the image source token `bkh-inline-image:N` in the message, e.g. `![Screenshot](bkh-inline-image:0)`. PNG, JPEG, WebP or GIF, max 5 MB each, max 10 images. Stored publicly (unguessable URL) so they render in the description everywhere, and also listed as ticket attachments. Unreferenced or failed images are dropped from the body.","default":"Files","type":"string","format":"binary"}},"branchSlug":{"maxLength":255,"examples":["plzen-skvrnany"],"description":"Branch the request is about (slug from `/branch/list`), when the visitor picked one. The ticket then appears in `/support/my-issue-list` of the branch technicians (unless it is confidential). An unknown or inactive slug is silently ignored and the ticket is created without a branch.","type":"string"},"idempotencyKey":{"minLength":1,"maxLength":128,"examples":["6f1c2b8e-3d4a-4f5b-9c7d-1e2f3a4b5c6d"],"description":"Protection against duplicate tickets when the caller retries after a timeout. Send a fresh UUID v4 per submission and REUSE it for retries of the same submission. The same key from the same organisation within 24 h does not create a second ticket: the response carries the already created ticket and `duplicate: true`. When the first request is still being processed, the retry waits up to 10 s and then answers `SUBMISSION_IN_PROGRESS`.","type":"string"},"technicalContext":{"description":"Optional structured technical context of the reporter's environment (JSON object; in multipart requests a JSON string). Stored next to the ticket, NOT inside the message: the ticket starts with the plain `message` and BizKitHub renders the context at the end of the ticket for the internal team only. It is never shown to the reporter (e-mails, public ticket page). Every field is optional; unknown fields are dropped and a malformed context never blocks the ticket.\n\nSections: `page` {url, referrer, route, title, entity, entityUrl}, `client` {userAgent, language, languages, viewport, screen, devicePixelRatio, colorScheme, zoomPercent, reducedMotion, touch, localTime, timezone, utcOffsetMinutes}, `session` {authenticated, userId, accountId, username, name, email, emailVerified, role, roles, organisationId, organisationName, project, impersonating, impersonatedBy}, `network` {online, connectionType, effectiveType, downlinkMbps, rttMs, saveData, ttfbMs, domContentLoadedMs, loadMs, jsHeapUsedMb, jsHeapLimitMb, deviceMemoryGb, cpuCores}, `app` {name, version, build, commit, environment, uiLanguage, featureFlags}, `correlation` {requestId, tabId, sessionHash}, `diagnostics` {errors: [{message, stack, source, at}], failedRequests: [{method, url, status, durationMs, at}]} (last 10 each), `custom` {any key: string | number | boolean} for integrator-specific data (max 30 keys).\n\nPrivacy: never send cookies, localStorage / sessionStorage, tokens, passwords or form contents. Sensitive URL query parameters (token, code, password, key, secret, signature, …) are masked to `***` server-side, a raw `sessionId` is replaced by its hash. BizKitHub adds the client IP (from `customerRealIp`), geo, ASN, parsed browser / OS / device, server receive time and clock skew itself; send the raw `userAgent`, not a parsed one.","examples":[{"page":{"url":"https://bandzone.cz/kapela/123/edit","referrer":"https://bandzone.cz/","route":"band.edit","entity":"band#123"},"client":{"userAgent":"Mozilla/5.0 …","language":"cs-CZ","viewport":"1440x900","timezone":"Europe/Prague","localTime":"2026-11-27T10:00:00+01:00"},"session":{"authenticated":true,"accountId":"123","username":"jan","role":"member"},"app":{"name":"bandzone-web","version":"4.12.0","commit":"abc123","environment":"production"},"correlation":{"requestId":"req-9f8e7d","tabId":"a1b2c3d4"},"custom":{"bandId":123}}]},"messageFormat":{"default":"text","description":"`text` (default): plain text, line breaks preserved. `markdown`: GitHub-flavoured markdown from a rich editor (headings, lists, code, tables, links, images); rendered through the same sanitizer as every ticket body.","anyOf":[{"const":"text","type":"string"},{"const":"markdown","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["message"],"properties":{"message":{"minLength":10,"maxLength":15000,"examples":["Hello, how are you?"],"description":"Message body from the customer. At least 10 characters (rejects one-word noise). At most 5000 characters for `messageFormat: text` and 15000 for `markdown` (formatting syntax and links take room); a full report fits, spam floods do not.","type":"string"},"subject":{"examples":["Request from Jan"],"description":"Subject line for the support ticket.","type":"string"},"notice":{"examples":["Internal notice"],"description":"Internal note (not visible to customer).","type":"string"},"sendToEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"categorySlug":{"examples":["offer"],"description":"Category slug for routing the ticket. By default the same slug is also assigned to the submitting contact as a contact group (new and existing contacts alike; a missing group is auto-created). If your website grants rights based on contact groups, pass `assignCategoryGroup: false` or use a category slug that is not used as a permission group.","type":"string"},"assignCategoryGroup":{"default":true,"description":"Whether `categorySlug` is also assigned to the contact as a contact group. Default `true` (historic behaviour). Pass `false` to only route the ticket and leave the contact groups untouched.","type":"boolean"},"customerEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"customerPhone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"customerFirstName":{"examples":["Jan"],"type":"string"},"customerLastName":{"examples":["Barášek"],"type":"string"},"urgent":{"default":false,"description":"Reporter's felt-urgency flag. Pass `true` when the contact form exposes an 'urgent for me' checkbox and the visitor ticked it. Persisted to `pm__issue.user_urgency_hint` and forwarded to the AI triage classifier as a soft input (never authoritative — content still decides the final priority). Keep unset / false for automated submissions.","type":"boolean"},"attachments":{"maxItems":5,"description":"Optional file attachments uploaded alongside the ticket. Send as multipart/form-data with repeated `attachments` parts. Policy: up to 5 files, max 10 MB each, max 25 MB combined. Only images, PDFs, plain text/CSV, Office and OpenDocument files are accepted — archives and executables are rejected via magic-byte detection even when the extension is renamed. Each accepted file is stored privately in `core__blob` and linked to the created issue via `pm__issue_attachment`.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional file attachments uploaded alongside the ticket. Send as multipart/form-data with repeated `attachments` parts. Policy: up to 5 files, max 10 MB each, max 25 MB combined. Only images, PDFs, plain text/CSV, Office and OpenDocument files are accepted — archives and executables are rejected via magic-byte detection even when the extension is renamed. Each accepted file is stored privately in `core__blob` and linked to the created issue via `pm__issue_attachment`.","default":"Files","type":"string","format":"binary"}},"inlineImages":{"maxItems":10,"description":"Images embedded in a markdown `message` (`messageFormat: markdown`). The N-th part replaces the image source token `bkh-inline-image:N` in the message, e.g. `![Screenshot](bkh-inline-image:0)`. PNG, JPEG, WebP or GIF, max 5 MB each, max 10 images. Stored publicly (unguessable URL) so they render in the description everywhere, and also listed as ticket attachments. Unreferenced or failed images are dropped from the body.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":10,"description":"Images embedded in a markdown `message` (`messageFormat: markdown`). The N-th part replaces the image source token `bkh-inline-image:N` in the message, e.g. `![Screenshot](bkh-inline-image:0)`. PNG, JPEG, WebP or GIF, max 5 MB each, max 10 images. Stored publicly (unguessable URL) so they render in the description everywhere, and also listed as ticket attachments. Unreferenced or failed images are dropped from the body.","default":"Files","type":"string","format":"binary"}},"branchSlug":{"maxLength":255,"examples":["plzen-skvrnany"],"description":"Branch the request is about (slug from `/branch/list`), when the visitor picked one. The ticket then appears in `/support/my-issue-list` of the branch technicians (unless it is confidential). An unknown or inactive slug is silently ignored and the ticket is created without a branch.","type":"string"},"idempotencyKey":{"minLength":1,"maxLength":128,"examples":["6f1c2b8e-3d4a-4f5b-9c7d-1e2f3a4b5c6d"],"description":"Protection against duplicate tickets when the caller retries after a timeout. Send a fresh UUID v4 per submission and REUSE it for retries of the same submission. The same key from the same organisation within 24 h does not create a second ticket: the response carries the already created ticket and `duplicate: true`. When the first request is still being processed, the retry waits up to 10 s and then answers `SUBMISSION_IN_PROGRESS`.","type":"string"},"technicalContext":{"description":"Optional structured technical context of the reporter's environment (JSON object; in multipart requests a JSON string). Stored next to the ticket, NOT inside the message: the ticket starts with the plain `message` and BizKitHub renders the context at the end of the ticket for the internal team only. It is never shown to the reporter (e-mails, public ticket page). Every field is optional; unknown fields are dropped and a malformed context never blocks the ticket.\n\nSections: `page` {url, referrer, route, title, entity, entityUrl}, `client` {userAgent, language, languages, viewport, screen, devicePixelRatio, colorScheme, zoomPercent, reducedMotion, touch, localTime, timezone, utcOffsetMinutes}, `session` {authenticated, userId, accountId, username, name, email, emailVerified, role, roles, organisationId, organisationName, project, impersonating, impersonatedBy}, `network` {online, connectionType, effectiveType, downlinkMbps, rttMs, saveData, ttfbMs, domContentLoadedMs, loadMs, jsHeapUsedMb, jsHeapLimitMb, deviceMemoryGb, cpuCores}, `app` {name, version, build, commit, environment, uiLanguage, featureFlags}, `correlation` {requestId, tabId, sessionHash}, `diagnostics` {errors: [{message, stack, source, at}], failedRequests: [{method, url, status, durationMs, at}]} (last 10 each), `custom` {any key: string | number | boolean} for integrator-specific data (max 30 keys).\n\nPrivacy: never send cookies, localStorage / sessionStorage, tokens, passwords or form contents. Sensitive URL query parameters (token, code, password, key, secret, signature, …) are masked to `***` server-side, a raw `sessionId` is replaced by its hash. BizKitHub adds the client IP (from `customerRealIp`), geo, ASN, parsed browser / OS / device, server receive time and clock skew itself; send the raw `userAgent`, not a parsed one.","examples":[{"page":{"url":"https://bandzone.cz/kapela/123/edit","referrer":"https://bandzone.cz/","route":"band.edit","entity":"band#123"},"client":{"userAgent":"Mozilla/5.0 …","language":"cs-CZ","viewport":"1440x900","timezone":"Europe/Prague","localTime":"2026-11-27T10:00:00+01:00"},"session":{"authenticated":true,"accountId":"123","username":"jan","role":"member"},"app":{"name":"bandzone-web","version":"4.12.0","commit":"abc123","environment":"production"},"correlation":{"requestId":"req-9f8e7d","tabId":"a1b2c3d4"},"custom":{"bandId":123}}]},"messageFormat":{"default":"text","description":"`text` (default): plain text, line breaks preserved. `markdown`: GitHub-flavoured markdown from a rich editor (headings, lists, code, tables, links, images); rendered through the same sanitizer as every ticket body.","anyOf":[{"const":"text","type":"string"},{"const":"markdown","type":"string"}]}}}}}}}},"/api/v1/support/my-tickets":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1SupportMy-tickets","tags":["support"],"summary":"E-mail me links to my tickets","description":"Sends the address an e-mail listing its non-spam tickets in this organisation (newest activity first, max 20) with links to the public ticket page. Login-free \"request history\" for customers. Always answers `{ success: true }` so it cannot be used to enumerate addresses; throttled to one mail per address per 15 minutes and 5 requests per IP per hour. Pass the end-user IP via `customerRealIp` when proxying.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"locale":{"description":"Language of the e-mail and ticket links. Defaults to the organisation locale.","anyOf":[{"const":"cs","type":"string"},{"const":"en","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"locale":{"description":"Language of the e-mail and ticket links. Defaults to the organisation locale.","anyOf":[{"const":"cs","type":"string"},{"const":"en","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"locale":{"description":"Language of the e-mail and ticket links. Defaults to the organisation locale.","anyOf":[{"const":"cs","type":"string"},{"const":"en","type":"string"}]}}}}}}}},"/api/v1/support/docs-suggest":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"The ticket subject as typed so far. Free text; noise words are dropped and Czech inflection is tolerated.","examples":["Nedaří se mi odeslat fakturu e-mailem"],"schema":{"type":"string","maxLength":200},"in":"query","name":"query","required":true},{"description":"Preferred locale (default `cs`). Hits in this locale rank slightly higher; hits in other locales are still returned.","examples":["cs"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"description":"Maximum number of suggestions (default 5).","examples":[5],"schema":{"minimum":1,"maximum":10,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":10,"examples":[5],"description":"Maximum number of suggestions (default 5).","type":"integer"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"description":"Normalized query.","type":"string"},"terms":{"description":"Search terms (stems) actually used.","type":"array","items":{"type":"string"}},"items":{"type":"array","items":{"type":"object","required":["type","title","context","snippet","locale","url","score"],"properties":{"type":{"anyOf":[{"const":"article","type":"string"},{"const":"section","type":"string"},{"const":"category","type":"string"}]},"title":{"examples":["Faktury"],"type":"string"},"context":{"description":"Article title for a section; category (or parent category) name otherwise.","anyOf":[{"type":"string"},{"type":"null"}]},"snippet":{"description":"One-line plain-text preview around the first hit.","type":"string"},"locale":{"examples":["cs"],"type":"string"},"url":{"examples":["https://docs.bizkithub.com/cs/faktury"],"type":"string"},"score":{"type":"number"}}}}},"required":["query","terms","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"query":{"description":"Normalized query.","type":"string"},"terms":{"description":"Search terms (stems) actually used.","type":"array","items":{"type":"string"}},"items":{"type":"array","items":{"type":"object","required":["type","title","context","snippet","locale","url","score"],"properties":{"type":{"anyOf":[{"const":"article","type":"string"},{"const":"section","type":"string"},{"const":"category","type":"string"}]},"title":{"examples":["Faktury"],"type":"string"},"context":{"description":"Article title for a section; category (or parent category) name otherwise.","anyOf":[{"type":"string"},{"type":"null"}]},"snippet":{"description":"One-line plain-text preview around the first hit.","type":"string"},"locale":{"examples":["cs"],"type":"string"},"url":{"examples":["https://docs.bizkithub.com/cs/faktury"],"type":"string"},"score":{"type":"number"}}}}},"required":["query","terms","items"]}},"text/plain":{"schema":{"type":"object","properties":{"query":{"description":"Normalized query.","type":"string"},"terms":{"description":"Search terms (stems) actually used.","type":"array","items":{"type":"string"}},"items":{"type":"array","items":{"type":"object","required":["type","title","context","snippet","locale","url","score"],"properties":{"type":{"anyOf":[{"const":"article","type":"string"},{"const":"section","type":"string"},{"const":"category","type":"string"}]},"title":{"examples":["Faktury"],"type":"string"},"context":{"description":"Article title for a section; category (or parent category) name otherwise.","anyOf":[{"type":"string"},{"type":"null"}]},"snippet":{"description":"One-line plain-text preview around the first hit.","type":"string"},"locale":{"examples":["cs"],"type":"string"},"url":{"examples":["https://docs.bizkithub.com/cs/faktury"],"type":"string"},"score":{"type":"number"}}}}},"required":["query","terms","items"]}}}}},"operationId":"getApiV1SupportDocs-suggest","tags":["support"],"summary":"Documentation suggestions for a support subject","description":"Autocomplete for help-desk ticket forms: returns the public documentation pages (docs.bizkithub.com) most relevant to a free-text subject. Searches article titles, section headings, perex, meta description, body, public tags and category names/descriptions across every docs locale. Each item is an `article`, a `section` (deep link to a heading anchor) or a `category`, with an absolute `url` in the locale the hit was found in. Only public, non-deleted content is searched. Any valid API key may call it; the docs corpus is shared."}},"/api/v1/support/issue/{externalId}":{"get":{"parameters":[{"description":"The 16-char alphanumeric external identifier of the issue (from BKH-ISSUE token).","examples":["a1B2c3D4e5F6g7H8"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true},{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","issue"],"properties":{"success":{"const":true,"type":"boolean"},"issue":{"type":"object","required":["externalId","issueKey","subject","description","statusCategoryCode","statusLabel","priority","insertedDate","locale","organisationName","organisationLogo","reporter","comments","attachments","escalations","nextEscalationAllowedAt"],"properties":{"externalId":{"type":"string"},"issueKey":{"type":"string"},"subject":{"type":"string"},"description":{"type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"locale":{"type":"string"},"organisationName":{"type":"string"},"organisationLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"reporter":{"type":"object","required":["email","displayName"],"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"type":"string"}}},"comments":{"type":"array","items":{"type":"object","required":["id","authorKind","authorDisplayName","insertedDate","message"],"properties":{"id":{"type":"string"},"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorDisplayName":{"type":"string"},"insertedDate":{"type":"string"},"message":{"description":"Comment body rendered as sanitised HTML. Internal staff notes (`channel = internal`) and spam-flagged rows are stripped at the SELECT level, so this list never leaks either to the customer-facing portal.","type":"string"}}}},"attachments":{"description":"Files uploaded together with the original issue. Empty when none.","type":"array","items":{"type":"object","required":["token","filename","size","contentType","downloadUrl"],"properties":{"token":{"description":"Opaque blob token, safe to embed in the public URL.","type":"string"},"filename":{"type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"type":"string"},"downloadUrl":{"description":"Signed direct-download URL.","type":"string"}}}},"escalations":{"description":"Accepted escalation requests, oldest first.","type":"array","items":{"type":"object","required":["insertedDate","reason","previousPriority","newPriority"],"properties":{"insertedDate":{"type":"string"},"reason":{"description":"Justification as submitted by the requester side (reporter, or a member of the originating organisation).","type":"string"},"previousPriority":{"description":"Priority before the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority after the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"}}}},"nextEscalationAllowedAt":{"description":"ISO timestamp from which the ticket may be escalated again (one escalation per ticket per 24 h). `null` = escalation is available now.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","issue"],"properties":{"success":{"const":true,"type":"boolean"},"issue":{"type":"object","required":["externalId","issueKey","subject","description","statusCategoryCode","statusLabel","priority","insertedDate","locale","organisationName","organisationLogo","reporter","comments","attachments","escalations","nextEscalationAllowedAt"],"properties":{"externalId":{"type":"string"},"issueKey":{"type":"string"},"subject":{"type":"string"},"description":{"type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"locale":{"type":"string"},"organisationName":{"type":"string"},"organisationLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"reporter":{"type":"object","required":["email","displayName"],"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"type":"string"}}},"comments":{"type":"array","items":{"type":"object","required":["id","authorKind","authorDisplayName","insertedDate","message"],"properties":{"id":{"type":"string"},"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorDisplayName":{"type":"string"},"insertedDate":{"type":"string"},"message":{"description":"Comment body rendered as sanitised HTML. Internal staff notes (`channel = internal`) and spam-flagged rows are stripped at the SELECT level, so this list never leaks either to the customer-facing portal.","type":"string"}}}},"attachments":{"description":"Files uploaded together with the original issue. Empty when none.","type":"array","items":{"type":"object","required":["token","filename","size","contentType","downloadUrl"],"properties":{"token":{"description":"Opaque blob token, safe to embed in the public URL.","type":"string"},"filename":{"type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"type":"string"},"downloadUrl":{"description":"Signed direct-download URL.","type":"string"}}}},"escalations":{"description":"Accepted escalation requests, oldest first.","type":"array","items":{"type":"object","required":["insertedDate","reason","previousPriority","newPriority"],"properties":{"insertedDate":{"type":"string"},"reason":{"description":"Justification as submitted by the requester side (reporter, or a member of the originating organisation).","type":"string"},"previousPriority":{"description":"Priority before the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority after the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"}}}},"nextEscalationAllowedAt":{"description":"ISO timestamp from which the ticket may be escalated again (one escalation per ticket per 24 h). `null` = escalation is available now.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","issue"],"properties":{"success":{"const":true,"type":"boolean"},"issue":{"type":"object","required":["externalId","issueKey","subject","description","statusCategoryCode","statusLabel","priority","insertedDate","locale","organisationName","organisationLogo","reporter","comments","attachments","escalations","nextEscalationAllowedAt"],"properties":{"externalId":{"type":"string"},"issueKey":{"type":"string"},"subject":{"type":"string"},"description":{"type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"locale":{"type":"string"},"organisationName":{"type":"string"},"organisationLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"reporter":{"type":"object","required":["email","displayName"],"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"type":"string"}}},"comments":{"type":"array","items":{"type":"object","required":["id","authorKind","authorDisplayName","insertedDate","message"],"properties":{"id":{"type":"string"},"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorDisplayName":{"type":"string"},"insertedDate":{"type":"string"},"message":{"description":"Comment body rendered as sanitised HTML. Internal staff notes (`channel = internal`) and spam-flagged rows are stripped at the SELECT level, so this list never leaks either to the customer-facing portal.","type":"string"}}}},"attachments":{"description":"Files uploaded together with the original issue. Empty when none.","type":"array","items":{"type":"object","required":["token","filename","size","contentType","downloadUrl"],"properties":{"token":{"description":"Opaque blob token, safe to embed in the public URL.","type":"string"},"filename":{"type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"type":"string"},"downloadUrl":{"description":"Signed direct-download URL.","type":"string"}}}},"escalations":{"description":"Accepted escalation requests, oldest first.","type":"array","items":{"type":"object","required":["insertedDate","reason","previousPriority","newPriority"],"properties":{"insertedDate":{"type":"string"},"reason":{"description":"Justification as submitted by the requester side (reporter, or a member of the originating organisation).","type":"string"},"previousPriority":{"description":"Priority before the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority after the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"}}}},"nextEscalationAllowedAt":{"description":"ISO timestamp from which the ticket may be escalated again (one escalation per ticket per 24 h). `null` = escalation is available now.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","issue"],"properties":{"success":{"const":true,"type":"boolean"},"issue":{"type":"object","required":["externalId","issueKey","subject","description","statusCategoryCode","statusLabel","priority","insertedDate","locale","organisationName","organisationLogo","reporter","comments","attachments","escalations","nextEscalationAllowedAt"],"properties":{"externalId":{"type":"string"},"issueKey":{"type":"string"},"subject":{"type":"string"},"description":{"type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"locale":{"type":"string"},"organisationName":{"type":"string"},"organisationLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"reporter":{"type":"object","required":["email","displayName"],"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"type":"string"}}},"comments":{"type":"array","items":{"type":"object","required":["id","authorKind","authorDisplayName","insertedDate","message"],"properties":{"id":{"type":"string"},"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorDisplayName":{"type":"string"},"insertedDate":{"type":"string"},"message":{"description":"Comment body rendered as sanitised HTML. Internal staff notes (`channel = internal`) and spam-flagged rows are stripped at the SELECT level, so this list never leaks either to the customer-facing portal.","type":"string"}}}},"attachments":{"description":"Files uploaded together with the original issue. Empty when none.","type":"array","items":{"type":"object","required":["token","filename","size","contentType","downloadUrl"],"properties":{"token":{"description":"Opaque blob token, safe to embed in the public URL.","type":"string"},"filename":{"type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"type":"string"},"downloadUrl":{"description":"Signed direct-download URL.","type":"string"}}}},"escalations":{"description":"Accepted escalation requests, oldest first.","type":"array","items":{"type":"object","required":["insertedDate","reason","previousPriority","newPriority"],"properties":{"insertedDate":{"type":"string"},"reason":{"description":"Justification as submitted by the requester side (reporter, or a member of the originating organisation).","type":"string"},"previousPriority":{"description":"Priority before the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority after the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"}}}},"nextEscalationAllowedAt":{"description":"ISO timestamp from which the ticket may be escalated again (one escalation per ticket per 24 h). `null` = escalation is available now.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"}]}}}]}}}}},"operationId":"getApiV1SupportIssueByExternalId","tags":["support"],"summary":"Fetch public issue detail by external id","description":"Returns the public-safe subset of an issue: subject, description, status, priority, reporter (name/email), and the full comment thread. Used by the customer-facing ticket page on bizkithub.com."}},"/api/v1/support/issue/{externalId}/comment":{"post":{"parameters":[{"description":"The 16-char alphanumeric external identifier of the issue.","examples":["a1B2c3D4e5F6g7H8"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true},{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"},{"const":"NO_REPORTER","type":"string"},{"const":"MESSAGE_TOO_SHORT","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"ATTACHMENT_REJECTED","type":"string"}]},"message":{"description":"Human-readable explanation for the failure. Present on RATE_LIMITED and UPSTREAM_ERROR — the customer-facing UI should prefer this over its own generic fallback so the reason is visible.","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"},{"const":"NO_REPORTER","type":"string"},{"const":"MESSAGE_TOO_SHORT","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"ATTACHMENT_REJECTED","type":"string"}]},"message":{"description":"Human-readable explanation for the failure. Present on RATE_LIMITED and UPSTREAM_ERROR — the customer-facing UI should prefer this over its own generic fallback so the reason is visible.","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"},{"const":"NO_REPORTER","type":"string"},{"const":"MESSAGE_TOO_SHORT","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"ATTACHMENT_REJECTED","type":"string"}]},"message":{"description":"Human-readable explanation for the failure. Present on RATE_LIMITED and UPSTREAM_ERROR — the customer-facing UI should prefer this over its own generic fallback so the reason is visible.","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"},{"const":"NO_REPORTER","type":"string"},{"const":"MESSAGE_TOO_SHORT","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"ATTACHMENT_REJECTED","type":"string"}]},"message":{"description":"Human-readable explanation for the failure. Present on RATE_LIMITED and UPSTREAM_ERROR — the customer-facing UI should prefer this over its own generic fallback so the reason is visible.","type":"string"}}}]}}}}},"operationId":"postApiV1SupportIssueByExternalIdComment","tags":["support"],"summary":"Post a public reply to an issue","description":"Appends a new comment to the ticket, attributed to the ticket reporter. Used by the reply form on the customer-facing ticket page on bizkithub.com. Applies min/max length, per-issue 24h rate limit, and an LLM spam check; spam replies are stored with a badge (or silently dropped once per-issue / per-IP thresholds are exceeded) and do not reopen closed tickets.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"minLength":1,"maxLength":10000,"examples":["Thanks for the update — issue confirmed on my side too."],"description":"Customer reply text. Server-side rules: leading/trailing whitespace is trimmed, then the payload is truncated at 5000 chars (silent), then rejected with MESSAGE_TOO_SHORT if fewer than 3 non-whitespace chars remain. A per-issue 24h volume ceiling and an LLM spam classifier are applied before insert.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attachments":{"maxItems":5,"description":"Optional files (screenshots, documents) sent with the reply as multipart/form-data `attachments` parts. Same policy as `/contact-form` (type sniffing, size caps). Linked to the issue only when the reply is accepted.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional files (screenshots, documents) sent with the reply as multipart/form-data `attachments` parts. Same policy as `/contact-form` (type sniffing, size caps). Linked to the issue only when the reply is accepted.","default":"Files","type":"string","format":"binary"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["message"],"properties":{"message":{"minLength":1,"maxLength":10000,"examples":["Thanks for the update — issue confirmed on my side too."],"description":"Customer reply text. Server-side rules: leading/trailing whitespace is trimmed, then the payload is truncated at 5000 chars (silent), then rejected with MESSAGE_TOO_SHORT if fewer than 3 non-whitespace chars remain. A per-issue 24h volume ceiling and an LLM spam classifier are applied before insert.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attachments":{"maxItems":5,"description":"Optional files (screenshots, documents) sent with the reply as multipart/form-data `attachments` parts. Same policy as `/contact-form` (type sniffing, size caps). Linked to the issue only when the reply is accepted.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional files (screenshots, documents) sent with the reply as multipart/form-data `attachments` parts. Same policy as `/contact-form` (type sniffing, size caps). Linked to the issue only when the reply is accepted.","default":"Files","type":"string","format":"binary"}}}}},"text/plain":{"schema":{"type":"object","required":["message"],"properties":{"message":{"minLength":1,"maxLength":10000,"examples":["Thanks for the update — issue confirmed on my side too."],"description":"Customer reply text. Server-side rules: leading/trailing whitespace is trimmed, then the payload is truncated at 5000 chars (silent), then rejected with MESSAGE_TOO_SHORT if fewer than 3 non-whitespace chars remain. A per-issue 24h volume ceiling and an LLM spam classifier are applied before insert.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attachments":{"maxItems":5,"description":"Optional files (screenshots, documents) sent with the reply as multipart/form-data `attachments` parts. Same policy as `/contact-form` (type sniffing, size caps). Linked to the issue only when the reply is accepted.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional files (screenshots, documents) sent with the reply as multipart/form-data `attachments` parts. Same policy as `/contact-form` (type sniffing, size caps). Linked to the issue only when the reply is accepted.","default":"Files","type":"string","format":"binary"}}}}}}}}},"/api/v1/support/issue/{externalId}/escalate":{"post":{"parameters":[{"description":"The 16-char alphanumeric external identifier of the issue.","examples":["a1B2c3D4e5F6g7H8"],"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true},{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","previousPriority","newPriority","changed"],"properties":{"success":{"const":true,"type":"boolean"},"previousPriority":{"description":"Priority BEFORE the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority AFTER the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"},"changed":{"description":"False when the ticket was already at blocker priority — the audit comment is still written.","type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"},{"const":"NO_REPORTER","type":"string"},{"const":"REASON_TOO_SHORT","type":"string"},{"const":"INVALID_REASON","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on INVALID_REASON (short blurb from the classifier), RATE_LIMITED and UPSTREAM_ERROR — surface verbatim in the UI.","type":"string"},"nextEscalationAllowedAt":{"description":"Present on RATE_LIMITED: ISO timestamp from which the ticket may be escalated again.","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","previousPriority","newPriority","changed"],"properties":{"success":{"const":true,"type":"boolean"},"previousPriority":{"description":"Priority BEFORE the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority AFTER the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"},"changed":{"description":"False when the ticket was already at blocker priority — the audit comment is still written.","type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"},{"const":"NO_REPORTER","type":"string"},{"const":"REASON_TOO_SHORT","type":"string"},{"const":"INVALID_REASON","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on INVALID_REASON (short blurb from the classifier), RATE_LIMITED and UPSTREAM_ERROR — surface verbatim in the UI.","type":"string"},"nextEscalationAllowedAt":{"description":"Present on RATE_LIMITED: ISO timestamp from which the ticket may be escalated again.","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","previousPriority","newPriority","changed"],"properties":{"success":{"const":true,"type":"boolean"},"previousPriority":{"description":"Priority BEFORE the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority AFTER the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"},"changed":{"description":"False when the ticket was already at blocker priority — the audit comment is still written.","type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"},{"const":"NO_REPORTER","type":"string"},{"const":"REASON_TOO_SHORT","type":"string"},{"const":"INVALID_REASON","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on INVALID_REASON (short blurb from the classifier), RATE_LIMITED and UPSTREAM_ERROR — surface verbatim in the UI.","type":"string"},"nextEscalationAllowedAt":{"description":"Present on RATE_LIMITED: ISO timestamp from which the ticket may be escalated again.","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","previousPriority","newPriority","changed"],"properties":{"success":{"const":true,"type":"boolean"},"previousPriority":{"description":"Priority BEFORE the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority AFTER the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"},"changed":{"description":"False when the ticket was already at blocker priority — the audit comment is still written.","type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"NOT_FOUND","type":"string"},{"const":"INVALID_EXTERNAL_ID","type":"string"},{"const":"NO_REPORTER","type":"string"},{"const":"REASON_TOO_SHORT","type":"string"},{"const":"INVALID_REASON","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on INVALID_REASON (short blurb from the classifier), RATE_LIMITED and UPSTREAM_ERROR — surface verbatim in the UI.","type":"string"},"nextEscalationAllowedAt":{"description":"Present on RATE_LIMITED: ISO timestamp from which the ticket may be escalated again.","type":"string"}}}]}}}}},"operationId":"postApiV1SupportIssueByExternalIdEscalate","tags":["support"],"summary":"Request priority escalation for an issue","description":"Escalates the ticket priority one step up the customer-facing ladder (low/normal → high → critical → blocker; blocker stays blocker), appends an internal audit comment and e-mails the assignee (or the organisation's root members when unassigned). One escalation per ticket per 24 h (RATE_LIMITED). Reason is validated by an LLM classifier before any write happens.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"minLength":1,"maxLength":500,"examples":["Prod down since 10 AM, cannot process orders."],"description":"Reporter's justification. Server rules: trim leading/trailing whitespace, silently truncate at 140 chars, reject as REASON_TOO_SHORT if fewer than 3 non-whitespace chars remain. Passed through an LLM classifier that rejects gibberish, spam, prompt-injection, and emphatic non-justifications (\"urgent!!!\", \"asap\") as INVALID_REASON.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"minLength":1,"maxLength":500,"examples":["Prod down since 10 AM, cannot process orders."],"description":"Reporter's justification. Server rules: trim leading/trailing whitespace, silently truncate at 140 chars, reject as REASON_TOO_SHORT if fewer than 3 non-whitespace chars remain. Passed through an LLM classifier that rejects gibberish, spam, prompt-injection, and emphatic non-justifications (\"urgent!!!\", \"asap\") as INVALID_REASON.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"minLength":1,"maxLength":500,"examples":["Prod down since 10 AM, cannot process orders."],"description":"Reporter's justification. Server rules: trim leading/trailing whitespace, silently truncate at 140 chars, reject as REASON_TOO_SHORT if fewer than 3 non-whitespace chars remain. Passed through an LLM classifier that rejects gibberish, spam, prompt-injection, and emphatic non-justifications (\"urgent!!!\", \"asap\") as INVALID_REASON.","type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/support/my-issue-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false},{"description":"Status category filter: `new`, `progress`, `waiting`, `done`. Repeat the parameter or pass a comma-separated list. Default: all.","examples":["new,progress"],"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"statusCategoryCode","required":false},{"description":"Tickets in category `done` are listed only when their last activity is at most this many days old. `0` = no closed tickets.","schema":{"minimum":0,"maximum":90,"default":14,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":90,"default":14,"description":"Tickets in category `done` are listed only when their last activity is at most this many days old. `0` = no closed tickets.","type":"integer"}]},"in":"query","name":"closedSinceDays","required":false},{"schema":{"minimum":1,"default":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"default":1,"type":"integer"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":100,"default":50,"type":"integer"}]},"in":"query","name":"limit","required":false},{"description":"Language of `statusLabel`. Default: the ticket language, then the organisation language.","examples":["cs"],"schema":{"type":"string","maxLength":5},"in":"query","name":"locale","required":false},{"description":"Only tickets of this branch. A branch the caller does not operate simply yields an empty list.","examples":["plzen-skvrnany"],"schema":{"type":"string","maxLength":255},"in":"query","name":"branchSlug","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"itemCount":{"description":"Total number of matching tickets (all pages).","type":"number"},"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","preview","statusCategoryCode","statusLabel","branchSlug","reporterDisplayName","assignedToMe","waitsForReply","lastCommentId","insertedDate","lastActivityDate"],"properties":{"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"type":"string"},"issueKey":{"examples":["GYMRO-844"],"type":"string"},"subject":{"type":"string"},"preview":{"description":"First ~220 characters of the description as plain text (no HTML, no markdown).","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"examples":["Nový"],"type":"string"},"branchSlug":{"examples":["plzen-skvrnany"],"anyOf":[{"type":"string"},{"type":"null"}]},"reporterDisplayName":{"examples":["Jana Nováková"],"type":"string"},"assignedToMe":{"description":"Accessible through rule A (assigned to the caller).","type":"boolean"},"waitsForReply":{"description":"Not `done` and the last customer-visible message (description, inbound mail, portal reply) is from the customer.","type":"boolean"},"lastCommentId":{"description":"Id of the last customer-visible comment (`ISSUEKEY_c<n>`), null when there is none. Pass it to `/my-issue-reply`.","examples":["GYMRO-844_c1267"],"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp.","type":"string"},"lastActivityDate":{"description":"ISO timestamp of the last update or customer-visible message.","type":"string"}}}}},"required":["success","itemCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"itemCount":{"description":"Total number of matching tickets (all pages).","type":"number"},"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","preview","statusCategoryCode","statusLabel","branchSlug","reporterDisplayName","assignedToMe","waitsForReply","lastCommentId","insertedDate","lastActivityDate"],"properties":{"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"type":"string"},"issueKey":{"examples":["GYMRO-844"],"type":"string"},"subject":{"type":"string"},"preview":{"description":"First ~220 characters of the description as plain text (no HTML, no markdown).","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"examples":["Nový"],"type":"string"},"branchSlug":{"examples":["plzen-skvrnany"],"anyOf":[{"type":"string"},{"type":"null"}]},"reporterDisplayName":{"examples":["Jana Nováková"],"type":"string"},"assignedToMe":{"description":"Accessible through rule A (assigned to the caller).","type":"boolean"},"waitsForReply":{"description":"Not `done` and the last customer-visible message (description, inbound mail, portal reply) is from the customer.","type":"boolean"},"lastCommentId":{"description":"Id of the last customer-visible comment (`ISSUEKEY_c<n>`), null when there is none. Pass it to `/my-issue-reply`.","examples":["GYMRO-844_c1267"],"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp.","type":"string"},"lastActivityDate":{"description":"ISO timestamp of the last update or customer-visible message.","type":"string"}}}}},"required":["success","itemCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"itemCount":{"description":"Total number of matching tickets (all pages).","type":"number"},"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","preview","statusCategoryCode","statusLabel","branchSlug","reporterDisplayName","assignedToMe","waitsForReply","lastCommentId","insertedDate","lastActivityDate"],"properties":{"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"type":"string"},"issueKey":{"examples":["GYMRO-844"],"type":"string"},"subject":{"type":"string"},"preview":{"description":"First ~220 characters of the description as plain text (no HTML, no markdown).","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"examples":["Nový"],"type":"string"},"branchSlug":{"examples":["plzen-skvrnany"],"anyOf":[{"type":"string"},{"type":"null"}]},"reporterDisplayName":{"examples":["Jana Nováková"],"type":"string"},"assignedToMe":{"description":"Accessible through rule A (assigned to the caller).","type":"boolean"},"waitsForReply":{"description":"Not `done` and the last customer-visible message (description, inbound mail, portal reply) is from the customer.","type":"boolean"},"lastCommentId":{"description":"Id of the last customer-visible comment (`ISSUEKEY_c<n>`), null when there is none. Pass it to `/my-issue-reply`.","examples":["GYMRO-844_c1267"],"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp.","type":"string"},"lastActivityDate":{"description":"ISO timestamp of the last update or customer-visible message.","type":"string"}}}}},"required":["success","itemCount","items"]}}}}},"operationId":"getApiV1SupportMy-issue-list","tags":["support"],"summary":"List tickets the logged-in franchisee may work on","description":"Tickets of the caller's branches plus tickets assigned to the caller. Sorted: waiting for a reply first, then by last activity (newest first). A caller without branch and assignment gets `200` with `items: []`.\n\n**Access rule `ISSUE_ACCESS`** (evaluated on every call): the caller is the contact behind `identityId` in the organisation of `apiKey`. A ticket is accessible when it belongs to that organisation, is classified as not spam, and\n\n- **A (assignment):** it is assigned to the caller's contact (also confidential tickets), or\n- **B (branch):** its branch is an active branch the caller operates (`shop__branch_person` role `technician`, `manager` or `owner`), the ticket is not confidential (`securedTicket` / hidden from the branch) and it was not handed back to the head office.\n\nThere is no owner (`root`) shortcut and contact groups (`fransiza`, `trainer`, …) never grant access. An inaccessible and a non-existent `externalId` answer the same **403 `ISSUE_FORBIDDEN`**. A missing or invalid `identityId` answers **401**."}},"/api/v1/support/my-issue-detail":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false},{"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","examples":["Qr0MZ0vYnp8xMYgs"],"schema":{"type":"string","minLength":1,"maxLength":32},"in":"query","name":"externalId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"issue":{"type":"object","required":["externalId","issueKey","subject","description","statusCategoryCode","statusLabel","priority","insertedDate","locale","organisationName","organisationLogo","reporter","comments","attachments","branchSlug","assignedToMe","lastCommentId","securedTicket"],"properties":{"externalId":{"type":"string"},"issueKey":{"type":"string"},"subject":{"type":"string"},"description":{"description":"Sanitised HTML.","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"locale":{"type":"string"},"organisationName":{"type":"string"},"organisationLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"reporter":{"type":"object","required":["email","displayName"],"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"type":"string"}}},"comments":{"description":"Newest first, at most 100.","type":"array","items":{"type":"object","required":["id","authorKind","authorDisplayName","channel","insertedDate","message"],"properties":{"id":{"examples":["GYMRO-844_c1267"],"type":"string"},"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorDisplayName":{"type":"string"},"channel":{"description":"`email_out` = reply sent to the customer, `email_in` = message from the customer, `internal` = staff note.","anyOf":[{"const":"internal","type":"string"},{"const":"email_out","type":"string"},{"const":"email_in","type":"string"}]},"insertedDate":{"type":"string"},"message":{"description":"Sanitised HTML.","type":"string"}}}},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"downloadUrl":{"description":"Signed direct-download URL. Fetch fresh, do not cache.","type":"string"}}}},"branchSlug":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignedToMe":{"type":"boolean"},"lastCommentId":{"description":"Last customer-visible comment; send it back with `/my-issue-reply`.","anyOf":[{"type":"string"},{"type":"null"}]},"securedTicket":{"type":"boolean"}}}},"required":["success","issue"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"issue":{"type":"object","required":["externalId","issueKey","subject","description","statusCategoryCode","statusLabel","priority","insertedDate","locale","organisationName","organisationLogo","reporter","comments","attachments","branchSlug","assignedToMe","lastCommentId","securedTicket"],"properties":{"externalId":{"type":"string"},"issueKey":{"type":"string"},"subject":{"type":"string"},"description":{"description":"Sanitised HTML.","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"locale":{"type":"string"},"organisationName":{"type":"string"},"organisationLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"reporter":{"type":"object","required":["email","displayName"],"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"type":"string"}}},"comments":{"description":"Newest first, at most 100.","type":"array","items":{"type":"object","required":["id","authorKind","authorDisplayName","channel","insertedDate","message"],"properties":{"id":{"examples":["GYMRO-844_c1267"],"type":"string"},"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorDisplayName":{"type":"string"},"channel":{"description":"`email_out` = reply sent to the customer, `email_in` = message from the customer, `internal` = staff note.","anyOf":[{"const":"internal","type":"string"},{"const":"email_out","type":"string"},{"const":"email_in","type":"string"}]},"insertedDate":{"type":"string"},"message":{"description":"Sanitised HTML.","type":"string"}}}},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"downloadUrl":{"description":"Signed direct-download URL. Fetch fresh, do not cache.","type":"string"}}}},"branchSlug":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignedToMe":{"type":"boolean"},"lastCommentId":{"description":"Last customer-visible comment; send it back with `/my-issue-reply`.","anyOf":[{"type":"string"},{"type":"null"}]},"securedTicket":{"type":"boolean"}}}},"required":["success","issue"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"issue":{"type":"object","required":["externalId","issueKey","subject","description","statusCategoryCode","statusLabel","priority","insertedDate","locale","organisationName","organisationLogo","reporter","comments","attachments","branchSlug","assignedToMe","lastCommentId","securedTicket"],"properties":{"externalId":{"type":"string"},"issueKey":{"type":"string"},"subject":{"type":"string"},"description":{"description":"Sanitised HTML.","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"type":"string"},"priority":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"locale":{"type":"string"},"organisationName":{"type":"string"},"organisationLogo":{"anyOf":[{"type":"string"},{"type":"null"}]},"reporter":{"type":"object","required":["email","displayName"],"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"type":"string"}}},"comments":{"description":"Newest first, at most 100.","type":"array","items":{"type":"object","required":["id","authorKind","authorDisplayName","channel","insertedDate","message"],"properties":{"id":{"examples":["GYMRO-844_c1267"],"type":"string"},"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorDisplayName":{"type":"string"},"channel":{"description":"`email_out` = reply sent to the customer, `email_in` = message from the customer, `internal` = staff note.","anyOf":[{"const":"internal","type":"string"},{"const":"email_out","type":"string"},{"const":"email_in","type":"string"}]},"insertedDate":{"type":"string"},"message":{"description":"Sanitised HTML.","type":"string"}}}},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"downloadUrl":{"description":"Signed direct-download URL. Fetch fresh, do not cache.","type":"string"}}}},"branchSlug":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignedToMe":{"type":"boolean"},"lastCommentId":{"description":"Last customer-visible comment; send it back with `/my-issue-reply`.","anyOf":[{"type":"string"},{"type":"null"}]},"securedTicket":{"type":"boolean"}}}},"required":["success","issue"]}}}},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}}},"operationId":"getApiV1SupportMy-issue-detail","tags":["support"],"summary":"Ticket detail for the logged-in franchisee","description":"Same shape as `GET /support/issue/{externalId}` (customer-visible thread without spam) plus `branchSlug`, `assignedToMe`, `lastCommentId`, `securedTicket` and `channel` on every comment. Internal notes (`channel = internal`) are included only for a ticket assigned to the caller, and only those written by people (never AI / system entries). The reporter's IP address is never included.\n\n**Access rule `ISSUE_ACCESS`** (evaluated on every call): the caller is the contact behind `identityId` in the organisation of `apiKey`. A ticket is accessible when it belongs to that organisation, is classified as not spam, and\n\n- **A (assignment):** it is assigned to the caller's contact (also confidential tickets), or\n- **B (branch):** its branch is an active branch the caller operates (`shop__branch_person` role `technician`, `manager` or `owner`), the ticket is not confidential (`securedTicket` / hidden from the branch) and it was not handed back to the head office.\n\nThere is no owner (`root`) shortcut and contact groups (`fransiza`, `trainer`, …) never grant access. An inaccessible and a non-existent `externalId` answer the same **403 `ISSUE_FORBIDDEN`**. A missing or invalid `identityId` answers **401**."}},"/api/v1/support/my-issue-reply":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"commentId":{"examples":["GYMRO-844_c1270"],"type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]}},"required":["success","commentId","statusCategoryCode"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"commentId":{"examples":["GYMRO-844_c1270"],"type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]}},"required":["success","commentId","statusCategoryCode"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"commentId":{"examples":["GYMRO-844_c1270"],"type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]}},"required":["success","commentId","statusCategoryCode"]}}}},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`, `ISSUE_CHANGED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`, `ISSUE_CHANGED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`, `ISSUE_CHANGED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"422":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `MESSAGE_TOO_SHORT`, `MESSAGE_TOO_LONG`, `NO_REPORTER`, `EMAIL_DISABLED`, `ATTACHMENT_REJECTED`.","examples":["MESSAGE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `MESSAGE_TOO_SHORT`, `MESSAGE_TOO_LONG`, `NO_REPORTER`, `EMAIL_DISABLED`, `ATTACHMENT_REJECTED`.","examples":["MESSAGE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `MESSAGE_TOO_SHORT`, `MESSAGE_TOO_LONG`, `NO_REPORTER`, `EMAIL_DISABLED`, `ATTACHMENT_REJECTED`.","examples":["MESSAGE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}}},"operationId":"postApiV1SupportMy-issue-reply","tags":["support"],"summary":"Reply to the customer as the logged-in franchisee","description":"Sends the reply as an e-mail to the reporter (same pipeline as an operator reply from admin) and stores it as an `email_out` comment. **Author and e-mail signature are the caller** (their organisation member when linked, otherwise the contact name), never the owner or the API-key owner. The e-mail is sent from the organisation sender address; the customer's answer returns into the ticket as usual. The status change is applied before the e-mail is rendered.\n\nChecks in this order: 403 `ISSUE_FORBIDDEN`, 422 `MESSAGE_TOO_SHORT` / `MESSAGE_TOO_LONG`, 409 `ISSUE_CLOSED`, 409 `ISSUE_CHANGED`, 422 `NO_REPORTER` / `EMAIL_DISABLED`, 429 `RATE_LIMITED` (over 30 replies per hour per caller). Nothing is sent on any error.\n\n**Access rule `ISSUE_ACCESS`** (evaluated on every call): the caller is the contact behind `identityId` in the organisation of `apiKey`. A ticket is accessible when it belongs to that organisation, is classified as not spam, and\n\n- **A (assignment):** it is assigned to the caller's contact (also confidential tickets), or\n- **B (branch):** its branch is an active branch the caller operates (`shop__branch_person` role `technician`, `manager` or `owner`), the ticket is not confidential (`securedTicket` / hidden from the branch) and it was not handed back to the head office.\n\nThere is no owner (`root`) shortcut and contact groups (`fransiza`, `trainer`, …) never grant access. An inaccessible and a non-existent `externalId` answer the same **403 `ISSUE_FORBIDDEN`**. A missing or invalid `identityId` answers **401**.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","message","targetStatus","lastCommentId"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"message":{"maxLength":20000,"description":"Plain-text reply, 10 to 8000 characters after trimming (MESSAGE_TOO_SHORT / MESSAGE_TOO_LONG).","examples":["Dobrý den, zámek jsme resetovali, už by měl fungovat."],"type":"string"},"targetStatus":{"description":"Status after the reply, mapped to the organisation default status of that category.","anyOf":[{"const":"done","type":"string"},{"const":"waiting","type":"string"}]},"lastCommentId":{"description":"`lastCommentId` from the detail the caller saw (may be null). When somebody replied meanwhile, the call answers 409 `ISSUE_CHANGED` and nothing is sent.","anyOf":[{"type":"string"},{"type":"null"}]},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attachments":{"maxItems":5,"description":"Optional files (multipart/form-data `attachments` parts). Same policy as `/contact-form`. Linked to the ticket.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional files (multipart/form-data `attachments` parts). Same policy as `/contact-form`. Linked to the ticket.","default":"Files","type":"string","format":"binary"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","message","targetStatus","lastCommentId"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"message":{"maxLength":20000,"description":"Plain-text reply, 10 to 8000 characters after trimming (MESSAGE_TOO_SHORT / MESSAGE_TOO_LONG).","examples":["Dobrý den, zámek jsme resetovali, už by měl fungovat."],"type":"string"},"targetStatus":{"description":"Status after the reply, mapped to the organisation default status of that category.","anyOf":[{"const":"done","type":"string"},{"const":"waiting","type":"string"}]},"lastCommentId":{"description":"`lastCommentId` from the detail the caller saw (may be null). When somebody replied meanwhile, the call answers 409 `ISSUE_CHANGED` and nothing is sent.","anyOf":[{"type":"string"},{"type":"null"}]},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attachments":{"maxItems":5,"description":"Optional files (multipart/form-data `attachments` parts). Same policy as `/contact-form`. Linked to the ticket.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional files (multipart/form-data `attachments` parts). Same policy as `/contact-form`. Linked to the ticket.","default":"Files","type":"string","format":"binary"}}}}},"text/plain":{"schema":{"type":"object","required":["externalId","message","targetStatus","lastCommentId"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"message":{"maxLength":20000,"description":"Plain-text reply, 10 to 8000 characters after trimming (MESSAGE_TOO_SHORT / MESSAGE_TOO_LONG).","examples":["Dobrý den, zámek jsme resetovali, už by měl fungovat."],"type":"string"},"targetStatus":{"description":"Status after the reply, mapped to the organisation default status of that category.","anyOf":[{"const":"done","type":"string"},{"const":"waiting","type":"string"}]},"lastCommentId":{"description":"`lastCommentId` from the detail the caller saw (may be null). When somebody replied meanwhile, the call answers 409 `ISSUE_CHANGED` and nothing is sent.","anyOf":[{"type":"string"},{"type":"null"}]},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"attachments":{"maxItems":5,"description":"Optional files (multipart/form-data `attachments` parts). Same policy as `/contact-form`. Linked to the ticket.","elysiaMeta":"Files","default":"Files","type":"array","items":{"maxItems":5,"description":"Optional files (multipart/form-data `attachments` parts). Same policy as `/contact-form`. Linked to the ticket.","default":"Files","type":"string","format":"binary"}}}}}}}}},"/api/v1/support/my-issue-status":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"statusCategoryCode":{"anyOf":[{"const":"done","type":"string"},{"const":"progress","type":"string"}]}},"required":["success","statusCategoryCode"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"statusCategoryCode":{"anyOf":[{"const":"done","type":"string"},{"const":"progress","type":"string"}]}},"required":["success","statusCategoryCode"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"statusCategoryCode":{"anyOf":[{"const":"done","type":"string"},{"const":"progress","type":"string"}]}},"required":["success","statusCategoryCode"]}}}},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"422":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `NOTE_TOO_SHORT`, `NOTE_TOO_LONG`.","examples":["NOTE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `NOTE_TOO_SHORT`, `NOTE_TOO_LONG`.","examples":["NOTE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `NOTE_TOO_SHORT`, `NOTE_TOO_LONG`.","examples":["NOTE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}}},"operationId":"postApiV1SupportMy-issue-status","tags":["support"],"summary":"Change ticket status without e-mailing the customer","description":"E.g. close a ticket solved by phone. Nothing is sent to the customer.\n\n**Access rule `ISSUE_ACCESS`** (evaluated on every call): the caller is the contact behind `identityId` in the organisation of `apiKey`. A ticket is accessible when it belongs to that organisation, is classified as not spam, and\n\n- **A (assignment):** it is assigned to the caller's contact (also confidential tickets), or\n- **B (branch):** its branch is an active branch the caller operates (`shop__branch_person` role `technician`, `manager` or `owner`), the ticket is not confidential (`securedTicket` / hidden from the branch) and it was not handed back to the head office.\n\nThere is no owner (`root`) shortcut and contact groups (`fransiza`, `trainer`, …) never grant access. An inaccessible and a non-existent `externalId` answer the same **403 `ISSUE_FORBIDDEN`**. A missing or invalid `identityId` answers **401**.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","status"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"status":{"anyOf":[{"const":"done","type":"string"},{"const":"progress","type":"string"}]},"note":{"maxLength":5000,"description":"Required for `done`, 3 to 2000 characters. Stored as an internal note authored by the caller.","examples":["Vyřešeno telefonicky, zámek resetován."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","status"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"status":{"anyOf":[{"const":"done","type":"string"},{"const":"progress","type":"string"}]},"note":{"maxLength":5000,"description":"Required for `done`, 3 to 2000 characters. Stored as an internal note authored by the caller.","examples":["Vyřešeno telefonicky, zámek resetován."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId","status"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"status":{"anyOf":[{"const":"done","type":"string"},{"const":"progress","type":"string"}]},"note":{"maxLength":5000,"description":"Required for `done`, 3 to 2000 characters. Stored as an internal note authored by the caller.","examples":["Vyřešeno telefonicky, zámek resetován."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/support/my-issue-handover":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}},"403":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_FORBIDDEN`.","examples":["ISSUE_FORBIDDEN"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `ISSUE_CLOSED`.","examples":["ISSUE_CLOSED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"422":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `NOTE_TOO_SHORT`, `NOTE_TOO_LONG`.","examples":["NOTE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `NOTE_TOO_SHORT`, `NOTE_TOO_LONG`.","examples":["NOTE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `NOTE_TOO_SHORT`, `NOTE_TOO_LONG`.","examples":["NOTE_TOO_SHORT"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}},"429":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"code":{"description":"One of: `RATE_LIMITED`.","examples":["RATE_LIMITED"],"type":"string"},"message":{"description":"Human-readable explanation (English).","type":"string"}},"required":["success","code","message"]}}}}},"operationId":"postApiV1SupportMy-issue-handover","tags":["support"],"summary":"Hand a ticket back to the head office","description":"After success the caller no longer sees the ticket (not in the list, detail answers 403): branch access ends for the whole branch and the caller's own assignment is cleared. The owner finds it in admin as unassigned. Nothing is sent to the customer.\n\n**Access rule `ISSUE_ACCESS`** (evaluated on every call): the caller is the contact behind `identityId` in the organisation of `apiKey`. A ticket is accessible when it belongs to that organisation, is classified as not spam, and\n\n- **A (assignment):** it is assigned to the caller's contact (also confidential tickets), or\n- **B (branch):** its branch is an active branch the caller operates (`shop__branch_person` role `technician`, `manager` or `owner`), the ticket is not confidential (`securedTicket` / hidden from the branch) and it was not handed back to the head office.\n\nThere is no owner (`root`) shortcut and contact groups (`fransiza`, `trainer`, …) never grant access. An inaccessible and a non-existent `externalId` answer the same **403 `ISSUE_FORBIDDEN`**. A missing or invalid `identityId` answers **401**.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","note"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"note":{"maxLength":5000,"description":"3 to 2000 characters. Stored as an internal note authored by the caller, prefixed with the branch name.","examples":["Zákazník chce vrátit peníze, to rozhoduje centrála."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","note"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"note":{"maxLength":5000,"description":"3 to 2000 characters. Stored as an internal note authored by the caller, prefixed with the branch name.","examples":["Zákazník chce vrátit peníze, to rozhoduje centrála."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId","note"],"properties":{"externalId":{"minLength":1,"maxLength":32,"examples":["Qr0MZ0vYnp8xMYgs"],"description":"Opaque 16-char ticket id (`externalId` from `/support/my-issue-list`).","type":"string"},"note":{"maxLength":5000,"description":"3 to 2000 characters. Stored as an internal note authored by the caller, prefixed with the branch name.","examples":["Zákazník chce vrátit peníze, to rozhoduje centrála."],"type":"string"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/support/my-reported-issue-list":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false},{"description":"Status category filter: `new`, `progress`, `waiting`, `done`. Repeat the parameter or pass a comma-separated list. Default: all.","examples":["new,progress"],"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"in":"query","name":"statusCategoryCode","required":false},{"description":"Closed (`done`) tickets are listed only when their last activity is at most this many days old. `0` = none.","schema":{"minimum":0,"maximum":365,"default":90,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":365,"default":90,"description":"Closed (`done`) tickets are listed only when their last activity is at most this many days old. `0` = none.","type":"integer"}]},"in":"query","name":"closedSinceDays","required":false},{"schema":{"minimum":1,"default":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"default":1,"type":"integer"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":100,"default":50,"type":"integer"}]},"in":"query","name":"limit","required":false},{"description":"Language of `statusLabel`. Default: the ticket language, then the organisation language.","examples":["cs"],"schema":{"type":"string","maxLength":5},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"itemCount":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","preview","statusCategoryCode","statusLabel","branchSlug","reporterDisplayName","assignedToMe","waitsForReply","lastCommentId","insertedDate","lastActivityDate"],"properties":{"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"type":"string"},"issueKey":{"examples":["GYMRO-844"],"type":"string"},"subject":{"type":"string"},"preview":{"description":"First ~220 characters of the description as plain text (no HTML, no markdown).","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"examples":["Nový"],"type":"string"},"branchSlug":{"examples":["plzen-skvrnany"],"anyOf":[{"type":"string"},{"type":"null"}]},"reporterDisplayName":{"examples":["Jana Nováková"],"type":"string"},"assignedToMe":{"description":"Accessible through rule A (assigned to the caller).","type":"boolean"},"waitsForReply":{"description":"Not `done` and the last customer-visible message (description, inbound mail, portal reply) is from the customer.","type":"boolean"},"lastCommentId":{"description":"Id of the last customer-visible comment (`ISSUEKEY_c<n>`), null when there is none. Pass it to `/my-issue-reply`.","examples":["GYMRO-844_c1267"],"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp.","type":"string"},"lastActivityDate":{"description":"ISO timestamp of the last update or customer-visible message.","type":"string"}}}}},"required":["success","itemCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"itemCount":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","preview","statusCategoryCode","statusLabel","branchSlug","reporterDisplayName","assignedToMe","waitsForReply","lastCommentId","insertedDate","lastActivityDate"],"properties":{"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"type":"string"},"issueKey":{"examples":["GYMRO-844"],"type":"string"},"subject":{"type":"string"},"preview":{"description":"First ~220 characters of the description as plain text (no HTML, no markdown).","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"examples":["Nový"],"type":"string"},"branchSlug":{"examples":["plzen-skvrnany"],"anyOf":[{"type":"string"},{"type":"null"}]},"reporterDisplayName":{"examples":["Jana Nováková"],"type":"string"},"assignedToMe":{"description":"Accessible through rule A (assigned to the caller).","type":"boolean"},"waitsForReply":{"description":"Not `done` and the last customer-visible message (description, inbound mail, portal reply) is from the customer.","type":"boolean"},"lastCommentId":{"description":"Id of the last customer-visible comment (`ISSUEKEY_c<n>`), null when there is none. Pass it to `/my-issue-reply`.","examples":["GYMRO-844_c1267"],"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp.","type":"string"},"lastActivityDate":{"description":"ISO timestamp of the last update or customer-visible message.","type":"string"}}}}},"required":["success","itemCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"itemCount":{"type":"number"},"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","preview","statusCategoryCode","statusLabel","branchSlug","reporterDisplayName","assignedToMe","waitsForReply","lastCommentId","insertedDate","lastActivityDate"],"properties":{"externalId":{"examples":["Qr0MZ0vYnp8xMYgs"],"type":"string"},"issueKey":{"examples":["GYMRO-844"],"type":"string"},"subject":{"type":"string"},"preview":{"description":"First ~220 characters of the description as plain text (no HTML, no markdown).","type":"string"},"statusCategoryCode":{"anyOf":[{"const":"new","type":"string"},{"const":"progress","type":"string"},{"const":"waiting","type":"string"},{"const":"done","type":"string"}]},"statusLabel":{"examples":["Nový"],"type":"string"},"branchSlug":{"examples":["plzen-skvrnany"],"anyOf":[{"type":"string"},{"type":"null"}]},"reporterDisplayName":{"examples":["Jana Nováková"],"type":"string"},"assignedToMe":{"description":"Accessible through rule A (assigned to the caller).","type":"boolean"},"waitsForReply":{"description":"Not `done` and the last customer-visible message (description, inbound mail, portal reply) is from the customer.","type":"boolean"},"lastCommentId":{"description":"Id of the last customer-visible comment (`ISSUEKEY_c<n>`), null when there is none. Pass it to `/my-issue-reply`.","examples":["GYMRO-844_c1267"],"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp.","type":"string"},"lastActivityDate":{"description":"ISO timestamp of the last update or customer-visible message.","type":"string"}}}}},"required":["success","itemCount","items"]}}}}},"operationId":"getApiV1SupportMy-reported-issue-list","tags":["support"],"summary":"List tickets reported by the logged-in contact","description":"Tickets where the caller (contact behind `identityId`) is the reporter, in the shape of `/support/my-issue-list` (`assignedToMe` is always false, `branchSlug` included). Spam is excluded. Use `GET /support/issue/{externalId}` for the customer-facing detail. Requires a valid `identityId` (401 otherwise)."}},"/api/v1/tracking/email-pixel":{"get":{"parameters":[{"description":"External generated message ID, for example `v2.mail::p0xvq-1736628881328-n92ql8.gymroom`.\n\nSupported prefixes:\n\n- `v1` bulk newsletter e-mail message\n- `v2` individual e-mail message","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"anyOf":[{"default":[1,2,3]},{"type":"Uint8Array"}],"content":{"application/json":{"schema":{"anyOf":[{"default":[1,2,3]},{"type":"Uint8Array"}]}},"multipart/form-data":{"schema":{"anyOf":[{"default":[1,2,3]},{"type":"Uint8Array"}]}},"text/plain":{"schema":{"anyOf":[{"default":[1,2,3]},{"type":"Uint8Array"}]}}}}},"operationId":"getApiV1TrackingEmail-pixel","tags":["tracking"],"description":"Render and return tracking pixel inside e-mail message."}},"/api/v1/tracking/log":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiV1TrackingLog","tags":["tracking"],"description":"Sentry-like logging endpoint for centralized log ingestion.\n\nAccepts log events from frontends (React/Next.js), backend services, workers and third-party systems. Each request creates a single log entry bound to the organisation, classified by severity and optionally eligible for notifications.\n\nDebouncing can be enabled to group repeated/noisy events. `useDebounce` supports a simple boolean or an advanced configuration with a custom key and a relative time window (`maxInterval`, e.g. `10m`, `1h 30m`, or minutes).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"description":"Log message payload. Intended for system/application logs coming from external services/websites. Keep it human-readable or JSON; include essential context (e.g., module, action, identifiers) to make triage easier. For structured data, serialize into the message or extend the endpoint to accept extra fields.","examples":["[checkout] Payment callback failed: missing transId (orderId=25000233)","Unhandled exception in worker: TypeError: Cannot read properties of undefined (jobId=abcd1234)"],"type":"string"},"code":{"maxLength":64,"description":"Application-defined log code (short slug). Groups related events for anomaly detection and links to `docs.bizkithub.com/system-codes/<code>`. Defaults to `API_TRK` when omitted.","examples":["DNS_SCHED_F","UPT_SCHED_F","CRN_JOB_FAIL"],"type":"string"},"component":{"maxLength":32,"description":"Sub-system that produced the log. Used for dashboard grouping. Free-form short slug — typical values: `common`, `cron`, `dns`, `geoIp`, `crawler`, `abuseIp`, `uptime`, `robotsTxt`.","examples":["cron","dns"],"type":"string"},"subject":{"maxLength":200,"description":"One-line summary used as the subject of any notification email dispatched for this log entry.","examples":["DNS sync-state write failed for domain 42 (example.com)"],"type":"string"},"level":{"enum":["info","success","error","warning","critical"],"description":"Severity level of the log entry. Used for filtering, alerting and retention rules.\n\n- `info` = diagnostic signal\n- `success` = positive milestone\n- `warning` = potential issue\n- `error` = failure that impacted a request/job\n- `critical` = high priority incident requiring immediate attention.\n\nIf omitted, the backend should treat it as a default level (commonly `info`).","examples":["error","warning"],"type":"string"},"sendNotification":{"description":"When `true`, the log entry is eligible to trigger notifications (e.g., email/Slack/push) according to organisation settings. Use sparingly for actionable events (typically `error`/`critical`). If omitted, the system decides based on `level` and notification rules.","examples":[true,false],"type":"boolean"},"useDebounce":{"anyOf":[{"description":"Advanced debounce configuration. `maxInterval` defines maximum grouping window for duplicates (if omitted, backend uses a default interval).","type":"object","required":["enabled","maxInterval"],"properties":{"enabled":{"description":"Enable/disable debouncing for this event. If omitted, the backend treats it as enabled.","examples":[true],"type":"boolean"},"key":{"description":"Optional custom debounce key. When provided, logs sharing the same key will be grouped together (useful for dynamic messages).","examples":["stripe-webhook-timeout","db-connection-failed"],"type":"string"},"maxInterval":{"anyOf":[{"examples":["3w 4d 12h","10m","0.5h","2.5","3,1"],"description":"Relative time interval expressed as a string.\n\nSupported units and conversion (`REAL_TIME_CHAR_TO_MINUTES`):\n\n| Unit | Name   | Minutes | Notes |\n|------|--------|---------|-------|\n| `m`  | minute | `1`     | |\n| `h`  | hour   | `60`    | |\n| `d`  | day    | `1440`  | 24h |\n| `w`  | week   | `10080` | 7d |\n| `y`  | year   | `525600`| 365d |\n\nRules:\n- Units are case-insensitive and can be combined: `3w 4d 12h`.\n- Decimal values are allowed: `0.5h`, `2.5d`.\n- Spaces and unit variants are tolerated: `10m`, `10 min`, `10 minutes`.\n- Numeric value without a unit is interpreted as **hours**.\n\nRounding:\n- Result is returned in minutes and rounded **up** (`Math.ceil`).\n\nInvalid or empty input returns `0`.","type":"string"},{"examples":[30,60,150,1440],"description":"Relative time interval expressed as a number of minutes.\n\nRules:\n- Value is taken directly as minutes (e.g. `30` = 30 minutes).\n- No unit parsing or conversion is applied.","type":"number"}]}}},{"description":"Simple debounce toggle. When `true`, repeated logs may be deduplicated/grouped within a backend-defined window. When `false`, debouncing is disabled and every event is stored.","examples":[true,false],"type":"boolean"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["message"],"properties":{"message":{"description":"Log message payload. Intended for system/application logs coming from external services/websites. Keep it human-readable or JSON; include essential context (e.g., module, action, identifiers) to make triage easier. For structured data, serialize into the message or extend the endpoint to accept extra fields.","examples":["[checkout] Payment callback failed: missing transId (orderId=25000233)","Unhandled exception in worker: TypeError: Cannot read properties of undefined (jobId=abcd1234)"],"type":"string"},"code":{"maxLength":64,"description":"Application-defined log code (short slug). Groups related events for anomaly detection and links to `docs.bizkithub.com/system-codes/<code>`. Defaults to `API_TRK` when omitted.","examples":["DNS_SCHED_F","UPT_SCHED_F","CRN_JOB_FAIL"],"type":"string"},"component":{"maxLength":32,"description":"Sub-system that produced the log. Used for dashboard grouping. Free-form short slug — typical values: `common`, `cron`, `dns`, `geoIp`, `crawler`, `abuseIp`, `uptime`, `robotsTxt`.","examples":["cron","dns"],"type":"string"},"subject":{"maxLength":200,"description":"One-line summary used as the subject of any notification email dispatched for this log entry.","examples":["DNS sync-state write failed for domain 42 (example.com)"],"type":"string"},"level":{"enum":["info","success","error","warning","critical"],"description":"Severity level of the log entry. Used for filtering, alerting and retention rules.\n\n- `info` = diagnostic signal\n- `success` = positive milestone\n- `warning` = potential issue\n- `error` = failure that impacted a request/job\n- `critical` = high priority incident requiring immediate attention.\n\nIf omitted, the backend should treat it as a default level (commonly `info`).","examples":["error","warning"],"type":"string"},"sendNotification":{"description":"When `true`, the log entry is eligible to trigger notifications (e.g., email/Slack/push) according to organisation settings. Use sparingly for actionable events (typically `error`/`critical`). If omitted, the system decides based on `level` and notification rules.","examples":[true,false],"type":"boolean"},"useDebounce":{"anyOf":[{"description":"Advanced debounce configuration. `maxInterval` defines maximum grouping window for duplicates (if omitted, backend uses a default interval).","type":"object","required":["enabled","maxInterval"],"properties":{"enabled":{"description":"Enable/disable debouncing for this event. If omitted, the backend treats it as enabled.","examples":[true],"type":"boolean"},"key":{"description":"Optional custom debounce key. When provided, logs sharing the same key will be grouped together (useful for dynamic messages).","examples":["stripe-webhook-timeout","db-connection-failed"],"type":"string"},"maxInterval":{"anyOf":[{"examples":["3w 4d 12h","10m","0.5h","2.5","3,1"],"description":"Relative time interval expressed as a string.\n\nSupported units and conversion (`REAL_TIME_CHAR_TO_MINUTES`):\n\n| Unit | Name   | Minutes | Notes |\n|------|--------|---------|-------|\n| `m`  | minute | `1`     | |\n| `h`  | hour   | `60`    | |\n| `d`  | day    | `1440`  | 24h |\n| `w`  | week   | `10080` | 7d |\n| `y`  | year   | `525600`| 365d |\n\nRules:\n- Units are case-insensitive and can be combined: `3w 4d 12h`.\n- Decimal values are allowed: `0.5h`, `2.5d`.\n- Spaces and unit variants are tolerated: `10m`, `10 min`, `10 minutes`.\n- Numeric value without a unit is interpreted as **hours**.\n\nRounding:\n- Result is returned in minutes and rounded **up** (`Math.ceil`).\n\nInvalid or empty input returns `0`.","type":"string"},{"examples":[30,60,150,1440],"description":"Relative time interval expressed as a number of minutes.\n\nRules:\n- Value is taken directly as minutes (e.g. `30` = 30 minutes).\n- No unit parsing or conversion is applied.","type":"number"}]}}},{"description":"Simple debounce toggle. When `true`, repeated logs may be deduplicated/grouped within a backend-defined window. When `false`, debouncing is disabled and every event is stored.","examples":[true,false],"type":"boolean"}]}}}},"text/plain":{"schema":{"type":"object","required":["message"],"properties":{"message":{"description":"Log message payload. Intended for system/application logs coming from external services/websites. Keep it human-readable or JSON; include essential context (e.g., module, action, identifiers) to make triage easier. For structured data, serialize into the message or extend the endpoint to accept extra fields.","examples":["[checkout] Payment callback failed: missing transId (orderId=25000233)","Unhandled exception in worker: TypeError: Cannot read properties of undefined (jobId=abcd1234)"],"type":"string"},"code":{"maxLength":64,"description":"Application-defined log code (short slug). Groups related events for anomaly detection and links to `docs.bizkithub.com/system-codes/<code>`. Defaults to `API_TRK` when omitted.","examples":["DNS_SCHED_F","UPT_SCHED_F","CRN_JOB_FAIL"],"type":"string"},"component":{"maxLength":32,"description":"Sub-system that produced the log. Used for dashboard grouping. Free-form short slug — typical values: `common`, `cron`, `dns`, `geoIp`, `crawler`, `abuseIp`, `uptime`, `robotsTxt`.","examples":["cron","dns"],"type":"string"},"subject":{"maxLength":200,"description":"One-line summary used as the subject of any notification email dispatched for this log entry.","examples":["DNS sync-state write failed for domain 42 (example.com)"],"type":"string"},"level":{"enum":["info","success","error","warning","critical"],"description":"Severity level of the log entry. Used for filtering, alerting and retention rules.\n\n- `info` = diagnostic signal\n- `success` = positive milestone\n- `warning` = potential issue\n- `error` = failure that impacted a request/job\n- `critical` = high priority incident requiring immediate attention.\n\nIf omitted, the backend should treat it as a default level (commonly `info`).","examples":["error","warning"],"type":"string"},"sendNotification":{"description":"When `true`, the log entry is eligible to trigger notifications (e.g., email/Slack/push) according to organisation settings. Use sparingly for actionable events (typically `error`/`critical`). If omitted, the system decides based on `level` and notification rules.","examples":[true,false],"type":"boolean"},"useDebounce":{"anyOf":[{"description":"Advanced debounce configuration. `maxInterval` defines maximum grouping window for duplicates (if omitted, backend uses a default interval).","type":"object","required":["enabled","maxInterval"],"properties":{"enabled":{"description":"Enable/disable debouncing for this event. If omitted, the backend treats it as enabled.","examples":[true],"type":"boolean"},"key":{"description":"Optional custom debounce key. When provided, logs sharing the same key will be grouped together (useful for dynamic messages).","examples":["stripe-webhook-timeout","db-connection-failed"],"type":"string"},"maxInterval":{"anyOf":[{"examples":["3w 4d 12h","10m","0.5h","2.5","3,1"],"description":"Relative time interval expressed as a string.\n\nSupported units and conversion (`REAL_TIME_CHAR_TO_MINUTES`):\n\n| Unit | Name   | Minutes | Notes |\n|------|--------|---------|-------|\n| `m`  | minute | `1`     | |\n| `h`  | hour   | `60`    | |\n| `d`  | day    | `1440`  | 24h |\n| `w`  | week   | `10080` | 7d |\n| `y`  | year   | `525600`| 365d |\n\nRules:\n- Units are case-insensitive and can be combined: `3w 4d 12h`.\n- Decimal values are allowed: `0.5h`, `2.5d`.\n- Spaces and unit variants are tolerated: `10m`, `10 min`, `10 minutes`.\n- Numeric value without a unit is interpreted as **hours**.\n\nRounding:\n- Result is returned in minutes and rounded **up** (`Math.ceil`).\n\nInvalid or empty input returns `0`.","type":"string"},{"examples":[30,60,150,1440],"description":"Relative time interval expressed as a number of minutes.\n\nRules:\n- Value is taken directly as minutes (e.g. `30` = 30 minutes).\n- No unit parsing or conversion is applied.","type":"number"}]}}},{"description":"Simple debounce toggle. When `true`, repeated logs may be deduplicated/grouped within a backend-defined window. When `false`, debouncing is disabled and every event is stored.","examples":[true,false],"type":"boolean"}]}}}}}}}},"/api/v1/vendor/create-organisation":{"post":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["success","organisationId","organisationSlug","founderMemberId","founderEmail","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"organisationId":{"description":"Internal id of the newly created organisation. Use this to correlate on the vendor side.","type":"number"},"organisationSlug":{"description":"URL slug of the new organisation. Use with POST /vendor/switch to enter it as a member.","examples":["acme-shop"],"type":"string"},"founderMemberId":{"description":"cas__organisation_member.id of the founder (root member) inside the new organisation.","type":"number"},"founderEmail":{"description":"Normalised e-mail address stored for the founder account (may differ in casing from input).","type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["NOT_LICENSED","EMAIL_ALREADY_TAKEN","WEAK_PASSWORD","HIGH_RISK"],"type":"string"},"message":{"examples":["Calling organisation does not hold an active white-label licence. Contact BizKitHub to request one.","A BizKitHub user account already exists for this e-mail. The founder must use a fresh address.","Password does not meet the minimum strength requirements.","Request temporarily unavailable from this network. Try again later or contact support."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","organisationId","organisationSlug","founderMemberId","founderEmail","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"organisationId":{"description":"Internal id of the newly created organisation. Use this to correlate on the vendor side.","type":"number"},"organisationSlug":{"description":"URL slug of the new organisation. Use with POST /vendor/switch to enter it as a member.","examples":["acme-shop"],"type":"string"},"founderMemberId":{"description":"cas__organisation_member.id of the founder (root member) inside the new organisation.","type":"number"},"founderEmail":{"description":"Normalised e-mail address stored for the founder account (may differ in casing from input).","type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["NOT_LICENSED","EMAIL_ALREADY_TAKEN","WEAK_PASSWORD","HIGH_RISK"],"type":"string"},"message":{"examples":["Calling organisation does not hold an active white-label licence. Contact BizKitHub to request one.","A BizKitHub user account already exists for this e-mail. The founder must use a fresh address.","Password does not meet the minimum strength requirements.","Request temporarily unavailable from this network. Try again later or contact support."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","organisationId","organisationSlug","founderMemberId","founderEmail","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"organisationId":{"description":"Internal id of the newly created organisation. Use this to correlate on the vendor side.","type":"number"},"organisationSlug":{"description":"URL slug of the new organisation. Use with POST /vendor/switch to enter it as a member.","examples":["acme-shop"],"type":"string"},"founderMemberId":{"description":"cas__organisation_member.id of the founder (root member) inside the new organisation.","type":"number"},"founderEmail":{"description":"Normalised e-mail address stored for the founder account (may differ in casing from input).","type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["NOT_LICENSED","EMAIL_ALREADY_TAKEN","WEAK_PASSWORD","HIGH_RISK"],"type":"string"},"message":{"examples":["Calling organisation does not hold an active white-label licence. Contact BizKitHub to request one.","A BizKitHub user account already exists for this e-mail. The founder must use a fresh address.","Password does not meet the minimum strength requirements.","Request temporarily unavailable from this network. Try again later or contact support."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","organisationId","organisationSlug","founderMemberId","founderEmail","riskScore"],"properties":{"success":{"const":true,"type":"boolean"},"organisationId":{"description":"Internal id of the newly created organisation. Use this to correlate on the vendor side.","type":"number"},"organisationSlug":{"description":"URL slug of the new organisation. Use with POST /vendor/switch to enter it as a member.","examples":["acme-shop"],"type":"string"},"founderMemberId":{"description":"cas__organisation_member.id of the founder (root member) inside the new organisation.","type":"number"},"founderEmail":{"description":"Normalised e-mail address stored for the founder account (may differ in casing from input).","type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}},{"type":"object","required":["success","errorCode","message","riskScore"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["NOT_LICENSED","EMAIL_ALREADY_TAKEN","WEAK_PASSWORD","HIGH_RISK"],"type":"string"},"message":{"examples":["Calling organisation does not hold an active white-label licence. Contact BizKitHub to request one.","A BizKitHub user account already exists for this e-mail. The founder must use a fresh address.","Password does not meet the minimum strength requirements.","Request temporarily unavailable from this network. Try again later or contact support."],"type":"string"},"riskScore":{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"examples":[0,25,60,100],"description":"Server-computed risk score for the current request, on an integer scale **0 – 100** (`RISK_SCORE_MIN` / `RISK_SCORE_MAX` in `features/security/riskScore/clampScore.ts`).\n\n**Direction:** *higher = riskier*. `0` is a clean, fully trusted signal; `100` is a hard-block-worthy signal (TOR exit node, active abuse-IP feed hit, login-flood threshold breached, or the caller organisation has explicitly banned the visitor IP).\n\n**Recommended integration buckets** for the calling application — these are guidance, not a contract, callers are free to pick their own thresholds:\n\n| Bucket | Range | What it means | Suggested action |\n|--------|-------|---------------|------------------|\n| `trusted`   |   0 – 19 | Green — known device / prior success / same-country / EU IP for an EU org. | Proceed silently. |\n| `neutral`   |  20 – 49 | No strong signal either way (fresh IP, unknown device, no history). | Proceed, log the score, optionally show a soft \"verify e-mail\" nudge. |\n| `suspicious`|  50 – 74 | Multiple soft red flags stacked (foreign origin for an EU org, new IP, other-org ban, …). | Require a second factor before granting sensitive actions (MFA, magic-link re-verification, CAPTCHA, ID verification). |\n| `hostile`   | 75 – 100 | Hard-block territory. Above 75 the internal `enforceLoginRiskScore` throws `LoginRiskScoreRejectionError`; 100 is reached only via a hard-block signal (TOR / active abuse-IP / own-org ban / login flood). | Reject the follow-up action, force password reset / step-up auth. |\n\n**How it is computed:** the score is a weighted average of independent signal families (IP reputation, org-country match, EU/high-risk-country policy, per-user history), clamped to `[0, 100]`. Any single family may return `hardBlock(...)` to short-circuit the average to `100`. Green signals (prior successful login from this IP, paid orders, active session, mobile carrier) subtract from the total; red signals (new IP, other-org ban, foreign continent for an EU org) add to it. Full rule table lives in `features/security/riskScore/calculateIpRiskScore.ts`.\n\n**Stability:** the numeric value is a heuristic — the exact algorithm may evolve between releases as new signals are added. The **scale, direction and the four bucket boundaries above are stable**; integrate against buckets, not exact numbers.\n\n**Order-create note:** the endpoint currently returns the best-case score (`0`) for order creation as a placeholder — the order-side risk model is being built out separately (device fingerprint, cart velocity, geo/billing mismatch, chargeback history). The field is exposed already so downstream integrations can wire their step-up logic once and pick up richer values automatically when the order-side model ships.","type":"integer"}]}}}]}}}}},"operationId":"postApiV1VendorCreate-organisation","tags":["vendor"],"summary":"Spawn a managed organisation as a white-label vendor","description":"Creates a new BizKitHub organisation on behalf of a white-label partner. The new org's `parent_id` is set to the caller (the vendor), so it appears in the vendor's `/vendor/managed-organisations` list and the customer-side \"Můj technický správce\" widget points back to the vendor. The founder is provisioned as a fresh `cas__user` + `shop__contact` in the same call and becomes the root member of the new org.\n\n**Licence gate:** the calling organisation MUST hold an active row in `cas__white_label_licence` (see `hasWhiteLabelLicence`). Calls from non-licensed orgs are rejected with `NOT_LICENSED` — this is what prevents random API keys from spawning parented orgs.\n\n**Welcome e-mail:** the platform welcome (`organisation-register` template) is always sent from `INTERNAL_ORGANISATION_ID` (BizKitHub sender), NOT from the vendor. If you want to send your own branded welcome on top, do it from your own transactional sender after the call succeeds.\n\n**Idempotency:** the endpoint is NOT idempotent. Retrying a successful call will attempt to create a second organisation and fail with `EMAIL_ALREADY_TAKEN` on the founder step. Persist the returned `organisationId` on the vendor side before retrying.\n\nList of error codes:\n\n| Code | Message |\n|------|---------|\n| NOT_LICENSED | Calling organisation does not hold an active white-label licence. Contact BizKitHub to request one. |\n| EMAIL_ALREADY_TAKEN | A BizKitHub user account already exists for this e-mail. The founder must use a fresh address. |\n| WEAK_PASSWORD | Password does not meet the minimum strength requirements. |\n| HIGH_RISK | Request temporarily unavailable from this network. Try again later or contact support. |","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationName","email","password","firstName","lastName"],"properties":{"organisationName":{"minLength":1,"maxLength":128,"description":"Display name of the new organisation the vendor is spawning. Must be unique across the platform; if the exact name is already taken, a numeric suffix is appended automatically (e.g. \"Acme\" → \"Acme 2\").","examples":["Acme Shop"],"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.\n\n**Vendor spawn:** address of the customer who will become the founder + root member of the new organisation. Must NOT already resolve to an existing `cas__user` — reuse of an existing account is rejected with `EMAIL_ALREADY_TAKEN` (the customer would have two root accounts otherwise). If your customer already has a BizKitHub account, invite them as a member of an existing org instead of spawning a new one.","type":"string"},"password":{"minLength":8,"description":"Founder password (min 8 chars, standard strength check). Collect it from the vendor form; BizKitHub never emails the plaintext back. If you prefer a \"reset link\" flow, send any placeholder here and immediately call POST /api/v1/customer/request-reset-password for the same e-mail to issue a token the customer can use to set their real password.","type":"string"},"firstName":{"minLength":1,"maxLength":128,"description":"Founder first name — becomes the contact's first name in the new org.","type":"string"},"lastName":{"minLength":1,"maxLength":128,"description":"Founder last name — becomes the contact's last name in the new org.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.\n\nDefaults to `cs` when omitted. Drives the primary locale of the new org, the founder's UI language, and the language of the platform welcome e-mail.","type":"string"},"timezone":{"description":"IANA timezone identifier for the new org (e.g. `Europe/Prague`). When omitted, resolved from the request IP's geo record.","examples":["Europe/Prague"],"type":"string"},"countryId":{"description":"HQ country FK (core__country.id, from GET /organisation/available-countries). When omitted, resolved via geo lookup with Czech Republic (id=158) as ultimate fallback.","examples":[158],"type":"number"},"description":{"maxLength":512,"description":"Optional short description of the new organisation.","type":"string"},"companyRegistrationNumber":{"description":"Optional company registration number (IČO in CZ). When provided, an ARES lookup is attempted to pre-fill legal name, address, and tax data.","type":"string"},"taxIdentificationNumber":{"description":"Optional VAT / tax identification number (DIČ in CZ).","type":"string"},"checkboxTerms":{"description":"Whether the founder has agreed to BizKitHub's terms and conditions. The vendor is responsible for collecting this consent from the end customer before calling the API.","default":false,"type":"boolean"},"checkboxMarketing":{"description":"Whether the founder has opted in to marketing communication.","default":true,"type":"boolean"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationName","email","password","firstName","lastName"],"properties":{"organisationName":{"minLength":1,"maxLength":128,"description":"Display name of the new organisation the vendor is spawning. Must be unique across the platform; if the exact name is already taken, a numeric suffix is appended automatically (e.g. \"Acme\" → \"Acme 2\").","examples":["Acme Shop"],"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.\n\n**Vendor spawn:** address of the customer who will become the founder + root member of the new organisation. Must NOT already resolve to an existing `cas__user` — reuse of an existing account is rejected with `EMAIL_ALREADY_TAKEN` (the customer would have two root accounts otherwise). If your customer already has a BizKitHub account, invite them as a member of an existing org instead of spawning a new one.","type":"string"},"password":{"minLength":8,"description":"Founder password (min 8 chars, standard strength check). Collect it from the vendor form; BizKitHub never emails the plaintext back. If you prefer a \"reset link\" flow, send any placeholder here and immediately call POST /api/v1/customer/request-reset-password for the same e-mail to issue a token the customer can use to set their real password.","type":"string"},"firstName":{"minLength":1,"maxLength":128,"description":"Founder first name — becomes the contact's first name in the new org.","type":"string"},"lastName":{"minLength":1,"maxLength":128,"description":"Founder last name — becomes the contact's last name in the new org.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.\n\nDefaults to `cs` when omitted. Drives the primary locale of the new org, the founder's UI language, and the language of the platform welcome e-mail.","type":"string"},"timezone":{"description":"IANA timezone identifier for the new org (e.g. `Europe/Prague`). When omitted, resolved from the request IP's geo record.","examples":["Europe/Prague"],"type":"string"},"countryId":{"description":"HQ country FK (core__country.id, from GET /organisation/available-countries). When omitted, resolved via geo lookup with Czech Republic (id=158) as ultimate fallback.","examples":[158],"type":"number"},"description":{"maxLength":512,"description":"Optional short description of the new organisation.","type":"string"},"companyRegistrationNumber":{"description":"Optional company registration number (IČO in CZ). When provided, an ARES lookup is attempted to pre-fill legal name, address, and tax data.","type":"string"},"taxIdentificationNumber":{"description":"Optional VAT / tax identification number (DIČ in CZ).","type":"string"},"checkboxTerms":{"description":"Whether the founder has agreed to BizKitHub's terms and conditions. The vendor is responsible for collecting this consent from the end customer before calling the API.","default":false,"type":"boolean"},"checkboxMarketing":{"description":"Whether the founder has opted in to marketing communication.","default":true,"type":"boolean"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationName","email","password","firstName","lastName"],"properties":{"organisationName":{"minLength":1,"maxLength":128,"description":"Display name of the new organisation the vendor is spawning. Must be unique across the platform; if the exact name is already taken, a numeric suffix is appended automatically (e.g. \"Acme\" → \"Acme 2\").","examples":["Acme Shop"],"type":"string"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.\n\n**Vendor spawn:** address of the customer who will become the founder + root member of the new organisation. Must NOT already resolve to an existing `cas__user` — reuse of an existing account is rejected with `EMAIL_ALREADY_TAKEN` (the customer would have two root accounts otherwise). If your customer already has a BizKitHub account, invite them as a member of an existing org instead of spawning a new one.","type":"string"},"password":{"minLength":8,"description":"Founder password (min 8 chars, standard strength check). Collect it from the vendor form; BizKitHub never emails the plaintext back. If you prefer a \"reset link\" flow, send any placeholder here and immediately call POST /api/v1/customer/request-reset-password for the same e-mail to issue a token the customer can use to set their real password.","type":"string"},"firstName":{"minLength":1,"maxLength":128,"description":"Founder first name — becomes the contact's first name in the new org.","type":"string"},"lastName":{"minLength":1,"maxLength":128,"description":"Founder last name — becomes the contact's last name in the new org.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.\n\nDefaults to `cs` when omitted. Drives the primary locale of the new org, the founder's UI language, and the language of the platform welcome e-mail.","type":"string"},"timezone":{"description":"IANA timezone identifier for the new org (e.g. `Europe/Prague`). When omitted, resolved from the request IP's geo record.","examples":["Europe/Prague"],"type":"string"},"countryId":{"description":"HQ country FK (core__country.id, from GET /organisation/available-countries). When omitted, resolved via geo lookup with Czech Republic (id=158) as ultimate fallback.","examples":[158],"type":"number"},"description":{"maxLength":512,"description":"Optional short description of the new organisation.","type":"string"},"companyRegistrationNumber":{"description":"Optional company registration number (IČO in CZ). When provided, an ARES lookup is attempted to pre-fill legal name, address, and tax data.","type":"string"},"taxIdentificationNumber":{"description":"Optional VAT / tax identification number (DIČ in CZ).","type":"string"},"checkboxTerms":{"description":"Whether the founder has agreed to BizKitHub's terms and conditions. The vendor is responsible for collecting this consent from the end customer before calling the API.","default":false,"type":"boolean"},"checkboxMarketing":{"description":"Whether the founder has opted in to marketing communication.","default":true,"type":"boolean"},"customerRealIp":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"}}}}}}}},"/api/v1/vikitron/dns-records-checker":{"get":{"parameters":[{"description":"Domain name to check.","examples":["example.com"],"schema":{"type":"string"},"in":"query","name":"domain","required":true},{"description":"Set to \"true\" to bypass the cache and trigger a fresh fetch.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"force","required":false}],"responses":{"200":{"description":"DNS records for the domain.","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"description":"List of DNS records.","type":"array","items":{"type":"object","required":["name","type","value","createdAt","updatedAt","active"],"properties":{"name":{"description":"DNS record name (hostname).","examples":["example.com"],"type":"string"},"type":{"description":"DNS record type.","examples":["A","AAAA","MX","CNAME","TXT"],"type":"string"},"value":{"description":"DNS record value.","type":"string"},"hostname":{"description":"Resolved hostname.","type":"string"},"priority":{"description":"Record priority (relevant for MX records).","type":"number"},"ttl":{"description":"Time-to-live in seconds.","type":"number"},"createdAt":{"description":"When the record was first seen.","anyOf":[{"description":"When the record was first seen.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"description":"When the record was last refreshed.","anyOf":[{"description":"When the record was last refreshed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the record is currently active.","type":"boolean"}}}},"checkedAt":{"description":"When the DNS of this domain was last checked (ISO 8601, UTC).","type":"string"}},"required":["records"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"records":{"description":"List of DNS records.","type":"array","items":{"type":"object","required":["name","type","value","createdAt","updatedAt","active"],"properties":{"name":{"description":"DNS record name (hostname).","examples":["example.com"],"type":"string"},"type":{"description":"DNS record type.","examples":["A","AAAA","MX","CNAME","TXT"],"type":"string"},"value":{"description":"DNS record value.","type":"string"},"hostname":{"description":"Resolved hostname.","type":"string"},"priority":{"description":"Record priority (relevant for MX records).","type":"number"},"ttl":{"description":"Time-to-live in seconds.","type":"number"},"createdAt":{"description":"When the record was first seen.","anyOf":[{"description":"When the record was first seen.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"description":"When the record was last refreshed.","anyOf":[{"description":"When the record was last refreshed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the record is currently active.","type":"boolean"}}}},"checkedAt":{"description":"When the DNS of this domain was last checked (ISO 8601, UTC).","type":"string"}},"required":["records"]}},"text/plain":{"schema":{"type":"object","properties":{"records":{"description":"List of DNS records.","type":"array","items":{"type":"object","required":["name","type","value","createdAt","updatedAt","active"],"properties":{"name":{"description":"DNS record name (hostname).","examples":["example.com"],"type":"string"},"type":{"description":"DNS record type.","examples":["A","AAAA","MX","CNAME","TXT"],"type":"string"},"value":{"description":"DNS record value.","type":"string"},"hostname":{"description":"Resolved hostname.","type":"string"},"priority":{"description":"Record priority (relevant for MX records).","type":"number"},"ttl":{"description":"Time-to-live in seconds.","type":"number"},"createdAt":{"description":"When the record was first seen.","anyOf":[{"description":"When the record was first seen.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"description":"When the record was last refreshed.","anyOf":[{"description":"When the record was last refreshed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the record is currently active.","type":"boolean"}}}},"checkedAt":{"description":"When the DNS of this domain was last checked (ISO 8601, UTC).","type":"string"}},"required":["records"]}}}}},"operationId":"getApiV1VikitronDns-records-checker","tags":["vikitron"],"summary":"Check DNS records for a domain","description":"Returns the last known DNS records for the given domain. Cached responses (5 min fresh + 1 h SWR) are served without an outbound DNS lookup; the response reflects whatever scout has most recently persisted. If no records exist yet, or ?force=true is passed and the domain was not checked in the last 15 minutes, a fresh DNS lookup runs before returning (uncached)."}},"/api/v1/vikitron/dns-records-recrawl":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"description":"`queued`: the lookup started. `throttled`: the domain was checked too recently.","anyOf":[{"const":"queued","type":"string"},{"const":"throttled","type":"string"}]},"domain":{"description":"Normalized domain.","type":"string"},"claimedAt":{"description":"When the recrawl was accepted (ISO 8601, UTC).","type":"string"},"checkedAt":{"description":"Last DNS check of the domain (ISO 8601, UTC).","type":"string"},"nextAllowedAt":{"description":"Earliest time of the next recrawl (ISO 8601, UTC).","type":"string"}},"required":["state","domain"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"description":"`queued`: the lookup started. `throttled`: the domain was checked too recently.","anyOf":[{"const":"queued","type":"string"},{"const":"throttled","type":"string"}]},"domain":{"description":"Normalized domain.","type":"string"},"claimedAt":{"description":"When the recrawl was accepted (ISO 8601, UTC).","type":"string"},"checkedAt":{"description":"Last DNS check of the domain (ISO 8601, UTC).","type":"string"},"nextAllowedAt":{"description":"Earliest time of the next recrawl (ISO 8601, UTC).","type":"string"}},"required":["state","domain"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"description":"`queued`: the lookup started. `throttled`: the domain was checked too recently.","anyOf":[{"const":"queued","type":"string"},{"const":"throttled","type":"string"}]},"domain":{"description":"Normalized domain.","type":"string"},"claimedAt":{"description":"When the recrawl was accepted (ISO 8601, UTC).","type":"string"},"checkedAt":{"description":"Last DNS check of the domain (ISO 8601, UTC).","type":"string"},"nextAllowedAt":{"description":"Earliest time of the next recrawl (ISO 8601, UTC).","type":"string"}},"required":["state","domain"]}}}}},"operationId":"postApiV1VikitronDns-records-recrawl","tags":["vikitron"],"summary":"Request a DNS recrawl of a domain","description":"Queues a fresh DNS lookup of the domain. Allowed at most once per 15 minutes per domain, counted from the last DNS check (including scheduled crawls). Poll GET /dns-records-checker until `checkedAt` is later than `claimedAt` to read the result.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain to recrawl.","examples":["example.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain to recrawl.","examples":["example.com"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain to recrawl.","examples":["example.com"],"type":"string"}}}}}}}},"/api/v1/vikitron/dns-explorer":{"get":{"parameters":[{"description":"Search query to find DNS records across all indexed domains.","examples":["mx google"],"schema":{"type":"string"},"in":"query","name":"query","required":true}],"responses":{"200":{"description":"Search results.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Matching DNS records.","type":"array","items":{"type":"object","required":["name","type","value","createdAt","updatedAt","active"],"properties":{"name":{"description":"DNS record name (hostname).","examples":["example.com"],"type":"string"},"type":{"description":"DNS record type.","examples":["A","AAAA","MX","CNAME","TXT"],"type":"string"},"value":{"description":"DNS record value.","type":"string"},"hostname":{"description":"Resolved hostname.","type":"string"},"priority":{"description":"Record priority (relevant for MX records).","type":"number"},"ttl":{"description":"Time-to-live in seconds.","type":"number"},"createdAt":{"description":"When the record was first seen.","anyOf":[{"description":"When the record was first seen.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"description":"When the record was last refreshed.","anyOf":[{"description":"When the record was last refreshed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the record is currently active.","type":"boolean"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Matching DNS records.","type":"array","items":{"type":"object","required":["name","type","value","createdAt","updatedAt","active"],"properties":{"name":{"description":"DNS record name (hostname).","examples":["example.com"],"type":"string"},"type":{"description":"DNS record type.","examples":["A","AAAA","MX","CNAME","TXT"],"type":"string"},"value":{"description":"DNS record value.","type":"string"},"hostname":{"description":"Resolved hostname.","type":"string"},"priority":{"description":"Record priority (relevant for MX records).","type":"number"},"ttl":{"description":"Time-to-live in seconds.","type":"number"},"createdAt":{"description":"When the record was first seen.","anyOf":[{"description":"When the record was first seen.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"description":"When the record was last refreshed.","anyOf":[{"description":"When the record was last refreshed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the record is currently active.","type":"boolean"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Matching DNS records.","type":"array","items":{"type":"object","required":["name","type","value","createdAt","updatedAt","active"],"properties":{"name":{"description":"DNS record name (hostname).","examples":["example.com"],"type":"string"},"type":{"description":"DNS record type.","examples":["A","AAAA","MX","CNAME","TXT"],"type":"string"},"value":{"description":"DNS record value.","type":"string"},"hostname":{"description":"Resolved hostname.","type":"string"},"priority":{"description":"Record priority (relevant for MX records).","type":"number"},"ttl":{"description":"Time-to-live in seconds.","type":"number"},"createdAt":{"description":"When the record was first seen.","anyOf":[{"description":"When the record was first seen.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedAt":{"description":"When the record was last refreshed.","anyOf":[{"description":"When the record was last refreshed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the record is currently active.","type":"boolean"}}}}},"required":["items"]}}}}},"operationId":"getApiV1VikitronDns-explorer","tags":["vikitron"],"summary":"Search DNS records","description":"Full-text search across all indexed DNS records. Useful for finding domains with specific record values."}},"/api/v1/vikitron/robots-txt-checker":{"get":{"parameters":[{"description":"Domain name to check.","examples":["example.com"],"schema":{"type":"string"},"in":"query","name":"domain","required":true},{"description":"Set to \"true\" to bypass the cache and trigger a fresh fetch.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"force","required":false}],"responses":{"200":{"description":"Robots.txt version history.","content":{"application/json":{"schema":{"type":"object","properties":{"records":{"description":"Version history of robots.txt snapshots (newest first).","type":"array","items":{"type":"object","required":["id","content","httpCode","firstSeen","updatedDate"],"properties":{"id":{"description":"Hashed version identifier.","type":"string"},"content":{"description":"Raw robots.txt content.","type":"string"},"httpCode":{"description":"HTTP status code when fetching robots.txt.","examples":[200,404],"type":"number"},"firstSeen":{"description":"When this version was first observed.","anyOf":[{"description":"When this version was first observed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When this version was last confirmed.","anyOf":[{"description":"When this version was last confirmed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["records"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"records":{"description":"Version history of robots.txt snapshots (newest first).","type":"array","items":{"type":"object","required":["id","content","httpCode","firstSeen","updatedDate"],"properties":{"id":{"description":"Hashed version identifier.","type":"string"},"content":{"description":"Raw robots.txt content.","type":"string"},"httpCode":{"description":"HTTP status code when fetching robots.txt.","examples":[200,404],"type":"number"},"firstSeen":{"description":"When this version was first observed.","anyOf":[{"description":"When this version was first observed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When this version was last confirmed.","anyOf":[{"description":"When this version was last confirmed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["records"]}},"text/plain":{"schema":{"type":"object","properties":{"records":{"description":"Version history of robots.txt snapshots (newest first).","type":"array","items":{"type":"object","required":["id","content","httpCode","firstSeen","updatedDate"],"properties":{"id":{"description":"Hashed version identifier.","type":"string"},"content":{"description":"Raw robots.txt content.","type":"string"},"httpCode":{"description":"HTTP status code when fetching robots.txt.","examples":[200,404],"type":"number"},"firstSeen":{"description":"When this version was first observed.","anyOf":[{"description":"When this version was first observed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When this version was last confirmed.","anyOf":[{"description":"When this version was last confirmed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["records"]}}}}},"operationId":"getApiV1VikitronRobots-txt-checker","tags":["vikitron"],"summary":"Check robots.txt history","description":"Returns the version history of robots.txt snapshots for the given domain. Cached responses (5 min fresh + 1 h SWR) skip the outbound HTTP request — refresh cadence is driven by scout. If no snapshots exist yet OR ?force=true is passed, a fresh fetch is triggered before returning results (uncached)."}},"/api/v1/vikitron/ssl-certificate-checker":{"get":{"parameters":[{"description":"Domain name to check.","examples":["example.com"],"schema":{"type":"string"},"in":"query","name":"domain","required":true},{"description":"Set to \"true\" to bypass the cache and trigger a fresh fetch.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"force","required":false}],"responses":{"200":{"description":"SSL certificate check result.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the certificate was successfully retrieved.","type":"boolean"},"certificate":{"description":"SSL certificate details.","type":"object","required":["subjectCommonName","validFrom","validTo","issuerCountry","issuerOrganization","issuerOrganizationalUnit","issuerCommonName","serialNumber","fingerprint"],"properties":{"subjectCommonName":{"description":"Certificate subject CN.","examples":["*.example.com"],"type":"string"},"validFrom":{"description":"Certificate validity start date.","anyOf":[{"description":"Certificate validity start date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"Certificate validity end date.","anyOf":[{"description":"Certificate validity end date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"issuerCountry":{"description":"Issuer country code.","examples":["US"],"type":"string"},"issuerOrganization":{"description":"Issuer organization name.","examples":["Let's Encrypt"],"type":"string"},"issuerOrganizationalUnit":{"nullable":true,"anyOf":[{"description":"Issuer organizational unit.","type":"string"},{"type":"null"}]},"issuerCommonName":{"description":"Issuer common name.","examples":["R3"],"type":"string"},"serialNumber":{"description":"Certificate serial number.","type":"string"},"fingerprint":{"description":"Certificate SHA-1 fingerprint.","type":"string"}}}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the certificate was successfully retrieved.","type":"boolean"},"certificate":{"description":"SSL certificate details.","type":"object","required":["subjectCommonName","validFrom","validTo","issuerCountry","issuerOrganization","issuerOrganizationalUnit","issuerCommonName","serialNumber","fingerprint"],"properties":{"subjectCommonName":{"description":"Certificate subject CN.","examples":["*.example.com"],"type":"string"},"validFrom":{"description":"Certificate validity start date.","anyOf":[{"description":"Certificate validity start date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"Certificate validity end date.","anyOf":[{"description":"Certificate validity end date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"issuerCountry":{"description":"Issuer country code.","examples":["US"],"type":"string"},"issuerOrganization":{"description":"Issuer organization name.","examples":["Let's Encrypt"],"type":"string"},"issuerOrganizationalUnit":{"nullable":true,"anyOf":[{"description":"Issuer organizational unit.","type":"string"},{"type":"null"}]},"issuerCommonName":{"description":"Issuer common name.","examples":["R3"],"type":"string"},"serialNumber":{"description":"Certificate serial number.","type":"string"},"fingerprint":{"description":"Certificate SHA-1 fingerprint.","type":"string"}}}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the certificate was successfully retrieved.","type":"boolean"},"certificate":{"description":"SSL certificate details.","type":"object","required":["subjectCommonName","validFrom","validTo","issuerCountry","issuerOrganization","issuerOrganizationalUnit","issuerCommonName","serialNumber","fingerprint"],"properties":{"subjectCommonName":{"description":"Certificate subject CN.","examples":["*.example.com"],"type":"string"},"validFrom":{"description":"Certificate validity start date.","anyOf":[{"description":"Certificate validity start date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"Certificate validity end date.","anyOf":[{"description":"Certificate validity end date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"issuerCountry":{"description":"Issuer country code.","examples":["US"],"type":"string"},"issuerOrganization":{"description":"Issuer organization name.","examples":["Let's Encrypt"],"type":"string"},"issuerOrganizationalUnit":{"nullable":true,"anyOf":[{"description":"Issuer organizational unit.","type":"string"},{"type":"null"}]},"issuerCommonName":{"description":"Issuer common name.","examples":["R3"],"type":"string"},"serialNumber":{"description":"Certificate serial number.","type":"string"},"fingerprint":{"description":"Certificate SHA-1 fingerprint.","type":"string"}}}},"required":["success"]}}}}},"operationId":"getApiV1VikitronSsl-certificate-checker","tags":["vikitron"],"summary":"Check SSL certificate","description":"Returns the most recently observed SSL/TLS certificate for the given domain. Cached responses (5 min fresh + 1 h SWR) skip the TLS handshake entirely. If no certificate has ever been scanned OR ?force=true is passed, a fresh handshake is performed (uncached)."}},"/api/v1/vikitron/subdomain-finder":{"get":{"parameters":[{"description":"Root hostname to scan for subdomains.","examples":["example.com"],"schema":{"type":"string","minLength":4,"pattern":"^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)+$"},"in":"query","name":"host","required":true}],"responses":{"200":{"description":"Subdomain scan results.","content":{"application/json":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of discovered subdomains.","type":"number"},"indexablePagesCount":{"description":"Number of subdomains that are indexable by search engines.","type":"number"},"items":{"description":"List of discovered subdomains.","type":"array","items":{"type":"object","required":["id","domain","insertedDate","httpCode"],"properties":{"id":{"description":"Subdomain identifier (same as domain).","type":"string"},"domain":{"description":"Full subdomain name.","examples":["www.example.com"],"type":"string"},"insertedDate":{"description":"When the subdomain was first discovered.","anyOf":[{"description":"When the subdomain was first discovered.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastCheckDate":{"description":"When the subdomain was last checked.","anyOf":[{"description":"When the subdomain was last checked.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"httpCode":{"description":"Last observed HTTP status code.","examples":[200,301,404],"type":"number"},"httpsSupport":{"description":"Whether the subdomain supports HTTPS.","type":"boolean"},"title":{"description":"Page title or crawl error message.","type":"string"},"server":{"description":"HTTP server software.","examples":["nginx","Apache"],"type":"string"},"responseTime":{"description":"Response time in milliseconds.","type":"number"},"uptimeOk":{"description":"Whether the subdomain is currently up.","type":"boolean"}}}}},"required":["itemCount","indexablePagesCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of discovered subdomains.","type":"number"},"indexablePagesCount":{"description":"Number of subdomains that are indexable by search engines.","type":"number"},"items":{"description":"List of discovered subdomains.","type":"array","items":{"type":"object","required":["id","domain","insertedDate","httpCode"],"properties":{"id":{"description":"Subdomain identifier (same as domain).","type":"string"},"domain":{"description":"Full subdomain name.","examples":["www.example.com"],"type":"string"},"insertedDate":{"description":"When the subdomain was first discovered.","anyOf":[{"description":"When the subdomain was first discovered.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastCheckDate":{"description":"When the subdomain was last checked.","anyOf":[{"description":"When the subdomain was last checked.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"httpCode":{"description":"Last observed HTTP status code.","examples":[200,301,404],"type":"number"},"httpsSupport":{"description":"Whether the subdomain supports HTTPS.","type":"boolean"},"title":{"description":"Page title or crawl error message.","type":"string"},"server":{"description":"HTTP server software.","examples":["nginx","Apache"],"type":"string"},"responseTime":{"description":"Response time in milliseconds.","type":"number"},"uptimeOk":{"description":"Whether the subdomain is currently up.","type":"boolean"}}}}},"required":["itemCount","indexablePagesCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of discovered subdomains.","type":"number"},"indexablePagesCount":{"description":"Number of subdomains that are indexable by search engines.","type":"number"},"items":{"description":"List of discovered subdomains.","type":"array","items":{"type":"object","required":["id","domain","insertedDate","httpCode"],"properties":{"id":{"description":"Subdomain identifier (same as domain).","type":"string"},"domain":{"description":"Full subdomain name.","examples":["www.example.com"],"type":"string"},"insertedDate":{"description":"When the subdomain was first discovered.","anyOf":[{"description":"When the subdomain was first discovered.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastCheckDate":{"description":"When the subdomain was last checked.","anyOf":[{"description":"When the subdomain was last checked.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"httpCode":{"description":"Last observed HTTP status code.","examples":[200,301,404],"type":"number"},"httpsSupport":{"description":"Whether the subdomain supports HTTPS.","type":"boolean"},"title":{"description":"Page title or crawl error message.","type":"string"},"server":{"description":"HTTP server software.","examples":["nginx","Apache"],"type":"string"},"responseTime":{"description":"Response time in milliseconds.","type":"number"},"uptimeOk":{"description":"Whether the subdomain is currently up.","type":"boolean"}}}}},"required":["itemCount","indexablePagesCount","items"]}}}}},"operationId":"getApiV1VikitronSubdomain-finder","tags":["vikitron"],"summary":"Find subdomains","description":"Discovers and returns all known subdomains for a given host. If indexing is still in progress, a background crawl is triggered automatically. Results are sorted by HTTP status code."}},"/api/v1/vikitron/ip-lookup":{"get":{"parameters":[{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"ip","required":true}],"responses":{"200":{"description":"IP address detail.","content":{"application/json":{"schema":{"type":"object","properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse DNS hostname.","type":"string"},"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Prague"],"type":"string"},"timezoneLabel":{"description":"Human-readable timezone name.","type":"string"},"timezoneGmt":{"description":"GMT offset string.","examples":["GMT+1"],"type":"string"},"asNumber":{"description":"Autonomous System number.","examples":["AS15169"],"type":"string"},"asName":{"description":"AS name.","type":"string"},"asOrganisation":{"description":"AS organization.","type":"string"},"city":{"description":"City name.","type":"string"},"country":{"description":"Country code.","examples":["CZ","US"],"type":"string"},"countryRegion":{"description":"Region or state within the country.","type":"string"},"zip":{"description":"Postal/ZIP code.","type":"string"},"latitude":{"description":"Latitude coordinate.","type":"number"},"longitude":{"description":"Longitude coordinate.","type":"number"},"isp":{"description":"Internet Service Provider name.","type":"string"},"organisation":{"description":"IP block owner organization.","type":"string"},"mobile":{"description":"Whether the IP belongs to a mobile network.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting/data center provider.","type":"boolean"},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"},"pingable":{"description":"Last known ICMP echo reachability. Omitted when the address has not been probed yet.","type":"boolean"},"abuse":{"description":"Whether the IP is CURRENTLY flagged in the platform aggregate abuse database. True when at least one external security feed has reported the address within the last 90 days.","type":"boolean"},"abuseFirstSeen":{"description":"When the IP was first reported by any feed. Set even after the row is aged out (abuse=false) to preserve the historical record. Omitted when the address has never been reported.","type":"string"},"abuseLastSeen":{"description":"When the IP was most recently reported by any feed. Combined with `abuse=false` this indicates a previously flagged address that has since aged out.","type":"string"},"abuseSourceCount":{"description":"How many distinct external feeds have ever reported this IP. Historical count — bits are OR-only and never cleared per feed.","type":"number"}},"required":["ip","timezone","timezoneLabel","timezoneGmt","mobile","proxy","hosting","tor","abuse"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse DNS hostname.","type":"string"},"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Prague"],"type":"string"},"timezoneLabel":{"description":"Human-readable timezone name.","type":"string"},"timezoneGmt":{"description":"GMT offset string.","examples":["GMT+1"],"type":"string"},"asNumber":{"description":"Autonomous System number.","examples":["AS15169"],"type":"string"},"asName":{"description":"AS name.","type":"string"},"asOrganisation":{"description":"AS organization.","type":"string"},"city":{"description":"City name.","type":"string"},"country":{"description":"Country code.","examples":["CZ","US"],"type":"string"},"countryRegion":{"description":"Region or state within the country.","type":"string"},"zip":{"description":"Postal/ZIP code.","type":"string"},"latitude":{"description":"Latitude coordinate.","type":"number"},"longitude":{"description":"Longitude coordinate.","type":"number"},"isp":{"description":"Internet Service Provider name.","type":"string"},"organisation":{"description":"IP block owner organization.","type":"string"},"mobile":{"description":"Whether the IP belongs to a mobile network.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting/data center provider.","type":"boolean"},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"},"pingable":{"description":"Last known ICMP echo reachability. Omitted when the address has not been probed yet.","type":"boolean"},"abuse":{"description":"Whether the IP is CURRENTLY flagged in the platform aggregate abuse database. True when at least one external security feed has reported the address within the last 90 days.","type":"boolean"},"abuseFirstSeen":{"description":"When the IP was first reported by any feed. Set even after the row is aged out (abuse=false) to preserve the historical record. Omitted when the address has never been reported.","type":"string"},"abuseLastSeen":{"description":"When the IP was most recently reported by any feed. Combined with `abuse=false` this indicates a previously flagged address that has since aged out.","type":"string"},"abuseSourceCount":{"description":"How many distinct external feeds have ever reported this IP. Historical count — bits are OR-only and never cleared per feed.","type":"number"}},"required":["ip","timezone","timezoneLabel","timezoneGmt","mobile","proxy","hosting","tor","abuse"]}},"text/plain":{"schema":{"type":"object","properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse DNS hostname.","type":"string"},"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Prague"],"type":"string"},"timezoneLabel":{"description":"Human-readable timezone name.","type":"string"},"timezoneGmt":{"description":"GMT offset string.","examples":["GMT+1"],"type":"string"},"asNumber":{"description":"Autonomous System number.","examples":["AS15169"],"type":"string"},"asName":{"description":"AS name.","type":"string"},"asOrganisation":{"description":"AS organization.","type":"string"},"city":{"description":"City name.","type":"string"},"country":{"description":"Country code.","examples":["CZ","US"],"type":"string"},"countryRegion":{"description":"Region or state within the country.","type":"string"},"zip":{"description":"Postal/ZIP code.","type":"string"},"latitude":{"description":"Latitude coordinate.","type":"number"},"longitude":{"description":"Longitude coordinate.","type":"number"},"isp":{"description":"Internet Service Provider name.","type":"string"},"organisation":{"description":"IP block owner organization.","type":"string"},"mobile":{"description":"Whether the IP belongs to a mobile network.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting/data center provider.","type":"boolean"},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"},"pingable":{"description":"Last known ICMP echo reachability. Omitted when the address has not been probed yet.","type":"boolean"},"abuse":{"description":"Whether the IP is CURRENTLY flagged in the platform aggregate abuse database. True when at least one external security feed has reported the address within the last 90 days.","type":"boolean"},"abuseFirstSeen":{"description":"When the IP was first reported by any feed. Set even after the row is aged out (abuse=false) to preserve the historical record. Omitted when the address has never been reported.","type":"string"},"abuseLastSeen":{"description":"When the IP was most recently reported by any feed. Combined with `abuse=false` this indicates a previously flagged address that has since aged out.","type":"string"},"abuseSourceCount":{"description":"How many distinct external feeds have ever reported this IP. Historical count — bits are OR-only and never cleared per feed.","type":"number"}},"required":["ip","timezone","timezoneLabel","timezoneGmt","mobile","proxy","hosting","tor","abuse"]}}}}},"operationId":"getApiV1VikitronIp-lookup","tags":["vikitron"],"summary":"IP address lookup","description":"Returns geolocation, ASN, ISP, and network classification information for the given IP address."}},"/api/v1/vikitron/as-lookup":{"get":{"parameters":[{"description":"Autonomous System number, with or without the \"AS\" prefix.","examples":["AS16019","16019"],"schema":{"type":"string","pattern":"^(?:AS|as)?[0-9]+$"},"in":"query","name":"as","required":true}],"responses":{"200":{"description":"Autonomous System detail.","content":{"application/json":{"schema":{"type":"object","properties":{"asNumber":{"description":"Canonical AS number.","examples":["AS16019"],"type":"string"},"asName":{"description":"AS name as published by the RIR / MaxMind.","type":"string"},"organization":{"description":"Organisation that operates the AS.","type":"string"},"ipCount":{"description":"Total IPs indexed by the platform under this AS.","type":"number"},"detectedCountry":{"description":"Present only when a single country accounts for ≥ 80 % of the indexed IPs under this AS.","type":"object","required":["code","confidencePercent"],"properties":{"code":{"description":"ISO-3166 alpha-2 country code.","examples":["CZ"],"type":"string"},"confidencePercent":{"description":"Share of indexed IPs that resolve to this country (0–100).","type":"number"}}},"detectedCity":{"description":"Present only when a single city accounts for ≥ 80 % of the indexed IPs under this AS.","type":"object","required":["city","country","confidencePercent"],"properties":{"city":{"description":"City name.","type":"string"},"country":{"description":"ISO-3166 alpha-2 country code of the city.","type":"string"},"confidencePercent":{"description":"Share of indexed IPs that resolve to this city (0–100).","type":"number"}}},"countries":{"description":"Top countries by indexed IP count (up to 20).","type":"array","items":{"type":"object","required":["country","count","percent"],"properties":{"country":{"description":"ISO-3166 alpha-2 country code.","type":"string"},"count":{"description":"IPs under this AS resolving to this country.","type":"number"},"percent":{"description":"Share of all indexed IPs (0–100).","type":"number"}}}},"cities":{"description":"Top cities by indexed IP count (up to 20).","type":"array","items":{"type":"object","required":["city","country","count","percent"],"properties":{"city":{"description":"City name.","type":"string"},"country":{"description":"ISO-3166 alpha-2 country code of the city.","type":"string"},"count":{"description":"IPs under this AS resolving to this city.","type":"number"},"percent":{"description":"Share of all indexed IPs (0–100).","type":"number"}}}},"isps":{"description":"Top ISPs seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["isp","count"],"properties":{"isp":{"description":"ISP name.","type":"string"},"count":{"description":"IPs under this AS reporting this ISP.","type":"number"}}}},"organisations":{"description":"Top block-owner organisations seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["organisation","count"],"properties":{"organisation":{"description":"IP block owner organisation name.","type":"string"},"count":{"description":"IPs under this AS reporting this organisation.","type":"number"}}}},"timezones":{"description":"Top timezones seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["timezone","count"],"properties":{"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Prague"],"type":"string"},"count":{"description":"IPs under this AS resolving to this timezone.","type":"number"}}}},"connectionFlags":{"description":"Aggregate connection-type signal for the AS.","type":"object","required":["mobilePercent","proxyPercent","hostingPercent","torPercent"],"properties":{"mobilePercent":{"description":"Share of indexed IPs flagged as mobile (0–100).","type":"number"},"proxyPercent":{"description":"Share of indexed IPs flagged as proxy/VPN (0–100).","type":"number"},"hostingPercent":{"description":"Share of indexed IPs flagged as hosting/DC (0–100).","type":"number"},"torPercent":{"description":"Share of indexed IPs flagged as Tor exit (0–100).","type":"number"}}},"examples":{"description":"Up to 50 example IPs indexed under this AS, most-recently-updated first. Each item is a valid target for the IP-lookup endpoint.","type":"array","items":{"type":"object","required":["ip","hostname","city","country","countryRegion","isp","organisation","mobile","proxy","hosting","tor"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS hostname of the IP.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"ISO-3166 alpha-2 country code.","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Region / state within the country.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"ISP name for this specific IP.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"Block owner organisation for this IP.","type":"string"},{"type":"null"}]},"mobile":{"description":"Whether this IP is flagged as mobile.","type":"boolean"},"proxy":{"description":"Whether this IP is flagged as proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether this IP is flagged as hosting/DC.","type":"boolean"},"tor":{"description":"Whether this IP is a known Tor exit node.","type":"boolean"}}}},"heNetUrl":{"description":"External BGP report on HE.net for this AS.","examples":["https://bgp.he.net/AS16019"],"type":"string"}},"required":["asNumber","asName","organization","ipCount","countries","cities","isps","organisations","timezones","connectionFlags","examples","heNetUrl"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"asNumber":{"description":"Canonical AS number.","examples":["AS16019"],"type":"string"},"asName":{"description":"AS name as published by the RIR / MaxMind.","type":"string"},"organization":{"description":"Organisation that operates the AS.","type":"string"},"ipCount":{"description":"Total IPs indexed by the platform under this AS.","type":"number"},"detectedCountry":{"description":"Present only when a single country accounts for ≥ 80 % of the indexed IPs under this AS.","type":"object","required":["code","confidencePercent"],"properties":{"code":{"description":"ISO-3166 alpha-2 country code.","examples":["CZ"],"type":"string"},"confidencePercent":{"description":"Share of indexed IPs that resolve to this country (0–100).","type":"number"}}},"detectedCity":{"description":"Present only when a single city accounts for ≥ 80 % of the indexed IPs under this AS.","type":"object","required":["city","country","confidencePercent"],"properties":{"city":{"description":"City name.","type":"string"},"country":{"description":"ISO-3166 alpha-2 country code of the city.","type":"string"},"confidencePercent":{"description":"Share of indexed IPs that resolve to this city (0–100).","type":"number"}}},"countries":{"description":"Top countries by indexed IP count (up to 20).","type":"array","items":{"type":"object","required":["country","count","percent"],"properties":{"country":{"description":"ISO-3166 alpha-2 country code.","type":"string"},"count":{"description":"IPs under this AS resolving to this country.","type":"number"},"percent":{"description":"Share of all indexed IPs (0–100).","type":"number"}}}},"cities":{"description":"Top cities by indexed IP count (up to 20).","type":"array","items":{"type":"object","required":["city","country","count","percent"],"properties":{"city":{"description":"City name.","type":"string"},"country":{"description":"ISO-3166 alpha-2 country code of the city.","type":"string"},"count":{"description":"IPs under this AS resolving to this city.","type":"number"},"percent":{"description":"Share of all indexed IPs (0–100).","type":"number"}}}},"isps":{"description":"Top ISPs seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["isp","count"],"properties":{"isp":{"description":"ISP name.","type":"string"},"count":{"description":"IPs under this AS reporting this ISP.","type":"number"}}}},"organisations":{"description":"Top block-owner organisations seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["organisation","count"],"properties":{"organisation":{"description":"IP block owner organisation name.","type":"string"},"count":{"description":"IPs under this AS reporting this organisation.","type":"number"}}}},"timezones":{"description":"Top timezones seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["timezone","count"],"properties":{"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Prague"],"type":"string"},"count":{"description":"IPs under this AS resolving to this timezone.","type":"number"}}}},"connectionFlags":{"description":"Aggregate connection-type signal for the AS.","type":"object","required":["mobilePercent","proxyPercent","hostingPercent","torPercent"],"properties":{"mobilePercent":{"description":"Share of indexed IPs flagged as mobile (0–100).","type":"number"},"proxyPercent":{"description":"Share of indexed IPs flagged as proxy/VPN (0–100).","type":"number"},"hostingPercent":{"description":"Share of indexed IPs flagged as hosting/DC (0–100).","type":"number"},"torPercent":{"description":"Share of indexed IPs flagged as Tor exit (0–100).","type":"number"}}},"examples":{"description":"Up to 50 example IPs indexed under this AS, most-recently-updated first. Each item is a valid target for the IP-lookup endpoint.","type":"array","items":{"type":"object","required":["ip","hostname","city","country","countryRegion","isp","organisation","mobile","proxy","hosting","tor"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS hostname of the IP.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"ISO-3166 alpha-2 country code.","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Region / state within the country.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"ISP name for this specific IP.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"Block owner organisation for this IP.","type":"string"},{"type":"null"}]},"mobile":{"description":"Whether this IP is flagged as mobile.","type":"boolean"},"proxy":{"description":"Whether this IP is flagged as proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether this IP is flagged as hosting/DC.","type":"boolean"},"tor":{"description":"Whether this IP is a known Tor exit node.","type":"boolean"}}}},"heNetUrl":{"description":"External BGP report on HE.net for this AS.","examples":["https://bgp.he.net/AS16019"],"type":"string"}},"required":["asNumber","asName","organization","ipCount","countries","cities","isps","organisations","timezones","connectionFlags","examples","heNetUrl"]}},"text/plain":{"schema":{"type":"object","properties":{"asNumber":{"description":"Canonical AS number.","examples":["AS16019"],"type":"string"},"asName":{"description":"AS name as published by the RIR / MaxMind.","type":"string"},"organization":{"description":"Organisation that operates the AS.","type":"string"},"ipCount":{"description":"Total IPs indexed by the platform under this AS.","type":"number"},"detectedCountry":{"description":"Present only when a single country accounts for ≥ 80 % of the indexed IPs under this AS.","type":"object","required":["code","confidencePercent"],"properties":{"code":{"description":"ISO-3166 alpha-2 country code.","examples":["CZ"],"type":"string"},"confidencePercent":{"description":"Share of indexed IPs that resolve to this country (0–100).","type":"number"}}},"detectedCity":{"description":"Present only when a single city accounts for ≥ 80 % of the indexed IPs under this AS.","type":"object","required":["city","country","confidencePercent"],"properties":{"city":{"description":"City name.","type":"string"},"country":{"description":"ISO-3166 alpha-2 country code of the city.","type":"string"},"confidencePercent":{"description":"Share of indexed IPs that resolve to this city (0–100).","type":"number"}}},"countries":{"description":"Top countries by indexed IP count (up to 20).","type":"array","items":{"type":"object","required":["country","count","percent"],"properties":{"country":{"description":"ISO-3166 alpha-2 country code.","type":"string"},"count":{"description":"IPs under this AS resolving to this country.","type":"number"},"percent":{"description":"Share of all indexed IPs (0–100).","type":"number"}}}},"cities":{"description":"Top cities by indexed IP count (up to 20).","type":"array","items":{"type":"object","required":["city","country","count","percent"],"properties":{"city":{"description":"City name.","type":"string"},"country":{"description":"ISO-3166 alpha-2 country code of the city.","type":"string"},"count":{"description":"IPs under this AS resolving to this city.","type":"number"},"percent":{"description":"Share of all indexed IPs (0–100).","type":"number"}}}},"isps":{"description":"Top ISPs seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["isp","count"],"properties":{"isp":{"description":"ISP name.","type":"string"},"count":{"description":"IPs under this AS reporting this ISP.","type":"number"}}}},"organisations":{"description":"Top block-owner organisations seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["organisation","count"],"properties":{"organisation":{"description":"IP block owner organisation name.","type":"string"},"count":{"description":"IPs under this AS reporting this organisation.","type":"number"}}}},"timezones":{"description":"Top timezones seen under this AS (up to 10).","type":"array","items":{"type":"object","required":["timezone","count"],"properties":{"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Prague"],"type":"string"},"count":{"description":"IPs under this AS resolving to this timezone.","type":"number"}}}},"connectionFlags":{"description":"Aggregate connection-type signal for the AS.","type":"object","required":["mobilePercent","proxyPercent","hostingPercent","torPercent"],"properties":{"mobilePercent":{"description":"Share of indexed IPs flagged as mobile (0–100).","type":"number"},"proxyPercent":{"description":"Share of indexed IPs flagged as proxy/VPN (0–100).","type":"number"},"hostingPercent":{"description":"Share of indexed IPs flagged as hosting/DC (0–100).","type":"number"},"torPercent":{"description":"Share of indexed IPs flagged as Tor exit (0–100).","type":"number"}}},"examples":{"description":"Up to 50 example IPs indexed under this AS, most-recently-updated first. Each item is a valid target for the IP-lookup endpoint.","type":"array","items":{"type":"object","required":["ip","hostname","city","country","countryRegion","isp","organisation","mobile","proxy","hosting","tor"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS hostname of the IP.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"ISO-3166 alpha-2 country code.","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Region / state within the country.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"ISP name for this specific IP.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"Block owner organisation for this IP.","type":"string"},{"type":"null"}]},"mobile":{"description":"Whether this IP is flagged as mobile.","type":"boolean"},"proxy":{"description":"Whether this IP is flagged as proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether this IP is flagged as hosting/DC.","type":"boolean"},"tor":{"description":"Whether this IP is a known Tor exit node.","type":"boolean"}}}},"heNetUrl":{"description":"External BGP report on HE.net for this AS.","examples":["https://bgp.he.net/AS16019"],"type":"string"}},"required":["asNumber","asName","organization","ipCount","countries","cities","isps","organisations","timezones","connectionFlags","examples","heNetUrl"]}}}}},"operationId":"getApiV1VikitronAs-lookup","tags":["vikitron"],"summary":"Autonomous System lookup","description":"Returns everything the platform knows about an Autonomous System (ASN): registered organisation, aggregated statistics across all IPs the platform has ever indexed under that AS (countries, cities, ISPs, timezones, connection-flag percentages), a detected country/city when ≥ 80 % of the indexed IPs agree, and up to 50 example IPs."}},"/api/v1/vikitron/ip-catalog":{"get":{"parameters":[{"description":"Dot-separated IPv4 prefix (0–2 octets). Omit or leave empty for the catalog root (all /8 blocks).","examples":["","94","94.113"],"schema":{"type":"string","pattern":"^$|^(?:0|[1-9][0-9]{0,2})(?:\\.(?:0|[1-9][0-9]{0,2})){0,1}$"},"in":"query","name":"prefix","required":false}],"responses":{"200":{"description":"Catalog node.","content":{"application/json":{"schema":{"type":"object","properties":{"prefix":{"description":"Echoed canonical prefix (empty string for the root).","examples":["","94","94.113"],"type":"string"},"level":{"description":"Number of octets in the prefix (0, 1 or 2).","examples":[0,1,2],"type":"number"},"children":{"description":"Existing children, sorted numerically by octet.","type":"array","items":{"type":"object","required":["octet","ipCount"],"properties":{"octet":{"description":"Next octet value (0–255).","type":"number"},"ipCount":{"description":"Indexed IPv4 addresses under this child prefix.","type":"number"}}}}},"required":["prefix","level","children"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"prefix":{"description":"Echoed canonical prefix (empty string for the root).","examples":["","94","94.113"],"type":"string"},"level":{"description":"Number of octets in the prefix (0, 1 or 2).","examples":[0,1,2],"type":"number"},"children":{"description":"Existing children, sorted numerically by octet.","type":"array","items":{"type":"object","required":["octet","ipCount"],"properties":{"octet":{"description":"Next octet value (0–255).","type":"number"},"ipCount":{"description":"Indexed IPv4 addresses under this child prefix.","type":"number"}}}}},"required":["prefix","level","children"]}},"text/plain":{"schema":{"type":"object","properties":{"prefix":{"description":"Echoed canonical prefix (empty string for the root).","examples":["","94","94.113"],"type":"string"},"level":{"description":"Number of octets in the prefix (0, 1 or 2).","examples":[0,1,2],"type":"number"},"children":{"description":"Existing children, sorted numerically by octet.","type":"array","items":{"type":"object","required":["octet","ipCount"],"properties":{"octet":{"description":"Next octet value (0–255).","type":"number"},"ipCount":{"description":"Indexed IPv4 addresses under this child prefix.","type":"number"}}}}},"required":["prefix","level","children"]}}}}},"operationId":"getApiV1VikitronIp-catalog","tags":["vikitron"],"summary":"IP catalog: children of a prefix","description":"Returns the ≤ 256 next-octet buckets that have at least one indexed IPv4 address below the given prefix, plus each bucket's row count. Used to render the hierarchical SEO catalog on vikitron.com at /ip-catalog (root), /{o1} (/8) and /{o1}.{o2} (/16)."}},"/api/v1/vikitron/ip-catalog-leaves":{"get":{"parameters":[{"description":"Three-octet IPv4 prefix identifying a /24 block.","examples":["94.113.97"],"schema":{"type":"string","pattern":"^(?:0|[1-9][0-9]{0,2})\\.(?:0|[1-9][0-9]{0,2})\\.(?:0|[1-9][0-9]{0,2})$"},"in":"query","name":"prefix","required":true}],"responses":{"200":{"description":"Catalog leaf listing.","content":{"application/json":{"schema":{"type":"object","properties":{"prefix":{"description":"Echoed canonical /24 prefix.","examples":["94.113.97"],"type":"string"},"ips":{"description":"All indexed IPs in this /24, sorted numerically.","type":"array","items":{"type":"object","required":["ip","hostname","city","country","countryRegion","isp","organisation","asNumber","mobile","proxy","hosting","tor"],"properties":{"ip":{"description":"Indexed IPv4 address.","examples":["94.113.97.252"],"type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS (PTR) record, when available.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name from the geolocation dataset.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"ISO-3166 alpha-2 country code.","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Region / state within the country.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"ISP name.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"IP block owner organisation.","type":"string"},{"type":"null"}]},"asNumber":{"nullable":true,"anyOf":[{"description":"Autonomous System number (with the AS prefix).","type":"string"},{"type":"null"}]},"mobile":{"description":"Whether the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting/data-center provider.","type":"boolean"},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["prefix","ips"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"prefix":{"description":"Echoed canonical /24 prefix.","examples":["94.113.97"],"type":"string"},"ips":{"description":"All indexed IPs in this /24, sorted numerically.","type":"array","items":{"type":"object","required":["ip","hostname","city","country","countryRegion","isp","organisation","asNumber","mobile","proxy","hosting","tor"],"properties":{"ip":{"description":"Indexed IPv4 address.","examples":["94.113.97.252"],"type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS (PTR) record, when available.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name from the geolocation dataset.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"ISO-3166 alpha-2 country code.","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Region / state within the country.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"ISP name.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"IP block owner organisation.","type":"string"},{"type":"null"}]},"asNumber":{"nullable":true,"anyOf":[{"description":"Autonomous System number (with the AS prefix).","type":"string"},{"type":"null"}]},"mobile":{"description":"Whether the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting/data-center provider.","type":"boolean"},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["prefix","ips"]}},"text/plain":{"schema":{"type":"object","properties":{"prefix":{"description":"Echoed canonical /24 prefix.","examples":["94.113.97"],"type":"string"},"ips":{"description":"All indexed IPs in this /24, sorted numerically.","type":"array","items":{"type":"object","required":["ip","hostname","city","country","countryRegion","isp","organisation","asNumber","mobile","proxy","hosting","tor"],"properties":{"ip":{"description":"Indexed IPv4 address.","examples":["94.113.97.252"],"type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS (PTR) record, when available.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name from the geolocation dataset.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"ISO-3166 alpha-2 country code.","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Region / state within the country.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"ISP name.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"IP block owner organisation.","type":"string"},{"type":"null"}]},"asNumber":{"nullable":true,"anyOf":[{"description":"Autonomous System number (with the AS prefix).","type":"string"},{"type":"null"}]},"mobile":{"description":"Whether the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy/VPN.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting/data-center provider.","type":"boolean"},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["prefix","ips"]}}}}},"operationId":"getApiV1VikitronIp-catalog-leaves","tags":["vikitron"],"summary":"IP catalog: leaves of a /24","description":"Returns every indexed IPv4 address inside the given /24 (max 256), enriched with hostname, city, country, ISP, ASN and connection flags in a single bulk query. Powers the deepest catalog page on vikitron.com at /{o1}.{o2}.{o3}."}},"/api/v1/vikitron/tor-ip-list":{"get":{"responses":{"200":{"description":"Tor exit node list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"List of Tor exit nodes.","type":"array","items":{"type":"object","required":["ip","hostname","country","city","as_number","as_name","as_organisation"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse DNS hostname.","type":"string"},"country":{"description":"Country code.","examples":["DE","US","NL"],"type":"string"},"city":{"description":"City name.","type":"string"},"as_number":{"description":"Autonomous System number.","type":"string"},"as_name":{"description":"AS name.","type":"string"},"as_organisation":{"description":"AS organization.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"List of Tor exit nodes.","type":"array","items":{"type":"object","required":["ip","hostname","country","city","as_number","as_name","as_organisation"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse DNS hostname.","type":"string"},"country":{"description":"Country code.","examples":["DE","US","NL"],"type":"string"},"city":{"description":"City name.","type":"string"},"as_number":{"description":"Autonomous System number.","type":"string"},"as_name":{"description":"AS name.","type":"string"},"as_organisation":{"description":"AS organization.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"List of Tor exit nodes.","type":"array","items":{"type":"object","required":["ip","hostname","country","city","as_number","as_name","as_organisation"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse DNS hostname.","type":"string"},"country":{"description":"Country code.","examples":["DE","US","NL"],"type":"string"},"city":{"description":"City name.","type":"string"},"as_number":{"description":"Autonomous System number.","type":"string"},"as_name":{"description":"AS name.","type":"string"},"as_organisation":{"description":"AS organization.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getApiV1VikitronTor-ip-list","tags":["vikitron"],"summary":"List known Tor exit nodes","description":"Returns a list of all known Tor exit node IP addresses with their geolocation and ASN information."}},"/api/v1/vikitron/crawl-start":{"post":{"parameters":[],"responses":{"200":{"description":"Crawl start result.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"description":"Normalised hostname being crawled (may differ from input after homepage redirects).","type":"string"},"domainId":{"description":"Opaque domain identifier (use for the status endpoint).","type":"string"},"inputHost":{"description":"Hostname the caller submitted, after normalisation.","type":"string"},"redirected":{"description":"True when the homepage probe followed a same-apex redirect chain.","type":"boolean"},"redirectChain":{"description":"Same-apex redirect chain followed at start (empty when no redirect).","type":"array","items":{"type":"object","required":["from","to","httpCode"],"properties":{"from":{"description":"Hostname before this hop.","type":"string"},"to":{"description":"Hostname after this hop.","type":"string"},"httpCode":{"description":"HTTP status code that produced this hop.","type":"number"}}}},"state":{"description":"Current crawl state.","anyOf":[{"const":"queued","type":"string"},{"const":"running","type":"string"},{"const":"completed","type":"string"}]},"started":{"description":"Whether this call actually started a new crawl.","type":"boolean"},"message":{"description":"Human-readable summary of the action taken.","type":"string"},"counts":{"type":"object","required":["pending","running","ok","error","redirect","skipped","total"],"properties":{"pending":{"description":"URLs waiting to be fetched.","type":"number"},"running":{"description":"URLs currently being fetched.","type":"number"},"ok":{"description":"Successfully fetched URLs (2xx).","type":"number"},"error":{"description":"URLs that failed to fetch.","type":"number"},"redirect":{"description":"URLs that returned a 3xx redirect.","type":"number"},"skipped":{"description":"URLs explicitly skipped (e.g. disallowed by robots.txt).","type":"number"},"total":{"description":"Total URLs discovered so far.","type":"number"}}},"crawlBudget":{"description":"Maximum number of URLs the crawler will fetch for this domain.","type":"number"}},"required":["domain","domainId","inputHost","redirected","redirectChain","state","started","message","counts","crawlBudget"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"domain":{"description":"Normalised hostname being crawled (may differ from input after homepage redirects).","type":"string"},"domainId":{"description":"Opaque domain identifier (use for the status endpoint).","type":"string"},"inputHost":{"description":"Hostname the caller submitted, after normalisation.","type":"string"},"redirected":{"description":"True when the homepage probe followed a same-apex redirect chain.","type":"boolean"},"redirectChain":{"description":"Same-apex redirect chain followed at start (empty when no redirect).","type":"array","items":{"type":"object","required":["from","to","httpCode"],"properties":{"from":{"description":"Hostname before this hop.","type":"string"},"to":{"description":"Hostname after this hop.","type":"string"},"httpCode":{"description":"HTTP status code that produced this hop.","type":"number"}}}},"state":{"description":"Current crawl state.","anyOf":[{"const":"queued","type":"string"},{"const":"running","type":"string"},{"const":"completed","type":"string"}]},"started":{"description":"Whether this call actually started a new crawl.","type":"boolean"},"message":{"description":"Human-readable summary of the action taken.","type":"string"},"counts":{"type":"object","required":["pending","running","ok","error","redirect","skipped","total"],"properties":{"pending":{"description":"URLs waiting to be fetched.","type":"number"},"running":{"description":"URLs currently being fetched.","type":"number"},"ok":{"description":"Successfully fetched URLs (2xx).","type":"number"},"error":{"description":"URLs that failed to fetch.","type":"number"},"redirect":{"description":"URLs that returned a 3xx redirect.","type":"number"},"skipped":{"description":"URLs explicitly skipped (e.g. disallowed by robots.txt).","type":"number"},"total":{"description":"Total URLs discovered so far.","type":"number"}}},"crawlBudget":{"description":"Maximum number of URLs the crawler will fetch for this domain.","type":"number"}},"required":["domain","domainId","inputHost","redirected","redirectChain","state","started","message","counts","crawlBudget"]}},"text/plain":{"schema":{"type":"object","properties":{"domain":{"description":"Normalised hostname being crawled (may differ from input after homepage redirects).","type":"string"},"domainId":{"description":"Opaque domain identifier (use for the status endpoint).","type":"string"},"inputHost":{"description":"Hostname the caller submitted, after normalisation.","type":"string"},"redirected":{"description":"True when the homepage probe followed a same-apex redirect chain.","type":"boolean"},"redirectChain":{"description":"Same-apex redirect chain followed at start (empty when no redirect).","type":"array","items":{"type":"object","required":["from","to","httpCode"],"properties":{"from":{"description":"Hostname before this hop.","type":"string"},"to":{"description":"Hostname after this hop.","type":"string"},"httpCode":{"description":"HTTP status code that produced this hop.","type":"number"}}}},"state":{"description":"Current crawl state.","anyOf":[{"const":"queued","type":"string"},{"const":"running","type":"string"},{"const":"completed","type":"string"}]},"started":{"description":"Whether this call actually started a new crawl.","type":"boolean"},"message":{"description":"Human-readable summary of the action taken.","type":"string"},"counts":{"type":"object","required":["pending","running","ok","error","redirect","skipped","total"],"properties":{"pending":{"description":"URLs waiting to be fetched.","type":"number"},"running":{"description":"URLs currently being fetched.","type":"number"},"ok":{"description":"Successfully fetched URLs (2xx).","type":"number"},"error":{"description":"URLs that failed to fetch.","type":"number"},"redirect":{"description":"URLs that returned a 3xx redirect.","type":"number"},"skipped":{"description":"URLs explicitly skipped (e.g. disallowed by robots.txt).","type":"number"},"total":{"description":"Total URLs discovered so far.","type":"number"}}},"crawlBudget":{"description":"Maximum number of URLs the crawler will fetch for this domain.","type":"number"}},"required":["domain","domainId","inputHost","redirected","redirectChain","state","started","message","counts","crawlBudget"]}}}}},"operationId":"postApiV1VikitronCrawl-start","tags":["vikitron"],"summary":"Start on-demand crawl","description":"Idempotently registers a domain as a crawl target and kicks off an immediate crawl. Will not start a second crawl while one is in progress and will not re-run a finished crawl.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name (or subdomain) to crawl.","examples":["example.com"],"minLength":4,"pattern":"^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)+$","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name (or subdomain) to crawl.","examples":["example.com"],"minLength":4,"pattern":"^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)+$","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name (or subdomain) to crawl.","examples":["example.com"],"minLength":4,"pattern":"^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)+$","type":"string"}}}}}}}},"/api/v1/vikitron/crawl-status":{"get":{"parameters":[{"description":"Domain name to check.","examples":["example.com"],"schema":{"type":"string"},"in":"query","name":"domain","required":true},{"description":"Set to \"true\" to bypass the cache and trigger a fresh fetch.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"force","required":false}],"operationId":"getApiV1VikitronCrawl-status","tags":["vikitron"],"summary":"Get crawl status","description":"Returns the current state of an on-demand crawl and a per-URL report aggregated across every subdomain under the same registrable apex (pending, running, fetched, failed, redirected, skipped). Up to 1000 URLs are returned, ordered with running first, pending next, and the most recently checked completed URLs last.","responses":{"200":{}}}},"/api/v1/voucher/analyze":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"Voucher code to analyze. Server trims + uppercases.","examples":["SUMMER2024"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Optional redemption context. \"order\" = voucher is being added to a reservation/order; \"voucher_page\" = voucher is being redeemed on the dedicated voucher-redeem page. When present, the response includes `rejectionReason`/`rejectionMessage` reflecting what the order engine would answer today.","examples":["order","voucher_page"],"schema":{"type":"string"},"in":"query","name":"redeemContext","required":false},{"description":"Logged user identity (from your frontend cookies). [Learn more](https://docs.bizkithub.com/identity-id)","examples":["Z9CPkS2o3UV163VQn5OUv0T8BQi8Fvdg"],"schema":{"type":"string"},"in":"query","name":"identityId","required":false},{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false}],"responses":{"200":{"description":"Voucher analysis result.","anyOf":[{"description":"Voucher not found.","type":"object","required":["exists","rejectionReason","rejectionMessage"],"properties":{"exists":{"description":"Voucher with this code does not exist.","const":false,"type":"boolean"},"rejectionReason":{"description":"Always \"code_not_found\" for the exists=false branch.","const":"code_not_found","type":"string"},"rejectionMessage":{"description":"Human-readable reason, pre-formatted for the frontend.","type":"string"}}},{"description":"Voucher exists — snapshot with computed status.","type":"object","required":["exists","code","type","value","active","effectivelyActive","isValid","status","usedCount","usageLimit","remainingUsage","validFrom","validTo","daysUntilExpiration","lastUsedDate","note","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","rejectionReason","rejectionMessage","acceptedForContext"],"properties":{"exists":{"const":true,"type":"boolean"},"code":{"description":"Voucher code (canonical, uppercase).","type":"string"},"type":{"description":"Discount type.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"active":{"description":"Database active flag (does NOT consider expiration/limit).","type":"boolean"},"effectivelyActive":{"description":"True if voucher is currently usable (active + within validity + below limit).","type":"boolean"},"isValid":{"description":"Alias of effectivelyActive — convenient flag for UI consumers.","type":"boolean"},"status":{"description":"Computed status enum.","anyOf":[{"const":"active","type":"string"},{"const":"inactive","type":"string"},{"const":"expired","type":"string"},{"const":"not-yet-valid","type":"string"},{"const":"limit-reached","type":"string"}]},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usageLimit":{"description":"Maximum number of uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"remainingUsage":{"description":"Remaining uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"daysUntilExpiration":{"description":"Days remaining until expiration, or null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"isOrderSingleton":{"description":"If true, voucher cannot be combined with other vouchers inside a single order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated \"redeem voucher\" page (typically used for free-credit vouchers).","type":"boolean"},"rejectionReason":{"description":"Rejection reason the order engine would answer for this voucher in the supplied `redeemContext`. Null when the voucher would be accepted or when `redeemContext` was not supplied.","anyOf":[{"const":"code_not_found","type":"string"},{"const":"inactive","type":"string"},{"const":"not_yet_valid","type":"string"},{"const":"expired","type":"string"},{"const":"usage_limit_reached","type":"string"},{"const":"already_used_by_customer","type":"string"},{"const":"wrong_redemption_context","type":"string"},{"type":"null"}]},"rejectionMessage":{"description":"Human-readable rejection message. Null when accepted or no context passed.","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedForContext":{"description":"When the engine accepted the voucher this echoes the requested `redeemContext`; otherwise null.","anyOf":[{"const":"order","type":"string"},{"const":"voucher_page","type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"description":"Voucher analysis result.","anyOf":[{"description":"Voucher not found.","type":"object","required":["exists","rejectionReason","rejectionMessage"],"properties":{"exists":{"description":"Voucher with this code does not exist.","const":false,"type":"boolean"},"rejectionReason":{"description":"Always \"code_not_found\" for the exists=false branch.","const":"code_not_found","type":"string"},"rejectionMessage":{"description":"Human-readable reason, pre-formatted for the frontend.","type":"string"}}},{"description":"Voucher exists — snapshot with computed status.","type":"object","required":["exists","code","type","value","active","effectivelyActive","isValid","status","usedCount","usageLimit","remainingUsage","validFrom","validTo","daysUntilExpiration","lastUsedDate","note","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","rejectionReason","rejectionMessage","acceptedForContext"],"properties":{"exists":{"const":true,"type":"boolean"},"code":{"description":"Voucher code (canonical, uppercase).","type":"string"},"type":{"description":"Discount type.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"active":{"description":"Database active flag (does NOT consider expiration/limit).","type":"boolean"},"effectivelyActive":{"description":"True if voucher is currently usable (active + within validity + below limit).","type":"boolean"},"isValid":{"description":"Alias of effectivelyActive — convenient flag for UI consumers.","type":"boolean"},"status":{"description":"Computed status enum.","anyOf":[{"const":"active","type":"string"},{"const":"inactive","type":"string"},{"const":"expired","type":"string"},{"const":"not-yet-valid","type":"string"},{"const":"limit-reached","type":"string"}]},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usageLimit":{"description":"Maximum number of uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"remainingUsage":{"description":"Remaining uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"daysUntilExpiration":{"description":"Days remaining until expiration, or null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"isOrderSingleton":{"description":"If true, voucher cannot be combined with other vouchers inside a single order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated \"redeem voucher\" page (typically used for free-credit vouchers).","type":"boolean"},"rejectionReason":{"description":"Rejection reason the order engine would answer for this voucher in the supplied `redeemContext`. Null when the voucher would be accepted or when `redeemContext` was not supplied.","anyOf":[{"const":"code_not_found","type":"string"},{"const":"inactive","type":"string"},{"const":"not_yet_valid","type":"string"},{"const":"expired","type":"string"},{"const":"usage_limit_reached","type":"string"},{"const":"already_used_by_customer","type":"string"},{"const":"wrong_redemption_context","type":"string"},{"type":"null"}]},"rejectionMessage":{"description":"Human-readable rejection message. Null when accepted or no context passed.","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedForContext":{"description":"When the engine accepted the voucher this echoes the requested `redeemContext`; otherwise null.","anyOf":[{"const":"order","type":"string"},{"const":"voucher_page","type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"description":"Voucher analysis result.","anyOf":[{"description":"Voucher not found.","type":"object","required":["exists","rejectionReason","rejectionMessage"],"properties":{"exists":{"description":"Voucher with this code does not exist.","const":false,"type":"boolean"},"rejectionReason":{"description":"Always \"code_not_found\" for the exists=false branch.","const":"code_not_found","type":"string"},"rejectionMessage":{"description":"Human-readable reason, pre-formatted for the frontend.","type":"string"}}},{"description":"Voucher exists — snapshot with computed status.","type":"object","required":["exists","code","type","value","active","effectivelyActive","isValid","status","usedCount","usageLimit","remainingUsage","validFrom","validTo","daysUntilExpiration","lastUsedDate","note","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","rejectionReason","rejectionMessage","acceptedForContext"],"properties":{"exists":{"const":true,"type":"boolean"},"code":{"description":"Voucher code (canonical, uppercase).","type":"string"},"type":{"description":"Discount type.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"active":{"description":"Database active flag (does NOT consider expiration/limit).","type":"boolean"},"effectivelyActive":{"description":"True if voucher is currently usable (active + within validity + below limit).","type":"boolean"},"isValid":{"description":"Alias of effectivelyActive — convenient flag for UI consumers.","type":"boolean"},"status":{"description":"Computed status enum.","anyOf":[{"const":"active","type":"string"},{"const":"inactive","type":"string"},{"const":"expired","type":"string"},{"const":"not-yet-valid","type":"string"},{"const":"limit-reached","type":"string"}]},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usageLimit":{"description":"Maximum number of uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"remainingUsage":{"description":"Remaining uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"daysUntilExpiration":{"description":"Days remaining until expiration, or null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"isOrderSingleton":{"description":"If true, voucher cannot be combined with other vouchers inside a single order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated \"redeem voucher\" page (typically used for free-credit vouchers).","type":"boolean"},"rejectionReason":{"description":"Rejection reason the order engine would answer for this voucher in the supplied `redeemContext`. Null when the voucher would be accepted or when `redeemContext` was not supplied.","anyOf":[{"const":"code_not_found","type":"string"},{"const":"inactive","type":"string"},{"const":"not_yet_valid","type":"string"},{"const":"expired","type":"string"},{"const":"usage_limit_reached","type":"string"},{"const":"already_used_by_customer","type":"string"},{"const":"wrong_redemption_context","type":"string"},{"type":"null"}]},"rejectionMessage":{"description":"Human-readable rejection message. Null when accepted or no context passed.","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedForContext":{"description":"When the engine accepted the voucher this echoes the requested `redeemContext`; otherwise null.","anyOf":[{"const":"order","type":"string"},{"const":"voucher_page","type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"description":"Voucher analysis result.","anyOf":[{"description":"Voucher not found.","type":"object","required":["exists","rejectionReason","rejectionMessage"],"properties":{"exists":{"description":"Voucher with this code does not exist.","const":false,"type":"boolean"},"rejectionReason":{"description":"Always \"code_not_found\" for the exists=false branch.","const":"code_not_found","type":"string"},"rejectionMessage":{"description":"Human-readable reason, pre-formatted for the frontend.","type":"string"}}},{"description":"Voucher exists — snapshot with computed status.","type":"object","required":["exists","code","type","value","active","effectivelyActive","isValid","status","usedCount","usageLimit","remainingUsage","validFrom","validTo","daysUntilExpiration","lastUsedDate","note","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","rejectionReason","rejectionMessage","acceptedForContext"],"properties":{"exists":{"const":true,"type":"boolean"},"code":{"description":"Voucher code (canonical, uppercase).","type":"string"},"type":{"description":"Discount type.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"active":{"description":"Database active flag (does NOT consider expiration/limit).","type":"boolean"},"effectivelyActive":{"description":"True if voucher is currently usable (active + within validity + below limit).","type":"boolean"},"isValid":{"description":"Alias of effectivelyActive — convenient flag for UI consumers.","type":"boolean"},"status":{"description":"Computed status enum.","anyOf":[{"const":"active","type":"string"},{"const":"inactive","type":"string"},{"const":"expired","type":"string"},{"const":"not-yet-valid","type":"string"},{"const":"limit-reached","type":"string"}]},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usageLimit":{"description":"Maximum number of uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"remainingUsage":{"description":"Remaining uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"daysUntilExpiration":{"description":"Days remaining until expiration, or null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"isOrderSingleton":{"description":"If true, voucher cannot be combined with other vouchers inside a single order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated \"redeem voucher\" page (typically used for free-credit vouchers).","type":"boolean"},"rejectionReason":{"description":"Rejection reason the order engine would answer for this voucher in the supplied `redeemContext`. Null when the voucher would be accepted or when `redeemContext` was not supplied.","anyOf":[{"const":"code_not_found","type":"string"},{"const":"inactive","type":"string"},{"const":"not_yet_valid","type":"string"},{"const":"expired","type":"string"},{"const":"usage_limit_reached","type":"string"},{"const":"already_used_by_customer","type":"string"},{"const":"wrong_redemption_context","type":"string"},{"type":"null"}]},"rejectionMessage":{"description":"Human-readable rejection message. Null when accepted or no context passed.","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedForContext":{"description":"When the engine accepted the voucher this echoes the requested `redeemContext`; otherwise null.","anyOf":[{"const":"order","type":"string"},{"const":"voucher_page","type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getApiV1VoucherAnalyze","tags":["Voucher"],"summary":"Analyze voucher code","description":"Public mirror of `/bff/voucher/analyze`. Returns a lightweight snapshot of a voucher: whether it exists in the organisation and, if it does, its computed status (active / inactive / expired / not-yet-valid / limit-reached). Does NOT throw when the voucher is missing — the exists=false branch carries rejectionReason=\"code_not_found\". When `redeemContext` is supplied, the response additionally carries the rejection reason this voucher would hit for that context. When `identityId` is supplied and resolves to a known contact, the engine also evaluates the \"single use per customer\" check. Read-only — never increments usedCount or writes an audit log."}},"/api/v1/webpage/favicon":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"description":"Favicon result.","content":{"application/json":{"schema":{"type":"object","properties":{"icon":{"description":"Favicon URL or data URI. Empty string if not available.","type":"string"}},"required":["icon"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"icon":{"description":"Favicon URL or data URI. Empty string if not available.","type":"string"}},"required":["icon"]}},"text/plain":{"schema":{"type":"object","properties":{"icon":{"description":"Favicon URL or data URI. Empty string if not available.","type":"string"}},"required":["icon"]}}}}},"operationId":"getApiV1WebpageFavicon","tags":["webpage"],"summary":"Get website favicon","description":"Returns the favicon URL for the organisation website. Currently returns an empty placeholder (not yet implemented)."}},"/api/v1/webpage/screenshot":{"get":{"parameters":[{"description":"Your BizKitHub API key (passed as GET parameter).\n\n**Key format:** A 32-character string matching: `^(PROD|DEV_|ROOT)[A-Za-z0-9]{28}$`  \nPrefixes: `PROD` (production key), `DEV_` (individual developer), `ROOT` (system key with no limits). [Learn more](https://docs.bizkithub.com/api-key)","examples":["PRODPGrFxpGEtrOZfuWhnoJohUYBXuOE"],"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"responses":{"200":{"description":"Screenshot result.","content":{"application/json":{"schema":{"type":"object","properties":{"screenshot":{"description":"Screenshot URL or data URI. Empty string if not available.","type":"string"}},"required":["screenshot"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"screenshot":{"description":"Screenshot URL or data URI. Empty string if not available.","type":"string"}},"required":["screenshot"]}},"text/plain":{"schema":{"type":"object","properties":{"screenshot":{"description":"Screenshot URL or data URI. Empty string if not available.","type":"string"}},"required":["screenshot"]}}}}},"operationId":"getApiV1WebpageScreenshot","tags":["webpage"],"summary":"Get website screenshot","description":"Returns a screenshot of the organisation website. Currently returns an empty placeholder (not yet implemented)."}},"/api/service/frontend/order-status":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"hash","required":true},{"schema":{"type":"string"},"in":"query","name":"skipRedirect","required":false}],"operationId":"getApiServiceFrontendOrder-status","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/frontend/order-storno":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"operationId":"getApiServiceFrontendOrder-storno","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/frontend/order-pay":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"operationId":"getApiServiceFrontendOrder-pay","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/frontend/newsletter-confirm":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getApiServiceFrontendNewsletter-confirm","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/frontend/unsubscribe-newsletter":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"description":"E-mail address of the customer to unsubscribe.","schema":{"type":"string"},"in":"query","name":"email","required":true},{"description":"Organisation slug to scope the unsubscribe.","schema":{"type":"string"},"in":"query","name":"organisation","required":true},{"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","examples":["1.1.1.1","2001:4860:4860::8888"],"schema":{"type":"string"},"in":"query","name":"customerRealIp","required":false}],"operationId":"getApiServiceFrontendUnsubscribe-newsletter","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/frontend/confirm-registration":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getApiServiceFrontendConfirm-registration","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/frontend/reset-password-verify-token":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getApiServiceFrontendReset-password-verify-token","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/emailer/queue-list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true}],"operationId":"getApiServiceEmailerQueue-list","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/emailer/send-mail":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"externalId","required":true}],"operationId":"getApiServiceEmailerSend-mail","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/ai":{"post":{"parameters":[],"operationId":"postApiServiceAi","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey","model","question"],"properties":{"apiKey":{"type":"string"},"model":{"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"question":{"minLength":1,"maxLength":20000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["apiKey","model","question"],"properties":{"apiKey":{"type":"string"},"model":{"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"question":{"minLength":1,"maxLength":20000,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["apiKey","model","question"],"properties":{"apiKey":{"type":"string"},"model":{"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"question":{"minLength":1,"maxLength":20000,"type":"string"}}}}}},"responses":{"200":{}}}},"/api/service/status-page":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKey","required":true},{"schema":{"type":"string"},"in":"query","name":"host","required":true}],"operationId":"getApiServiceStatus-page","tags":["service"],"description":"Internal API endpoints for micro-service architecture.","responses":{"200":{}}}},"/api/service/scheduler/peek":{"post":{"parameters":[],"operationId":"postApiServiceSchedulerPeek","tags":["service"],"description":"Read-only peek into the scheduler queue. Runs the same SELECT used by /claim but without the UPDATE, so the runner can validate end-to-end queue access (auth + DB + query) from its health check without consuming jobs.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"type":"string"},"sampleSize":{"minimum":0,"maximum":25,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"type":"string"},"sampleSize":{"minimum":0,"maximum":25,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"type":"string"},"sampleSize":{"minimum":0,"maximum":25,"type":"number"}}}}}},"responses":{"200":{}}}},"/api/service/scheduler/heartbeat":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiServiceSchedulerHeartbeat","tags":["service"],"description":"Liveness signal from the external scheduler runner. Stored as a temp record so /api/v1/ping/health can flag the runner offline if no heartbeat is received within the staleness window.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey","runnerId","requestCount","successCount"],"properties":{"apiKey":{"type":"string"},"runnerId":{"minLength":4,"maxLength":8,"type":"string"},"requestCount":{"minimum":0,"type":"number"},"successCount":{"minimum":0,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["apiKey","runnerId","requestCount","successCount"],"properties":{"apiKey":{"type":"string"},"runnerId":{"minLength":4,"maxLength":8,"type":"string"},"requestCount":{"minimum":0,"type":"number"},"successCount":{"minimum":0,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["apiKey","runnerId","requestCount","successCount"],"properties":{"apiKey":{"type":"string"},"runnerId":{"minLength":4,"maxLength":8,"type":"string"},"requestCount":{"minimum":0,"type":"number"},"successCount":{"minimum":0,"type":"number"}}}}}}}},"/api/service/scheduler/log":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postApiServiceSchedulerLog","tags":["service"],"description":"Centralized log channel for the external scheduler runner. Always writes against the BizKitHub internal organisation so failures are surfaced even when the runner has no DB access.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey","message"],"properties":{"apiKey":{"type":"string"},"message":{"type":"string"},"level":{"enum":["info","success","error","warning","critical"],"type":"string"},"subject":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["apiKey","message"],"properties":{"apiKey":{"type":"string"},"message":{"type":"string"},"level":{"enum":["info","success","error","warning","critical"],"type":"string"},"subject":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["apiKey","message"],"properties":{"apiKey":{"type":"string"},"message":{"type":"string"},"level":{"enum":["info","success","error","warning","critical"],"type":"string"},"subject":{"type":"string"}}}}}}}},"/bff/account/":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"isLoggedIn":{"description":"Whether the user is currently logged in.","type":"boolean"}},"required":["isLoggedIn"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"isLoggedIn":{"description":"Whether the user is currently logged in.","type":"boolean"}},"required":["isLoggedIn"]}},"text/plain":{"schema":{"type":"object","properties":{"isLoggedIn":{"description":"Whether the user is currently logged in.","type":"boolean"}},"required":["isLoggedIn"]}}}}},"operationId":"getBffAccount","tags":["Account"],"summary":"Check authentication status","description":"Returns whether the current request is authenticated."}},"/bff/account/detail":{"get":{"parameters":[{"description":"Override identity ID (defaults to cookie value).","schema":{"type":"string"},"in":"query","name":"brjInternalQueryIdentityId","required":false}],"operationId":"getBffAccountDetail","tags":["Account"],"summary":"Get account detail","description":"Returns full account detail for the authenticated user, including profile and geo information.","responses":{"200":{}}}},"/bff/account/detail-contact":{"get":{"operationId":"getBffAccountDetail-contact","tags":["Account"],"summary":"Get account contact information","description":"Returns contact details (email, phone, address) for the authenticated user.","responses":{"200":{}}}},"/bff/account/audit-login-attempts":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"currentIp":{"description":"IP address of the current request.","type":"string"},"currentLocation":{"description":"Resolved location string for the current request.","type":"string"},"itemCount":{"description":"Total number of login attempts.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","committed","riskScore","insertedDate","relativeDate","ip","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Masked attempt identifier.","type":"string"},"committed":{"description":"True if the attempt succeeded and issued a session.","type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"description":"Risk score computed at the moment of the attempt (0 = clean, 100 = maximum).","type":"number"},"insertedDate":{"description":"Absolute date the attempt was made.","type":"string"},"relativeDate":{"description":"Human-relative date (e.g. \"3 hours ago\").","type":"string"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP, if resolved.","type":"string"},"city":{"description":"City resolved from GeoIP.","type":"string"},"country":{"description":"ISO country code resolved from GeoIP.","type":"string"},"countryRegion":{"description":"Region/state code resolved from GeoIP.","type":"string"},"asn":{"description":"Autonomous System Number of the network owning the IP.","type":"string"},"asnOrganization":{"description":"Organisation owning the ASN (e.g. Cloudflare).","type":"string"},"isp":{"description":"ISP name from the GeoIP database.","type":"string"},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["currentIp","currentLocation","itemCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"currentIp":{"description":"IP address of the current request.","type":"string"},"currentLocation":{"description":"Resolved location string for the current request.","type":"string"},"itemCount":{"description":"Total number of login attempts.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","committed","riskScore","insertedDate","relativeDate","ip","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Masked attempt identifier.","type":"string"},"committed":{"description":"True if the attempt succeeded and issued a session.","type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"description":"Risk score computed at the moment of the attempt (0 = clean, 100 = maximum).","type":"number"},"insertedDate":{"description":"Absolute date the attempt was made.","type":"string"},"relativeDate":{"description":"Human-relative date (e.g. \"3 hours ago\").","type":"string"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP, if resolved.","type":"string"},"city":{"description":"City resolved from GeoIP.","type":"string"},"country":{"description":"ISO country code resolved from GeoIP.","type":"string"},"countryRegion":{"description":"Region/state code resolved from GeoIP.","type":"string"},"asn":{"description":"Autonomous System Number of the network owning the IP.","type":"string"},"asnOrganization":{"description":"Organisation owning the ASN (e.g. Cloudflare).","type":"string"},"isp":{"description":"ISP name from the GeoIP database.","type":"string"},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["currentIp","currentLocation","itemCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"currentIp":{"description":"IP address of the current request.","type":"string"},"currentLocation":{"description":"Resolved location string for the current request.","type":"string"},"itemCount":{"description":"Total number of login attempts.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","committed","riskScore","insertedDate","relativeDate","ip","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Masked attempt identifier.","type":"string"},"committed":{"description":"True if the attempt succeeded and issued a session.","type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"description":"Risk score computed at the moment of the attempt (0 = clean, 100 = maximum).","type":"number"},"insertedDate":{"description":"Absolute date the attempt was made.","type":"string"},"relativeDate":{"description":"Human-relative date (e.g. \"3 hours ago\").","type":"string"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP, if resolved.","type":"string"},"city":{"description":"City resolved from GeoIP.","type":"string"},"country":{"description":"ISO country code resolved from GeoIP.","type":"string"},"countryRegion":{"description":"Region/state code resolved from GeoIP.","type":"string"},"asn":{"description":"Autonomous System Number of the network owning the IP.","type":"string"},"asnOrganization":{"description":"Organisation owning the ASN (e.g. Cloudflare).","type":"string"},"isp":{"description":"ISP name from the GeoIP database.","type":"string"},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["currentIp","currentLocation","itemCount","items"]}}}}},"operationId":"getBffAccountAudit-login-attempts","tags":["Account"],"summary":"List login attempts","description":"Returns audit log of login attempts for the authenticated user with geo/threat context. Same row shape as `/bff/contact/detail-login-attempts` so the same UI grid can render both."}},"/bff/account/active-sessions":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of active sessions returned.","type":"number"},"currentSessionId":{"description":"Internal id of the row backing the caller's current session, or null when the caller is not authenticated by a cookie.","anyOf":[{"type":"number"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","kind","agentChildCount","insertedDate","expirationDate","lastActivityDate","device","userAgent","ip","hostname","city","country","countryRegion","asn","asnOrganization","isp","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Internal id of the shop__contact_login_identity row (the only wire handle for logout).","type":"number"},"kind":{"description":"Browser session vs. AI-agent credential provisioned via /bff/ai-agent/provision.","anyOf":[{"const":"human","type":"string"},{"const":"ai_agent","type":"string"}]},"agentChildCount":{"minimum":0,"description":"Count of active AI-agent rows whose parent_identity_id points at this session. Always 0 for ai_agent rows themselves.","type":"number"},"insertedDate":{"description":"ISO datetime when the session was created (login or provisioning).","type":"string"},"expirationDate":{"description":"ISO datetime when the session will expire on its own (~3 months for humans, 30 days for agents).","type":"string"},"lastActivityDate":{"description":"ISO datetime of the last request that used this identity, or null if never used.","anyOf":[{"type":"string"},{"type":"null"}]},"device":{"description":"Parsed device label from the User-Agent, if available.","anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"description":"Raw User-Agent header captured at creation.","anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP.","anyOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO country code resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"countryRegion":{"description":"Region/state resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"asn":{"description":"ASN of the network owning the IP.","anyOf":[{"type":"string"},{"type":"null"}]},"asnOrganization":{"description":"ASN owner organisation name.","anyOf":[{"type":"string"},{"type":"null"}]},"isp":{"description":"ISP name from the GeoIP database.","anyOf":[{"type":"string"},{"type":"null"}]},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["itemCount","currentSessionId","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of active sessions returned.","type":"number"},"currentSessionId":{"description":"Internal id of the row backing the caller's current session, or null when the caller is not authenticated by a cookie.","anyOf":[{"type":"number"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","kind","agentChildCount","insertedDate","expirationDate","lastActivityDate","device","userAgent","ip","hostname","city","country","countryRegion","asn","asnOrganization","isp","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Internal id of the shop__contact_login_identity row (the only wire handle for logout).","type":"number"},"kind":{"description":"Browser session vs. AI-agent credential provisioned via /bff/ai-agent/provision.","anyOf":[{"const":"human","type":"string"},{"const":"ai_agent","type":"string"}]},"agentChildCount":{"minimum":0,"description":"Count of active AI-agent rows whose parent_identity_id points at this session. Always 0 for ai_agent rows themselves.","type":"number"},"insertedDate":{"description":"ISO datetime when the session was created (login or provisioning).","type":"string"},"expirationDate":{"description":"ISO datetime when the session will expire on its own (~3 months for humans, 30 days for agents).","type":"string"},"lastActivityDate":{"description":"ISO datetime of the last request that used this identity, or null if never used.","anyOf":[{"type":"string"},{"type":"null"}]},"device":{"description":"Parsed device label from the User-Agent, if available.","anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"description":"Raw User-Agent header captured at creation.","anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP.","anyOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO country code resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"countryRegion":{"description":"Region/state resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"asn":{"description":"ASN of the network owning the IP.","anyOf":[{"type":"string"},{"type":"null"}]},"asnOrganization":{"description":"ASN owner organisation name.","anyOf":[{"type":"string"},{"type":"null"}]},"isp":{"description":"ISP name from the GeoIP database.","anyOf":[{"type":"string"},{"type":"null"}]},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["itemCount","currentSessionId","items"]}},"text/plain":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of active sessions returned.","type":"number"},"currentSessionId":{"description":"Internal id of the row backing the caller's current session, or null when the caller is not authenticated by a cookie.","anyOf":[{"type":"number"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","kind","agentChildCount","insertedDate","expirationDate","lastActivityDate","device","userAgent","ip","hostname","city","country","countryRegion","asn","asnOrganization","isp","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Internal id of the shop__contact_login_identity row (the only wire handle for logout).","type":"number"},"kind":{"description":"Browser session vs. AI-agent credential provisioned via /bff/ai-agent/provision.","anyOf":[{"const":"human","type":"string"},{"const":"ai_agent","type":"string"}]},"agentChildCount":{"minimum":0,"description":"Count of active AI-agent rows whose parent_identity_id points at this session. Always 0 for ai_agent rows themselves.","type":"number"},"insertedDate":{"description":"ISO datetime when the session was created (login or provisioning).","type":"string"},"expirationDate":{"description":"ISO datetime when the session will expire on its own (~3 months for humans, 30 days for agents).","type":"string"},"lastActivityDate":{"description":"ISO datetime of the last request that used this identity, or null if never used.","anyOf":[{"type":"string"},{"type":"null"}]},"device":{"description":"Parsed device label from the User-Agent, if available.","anyOf":[{"type":"string"},{"type":"null"}]},"userAgent":{"description":"Raw User-Agent header captured at creation.","anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP.","anyOf":[{"type":"string"},{"type":"null"}]},"city":{"description":"City resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"country":{"description":"ISO country code resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"countryRegion":{"description":"Region/state resolved from GeoIP.","anyOf":[{"type":"string"},{"type":"null"}]},"asn":{"description":"ASN of the network owning the IP.","anyOf":[{"type":"string"},{"type":"null"}]},"asnOrganization":{"description":"ASN owner organisation name.","anyOf":[{"type":"string"},{"type":"null"}]},"isp":{"description":"ISP name from the GeoIP database.","anyOf":[{"type":"string"},{"type":"null"}]},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["itemCount","currentSessionId","items"]}}}}},"operationId":"getBffAccountActive-sessions","tags":["Account"],"summary":"List active sessions","description":"Returns every authorised `shop__contact_login_identity` row for the current user — browser sessions and AI-agent credentials both. API keys are excluded (external-integration credentials owned by the organisation, not personal seats). Powers the settings > security > active sessions grid; the `currentSessionId` field identifies which row belongs to the calling browser."}},"/bff/account/logout-session":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"description":"True when the row was active and is now revoked; false when nothing changed.","type":"boolean"},"agentsRevokedCount":{"description":"Number of AI-agent rows revoked as a kill-chain side effect (0 for AI-agent rows themselves or when no children existed).","type":"number"}},"required":["revoked","agentsRevokedCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"revoked":{"description":"True when the row was active and is now revoked; false when nothing changed.","type":"boolean"},"agentsRevokedCount":{"description":"Number of AI-agent rows revoked as a kill-chain side effect (0 for AI-agent rows themselves or when no children existed).","type":"number"}},"required":["revoked","agentsRevokedCount"]}},"text/plain":{"schema":{"type":"object","properties":{"revoked":{"description":"True when the row was active and is now revoked; false when nothing changed.","type":"boolean"},"agentsRevokedCount":{"description":"Number of AI-agent rows revoked as a kill-chain side effect (0 for AI-agent rows themselves or when no children existed).","type":"number"}},"required":["revoked","agentsRevokedCount"]}}}}},"operationId":"postBffAccountLogout-session","tags":["Account"],"summary":"Log out a single active session by row id","description":"Revokes the given `shop__contact_login_identity` row (scoped to the authenticated user — cannot address another user's row). Human sessions cascade to any AI-agent credentials provisioned from them; AI-agent rows die alone. Idempotent — `revoked: false` when the row was already inactive.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Internal id of the shop__contact_login_identity row to revoke (as returned by /active-sessions).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Internal id of the shop__contact_login_identity row to revoke (as returned by /active-sessions).","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Internal id of the shop__contact_login_identity row to revoke (as returned by /active-sessions).","type":"number"}}}}}}}},"/bff/account/search-history":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Optional substring filter on the stored query text.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of distinct historical queries (after the filter).","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","query","results","frequency","updatedDate"],"properties":{"id":{"description":"Internal log row id (stable identifier for the row).","type":"number"},"query":{"description":"The exact normalized query text the member searched for.","type":"string"},"results":{"description":"Result count recorded the last time anyone in the org ran this query.","type":"number"},"frequency":{"description":"How many times this member has run this query.","type":"number"},"updatedDate":{"description":"Timestamp of the most recent time the member ran this query.","type":"string"}}}}},"required":["itemCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of distinct historical queries (after the filter).","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","query","results","frequency","updatedDate"],"properties":{"id":{"description":"Internal log row id (stable identifier for the row).","type":"number"},"query":{"description":"The exact normalized query text the member searched for.","type":"string"},"results":{"description":"Result count recorded the last time anyone in the org ran this query.","type":"number"},"frequency":{"description":"How many times this member has run this query.","type":"number"},"updatedDate":{"description":"Timestamp of the most recent time the member ran this query.","type":"string"}}}}},"required":["itemCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of distinct historical queries (after the filter).","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","query","results","frequency","updatedDate"],"properties":{"id":{"description":"Internal log row id (stable identifier for the row).","type":"number"},"query":{"description":"The exact normalized query text the member searched for.","type":"string"},"results":{"description":"Result count recorded the last time anyone in the org ran this query.","type":"number"},"frequency":{"description":"How many times this member has run this query.","type":"number"},"updatedDate":{"description":"Timestamp of the most recent time the member ran this query.","type":"string"}}}}},"required":["itemCount","items"]}}}}},"operationId":"getBffAccountSearch-history","tags":["Account"],"summary":"List my search history","description":"Returns the personal search history of the authenticated member — one row per unique query (deduplicated by the unique index on cas__organisation_search_log), ordered by the most recent occurrence first. Includes how many times the member ran the query (frequency) and the latest result count. Category filter is intentionally ignored on the write side, so the history reflects what the user searched for, not where from."}},"/bff/account/login-otp-auth":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the OTP code was valid.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the OTP code was valid.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the OTP code was valid.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAccountLogin-otp-auth","tags":["Account"],"summary":"Verify OTP code","description":"Validates the 6-digit TOTP code (RFC 6238, HMAC-SHA1, 30s period) against the user's stored base32 secret with ±1-step clock skew tolerance, and authorizes the login identity if correct.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["otpCode"],"properties":{"otpCode":{"description":"One-time password code from the authenticator app.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["otpCode"],"properties":{"otpCode":{"description":"One-time password code from the authenticator app.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["otpCode"],"properties":{"otpCode":{"description":"One-time password code from the authenticator app.","type":"string"}}}}}}}},"/bff/account/reset-password":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the password was reset.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the password was reset.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the password was reset.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAccountReset-password","tags":["Account"],"summary":"Reset password","description":"Sets a new password using a reset token received via email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","passwordInput","passwordAgain"],"properties":{"token":{"description":"Password reset token from the email link.","type":"string"},"passwordInput":{"description":"New password.","type":"string"},"passwordAgain":{"description":"New password confirmation (must match passwordInput).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","passwordInput","passwordAgain"],"properties":{"token":{"description":"Password reset token from the email link.","type":"string"},"passwordInput":{"description":"New password.","type":"string"},"passwordAgain":{"description":"New password confirmation (must match passwordInput).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token","passwordInput","passwordAgain"],"properties":{"token":{"description":"Password reset token from the email link.","type":"string"},"passwordInput":{"description":"New password.","type":"string"},"passwordAgain":{"description":"New password confirmation (must match passwordInput).","type":"string"}}}}}}}},"/bff/account/restore-personal-account":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true if no error is thrown.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true if no error is thrown.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true if no error is thrown.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAccountRestore-personal-account","tags":["Account"],"summary":"Restore personal account","description":"Sends a password reset email to the specified address if a matching account exists.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["emailInput","csrfToken"],"properties":{"emailInput":{"description":"Email address of the account to restore.","examples":["user@example.com"],"type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["emailInput","csrfToken"],"properties":{"emailInput":{"description":"Email address of the account to restore.","examples":["user@example.com"],"type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["emailInput","csrfToken"],"properties":{"emailInput":{"description":"Email address of the account to restore.","examples":["user@example.com"],"type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/account/activity-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status"]}}}}},"operationId":"postBffAccountActivity-status","tags":["Account"],"summary":"Set activity status","description":"Stores the manual availability of the authenticated person (global across organisations). The effective status shown to colleagues combines it with the last heartbeat, see `GET /bff/presence/members`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"nullable":true,"anyOf":[{"description":"Manual availability: a online, b busy, d do not disturb, r be right back, w away, o out of office, v vacation, f appear offline. `null` clears the manual choice (status follows activity).","anyOf":[{"const":"a","type":"string"},{"const":"b","type":"string"},{"const":"d","type":"string"},{"const":"r","type":"string"},{"const":"w","type":"string"},{"const":"o","type":"string"},{"const":"v","type":"string"},{"const":"f","type":"string"}]},{"type":"null"}]},"until":{"nullable":true,"anyOf":[{"description":"ISO time when the manual status resets (\"DND for 1 hour\"); null = until changed.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["status"],"properties":{"status":{"nullable":true,"anyOf":[{"description":"Manual availability: a online, b busy, d do not disturb, r be right back, w away, o out of office, v vacation, f appear offline. `null` clears the manual choice (status follows activity).","anyOf":[{"const":"a","type":"string"},{"const":"b","type":"string"},{"const":"d","type":"string"},{"const":"r","type":"string"},{"const":"w","type":"string"},{"const":"o","type":"string"},{"const":"v","type":"string"},{"const":"f","type":"string"}]},{"type":"null"}]},"until":{"nullable":true,"anyOf":[{"description":"ISO time when the manual status resets (\"DND for 1 hour\"); null = until changed.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["status"],"properties":{"status":{"nullable":true,"anyOf":[{"description":"Manual availability: a online, b busy, d do not disturb, r be right back, w away, o out of office, v vacation, f appear offline. `null` clears the manual choice (status follows activity).","anyOf":[{"const":"a","type":"string"},{"const":"b","type":"string"},{"const":"d","type":"string"},{"const":"r","type":"string"},{"const":"w","type":"string"},{"const":"o","type":"string"},{"const":"v","type":"string"},{"const":"f","type":"string"}]},{"type":"null"}]},"until":{"nullable":true,"anyOf":[{"description":"ISO time when the manual status resets (\"DND for 1 hour\"); null = until changed.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/account/status":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}},"text/plain":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}}}}},"operationId":"getBffAccountStatus","tags":["Account"],"summary":"My status settings","description":"Manual availability with its reset time and the custom status (emoji, text, clear time)."}},"/bff/account/privacy":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}},"required":["readReceipts","lastSeen"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}},"required":["readReceipts","lastSeen"]}},"text/plain":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}},"required":["readReceipts","lastSeen"]}}}}},"operationId":"getBffAccountPrivacy","tags":["Account"],"summary":"My team chat privacy","description":"Read receipts and last seen; both reciprocal (off = I do not see them from others either)."},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}},"required":["readReceipts","lastSeen"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}},"required":["readReceipts","lastSeen"]}},"text/plain":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}},"required":["readReceipts","lastSeen"]}}}}},"operationId":"postBffAccountPrivacy","tags":["Account"],"summary":"Update my team chat privacy","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","properties":{"readReceipts":{"type":"boolean"},"lastSeen":{"type":"boolean"}}}}}}}},"/bff/account/quiet-hours":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}},"required":["start","end","weekends"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"start":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}},"required":["start","end","weekends"]}},"text/plain":{"schema":{"type":"object","properties":{"start":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}},"required":["start","end","weekends"]}}}}},"operationId":"getBffAccountQuiet-hours","tags":["Account"],"summary":"My quiet hours (Web Push silenced)"},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"start":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}},"required":["start","end","weekends"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"start":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}},"required":["start","end","weekends"]}},"text/plain":{"schema":{"type":"object","properties":{"start":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}},"required":["start","end","weekends"]}}}}},"operationId":"postBffAccountQuiet-hours","tags":["Account"],"summary":"Set my quiet hours","description":"Daily window in my time zone (may cross midnight) and/or the whole weekend. Web Push for chat messages, calls and meetings is silenced inside; unread counters still update.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["start","end","weekends"],"properties":{"start":{"nullable":true,"anyOf":[{"maxLength":5,"description":"HH:MM local, null = no daily window","type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"maxLength":5,"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["start","end","weekends"],"properties":{"start":{"nullable":true,"anyOf":[{"maxLength":5,"description":"HH:MM local, null = no daily window","type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"maxLength":5,"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["start","end","weekends"],"properties":{"start":{"nullable":true,"anyOf":[{"maxLength":5,"description":"HH:MM local, null = no daily window","type":"string"},{"type":"null"}]},"end":{"nullable":true,"anyOf":[{"maxLength":5,"type":"string"},{"type":"null"}]},"weekends":{"type":"boolean"}}}}}}}},"/bff/account/custom-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}},"text/plain":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}}}}},"operationId":"postBffAccountCustom-status","tags":["Account"],"summary":"Set my custom status","description":"Emoji + short text shown next to my name everywhere. Both empty clears it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"clearAt":{"nullable":true,"anyOf":[{"description":"ISO time; null = never.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"clearAt":{"nullable":true,"anyOf":[{"description":"ISO time; null = never.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"clearAt":{"nullable":true,"anyOf":[{"description":"ISO time; null = never.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/account/presence-idle":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAccountPresence-idle","tags":["Account"],"summary":"Report that I am idle / active again (automatic Away)","description":"Sent by the admin while idle (refreshed every minute, expires after 150 s) and once on return.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["idle"],"properties":{"idle":{"description":"No keyboard / mouse input in any of my tabs for 5 minutes.","type":"boolean"}},"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","required":["idle"],"properties":{"idle":{"description":"No keyboard / mouse input in any of my tabs for 5 minutes.","type":"boolean"}},"additionalProperties":false}},"text/plain":{"schema":{"type":"object","required":["idle"],"properties":{"idle":{"description":"No keyboard / mouse input in any of my tabs for 5 minutes.","type":"boolean"}},"additionalProperties":false}}}}}},"/bff/account/work-location-schedule":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}},"text/plain":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}}}}},"operationId":"postBffAccountWork-location-schedule","tags":["Account"],"summary":"Set my weekly work location plan","description":"Used whenever no work location is set for today.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["schedule"],"properties":{"schedule":{"nullable":true,"anyOf":[{"description":"ISO weekday \"1\" (Monday) … \"7\" → office | remote | travel; null clears the plan.","type":"object","patternProperties":{"^[1-7]$":{"maxLength":16,"type":"string"}}},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["schedule"],"properties":{"schedule":{"nullable":true,"anyOf":[{"description":"ISO weekday \"1\" (Monday) … \"7\" → office | remote | travel; null clears the plan.","type":"object","patternProperties":{"^[1-7]$":{"maxLength":16,"type":"string"}}},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["schedule"],"properties":{"schedule":{"nullable":true,"anyOf":[{"description":"ISO weekday \"1\" (Monday) … \"7\" → office | remote | travel; null clears the plan.","type":"object","patternProperties":{"^[1-7]$":{"maxLength":16,"type":"string"}}},{"type":"null"}]}}}}}}}},"/bff/account/work-location":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}},"text/plain":{"schema":{"type":"object","properties":{"activityStatus":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"activityStatusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusEmoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"statusClearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workLocationSchedule":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},{"type":"null"}]}},"required":["activityStatus","activityStatusUntil","statusEmoji","statusText","statusClearDate","workLocation","workLocationUntil","workLocationSchedule"]}}}}},"operationId":"postBffAccountWork-location","tags":["Account"],"summary":"Set my work location (Teams style)","description":"Where I work today; shown to colleagues next to my status until the end time.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["location"],"properties":{"location":{"nullable":true,"anyOf":[{"maxLength":16,"description":"office | remote | travel; null clears.","type":"string"},{"type":"null"}]},"until":{"nullable":true,"anyOf":[{"description":"ISO end, normally the end of my local day.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["location"],"properties":{"location":{"nullable":true,"anyOf":[{"maxLength":16,"description":"office | remote | travel; null clears.","type":"string"},{"type":"null"}]},"until":{"nullable":true,"anyOf":[{"description":"ISO end, normally the end of my local day.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["location"],"properties":{"location":{"nullable":true,"anyOf":[{"maxLength":16,"description":"office | remote | travel; null clears.","type":"string"},{"type":"null"}]},"until":{"nullable":true,"anyOf":[{"description":"ISO end, normally the end of my local day.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/account/set-activity-status":{"get":{"parameters":[{"description":"Activity status key (e.g. \"a\", \"b\", \"d\").","examples":["a"],"schema":{"type":"string"},"in":"query","name":"status","required":true}],"operationId":"getBffAccountSet-activity-status","tags":["Account"],"summary":"Set activity status (deprecated, use POST /bff/account/activity-status)","description":"Deprecated mutating GET kept for already-loaded admin tabs during the rollout. Remove after one release.","deprecated":true,"responses":{"200":{}}}},"/bff/account/set-name":{"post":{"parameters":[],"operationId":"postBffAccountSet-name","tags":["Account"],"summary":"Set user name","description":"Updates the first, last, and optionally middle name of the authenticated user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"description":"First name (will be capitalized).","type":"string"},"lastName":{"description":"Last name (will be capitalized).","type":"string"},"middleName":{"description":"Middle name (will be capitalized). Omit to leave unchanged.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"description":"First name (will be capitalized).","type":"string"},"lastName":{"description":"Last name (will be capitalized).","type":"string"},"middleName":{"description":"Middle name (will be capitalized). Omit to leave unchanged.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["firstName","lastName"],"properties":{"firstName":{"description":"First name (will be capitalized).","type":"string"},"lastName":{"description":"Last name (will be capitalized).","type":"string"},"middleName":{"description":"Middle name (will be capitalized). Omit to leave unchanged.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/account/update-profile":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAccountUpdate-profile","tags":["Account"],"summary":"Update user profile","description":"Partial update of the authenticated user profile. Only provided fields are changed. Supersedes /set-name for new code — supports all personal fields including birthday and gender.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"minLength":2,"maxLength":100,"description":"First name (will be capitalized).","type":"string"},"lastName":{"minLength":2,"maxLength":100,"description":"Last name (will be capitalized).","type":"string"},"middleName":{"nullable":true,"anyOf":[{"maxLength":100,"description":"Middle name (will be capitalized). Null to clear.","type":"string"},{"type":"null"}]},"birthday":{"nullable":true,"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Date of birth in ISO 8601 format (YYYY-MM-DD). Null to clear.","examples":["1990-05-15"],"type":"string"},{"type":"null"}]},"gender":{"nullable":true,"anyOf":[{"description":"Gender identifier: \"male\", \"female\", \"other\", or null to clear.","examples":["male"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"firstName":{"minLength":2,"maxLength":100,"description":"First name (will be capitalized).","type":"string"},"lastName":{"minLength":2,"maxLength":100,"description":"Last name (will be capitalized).","type":"string"},"middleName":{"nullable":true,"anyOf":[{"maxLength":100,"description":"Middle name (will be capitalized). Null to clear.","type":"string"},{"type":"null"}]},"birthday":{"nullable":true,"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Date of birth in ISO 8601 format (YYYY-MM-DD). Null to clear.","examples":["1990-05-15"],"type":"string"},{"type":"null"}]},"gender":{"nullable":true,"anyOf":[{"description":"Gender identifier: \"male\", \"female\", \"other\", or null to clear.","examples":["male"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"firstName":{"minLength":2,"maxLength":100,"description":"First name (will be capitalized).","type":"string"},"lastName":{"minLength":2,"maxLength":100,"description":"Last name (will be capitalized).","type":"string"},"middleName":{"nullable":true,"anyOf":[{"maxLength":100,"description":"Middle name (will be capitalized). Null to clear.","type":"string"},{"type":"null"}]},"birthday":{"nullable":true,"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Date of birth in ISO 8601 format (YYYY-MM-DD). Null to clear.","examples":["1990-05-15"],"type":"string"},{"type":"null"}]},"gender":{"nullable":true,"anyOf":[{"description":"Gender identifier: \"male\", \"female\", \"other\", or null to clear.","examples":["male"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/account/setup-otp-generate-secret":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"description":"Base32-encoded TOTP secret (RFC 4648, A–Z2–7, 32 chars).","type":"string"},"otpAuthUri":{"description":"Canonical otpauth://totp/... URI suitable for direct QR encoding (works with all TOTP apps).","type":"string"},"qrCodeUrl":{"description":"Pre-rendered QR code image URL hosted on cdn.bizkithub.com.","type":"string"}},"required":["secret","otpAuthUri","qrCodeUrl"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"secret":{"description":"Base32-encoded TOTP secret (RFC 4648, A–Z2–7, 32 chars).","type":"string"},"otpAuthUri":{"description":"Canonical otpauth://totp/... URI suitable for direct QR encoding (works with all TOTP apps).","type":"string"},"qrCodeUrl":{"description":"Pre-rendered QR code image URL hosted on cdn.bizkithub.com.","type":"string"}},"required":["secret","otpAuthUri","qrCodeUrl"]}},"text/plain":{"schema":{"type":"object","properties":{"secret":{"description":"Base32-encoded TOTP secret (RFC 4648, A–Z2–7, 32 chars).","type":"string"},"otpAuthUri":{"description":"Canonical otpauth://totp/... URI suitable for direct QR encoding (works with all TOTP apps).","type":"string"},"qrCodeUrl":{"description":"Pre-rendered QR code image URL hosted on cdn.bizkithub.com.","type":"string"}},"required":["secret","otpAuthUri","qrCodeUrl"]}}}}},"operationId":"postBffAccountSetup-otp-generate-secret","tags":["Account"],"summary":"Generate OTP secret","description":"Generates a fresh RFC 4226 base32 TOTP secret (160 bits) plus the canonical otpauth:// URI for QR-code rendering. The secret is NOT persisted yet — call /setup-otp-save with a verification code to enable 2FA."}},"/bff/account/setup-otp-save":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","reason"],"properties":{"success":{"const":false,"type":"boolean"},"reason":{"const":"invalid-code","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","reason"],"properties":{"success":{"const":false,"type":"boolean"},"reason":{"const":"invalid-code","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","reason"],"properties":{"success":{"const":false,"type":"boolean"},"reason":{"const":"invalid-code","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","reason"],"properties":{"success":{"const":false,"type":"boolean"},"reason":{"const":"invalid-code","type":"string"}}}]}}}}},"operationId":"postBffAccountSetup-otp-save","tags":["Account"],"summary":"Activate 2FA on the account","description":"Verifies the 6-digit TOTP code against the supplied base32 secret. On success persists the secret on cas__user.otp_code and sets otp_enabled_date = NOW(); on failure returns `{ success: false, reason: \"invalid-code\" }` so the UI can prompt the user to retry.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["secret","otpCode"],"properties":{"secret":{"description":"Base32 TOTP secret returned by /setup-otp-generate-secret.","type":"string"},"otpCode":{"description":"6-digit code shown by the authenticator app right now — proves the user actually scanned the QR.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["secret","otpCode"],"properties":{"secret":{"description":"Base32 TOTP secret returned by /setup-otp-generate-secret.","type":"string"},"otpCode":{"description":"6-digit code shown by the authenticator app right now — proves the user actually scanned the QR.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["secret","otpCode"],"properties":{"secret":{"description":"Base32 TOTP secret returned by /setup-otp-generate-secret.","type":"string"},"otpCode":{"description":"6-digit code shown by the authenticator app right now — proves the user actually scanned the QR.","type":"string"}}}}}}}},"/bff/account/setup-otp-disable":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","reason"],"properties":{"success":{"const":false,"type":"boolean"},"reason":{"const":"invalid-code","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","reason"],"properties":{"success":{"const":false,"type":"boolean"},"reason":{"const":"invalid-code","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","reason"],"properties":{"success":{"const":false,"type":"boolean"},"reason":{"const":"invalid-code","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","reason"],"properties":{"success":{"const":false,"type":"boolean"},"reason":{"const":"invalid-code","type":"string"}}}]}}}}},"operationId":"postBffAccountSetup-otp-disable","tags":["Account"],"summary":"Disable 2FA on the account","description":"Removes the stored TOTP secret after verifying the user can still produce a valid code. When the user has no 2FA configured, returns `{ success: true }` as a no-op.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["otpCode"],"properties":{"otpCode":{"description":"Current 6-digit TOTP code from the authenticator app — required to prove the request comes from the legitimate device and is not a session-hijack attempt to drop 2FA.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["otpCode"],"properties":{"otpCode":{"description":"Current 6-digit TOTP code from the authenticator app — required to prove the request comes from the legitimate device and is not a session-hijack attempt to drop 2FA.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["otpCode"],"properties":{"otpCode":{"description":"Current 6-digit TOTP code from the authenticator app — required to prove the request comes from the legitimate device and is not a session-hijack attempt to drop 2FA.","type":"string"}}}}}}}},"/bff/account/sync-status":{"get":{"operationId":"getBffAccountSync-status","tags":["Account"],"summary":"Get sync status","description":"Returns the current authentication and session sync status based on request geo data.","responses":{"200":{}}}},"/bff/account/create-login-attempt":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success","identifier"],"properties":{"success":{"const":true,"type":"boolean"},"identifier":{"examples":["03oq7hsu9Iv70QogX0vBIcjDElj27WWe"],"type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"examples":["No account exists for this e-mail. Please check the value or create a new account."],"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","identifier"],"properties":{"success":{"const":true,"type":"boolean"},"identifier":{"examples":["03oq7hsu9Iv70QogX0vBIcjDElj27WWe"],"type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"examples":["No account exists for this e-mail. Please check the value or create a new account."],"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","identifier"],"properties":{"success":{"const":true,"type":"boolean"},"identifier":{"examples":["03oq7hsu9Iv70QogX0vBIcjDElj27WWe"],"type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"examples":["No account exists for this e-mail. Please check the value or create a new account."],"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","identifier"],"properties":{"success":{"const":true,"type":"boolean"},"identifier":{"examples":["03oq7hsu9Iv70QogX0vBIcjDElj27WWe"],"type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"examples":["No account exists for this e-mail. Please check the value or create a new account."],"type":"string"}}}]}}}}},"operationId":"postBffAccountCreate-login-attempt","tags":["Account"],"summary":"Create login attempt","description":"Creates a login attempt record and returns an identifier used for the subsequent /login call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["username","csrfToken"],"properties":{"username":{"description":"Username (email) to create a login attempt for.","examples":["janbarasek@gmail.com"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["username","csrfToken"],"properties":{"username":{"description":"Username (email) to create a login attempt for.","examples":["janbarasek@gmail.com"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["username","csrfToken"],"properties":{"username":{"description":"Username (email) to create a login attempt for.","examples":["janbarasek@gmail.com"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/account/login":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success","identity","needOtp","locale"],"properties":{"success":{"const":true,"type":"boolean"},"identity":{"examples":["03oq7hsu9Iv70QogX0vBIcjDElj27WWe"],"type":"string"},"needOtp":{"examples":false,"type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"examples":["User can not be logged in."],"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","identity","needOtp","locale"],"properties":{"success":{"const":true,"type":"boolean"},"identity":{"examples":["03oq7hsu9Iv70QogX0vBIcjDElj27WWe"],"type":"string"},"needOtp":{"examples":false,"type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"examples":["User can not be logged in."],"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","identity","needOtp","locale"],"properties":{"success":{"const":true,"type":"boolean"},"identity":{"examples":["03oq7hsu9Iv70QogX0vBIcjDElj27WWe"],"type":"string"},"needOtp":{"examples":false,"type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"examples":["User can not be logged in."],"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","identity","needOtp","locale"],"properties":{"success":{"const":true,"type":"boolean"},"identity":{"examples":["03oq7hsu9Iv70QogX0vBIcjDElj27WWe"],"type":"string"},"needOtp":{"examples":false,"type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"examples":["User can not be logged in."],"type":"string"}}}]}}}}},"operationId":"postBffAccountLogin","tags":["Account"],"summary":"Log in","description":"Authenticates the user with credentials and a valid login attempt identifier.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["username","password","attempt"],"properties":{"username":{"minLength":1,"description":"Username (email) of the account.","type":"string"},"password":{"minLength":1,"description":"Account password.","type":"string"},"attempt":{"minLength":1,"description":"Login attempt identifier from /create-login-attempt.","type":"string"},"host":{"description":"Optional host origin for cross-domain login.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["username","password","attempt"],"properties":{"username":{"minLength":1,"description":"Username (email) of the account.","type":"string"},"password":{"minLength":1,"description":"Account password.","type":"string"},"attempt":{"minLength":1,"description":"Login attempt identifier from /create-login-attempt.","type":"string"},"host":{"description":"Optional host origin for cross-domain login.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["username","password","attempt"],"properties":{"username":{"minLength":1,"description":"Username (email) of the account.","type":"string"},"password":{"minLength":1,"description":"Account password.","type":"string"},"attempt":{"minLength":1,"description":"Login attempt identifier from /create-login-attempt.","type":"string"},"host":{"description":"Optional host origin for cross-domain login.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}}}},"/bff/account/logout":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAccountLogout","tags":["Account"],"summary":"Log out","description":"Logs out a specific session or all other sessions for the authenticated user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"identityId":{"description":"Identity to log out (defaults to current session).","type":"string"},"logoutAllOther":{"description":"Log out all other sessions instead.","examples":[false],"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"identityId":{"description":"Identity to log out (defaults to current session).","type":"string"},"logoutAllOther":{"description":"Log out all other sessions instead.","examples":[false],"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","properties":{"identityId":{"description":"Identity to log out (defaults to current session).","type":"string"},"logoutAllOther":{"description":"Log out all other sessions instead.","examples":[false],"type":"boolean"}}}}}}}},"/bff/account/self-logout":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAccountSelf-logout","tags":["Account"],"summary":"Force logout of the current cookie","description":"Clears the identity cookie and invalidates the underlying login-identity record without requiring a still-valid session. Used by admin as a recovery path when the browser holds a cookie the server no longer accepts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}},"multipart/form-data":{"schema":{"type":"object","properties":{}}},"text/plain":{"schema":{"type":"object","properties":{}}}}}}},"/bff/account/create-account":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the account was created.","type":"boolean"},"pendingSigninToken":{"description":"Secret handle the browser stores in sessionStorage so it can poll /bff/account/verify-signup-poll and claim a session automatically when the user clicks the e-mail link on a different device. 24-char opaque; single-use once verified.","minLength":24,"maxLength":24,"type":"string"}},"required":["success","pendingSigninToken"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the account was created.","type":"boolean"},"pendingSigninToken":{"description":"Secret handle the browser stores in sessionStorage so it can poll /bff/account/verify-signup-poll and claim a session automatically when the user clicks the e-mail link on a different device. 24-char opaque; single-use once verified.","minLength":24,"maxLength":24,"type":"string"}},"required":["success","pendingSigninToken"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the account was created.","type":"boolean"},"pendingSigninToken":{"description":"Secret handle the browser stores in sessionStorage so it can poll /bff/account/verify-signup-poll and claim a session automatically when the user clicks the e-mail link on a different device. 24-char opaque; single-use once verified.","minLength":24,"maxLength":24,"type":"string"}},"required":["success","pendingSigninToken"]}}}}},"operationId":"postBffAccountCreate-account","tags":["Account"],"summary":"Create account","description":"Registers a new user account and sends a confirmation email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["locale","emailInput","firstName","lastName","passwordInput","passwordAgain","csrfToken"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"organisationName":{"description":"Optional up-front organisation name. When omitted, the follow-up e-mail confirmation creates only the user account; the new user then joins an org either by accepting a pending invitation or by creating one from /onboarding.","type":"string"},"emailInput":{"description":"Email address for the new account.","examples":["user@example.com"],"type":"string"},"firstName":{"minLength":2,"description":"First name of the account holder.","type":"string"},"lastName":{"minLength":2,"description":"Last name of the account holder.","type":"string"},"passwordInput":{"minLength":8,"description":"Password (min 8 characters).","type":"string"},"passwordAgain":{"minLength":8,"description":"Password confirmation (must match passwordInput).","type":"string"},"checkboxTerms":{"description":"Whether terms and conditions were accepted.","type":"boolean"},"checkboxMarketing":{"description":"Whether marketing consent was given.","default":true,"type":"boolean"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["locale","emailInput","firstName","lastName","passwordInput","passwordAgain","csrfToken"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"organisationName":{"description":"Optional up-front organisation name. When omitted, the follow-up e-mail confirmation creates only the user account; the new user then joins an org either by accepting a pending invitation or by creating one from /onboarding.","type":"string"},"emailInput":{"description":"Email address for the new account.","examples":["user@example.com"],"type":"string"},"firstName":{"minLength":2,"description":"First name of the account holder.","type":"string"},"lastName":{"minLength":2,"description":"Last name of the account holder.","type":"string"},"passwordInput":{"minLength":8,"description":"Password (min 8 characters).","type":"string"},"passwordAgain":{"minLength":8,"description":"Password confirmation (must match passwordInput).","type":"string"},"checkboxTerms":{"description":"Whether terms and conditions were accepted.","type":"boolean"},"checkboxMarketing":{"description":"Whether marketing consent was given.","default":true,"type":"boolean"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["locale","emailInput","firstName","lastName","passwordInput","passwordAgain","csrfToken"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"organisationName":{"description":"Optional up-front organisation name. When omitted, the follow-up e-mail confirmation creates only the user account; the new user then joins an org either by accepting a pending invitation or by creating one from /onboarding.","type":"string"},"emailInput":{"description":"Email address for the new account.","examples":["user@example.com"],"type":"string"},"firstName":{"minLength":2,"description":"First name of the account holder.","type":"string"},"lastName":{"minLength":2,"description":"Last name of the account holder.","type":"string"},"passwordInput":{"minLength":8,"description":"Password (min 8 characters).","type":"string"},"passwordAgain":{"minLength":8,"description":"Password confirmation (must match passwordInput).","type":"string"},"checkboxTerms":{"description":"Whether terms and conditions were accepted.","type":"boolean"},"checkboxMarketing":{"description":"Whether marketing consent was given.","default":true,"type":"boolean"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/account/create-account-by-token":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the account was activated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the account was activated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the account was activated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAccountCreate-account-by-token","tags":["Account"],"summary":"Confirm account by token","description":"Activates a previously created account using the confirmation token from email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"Confirmation token from the registration email.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"Confirmation token from the registration email.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"Confirmation token from the registration email.","type":"string"}}}}}}}},"/bff/account/verify-signup":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["status"],"properties":{"status":{"const":"ok","type":"string"}}},{"type":"object","required":["status","attemptsLeft"],"properties":{"status":{"const":"wrong_code","type":"string"},"attemptsLeft":{"type":"number"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"locked","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"already_verified","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["status"],"properties":{"status":{"const":"ok","type":"string"}}},{"type":"object","required":["status","attemptsLeft"],"properties":{"status":{"const":"wrong_code","type":"string"},"attemptsLeft":{"type":"number"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"locked","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"already_verified","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["status"],"properties":{"status":{"const":"ok","type":"string"}}},{"type":"object","required":["status","attemptsLeft"],"properties":{"status":{"const":"wrong_code","type":"string"},"attemptsLeft":{"type":"number"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"locked","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"already_verified","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["status"],"properties":{"status":{"const":"ok","type":"string"}}},{"type":"object","required":["status","attemptsLeft"],"properties":{"status":{"const":"wrong_code","type":"string"},"attemptsLeft":{"type":"number"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"locked","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"already_verified","type":"string"}}}]}}}}},"operationId":"postBffAccountVerify-signup","tags":["Account"],"summary":"Verify a pending signup (code or token)","description":"Dual-channel verification for the new signup flow. On success, materialises the cas__user, marks the pending request as verified, and sets a session cookie in the same response so the caller can redirect straight to `/`. Returns a discriminated-union error payload for every failure mode so the UI can render precise copy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["by","email","code"],"properties":{"by":{"const":"code","type":"string"},"email":{"description":"E-mail address used in the pending signup.","type":"string"},"code":{"minLength":6,"maxLength":6,"description":"6-digit code from the confirmation e-mail.","type":"string"}}},{"type":"object","required":["by","token"],"properties":{"by":{"const":"token","type":"string"},"token":{"minLength":32,"maxLength":32,"description":"32-char token from the confirmation link.","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["by","email","code"],"properties":{"by":{"const":"code","type":"string"},"email":{"description":"E-mail address used in the pending signup.","type":"string"},"code":{"minLength":6,"maxLength":6,"description":"6-digit code from the confirmation e-mail.","type":"string"}}},{"type":"object","required":["by","token"],"properties":{"by":{"const":"token","type":"string"},"token":{"minLength":32,"maxLength":32,"description":"32-char token from the confirmation link.","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["by","email","code"],"properties":{"by":{"const":"code","type":"string"},"email":{"description":"E-mail address used in the pending signup.","type":"string"},"code":{"minLength":6,"maxLength":6,"description":"6-digit code from the confirmation e-mail.","type":"string"}}},{"type":"object","required":["by","token"],"properties":{"by":{"const":"token","type":"string"},"token":{"minLength":32,"maxLength":32,"description":"32-char token from the confirmation link.","type":"string"}}}]}}}}}},"/bff/account/verify-signup-poll":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["status"],"properties":{"status":{"const":"ok","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"waiting","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["status"],"properties":{"status":{"const":"ok","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"waiting","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["status"],"properties":{"status":{"const":"ok","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"waiting","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["status"],"properties":{"status":{"const":"ok","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"waiting","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}}]}}}}},"operationId":"postBffAccountVerify-signup-poll","tags":["Account"],"summary":"Poll signup verification status","description":"Called every few seconds by the signup success screen so a browser that received the signin token can claim a session once the e-mail is verified on any device. One-shot — the token is invalidated after a successful exchange.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pendingSigninToken"],"properties":{"pendingSigninToken":{"minLength":24,"maxLength":24,"description":"Secret handle returned by /bff/account/create-account and stored in the browser.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["pendingSigninToken"],"properties":{"pendingSigninToken":{"minLength":24,"maxLength":24,"description":"Secret handle returned by /bff/account/create-account and stored in the browser.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["pendingSigninToken"],"properties":{"pendingSigninToken":{"minLength":24,"maxLength":24,"description":"Secret handle returned by /bff/account/create-account and stored in the browser.","type":"string"}}}}}}}},"/bff/account/resend-verification":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["status","resendCountLeft"],"properties":{"status":{"const":"ok","type":"string"},"resendCountLeft":{"type":"number"}}},{"type":"object","required":["status","retryInMs"],"properties":{"status":{"const":"cooldown","type":"string"},"retryInMs":{"type":"number"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"resend_exhausted","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["status","resendCountLeft"],"properties":{"status":{"const":"ok","type":"string"},"resendCountLeft":{"type":"number"}}},{"type":"object","required":["status","retryInMs"],"properties":{"status":{"const":"cooldown","type":"string"},"retryInMs":{"type":"number"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"resend_exhausted","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["status","resendCountLeft"],"properties":{"status":{"const":"ok","type":"string"},"resendCountLeft":{"type":"number"}}},{"type":"object","required":["status","retryInMs"],"properties":{"status":{"const":"cooldown","type":"string"},"retryInMs":{"type":"number"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"resend_exhausted","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["status","resendCountLeft"],"properties":{"status":{"const":"ok","type":"string"},"resendCountLeft":{"type":"number"}}},{"type":"object","required":["status","retryInMs"],"properties":{"status":{"const":"cooldown","type":"string"},"retryInMs":{"type":"number"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"resend_exhausted","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"expired","type":"string"}}},{"type":"object","required":["status"],"properties":{"status":{"const":"not_found","type":"string"}}}]}}}}},"operationId":"postBffAccountResend-verification","tags":["Account"],"summary":"Resend signup verification e-mail","description":"Mints a fresh 6-digit code and re-sends the confirmation e-mail. Capped at 3 resends per signup and 60 s between each. The 32-char link token is preserved so earlier e-mail links keep working.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"description":"E-mail address used in the pending signup.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"description":"E-mail address used in the pending signup.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"description":"E-mail address used in the pending signup.","type":"string"}}}}}}}},"/bff/account/member-invite-validate":{"get":{"parameters":[{"description":"Invitation token from the e-mail link.","schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getBffAccountMember-invite-validate","tags":["Account"],"summary":"Validate a member-invitation token (BFF)","description":"Same shape as /api/v1/crm/member-invite/validate, no API key required — the token itself is the credential. Used by admin.bizkithub.com/signup/member.","responses":{"200":{}}}},"/bff/account/member-invite-complete":{"post":{"parameters":[],"operationId":"postBffAccountMember-invite-complete","tags":["Account"],"summary":"Complete a member invitation (BFF)","description":"Same shape as /api/v1/crm/member-invite/complete, no API key required — the token is the credential. Used by admin.bizkithub.com/signup/member.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","firstName","lastName","password","agreeToTerms","csrfToken"],"properties":{"token":{"description":"Invitation token from the e-mail link.","type":"string"},"firstName":{"description":"First name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"lastName":{"description":"Last name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"password":{"description":"Chosen account password.","minLength":8,"type":"string"},"agreeToTerms":{"description":"Accepted Terms of Service.","type":"boolean"},"agreeToMarketing":{"description":"Accepted marketing communications.","type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","firstName","lastName","password","agreeToTerms","csrfToken"],"properties":{"token":{"description":"Invitation token from the e-mail link.","type":"string"},"firstName":{"description":"First name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"lastName":{"description":"Last name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"password":{"description":"Chosen account password.","minLength":8,"type":"string"},"agreeToTerms":{"description":"Accepted Terms of Service.","type":"boolean"},"agreeToMarketing":{"description":"Accepted marketing communications.","type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token","firstName","lastName","password","agreeToTerms","csrfToken"],"properties":{"token":{"description":"Invitation token from the e-mail link.","type":"string"},"firstName":{"description":"First name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"lastName":{"description":"Last name of the invitee.","minLength":1,"maxLength":128,"type":"string"},"password":{"description":"Chosen account password.","minLength":8,"type":"string"},"agreeToTerms":{"description":"Accepted Terms of Service.","type":"boolean"},"agreeToMarketing":{"description":"Accepted marketing communications.","type":"boolean"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"csrfToken":{"description":"One-shot CSRF token from /bff/csrf/create.","minLength":16,"maxLength":16,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/account/pending-invites":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["token","organisationId","organisationSlug","organisationName","organisationLogoUrl","firstName","lastName","expirationDate","insertedDate","pendingRoleCodes","pendingPermissionCodes","inviterMemberId"],"properties":{"token":{"description":"Invitation token — pass back to /accept-pending-invite.","type":"string"},"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"organisationLogoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expirationDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"pendingRoleCodes":{"type":"array","items":{"type":"string"}},"pendingPermissionCodes":{"type":"array","items":{"type":"string"}},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["token","organisationId","organisationSlug","organisationName","organisationLogoUrl","firstName","lastName","expirationDate","insertedDate","pendingRoleCodes","pendingPermissionCodes","inviterMemberId"],"properties":{"token":{"description":"Invitation token — pass back to /accept-pending-invite.","type":"string"},"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"organisationLogoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expirationDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"pendingRoleCodes":{"type":"array","items":{"type":"string"}},"pendingPermissionCodes":{"type":"array","items":{"type":"string"}},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["token","organisationId","organisationSlug","organisationName","organisationLogoUrl","firstName","lastName","expirationDate","insertedDate","pendingRoleCodes","pendingPermissionCodes","inviterMemberId"],"properties":{"token":{"description":"Invitation token — pass back to /accept-pending-invite.","type":"string"},"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"organisationLogoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expirationDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"pendingRoleCodes":{"type":"array","items":{"type":"string"}},"pendingPermissionCodes":{"type":"array","items":{"type":"string"}},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffAccountPending-invites","tags":["Account"],"summary":"List pending organisation invitations for the signed-in user","description":"Returns non-expired member invitations whose e-mail matches the signed-in user's username (case-insensitive). Powers the /onboarding UI on admin.bizkithub.com."}},"/bff/account/accept-pending-invite":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"memberId":{"type":"number"},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"invitedEmail":{"type":"string"}},"required":["success","organisationId","organisationSlug","organisationName","memberId","inviterMemberId","invitedEmail"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"memberId":{"type":"number"},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"invitedEmail":{"type":"string"}},"required":["success","organisationId","organisationSlug","organisationName","memberId","inviterMemberId","invitedEmail"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"memberId":{"type":"number"},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"invitedEmail":{"type":"string"}},"required":["success","organisationId","organisationSlug","organisationName","memberId","inviterMemberId","invitedEmail"]}}}}},"operationId":"postBffAccountAccept-pending-invite","tags":["Account"],"summary":"Accept a pending organisation invitation (signed-in flow)","description":"Materializes a `cas__user_request_member` row into an active `cas__organisation_member` for the signed-in user, applies pre-granted role/permission codes, and deletes the pending row. The token must be addressed to the signed-in account (e-mail match).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"Invitation token from /pending-invites.","minLength":8,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"Invitation token from /pending-invites.","minLength":8,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token"],"properties":{"token":{"description":"Invitation token from /pending-invites.","minLength":8,"type":"string"}}}}}}}},"/bff/account/accept-all-pending-invites":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"accepted":{"type":"array","items":{"type":"object","required":["organisationId","organisationSlug","organisationName","memberId","inviterMemberId","invitedEmail"],"properties":{"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"memberId":{"type":"number"},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"invitedEmail":{"type":"string"}}}},"failed":{"type":"array","items":{"type":"object","required":["token","reason"],"properties":{"token":{"type":"string"},"reason":{"type":"string"}}}},"acceptedCount":{"type":"number"},"failedCount":{"type":"number"}},"required":["success","accepted","failed","acceptedCount","failedCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"accepted":{"type":"array","items":{"type":"object","required":["organisationId","organisationSlug","organisationName","memberId","inviterMemberId","invitedEmail"],"properties":{"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"memberId":{"type":"number"},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"invitedEmail":{"type":"string"}}}},"failed":{"type":"array","items":{"type":"object","required":["token","reason"],"properties":{"token":{"type":"string"},"reason":{"type":"string"}}}},"acceptedCount":{"type":"number"},"failedCount":{"type":"number"}},"required":["success","accepted","failed","acceptedCount","failedCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"accepted":{"type":"array","items":{"type":"object","required":["organisationId","organisationSlug","organisationName","memberId","inviterMemberId","invitedEmail"],"properties":{"organisationId":{"type":"number"},"organisationSlug":{"type":"string"},"organisationName":{"type":"string"},"memberId":{"type":"number"},"inviterMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"invitedEmail":{"type":"string"}}}},"failed":{"type":"array","items":{"type":"object","required":["token","reason"],"properties":{"token":{"type":"string"},"reason":{"type":"string"}}}},"acceptedCount":{"type":"number"},"failedCount":{"type":"number"}},"required":["success","accepted","failed","acceptedCount","failedCount"]}}}}},"operationId":"postBffAccountAccept-all-pending-invites","tags":["Account"],"summary":"Accept every pending organisation invitation for the signed-in user","description":"Bulk version of /accept-pending-invite. Each invite is materialized independently so a single failing token (e.g. cancelled by an admin between list and accept) does not stop the rest."}},"/bff/account/public-profile":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["headline","bio","location","workingHours","skills","awayUntil","awayMessage"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["headline","bio","location","workingHours","skills","awayUntil","awayMessage"]}},"text/plain":{"schema":{"type":"object","properties":{"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["headline","bio","location","workingHours","skills","awayUntil","awayMessage"]}}}}},"operationId":"getBffAccountPublic-profile","tags":["Account"],"summary":"My public profile (headline, bio, skills, away)","description":"Global (cas__user), shown to colleagues in every organisation and in team chat."},"put":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"putBffAccountPublic-profile","tags":["Account"],"summary":"Update my public profile","description":"Only supplied fields change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"headline":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"skills":{"maxItems":50,"type":"array","items":{"maxLength":100,"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"maxLength":40,"description":"ISO date-time; null / past = not away.","type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"maxLength":280,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"headline":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"skills":{"maxItems":50,"type":"array","items":{"maxLength":100,"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"maxLength":40,"description":"ISO date-time; null / past = not away.","type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"maxLength":280,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"headline":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"skills":{"maxItems":50,"type":"array","items":{"maxLength":100,"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"maxLength":40,"description":"ISO date-time; null / past = not away.","type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"maxLength":280,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/account/profile":{"put":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"updated":{"description":"False when no field was supplied; true when at least one column was written.","type":"boolean"}},"required":["success","updated"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"updated":{"description":"False when no field was supplied; true when at least one column was written.","type":"boolean"}},"required":["success","updated"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"updated":{"description":"False when no field was supplied; true when at least one column was written.","type":"boolean"}},"required":["success","updated"]}}}}},"operationId":"putBffAccountProfile","tags":["Account"],"summary":"Update the signed-in user's global profile","description":"Writes to `cas__user` — the authoritative global identity carrier. Every field is optional; only supplied fields are updated. Same person visible in every org they belong to.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"description":"Given name.","maxLength":128,"type":"string"},"lastName":{"description":"Family name.","maxLength":128,"type":"string"},"timezoneId":{"description":"cas__timezone.id — IANA-backed timezone reference.","type":"number"},"primaryLocaleId":{"description":"core__localization_locale.id — user's preferred locale.","type":"number"},"avatarBlobId":{"anyOf":[{"description":"core__blob.id — new avatar reference.","type":"number"},{"description":"Clear the current avatar.","type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"firstName":{"description":"Given name.","maxLength":128,"type":"string"},"lastName":{"description":"Family name.","maxLength":128,"type":"string"},"timezoneId":{"description":"cas__timezone.id — IANA-backed timezone reference.","type":"number"},"primaryLocaleId":{"description":"core__localization_locale.id — user's preferred locale.","type":"number"},"avatarBlobId":{"anyOf":[{"description":"core__blob.id — new avatar reference.","type":"number"},{"description":"Clear the current avatar.","type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"firstName":{"description":"Given name.","maxLength":128,"type":"string"},"lastName":{"description":"Family name.","maxLength":128,"type":"string"},"timezoneId":{"description":"cas__timezone.id — IANA-backed timezone reference.","type":"number"},"primaryLocaleId":{"description":"core__localization_locale.id — user's preferred locale.","type":"number"},"avatarBlobId":{"anyOf":[{"description":"core__blob.id — new avatar reference.","type":"number"},{"description":"Clear the current avatar.","type":"null"}]}}}}}}}},"/bff/account/change-password":{"put":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"putBffAccountChange-password","tags":["Account"],"summary":"Change the signed-in user's BKH platform password","description":"In-session password change. Verifies the current password against cas__user.password (with a shop__contact.password fallback while the identity migration is in progress), then writes a fresh bcrypt hash to BOTH cas__user.password and shop__contact.password inside one transaction.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["currentPassword","newPassword","newPasswordAgain"],"properties":{"currentPassword":{"description":"Password currently in use — verified before the change is applied.","type":"string"},"newPassword":{"description":"New password. Must satisfy the platform strength policy.","minLength":8,"type":"string"},"newPasswordAgain":{"description":"Confirmation of the new password. Must equal newPassword.","minLength":8,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["currentPassword","newPassword","newPasswordAgain"],"properties":{"currentPassword":{"description":"Password currently in use — verified before the change is applied.","type":"string"},"newPassword":{"description":"New password. Must satisfy the platform strength policy.","minLength":8,"type":"string"},"newPasswordAgain":{"description":"Confirmation of the new password. Must equal newPassword.","minLength":8,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["currentPassword","newPassword","newPasswordAgain"],"properties":{"currentPassword":{"description":"Password currently in use — verified before the change is applied.","type":"string"},"newPassword":{"description":"New password. Must satisfy the platform strength policy.","minLength":8,"type":"string"},"newPasswordAgain":{"description":"Confirmation of the new password. Must equal newPassword.","minLength":8,"type":"string"}}}}}}}},"/bff/account/switch-org":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"organisationSlug":{"type":"string"},"organisationId":{"type":"number"},"memberId":{"type":"number"}},"required":["success","organisationSlug","organisationId","memberId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"organisationSlug":{"type":"string"},"organisationId":{"type":"number"},"memberId":{"type":"number"}},"required":["success","organisationSlug","organisationId","memberId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"organisationSlug":{"type":"string"},"organisationId":{"type":"number"},"memberId":{"type":"number"}},"required":["success","organisationSlug","organisationId","memberId"]}}}}},"operationId":"postBffAccountSwitch-org","tags":["Account"],"summary":"Switch the active organisation on the current session","description":"Updates `shop__contact_login_identity.member_id` in place, so no new cookie is issued and the identity token stays valid. Cheap alternative to /bff/cms/switch-organisation which rotates the session; the legacy endpoint stays available until the admin UI is migrated. Every successful switch is audited to `core__activity` in the target org as `account.switch_org` (level 0).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation the user wants to switch into. Must belong to the signed-in user (non-blocked membership, non-deleted org).","minLength":1,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation the user wants to switch into. Must belong to the signed-in user (non-blocked membership, non-deleted org).","minLength":1,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation the user wants to switch into. Must belong to the signed-in user (non-blocked membership, non-deleted org).","minLength":1,"type":"string"}}}}}}}},"/bff/activity/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Filter by event type (e.g. `order.create`).","examples":["order.create"],"schema":{"type":"string"},"in":"query","name":"type","required":false},{"description":"Filter by module: the part of `type` before the first dot (`order` matches `order.create`, `order.storno`, …). Same grouping as the module breakdown in `/statistics/insights`.","examples":["order"],"schema":{"type":"string"},"in":"query","name":"module","required":false},{"description":"Only Tier A (security-sensitive) event types: env access, API keys, webhooks, impersonation, …","schema":{"type":"string","const":"A"},"in":"query","name":"tier","required":false},{"description":"Polymorphic subject entity (DB table name). Used together with `subjectId` to load the \"Activity\" tab on a specific entity detail page.","examples":["shop__order"],"schema":{"type":"string"},"in":"query","name":"subjectEntity","required":false},{"description":"Polymorphic subject row id.","examples":["1234"],"schema":{"type":"string"},"in":"query","name":"subjectId","required":false},{"description":"Alternative to `subjectId` when the caller only has an external handle. Currently supported for `subjectEntity=shop__branch` (the slug). Resolved server-side to the numeric `subject_id`. Ignored when `subjectId` is also provided.","examples":["prague-central"],"schema":{"type":"string"},"in":"query","name":"subjectSlug","required":false},{"description":"Composite actor filter from the admin \"Kto\" dropdown. Format: `member:<external_id>` or `contact:<external_id>` (16-char `shop__contact.external_id`).","examples":["member:6NZboqKESgMFufqe","contact:Dlko1bEG85c6304a"],"schema":{"type":"string"},"in":"query","name":"actor","required":false},{"description":"Filter by actor kind.","examples":["member"],"schema":{"anyOf":[{"const":"member","type":"string"},{"const":"contact","type":"string"},{"const":"system","type":"string"},{"const":"cron","type":"string"},{"const":"api","type":"string"}]},"in":"query","name":"actorKind","required":false},{"description":"Filter by a specific staff member as actor (`cas__organisation_member.id`).","examples":["42"],"schema":{"type":"string"},"in":"query","name":"actorMemberId","required":false},{"description":"External 16-char id of the contact who acted.","examples":["Dlko1bEG85c6304a"],"schema":{"type":"string"},"in":"query","name":"actorContactExternalId","required":false},{"description":"External 16-char id of the contact the action was directed at.","examples":["Dlko1bEG85c6304a"],"schema":{"type":"string"},"in":"query","name":"targetContactExternalId","required":false},{"description":"External 16-char id matching the contact in *either* role — actor OR target. Used by the \"Aktivity\" tab on the contact detail page where the operator wants to see everything about a contact regardless of which side they played.","examples":["Dlko1bEG85c6304a"],"schema":{"type":"string"},"in":"query","name":"contactExternalId","required":false},{"description":"Minimum level (0 info, 1 notice, 2 warning).","examples":["1"],"schema":{"type":"string"},"in":"query","name":"minLevel","required":false},{"description":"ISO timestamp — events after this point.","examples":["2026-01-01T00:00:00Z"],"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"ISO timestamp — events before this point.","examples":["2026-12-31T23:59:59Z"],"schema":{"type":"string"},"in":"query","name":"dateTo","required":false},{"description":"Group all activities from one HTTP request / cron run.","examples":["iad1::cdy5w-1758481392361"],"schema":{"type":"string"},"in":"query","name":"correlationId","required":false}],"operationId":"getBffActivityList","tags":["Activity"],"summary":"List activity entries","description":"Returns a paginated list of activity entries for the current organisation. Supports filtering by event type, polymorphic subject, actor (member/contact/system/cron/api), target contact, level, time range, and correlation id.","responses":{"200":{}}}},"/bff/activity/detail":{"get":{"parameters":[{"description":"24-char activity external id (the URL slug from /activity/{id} in admin).","examples":["aZfP19992R1wD0Cp8hx7ao2w"],"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffActivityDetail","tags":["Activity"],"summary":"Get activity entry detail","description":"Returns a single activity entry with the full meta payload, geo enrichment and network context. Scoped to the current organisation.","responses":{"200":{}}}},"/bff/activity/statistics":{"get":{"parameters":[{"description":"Chart window: 30d (default), 90d or 365d.","examples":["30d"],"schema":{"type":"string"},"in":"query","name":"period","required":false}],"operationId":"getBffActivityStatistics","tags":["Activity"],"summary":"Activity statistics for the /activity panel","description":"Rolling pulse counts (1 h / 24 h / 7 d, warnings in 24 h), a zero-filled daily series split by actor group (member / contact / api / automation) with warnings, median and best day, the \"who\" column for the period (count per actor kind, top 5 members and top 5 contacts with avatar and the grid `actor` filter token), plus 7-day KPI trends (events, active members, acting contacts, warnings, AI-agent share, impersonated actions). Cached 60 s per organisation and period.","responses":{"200":{}}}},"/bff/activity/statistics/insights":{"get":{"parameters":[{"description":"Module breakdown window: 30d (default), 90d or 365d.","examples":["30d"],"schema":{"type":"string"},"in":"query","name":"period","required":false}],"operationId":"getBffActivityStatisticsInsights","tags":["Activity"],"summary":"Insights row for the /activity panel","description":"Module breakdown (part of `type` before the first dot) for the period vs. the previous period of the same length, Tier A security-sensitive events (24 h / 7 d counts + 8 latest rows) and unusual spikes (event types whose last 24 h exceed 3× the prior 7-day daily average). Cached 60 s per organisation and period.","responses":{"200":{}}}},"/bff/activity/statistics/heatmap":{"get":{"parameters":[{"description":"Window: 30d (default), 90d or 365d.","examples":["30d"],"schema":{"type":"string"},"in":"query","name":"period","required":false}],"operationId":"getBffActivityStatisticsHeatmap","tags":["Activity"],"summary":"Weekday × hour heatmap for the /activity panel","description":"Weekday (ISO, 1 = Monday) × hour distribution of all activity in the period, in the organisation timezone, split by actor group (member / contact / api / automation). Sparse cells. Cached 15 min.","responses":{"200":{}}}},"/bff/activity/statistics/modules":{"get":{"parameters":[{"description":"Window: 30d (default), 90d or 365d.","examples":["30d"],"schema":{"type":"string"},"in":"query","name":"period","required":false}],"operationId":"getBffActivityStatisticsModules","tags":["Activity"],"summary":"Daily activity by module for the /activity chart","description":"Zero-filled daily series for the period split by module (part of `type` before the first dot). The six named modules are the busiest of the last 365 days, so colours stay stable across periods; the last count of each day is every other module summed. Cached 60 s.","responses":{"200":{}}}},"/bff/activity/actors":{"get":{"operationId":"getBffActivityActors","tags":["Activity"],"summary":"List distinct actors who have written activity entries","description":"Returns staff members and external contacts who have authored at least one row in `core__activity` for the current organisation. Used to populate the leading \"Kto\" filter on the admin Aktivity grid — only real actors show up, no empty options.","responses":{"200":{}}}},"/bff/address/detail":{"get":{"parameters":[{"description":"External address identifier.","examples":["addr_abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"description":"Address detail.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Unique external address identifier.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","examples":["Nové Město"],"type":"string"},"stateRegion":{"description":"State or region.","examples":["Středočeský kraj"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"},"frozenAt":{"description":"ISO timestamp when this address was frozen into an immutable snapshot referenced by an order/invoice. When present, admin UI must hide the edit affordance and render a \"Read-only snapshot\" badge — the DB trigger rejects any mutation attempt anyway.","type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Unique external address identifier.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","examples":["Nové Město"],"type":"string"},"stateRegion":{"description":"State or region.","examples":["Středočeský kraj"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"},"frozenAt":{"description":"ISO timestamp when this address was frozen into an immutable snapshot referenced by an order/invoice. When present, admin UI must hide the edit affordance and render a \"Read-only snapshot\" badge — the DB trigger rejects any mutation attempt anyway.","type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Unique external address identifier.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","examples":["Nové Město"],"type":"string"},"stateRegion":{"description":"State or region.","examples":["Středočeský kraj"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"},"frozenAt":{"description":"ISO timestamp when this address was frozen into an immutable snapshot referenced by an order/invoice. When present, admin UI must hide the edit affordance and render a \"Read-only snapshot\" badge — the DB trigger rejects any mutation attempt anyway.","type":"string"}},"required":["id"]}}}}},"operationId":"getBffAddressDetail","tags":["Address"],"summary":"Get address detail","description":"Returns a single address record by its external ID."}},"/bff/address/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAddressCreate","tags":["Address"],"summary":"Create a new address","description":"Creates a new address record and links it to a contact identified by contactId.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"External address ID. Required for update, optional for create.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"contactId":{"description":"Contact external reference number to link address to.","examples":["cu_xyz789"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"External address ID. Required for update, optional for create.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"contactId":{"description":"Contact external reference number to link address to.","examples":["cu_xyz789"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"External address ID. Required for update, optional for create.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"contactId":{"description":"Contact external reference number to link address to.","examples":["cu_xyz789"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"}}}}}}}},"/bff/address/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAddressUpdate","tags":["Address"],"summary":"Update an existing address","description":"Updates an existing address record. The address ID must be provided in the body.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"External address ID. Required for update, optional for create.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"contactId":{"description":"Contact external reference number to link address to.","examples":["cu_xyz789"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"External address ID. Required for update, optional for create.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"contactId":{"description":"Contact external reference number to link address to.","examples":["cu_xyz789"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"External address ID. Required for update, optional for create.","examples":["addr_abc123"],"type":"string"},"type":{"description":"Address type: accounting, billing, deliveryGoods or deliveryInvoice.","examples":["billing"],"type":"string"},"contactId":{"description":"Contact external reference number to link address to.","examples":["cu_xyz789"],"type":"string"},"firstName":{"description":"First name.","examples":["Jan"],"type":"string"},"lastName":{"description":"Last name.","examples":["Novák"],"type":"string"},"companyName":{"description":"Company name.","examples":["Acme s.r.o."],"type":"string"},"streetAddress":{"description":"Street and house number.","examples":["Vodičkova 36"],"type":"string"},"postalCode":{"description":"Postal / ZIP code.","examples":["11000"],"type":"string"},"city":{"description":"City name.","examples":["Praha"],"type":"string"},"cityPart":{"description":"City part or district.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ).","examples":["CZ9609040727"],"type":"string"},"notice":{"description":"Internal note about the address.","type":"string"}}}}}}}},"/bff/admin/chat-room-list":{"get":{"operationId":"getBffAdminChat-room-list","tags":["Admin"],"summary":"List all chat rooms (global super admin)","description":"Read-only monitoring: every live chat room in the system across all organisations (AI assistant, external customer chat, internal team chat), sorted by the newest message. Query: `kind` (ai | external | internal), `filterFulltextQuery`, `page`, `limit`. Requires a global super admin: own human session + root in the internal organisation.","responses":{"200":{}}}},"/bff/admin/chat-room-detail":{"get":{"parameters":[{"description":"Chat room external id (24 chars).","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffAdminChat-room-detail","tags":["Admin"],"summary":"Chat room transcript (global super admin)","description":"Read-only transcript of one chat room with participants and the newest 1000 messages. Every call is audit-logged in the internal organisation (`admin.chat_room_view`). Requires a global super admin.","responses":{"200":{}}}},"/bff/admin/organisation-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","name","slug","description","emoji","storageUsedBytes","suspendedDate","deletedDate","memberCount","contactCount","orderCount","lastActivityAt","magnitude","magnitudeRank","isMember","manager","technicalContact","tariff","tariffFit","aiSpend","turnover","platformBilling"],"properties":{"organisationId":{"description":"cas__organisation.id (target of the lifecycle quick actions).","type":"number"},"name":{"description":"Organisation display name.","type":"string"},"slug":{"description":"URL-friendly organisation identifier.","type":"string"},"description":{"description":"Organisation description.","anyOf":[{"type":"string"},{"type":"null"}]},"emoji":{"description":"Organisation emoji icon.","anyOf":[{"type":"string"},{"type":"null"}]},"storageUsedBytes":{"description":"Storage occupied by the organisation (cas__organisation.storage_used), bytes.","type":"number"},"suspendedDate":{"description":"ISO timestamp since when the organisation is suspended (frozen); null = running.","anyOf":[{"type":"string"},{"type":"null"}]},"deletedDate":{"description":"ISO timestamp of soft-delete (deactivation); null = active.","anyOf":[{"type":"string"},{"type":"null"}]},"memberCount":{"description":"Number of active (non-blocked) members.","type":"number"},"contactCount":{"description":"Number of contacts (shop__contact rows, excluding soft-deleted).","type":"number"},"orderCount":{"description":"Total number of orders (shop__order rows).","type":"number"},"lastActivityAt":{"description":"Most recent member activity timestamp (ISO-8601). Falls back to the organisation inserted date when there has been no member activity yet. Secondary list ordering.","type":"string"},"magnitude":{"description":"Internal organisation magnitude (0 – 1 000 000): how big and alive the organisation is, recomputed daily and smoothed. Primary list ordering (descending). Null = not computed yet.","anyOf":[{"type":"number"},{"type":"null"}]},"magnitudeRank":{"description":"Position of the organisation by magnitude across all organisations (1 = largest).","anyOf":[{"type":"number"},{"type":"null"}]},"isMember":{"description":"True when the calling admin is an active (non-blocked) member of this organisation.","type":"boolean"},"manager":{"description":"The integration-partner organisation that manages this org (the row referenced by `cas__organisation.parent_id`). Whether the parent holds an active `cas__white_label_licence` is flagged via `hasActiveLicence`; a `parent_id` pointing at a non-licensed org is returned with `hasActiveLicence: false` (inert for vendor features, matching `/vendor/of-current`). NULL means \"managed directly by BizKitHub\".","anyOf":[{"type":"object","required":["organisationId","slug","name","emoji","hasActiveLicence"],"properties":{"organisationId":{"description":"Internal id of the manager (parent) organisation.","type":"number"},"slug":{"description":"URL slug of the manager organisation. Use with /admin/{slug}.","type":"string"},"name":{"description":"Display name of the manager organisation.","type":"string"},"emoji":{"description":"Emoji of the manager organisation, if set.","anyOf":[{"type":"string"},{"type":"null"}]},"hasActiveLicence":{"description":"False = stale link: the parent no longer holds an active integration-partner licence, so vendor privileges are inert. The admin UI flags it and offers a re-assignment.","type":"boolean"}}},{"type":"null"}]},"technicalContact":{"description":"Who technically manages the organisation. NULL when the licensed manager has no active support person, or the org has no deliverable operator contact.","anyOf":[{"type":"object","required":["source","fullName","email"],"properties":{"source":{"description":"`manager` = support person (`support_person_id`) of the licensed manager org; `self` = the organisation's own operator contact (`admin_contact_id`) when no licensed manager exists.","anyOf":[{"const":"manager","type":"string"},{"const":"self","type":"string"}]},"fullName":{"description":"Display name (first + last, company or e-mail fallback).","type":"string"},"email":{"description":"Contact e-mail, if any.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tariff":{"description":"Assigned tariff summary. NULL when no tariff row exists for the organisation.","anyOf":[{"type":"object","required":["code","effectivePriceCzk","activeTo"],"properties":{"code":{"description":"Tariff code from the catalogue (e.g. \"free\", \"business\").","type":"string"},"effectivePriceCzk":{"description":"Effective monthly price in whole CZK. Custom override wins over the catalogue price minus discount.","type":"number"},"activeTo":{"description":"Paid-until date (ISO-8601). NULL when the tariff has no expiry set.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tariffFit":{"description":"Why the organisation has outgrown its tariff (limits exceeded this or last month, AI cost above the tariff price). Empty `signals` = fits its tariff.","type":"object","required":["signals","suggestedTariffCode"],"properties":{"signals":{"type":"array","items":{"anyOf":[{"type":"object","required":["kind","resource","period","used","limit"],"properties":{"kind":{"const":"limit","type":"string"},"resource":{"anyOf":[{"const":"members","type":"string"},{"const":"products","type":"string"},{"const":"customers","type":"string"},{"const":"forms","type":"string"},{"const":"ordersMonthly","type":"string"},{"const":"emailsMonthly","type":"string"},{"const":"aiTokensMonthly","type":"string"},{"const":"apiRequestsMonthly","type":"string"}]},"period":{"description":"`current` = this month so far, `previous` = last full month, `count` = current total.","anyOf":[{"const":"current","type":"string"},{"const":"previous","type":"string"},{"const":"count","type":"string"}]},"used":{"type":"number"},"limit":{"type":"number"}}},{"type":"object","required":["kind","costCzkLast30d","tariffPriceCzk"],"properties":{"kind":{"const":"aiCost","type":"string"},"costCzkLast30d":{"description":"BizKitHub AI cost for this org over the last 30 days (CZK).","type":"number"},"tariffPriceCzk":{"description":"Effective monthly tariff price (CZK).","type":"number"}}}]}},"suggestedTariffCode":{"description":"Cheapest pricier catalogue tariff that covers the usage; NULL when none fits.","anyOf":[{"type":"string"},{"type":"null"}]}}},"aiSpend":{"description":"Rollup of the organisation's AI usage in `ai__question` — lifetime and rolling 30-day windows. Uses per-token SCD pricing with margin.","type":"object","required":["tokensLifetime","tokensLast30d","promptsLifetime","promptsLast30d","costCzkLifetime","costCzkLast30d"],"properties":{"tokensLifetime":{"description":"Total AI tokens ever billed to this organisation (input + output combined).","type":"number"},"tokensLast30d":{"description":"AI tokens billed to this organisation in the last 30 days.","type":"number"},"promptsLifetime":{"description":"Total number of AI prompts stored for this organisation.","type":"number"},"promptsLast30d":{"description":"Number of AI prompts stored in the last 30 days.","type":"number"},"costCzkLifetime":{"description":"BizKitHub-side lifetime cost in CZK — per-token price from `ai__model_price` × `margin_multiplier`, converted USD→CZK at today's fixing.","type":"number"},"costCzkLast30d":{"description":"Cost in CZK for the last 30 days, same formula as `costCzkLifetime`.","type":"number"}}},"turnover":{"nullable":true,"anyOf":[{"description":"Approximate lifetime turnover: orders in `processing` / `done`, converted in SQL to the organisation's default currency via the latest FAWAZ USD rates. Null = no such orders.","type":"object","required":["amount","currencyCode"],"properties":{"amount":{"description":"Approximate lifetime turnover, rounded.","type":"number"},"currencyCode":{"description":"Default currency of the organisation (ISO code).","type":"string"}}},{"type":"null"}]},"platformBilling":{"description":"What the organisation spent with BizKitHub: orders of the internal organisation whose customer contact matches this organisation by IČO (or by the e-mail of its internal customer contact). Storno excluded, converted to CZK at today's rate.","type":"object","required":["paidCzk","owedCzk"],"properties":{"paidCzk":{"description":"Paid to BizKitHub in total (internal-org orders with a pay date), CZK.","type":"number"},"owedCzk":{"description":"Issued by BizKitHub but not paid yet (no pay date), CZK.","type":"number"}}}}}},"itemCount":{"description":"Total number of organisations matching the filter.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","name","slug","description","emoji","storageUsedBytes","suspendedDate","deletedDate","memberCount","contactCount","orderCount","lastActivityAt","magnitude","magnitudeRank","isMember","manager","technicalContact","tariff","tariffFit","aiSpend","turnover","platformBilling"],"properties":{"organisationId":{"description":"cas__organisation.id (target of the lifecycle quick actions).","type":"number"},"name":{"description":"Organisation display name.","type":"string"},"slug":{"description":"URL-friendly organisation identifier.","type":"string"},"description":{"description":"Organisation description.","anyOf":[{"type":"string"},{"type":"null"}]},"emoji":{"description":"Organisation emoji icon.","anyOf":[{"type":"string"},{"type":"null"}]},"storageUsedBytes":{"description":"Storage occupied by the organisation (cas__organisation.storage_used), bytes.","type":"number"},"suspendedDate":{"description":"ISO timestamp since when the organisation is suspended (frozen); null = running.","anyOf":[{"type":"string"},{"type":"null"}]},"deletedDate":{"description":"ISO timestamp of soft-delete (deactivation); null = active.","anyOf":[{"type":"string"},{"type":"null"}]},"memberCount":{"description":"Number of active (non-blocked) members.","type":"number"},"contactCount":{"description":"Number of contacts (shop__contact rows, excluding soft-deleted).","type":"number"},"orderCount":{"description":"Total number of orders (shop__order rows).","type":"number"},"lastActivityAt":{"description":"Most recent member activity timestamp (ISO-8601). Falls back to the organisation inserted date when there has been no member activity yet. Secondary list ordering.","type":"string"},"magnitude":{"description":"Internal organisation magnitude (0 – 1 000 000): how big and alive the organisation is, recomputed daily and smoothed. Primary list ordering (descending). Null = not computed yet.","anyOf":[{"type":"number"},{"type":"null"}]},"magnitudeRank":{"description":"Position of the organisation by magnitude across all organisations (1 = largest).","anyOf":[{"type":"number"},{"type":"null"}]},"isMember":{"description":"True when the calling admin is an active (non-blocked) member of this organisation.","type":"boolean"},"manager":{"description":"The integration-partner organisation that manages this org (the row referenced by `cas__organisation.parent_id`). Whether the parent holds an active `cas__white_label_licence` is flagged via `hasActiveLicence`; a `parent_id` pointing at a non-licensed org is returned with `hasActiveLicence: false` (inert for vendor features, matching `/vendor/of-current`). NULL means \"managed directly by BizKitHub\".","anyOf":[{"type":"object","required":["organisationId","slug","name","emoji","hasActiveLicence"],"properties":{"organisationId":{"description":"Internal id of the manager (parent) organisation.","type":"number"},"slug":{"description":"URL slug of the manager organisation. Use with /admin/{slug}.","type":"string"},"name":{"description":"Display name of the manager organisation.","type":"string"},"emoji":{"description":"Emoji of the manager organisation, if set.","anyOf":[{"type":"string"},{"type":"null"}]},"hasActiveLicence":{"description":"False = stale link: the parent no longer holds an active integration-partner licence, so vendor privileges are inert. The admin UI flags it and offers a re-assignment.","type":"boolean"}}},{"type":"null"}]},"technicalContact":{"description":"Who technically manages the organisation. NULL when the licensed manager has no active support person, or the org has no deliverable operator contact.","anyOf":[{"type":"object","required":["source","fullName","email"],"properties":{"source":{"description":"`manager` = support person (`support_person_id`) of the licensed manager org; `self` = the organisation's own operator contact (`admin_contact_id`) when no licensed manager exists.","anyOf":[{"const":"manager","type":"string"},{"const":"self","type":"string"}]},"fullName":{"description":"Display name (first + last, company or e-mail fallback).","type":"string"},"email":{"description":"Contact e-mail, if any.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tariff":{"description":"Assigned tariff summary. NULL when no tariff row exists for the organisation.","anyOf":[{"type":"object","required":["code","effectivePriceCzk","activeTo"],"properties":{"code":{"description":"Tariff code from the catalogue (e.g. \"free\", \"business\").","type":"string"},"effectivePriceCzk":{"description":"Effective monthly price in whole CZK. Custom override wins over the catalogue price minus discount.","type":"number"},"activeTo":{"description":"Paid-until date (ISO-8601). NULL when the tariff has no expiry set.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tariffFit":{"description":"Why the organisation has outgrown its tariff (limits exceeded this or last month, AI cost above the tariff price). Empty `signals` = fits its tariff.","type":"object","required":["signals","suggestedTariffCode"],"properties":{"signals":{"type":"array","items":{"anyOf":[{"type":"object","required":["kind","resource","period","used","limit"],"properties":{"kind":{"const":"limit","type":"string"},"resource":{"anyOf":[{"const":"members","type":"string"},{"const":"products","type":"string"},{"const":"customers","type":"string"},{"const":"forms","type":"string"},{"const":"ordersMonthly","type":"string"},{"const":"emailsMonthly","type":"string"},{"const":"aiTokensMonthly","type":"string"},{"const":"apiRequestsMonthly","type":"string"}]},"period":{"description":"`current` = this month so far, `previous` = last full month, `count` = current total.","anyOf":[{"const":"current","type":"string"},{"const":"previous","type":"string"},{"const":"count","type":"string"}]},"used":{"type":"number"},"limit":{"type":"number"}}},{"type":"object","required":["kind","costCzkLast30d","tariffPriceCzk"],"properties":{"kind":{"const":"aiCost","type":"string"},"costCzkLast30d":{"description":"BizKitHub AI cost for this org over the last 30 days (CZK).","type":"number"},"tariffPriceCzk":{"description":"Effective monthly tariff price (CZK).","type":"number"}}}]}},"suggestedTariffCode":{"description":"Cheapest pricier catalogue tariff that covers the usage; NULL when none fits.","anyOf":[{"type":"string"},{"type":"null"}]}}},"aiSpend":{"description":"Rollup of the organisation's AI usage in `ai__question` — lifetime and rolling 30-day windows. Uses per-token SCD pricing with margin.","type":"object","required":["tokensLifetime","tokensLast30d","promptsLifetime","promptsLast30d","costCzkLifetime","costCzkLast30d"],"properties":{"tokensLifetime":{"description":"Total AI tokens ever billed to this organisation (input + output combined).","type":"number"},"tokensLast30d":{"description":"AI tokens billed to this organisation in the last 30 days.","type":"number"},"promptsLifetime":{"description":"Total number of AI prompts stored for this organisation.","type":"number"},"promptsLast30d":{"description":"Number of AI prompts stored in the last 30 days.","type":"number"},"costCzkLifetime":{"description":"BizKitHub-side lifetime cost in CZK — per-token price from `ai__model_price` × `margin_multiplier`, converted USD→CZK at today's fixing.","type":"number"},"costCzkLast30d":{"description":"Cost in CZK for the last 30 days, same formula as `costCzkLifetime`.","type":"number"}}},"turnover":{"nullable":true,"anyOf":[{"description":"Approximate lifetime turnover: orders in `processing` / `done`, converted in SQL to the organisation's default currency via the latest FAWAZ USD rates. Null = no such orders.","type":"object","required":["amount","currencyCode"],"properties":{"amount":{"description":"Approximate lifetime turnover, rounded.","type":"number"},"currencyCode":{"description":"Default currency of the organisation (ISO code).","type":"string"}}},{"type":"null"}]},"platformBilling":{"description":"What the organisation spent with BizKitHub: orders of the internal organisation whose customer contact matches this organisation by IČO (or by the e-mail of its internal customer contact). Storno excluded, converted to CZK at today's rate.","type":"object","required":["paidCzk","owedCzk"],"properties":{"paidCzk":{"description":"Paid to BizKitHub in total (internal-org orders with a pay date), CZK.","type":"number"},"owedCzk":{"description":"Issued by BizKitHub but not paid yet (no pay date), CZK.","type":"number"}}}}}},"itemCount":{"description":"Total number of organisations matching the filter.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","name","slug","description","emoji","storageUsedBytes","suspendedDate","deletedDate","memberCount","contactCount","orderCount","lastActivityAt","magnitude","magnitudeRank","isMember","manager","technicalContact","tariff","tariffFit","aiSpend","turnover","platformBilling"],"properties":{"organisationId":{"description":"cas__organisation.id (target of the lifecycle quick actions).","type":"number"},"name":{"description":"Organisation display name.","type":"string"},"slug":{"description":"URL-friendly organisation identifier.","type":"string"},"description":{"description":"Organisation description.","anyOf":[{"type":"string"},{"type":"null"}]},"emoji":{"description":"Organisation emoji icon.","anyOf":[{"type":"string"},{"type":"null"}]},"storageUsedBytes":{"description":"Storage occupied by the organisation (cas__organisation.storage_used), bytes.","type":"number"},"suspendedDate":{"description":"ISO timestamp since when the organisation is suspended (frozen); null = running.","anyOf":[{"type":"string"},{"type":"null"}]},"deletedDate":{"description":"ISO timestamp of soft-delete (deactivation); null = active.","anyOf":[{"type":"string"},{"type":"null"}]},"memberCount":{"description":"Number of active (non-blocked) members.","type":"number"},"contactCount":{"description":"Number of contacts (shop__contact rows, excluding soft-deleted).","type":"number"},"orderCount":{"description":"Total number of orders (shop__order rows).","type":"number"},"lastActivityAt":{"description":"Most recent member activity timestamp (ISO-8601). Falls back to the organisation inserted date when there has been no member activity yet. Secondary list ordering.","type":"string"},"magnitude":{"description":"Internal organisation magnitude (0 – 1 000 000): how big and alive the organisation is, recomputed daily and smoothed. Primary list ordering (descending). Null = not computed yet.","anyOf":[{"type":"number"},{"type":"null"}]},"magnitudeRank":{"description":"Position of the organisation by magnitude across all organisations (1 = largest).","anyOf":[{"type":"number"},{"type":"null"}]},"isMember":{"description":"True when the calling admin is an active (non-blocked) member of this organisation.","type":"boolean"},"manager":{"description":"The integration-partner organisation that manages this org (the row referenced by `cas__organisation.parent_id`). Whether the parent holds an active `cas__white_label_licence` is flagged via `hasActiveLicence`; a `parent_id` pointing at a non-licensed org is returned with `hasActiveLicence: false` (inert for vendor features, matching `/vendor/of-current`). NULL means \"managed directly by BizKitHub\".","anyOf":[{"type":"object","required":["organisationId","slug","name","emoji","hasActiveLicence"],"properties":{"organisationId":{"description":"Internal id of the manager (parent) organisation.","type":"number"},"slug":{"description":"URL slug of the manager organisation. Use with /admin/{slug}.","type":"string"},"name":{"description":"Display name of the manager organisation.","type":"string"},"emoji":{"description":"Emoji of the manager organisation, if set.","anyOf":[{"type":"string"},{"type":"null"}]},"hasActiveLicence":{"description":"False = stale link: the parent no longer holds an active integration-partner licence, so vendor privileges are inert. The admin UI flags it and offers a re-assignment.","type":"boolean"}}},{"type":"null"}]},"technicalContact":{"description":"Who technically manages the organisation. NULL when the licensed manager has no active support person, or the org has no deliverable operator contact.","anyOf":[{"type":"object","required":["source","fullName","email"],"properties":{"source":{"description":"`manager` = support person (`support_person_id`) of the licensed manager org; `self` = the organisation's own operator contact (`admin_contact_id`) when no licensed manager exists.","anyOf":[{"const":"manager","type":"string"},{"const":"self","type":"string"}]},"fullName":{"description":"Display name (first + last, company or e-mail fallback).","type":"string"},"email":{"description":"Contact e-mail, if any.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tariff":{"description":"Assigned tariff summary. NULL when no tariff row exists for the organisation.","anyOf":[{"type":"object","required":["code","effectivePriceCzk","activeTo"],"properties":{"code":{"description":"Tariff code from the catalogue (e.g. \"free\", \"business\").","type":"string"},"effectivePriceCzk":{"description":"Effective monthly price in whole CZK. Custom override wins over the catalogue price minus discount.","type":"number"},"activeTo":{"description":"Paid-until date (ISO-8601). NULL when the tariff has no expiry set.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"tariffFit":{"description":"Why the organisation has outgrown its tariff (limits exceeded this or last month, AI cost above the tariff price). Empty `signals` = fits its tariff.","type":"object","required":["signals","suggestedTariffCode"],"properties":{"signals":{"type":"array","items":{"anyOf":[{"type":"object","required":["kind","resource","period","used","limit"],"properties":{"kind":{"const":"limit","type":"string"},"resource":{"anyOf":[{"const":"members","type":"string"},{"const":"products","type":"string"},{"const":"customers","type":"string"},{"const":"forms","type":"string"},{"const":"ordersMonthly","type":"string"},{"const":"emailsMonthly","type":"string"},{"const":"aiTokensMonthly","type":"string"},{"const":"apiRequestsMonthly","type":"string"}]},"period":{"description":"`current` = this month so far, `previous` = last full month, `count` = current total.","anyOf":[{"const":"current","type":"string"},{"const":"previous","type":"string"},{"const":"count","type":"string"}]},"used":{"type":"number"},"limit":{"type":"number"}}},{"type":"object","required":["kind","costCzkLast30d","tariffPriceCzk"],"properties":{"kind":{"const":"aiCost","type":"string"},"costCzkLast30d":{"description":"BizKitHub AI cost for this org over the last 30 days (CZK).","type":"number"},"tariffPriceCzk":{"description":"Effective monthly tariff price (CZK).","type":"number"}}}]}},"suggestedTariffCode":{"description":"Cheapest pricier catalogue tariff that covers the usage; NULL when none fits.","anyOf":[{"type":"string"},{"type":"null"}]}}},"aiSpend":{"description":"Rollup of the organisation's AI usage in `ai__question` — lifetime and rolling 30-day windows. Uses per-token SCD pricing with margin.","type":"object","required":["tokensLifetime","tokensLast30d","promptsLifetime","promptsLast30d","costCzkLifetime","costCzkLast30d"],"properties":{"tokensLifetime":{"description":"Total AI tokens ever billed to this organisation (input + output combined).","type":"number"},"tokensLast30d":{"description":"AI tokens billed to this organisation in the last 30 days.","type":"number"},"promptsLifetime":{"description":"Total number of AI prompts stored for this organisation.","type":"number"},"promptsLast30d":{"description":"Number of AI prompts stored in the last 30 days.","type":"number"},"costCzkLifetime":{"description":"BizKitHub-side lifetime cost in CZK — per-token price from `ai__model_price` × `margin_multiplier`, converted USD→CZK at today's fixing.","type":"number"},"costCzkLast30d":{"description":"Cost in CZK for the last 30 days, same formula as `costCzkLifetime`.","type":"number"}}},"turnover":{"nullable":true,"anyOf":[{"description":"Approximate lifetime turnover: orders in `processing` / `done`, converted in SQL to the organisation's default currency via the latest FAWAZ USD rates. Null = no such orders.","type":"object","required":["amount","currencyCode"],"properties":{"amount":{"description":"Approximate lifetime turnover, rounded.","type":"number"},"currencyCode":{"description":"Default currency of the organisation (ISO code).","type":"string"}}},{"type":"null"}]},"platformBilling":{"description":"What the organisation spent with BizKitHub: orders of the internal organisation whose customer contact matches this organisation by IČO (or by the e-mail of its internal customer contact). Storno excluded, converted to CZK at today's rate.","type":"object","required":["paidCzk","owedCzk"],"properties":{"paidCzk":{"description":"Paid to BizKitHub in total (internal-org orders with a pay date), CZK.","type":"number"},"owedCzk":{"description":"Issued by BizKitHub but not paid yet (no pay date), CZK.","type":"number"}}}}}},"itemCount":{"description":"Total number of organisations matching the filter.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffAdminOrganisation-list","tags":["Admin"],"summary":"List organisations","description":"Returns a paginated list of all organisations with active member counts. Supports fulltext search by name, slug, or description. Sorted by the internal magnitude score (cas__organisation.magnitude, descending, nulls last), then by the latest member activity, so the organisations that matter most for the platform come first. Each item carries an `isMember` flag indicating whether the calling admin has an active (non-blocked) membership in that organisation. Requires internal admin membership."}},"/bff/admin/organisation-detail":{"get":{"parameters":[{"description":"Organisation slug to look up.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"operationId":"getBffAdminOrganisation-detail","tags":["Admin"],"summary":"Get organisation detail","description":"Returns full organisation record by slug. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/organisation-profile":{"get":{"parameters":[{"description":"Organisation slug to look up.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"operationId":"getBffAdminOrganisation-profile","tags":["Admin"],"summary":"Get organisation full profile (admin)","description":"Returns the complete organisation profile (same payload as GET /organisation/profile) for any organisation looked up by slug. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/update-organisation-profile":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update succeeded.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update succeeded.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update succeeded.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminUpdate-organisation-profile","tags":["Admin"],"summary":"Update organisation profile (admin)","description":"Updates the profile of any organisation looked up by slug. Accepts a focused editable subset of the organisation profile — basic info, company/VAT identity, branding, notification e-mail routing, post digest, and payment. Delegates to updateOrganisationProfile. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Organisation slug to update.","examples":["acme-corp"],"type":"string"},"name":{"minLength":1,"maxLength":255,"description":"Organisation display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":5000,"description":"Free-form profile description.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"description":"Organisation emoji icon.","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Company registration number (IČO).","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Tax identification number (DIČ).","type":"string"},{"type":"null"}]},"vatPayer":{"description":"VAT payer flag.","type":"boolean"},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex colour (e.g. \"#1a2b3c\").","type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex colour.","type":"string"},{"type":"null"}]},"supportEmail":{"nullable":true,"anyOf":[{"description":"Default \"From\" address for transactional emails.","type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"description":"Override \"From\" address for marketing emails.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated internal notification e-mails for order events.","type":"string"},{"type":"null"}]},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated internal notification e-mails for system-log events.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Enable the post digest newsletter.","type":"boolean"},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Post digest email subject.","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Post digest email intro text.","type":"string"},{"type":"null"}]},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"description":"Post digest interval in days.","type":"number"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"description":"Maximum posts included in one digest.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"minimum":0,"maximum":23,"description":"Hour of day (0-23, UTC) at which the digest may be sent. Cron runs hourly; only sends when the current UTC hour matches. Null lets the system lazy-init on the next digest run.","type":"number"},{"type":"null"}]},"paymentRecurringEnabled":{"description":"Enable recurring/tokenised payments.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration policy for customer credit.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Organisation slug to update.","examples":["acme-corp"],"type":"string"},"name":{"minLength":1,"maxLength":255,"description":"Organisation display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":5000,"description":"Free-form profile description.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"description":"Organisation emoji icon.","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Company registration number (IČO).","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Tax identification number (DIČ).","type":"string"},{"type":"null"}]},"vatPayer":{"description":"VAT payer flag.","type":"boolean"},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex colour (e.g. \"#1a2b3c\").","type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex colour.","type":"string"},{"type":"null"}]},"supportEmail":{"nullable":true,"anyOf":[{"description":"Default \"From\" address for transactional emails.","type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"description":"Override \"From\" address for marketing emails.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated internal notification e-mails for order events.","type":"string"},{"type":"null"}]},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated internal notification e-mails for system-log events.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Enable the post digest newsletter.","type":"boolean"},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Post digest email subject.","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Post digest email intro text.","type":"string"},{"type":"null"}]},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"description":"Post digest interval in days.","type":"number"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"description":"Maximum posts included in one digest.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"minimum":0,"maximum":23,"description":"Hour of day (0-23, UTC) at which the digest may be sent. Cron runs hourly; only sends when the current UTC hour matches. Null lets the system lazy-init on the next digest run.","type":"number"},{"type":"null"}]},"paymentRecurringEnabled":{"description":"Enable recurring/tokenised payments.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration policy for customer credit.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Organisation slug to update.","examples":["acme-corp"],"type":"string"},"name":{"minLength":1,"maxLength":255,"description":"Organisation display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":5000,"description":"Free-form profile description.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"description":"Organisation emoji icon.","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Company registration number (IČO).","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Tax identification number (DIČ).","type":"string"},{"type":"null"}]},"vatPayer":{"description":"VAT payer flag.","type":"boolean"},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex colour (e.g. \"#1a2b3c\").","type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex colour.","type":"string"},{"type":"null"}]},"supportEmail":{"nullable":true,"anyOf":[{"description":"Default \"From\" address for transactional emails.","type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"description":"Override \"From\" address for marketing emails.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated internal notification e-mails for order events.","type":"string"},{"type":"null"}]},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated internal notification e-mails for system-log events.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Enable the post digest newsletter.","type":"boolean"},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Post digest email subject.","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Post digest email intro text.","type":"string"},{"type":"null"}]},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"description":"Post digest interval in days.","type":"number"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"description":"Maximum posts included in one digest.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"minimum":0,"maximum":23,"description":"Hour of day (0-23, UTC) at which the digest may be sent. Cron runs hourly; only sends when the current UTC hour matches. Null lets the system lazy-init on the next digest run.","type":"number"},{"type":"null"}]},"paymentRecurringEnabled":{"description":"Enable recurring/tokenised payments.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration policy for customer credit.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/admin/organisation-company-info":{"get":{"parameters":[{"description":"Organisation slug to look up.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"operationId":"getBffAdminOrganisation-company-info","tags":["Admin"],"summary":"Get organisation ARES company record (admin)","description":"Returns the ARES-fetched company record for any organisation looked up by slug. The record is physically stored on the org's internal contact (`cas__organisation.internal_customer_id` → `shop__contact` + `shop__contact_company_record`) and mirrored back to the org via `mirrorContactCompanyToOrganisation`. Response mirrors the shape used by the contact detail \"Firma\" tab. `company` is null when the org has no IČO. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/organisation-company-refresh":{"post":{"parameters":[],"operationId":"postBffAdminOrganisation-company-refresh","tags":["Admin"],"summary":"Force-refresh organisation ARES record (admin)","description":"Forces a fresh ARES fetch for the organisation's internal contact and updates the cached company record, VAT-payer status, unreliable-VAT-payer cross-check, and mirrored org columns. Same underlying flow as `/bff/contact/company-refresh` but routed via the org slug. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation to refresh.","examples":["acme-corp"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation to refresh.","examples":["acme-corp"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation to refresh.","examples":["acme-corp"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/admin/member-list":{"get":{"parameters":[{"description":"Slug of the organisation to list members for.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"organisationSlug","required":true}],"operationId":"getBffAdminMember-list","tags":["Admin"],"summary":"List organisation members","description":"Returns a paginated list of members for a given organisation. Supports fulltext search by name, username, or personal number. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/member-detail":{"get":{"parameters":[{"description":"Slug of the organisation the member belongs to.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"organisationSlug","required":true},{"description":"Member external ID (customer external_id).","examples":["cust_abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffAdminMember-detail","tags":["Admin"],"summary":"Get member detail","description":"Returns full member profile including contact info, parent member, timezone, and activity data. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/organisation-add-or-invite-member":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"anyOf":[{"const":"added","type":"string"},{"const":"invited","type":"string"}]}},"required":["mode"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"mode":{"anyOf":[{"const":"added","type":"string"},{"const":"invited","type":"string"}]}},"required":["mode"]}},"text/plain":{"schema":{"type":"object","properties":{"mode":{"anyOf":[{"const":"added","type":"string"},{"const":"invited","type":"string"}]}},"required":["mode"]}}}}},"operationId":"postBffAdminOrganisation-add-or-invite-member","tags":["Admin"],"summary":"Add an existing user or invite a new person (admin)","description":"Existing cas__user → direct membership; unknown e-mail → invitation e-mail with optional pending root role. A blocked existing membership is reported as an error. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","email","asRoot"],"properties":{"slug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"email":{"description":"E-mail of the person.","examples":["john@example.com"],"type":"string"},"firstName":{"maxLength":100,"type":"string"},"lastName":{"maxLength":100,"type":"string"},"asRoot":{"description":"Grant root (immediately, or on invitation acceptance).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","email","asRoot"],"properties":{"slug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"email":{"description":"E-mail of the person.","examples":["john@example.com"],"type":"string"},"firstName":{"maxLength":100,"type":"string"},"lastName":{"maxLength":100,"type":"string"},"asRoot":{"description":"Grant root (immediately, or on invitation acceptance).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["slug","email","asRoot"],"properties":{"slug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"email":{"description":"E-mail of the person.","examples":["john@example.com"],"type":"string"},"firstName":{"maxLength":100,"type":"string"},"lastName":{"maxLength":100,"type":"string"},"asRoot":{"description":"Grant root (immediately, or on invitation acceptance).","type":"boolean"}}}}}}}},"/bff/admin/add-member":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the member was added successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the member was added successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the member was added successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminAdd-member","tags":["Admin"],"summary":"Add member to organisation","description":"Creates a new membership for an existing user in the specified organisation. If the user is already a member, returns the existing membership. Sends a welcome email notification. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","username"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"},"username":{"description":"Username (email) of the user to add as a member.","examples":["john@example.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","username"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"},"username":{"description":"Username (email) of the user to add as a member.","examples":["john@example.com"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","username"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"},"username":{"description":"Username (email) of the user to add as a member.","examples":["john@example.com"],"type":"string"}}}}}}}},"/bff/admin/organisation-contacts":{"get":{"parameters":[{"description":"Organisation slug to look up.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"operationId":"getBffAdminOrganisation-contacts","tags":["Admin"],"summary":"Organisation contacts and mail routing (admin)","description":"Single payload for the admin \"Kontakty\" tab: operator (admin_contact_id), transactional sender override, internal company contact, support person, manager (parent org), active members with their effective root flag, the EFFECTIVE daily-report recipient (+ why) and the effective transactional / marketing sender addresses with the mail-related configuration. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/organisation-contact-search":{"get":{"parameters":[{"description":"Organisation slug whose contacts are searched.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Fulltext over e-mail, name and company name.","schema":{"type":"string","maxLength":200},"in":"query","name":"query","required":false}],"operationId":"getBffAdminOrganisation-contact-search","tags":["Admin"],"summary":"Search contacts of another organisation (admin)","description":"Contact picker source for /admin/[slug]. Unlike /bff/contact/list (scoped to the caller's own organisation) this searches the TARGET organisation. Members first, max 30 rows. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/update-organisation-support-person":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminUpdate-organisation-support-person","tags":["Admin"],"summary":"Set the organisation support person (admin)","description":"Re-points cas__organisation.support_person_id at a member of the same organisation (tenant-guarded by updateOrganisationProfile) or clears it. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"nullable":true,"anyOf":[{"description":"cas__organisation_member.id of an in-org member, or null to clear.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__organisation_member.id of an in-org member, or null to clear.","type":"integer"}]},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"nullable":true,"anyOf":[{"description":"cas__organisation_member.id of an in-org member, or null to clear.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__organisation_member.id of an in-org member, or null to clear.","type":"integer"}]},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"nullable":true,"anyOf":[{"description":"cas__organisation_member.id of an in-org member, or null to clear.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__organisation_member.id of an in-org member, or null to clear.","type":"integer"}]},{"type":"null"}]}}}}}}}},"/bff/admin/organisation-handover":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminOrganisation-handover","tags":["Admin"],"summary":"Hand over an organisation (admin)","description":"Re-assigns manager (parent_id), operator contact (+ optional root grant) and support person in one validated action. All inputs are checked before the first write; one summary activity `admin.organisation_handover` is written to the BizKitHub org. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Slug of the organisation being handed over.","examples":["acme-corp"],"type":"string"},"managerOrganisationSlug":{"nullable":true,"anyOf":[{"description":"Licensed integration partner to manage the org. NULL = managed directly by BizKitHub, omitted = unchanged.","type":"string"},{"type":"null"}]},"adminContactExternalId":{"description":"shop__contact.external_id of an active member with e-mail; omitted = unchanged.","type":"string"},"grantRootToAdminContact":{"description":"Grant root to the (new or current) operator when they lack it.","type":"boolean"},"supportMemberId":{"nullable":true,"anyOf":[{"description":"cas__organisation_member.id; NULL = clear, omitted = unchanged.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__organisation_member.id; NULL = clear, omitted = unchanged.","type":"integer"}]},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Slug of the organisation being handed over.","examples":["acme-corp"],"type":"string"},"managerOrganisationSlug":{"nullable":true,"anyOf":[{"description":"Licensed integration partner to manage the org. NULL = managed directly by BizKitHub, omitted = unchanged.","type":"string"},{"type":"null"}]},"adminContactExternalId":{"description":"shop__contact.external_id of an active member with e-mail; omitted = unchanged.","type":"string"},"grantRootToAdminContact":{"description":"Grant root to the (new or current) operator when they lack it.","type":"boolean"},"supportMemberId":{"nullable":true,"anyOf":[{"description":"cas__organisation_member.id; NULL = clear, omitted = unchanged.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__organisation_member.id; NULL = clear, omitted = unchanged.","type":"integer"}]},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Slug of the organisation being handed over.","examples":["acme-corp"],"type":"string"},"managerOrganisationSlug":{"nullable":true,"anyOf":[{"description":"Licensed integration partner to manage the org. NULL = managed directly by BizKitHub, omitted = unchanged.","type":"string"},{"type":"null"}]},"adminContactExternalId":{"description":"shop__contact.external_id of an active member with e-mail; omitted = unchanged.","type":"string"},"grantRootToAdminContact":{"description":"Grant root to the (new or current) operator when they lack it.","type":"boolean"},"supportMemberId":{"nullable":true,"anyOf":[{"description":"cas__organisation_member.id; NULL = clear, omitted = unchanged.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__organisation_member.id; NULL = clear, omitted = unchanged.","type":"integer"}]},{"type":"null"}]}}}}}}}},"/bff/admin/update-organisation-admin-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminUpdate-organisation-admin-contact","tags":["Admin"],"summary":"Change the operator (\"Provozovatel\") contact (admin)","description":"Admin-scoped counterpart of POST /organisation/update-admin-contact. Re-points admin_contact_id on any organisation looked up by slug. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"description":"shop__contact.external_id of an in-org contact with a deliverable e-mail.","examples":["cust_abc123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"description":"shop__contact.external_id of an in-org contact with a deliverable e-mail.","examples":["cust_abc123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"description":"shop__contact.external_id of an in-org contact with a deliverable e-mail.","examples":["cust_abc123"],"type":"string"}}}}}}}},"/bff/admin/update-organisation-transactional-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminUpdate-organisation-transactional-contact","tags":["Admin"],"summary":"Change or clear the transactional From-address contact (admin)","description":"Admin-scoped counterpart of POST /organisation/update-transactional-contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id, or NULL to clear the override.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id, or NULL to clear the override.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id, or NULL to clear the override.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/admin/update-organisation-report-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminUpdate-organisation-report-contact","tags":["Admin"],"summary":"Set or remove the business report contact (admin)","description":"Admin-scoped counterpart of POST /organisation/update-report-contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id of an in-org contact with an e-mail, or NULL to remove it.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id of an in-org contact with an e-mail, or NULL to remove it.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","contactExternalId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id of an in-org contact with an e-mail, or NULL to remove it.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/admin/resend-member-invite":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the invite was resent.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the invite was resent.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the invite was resent.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminResend-member-invite","tags":["Admin"],"summary":"Resend a pending member invitation (admin)","description":"Re-sends the invitation e-mail and refreshes its expiration date on any organisation, looked up by slug. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Pending-invite id in the wire form `pending-<token>`. Non-pending ids are rejected.","examples":["pending-abc123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Pending-invite id in the wire form `pending-<token>`. Non-pending ids are rejected.","examples":["pending-abc123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Pending-invite id in the wire form `pending-<token>`. Non-pending ids are rejected.","examples":["pending-abc123"],"type":"string"}}}}}}}},"/bff/admin/cancel-member-invite":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the invite was cancelled.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the invite was cancelled.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the invite was cancelled.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminCancel-member-invite","tags":["Admin"],"summary":"Cancel a pending member invitation (admin)","description":"Deletes the pending invitation (the registration link is invalidated) on any organisation, looked up by slug. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Pending-invite id in the wire form `pending-<token>`. Non-pending ids are rejected.","examples":["pending-abc123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Pending-invite id in the wire form `pending-<token>`. Non-pending ids are rejected.","examples":["pending-abc123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","memberId"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Pending-invite id in the wire form `pending-<token>`. Non-pending ids are rejected.","examples":["pending-abc123"],"type":"string"}}}}}}}},"/bff/admin/set-member-root":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation succeeded.","type":"boolean"},"hasRoot":{"description":"Resulting root state on the member.","type":"boolean"}},"required":["success","hasRoot"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation succeeded.","type":"boolean"},"hasRoot":{"description":"Resulting root state on the member.","type":"boolean"}},"required":["success","hasRoot"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation succeeded.","type":"boolean"},"hasRoot":{"description":"Resulting root state on the member.","type":"boolean"}},"required":["success","hasRoot"]}}}}},"operationId":"postBffAdminSet-member-root","tags":["Admin"],"summary":"Grant or revoke root permission on a member","description":"Additively toggles the `root` role on an organisation member. Other permissions and roles are left untouched. Triggers the standard root-grant audit log when transitioning from non-root to root. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","memberId","hasRoot"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Wire member id (shop__contact.external_id). Pending invitations are not accepted.","examples":["cust_abc123"],"type":"string"},"hasRoot":{"description":"true → grant root role, false → revoke root role and any direct root permission.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","memberId","hasRoot"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Wire member id (shop__contact.external_id). Pending invitations are not accepted.","examples":["cust_abc123"],"type":"string"},"hasRoot":{"description":"true → grant root role, false → revoke root role and any direct root permission.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","memberId","hasRoot"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"memberId":{"description":"Wire member id (shop__contact.external_id). Pending invitations are not accepted.","examples":["cust_abc123"],"type":"string"},"hasRoot":{"description":"true → grant root role, false → revoke root role and any direct root permission.","type":"boolean"}}}}}}}},"/bff/admin/add-self-as-root":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation succeeded.","type":"boolean"},"memberExternalId":{"description":"External id of the member that now holds root.","type":"string"}},"required":["success","memberExternalId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation succeeded.","type":"boolean"},"memberExternalId":{"description":"External id of the member that now holds root.","type":"string"}},"required":["success","memberExternalId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation succeeded.","type":"boolean"},"memberExternalId":{"description":"External id of the member that now holds root.","type":"string"}},"required":["success","memberExternalId"]}}}}},"operationId":"postBffAdminAdd-self-as-root","tags":["Admin"],"summary":"Add the calling internal admin as a root member","description":"Self-onboards the calling operator into the target organisation with full root permissions. Idempotent for membership creation. Skips the welcome email since this is an operator action. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"}}}}}}}},"/bff/admin/block-member":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the member was blocked successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the member was blocked successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the member was blocked successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminBlock-member","tags":["Admin"],"summary":"Block organisation member","description":"Blocks a member by email in the specified organisation. Invalidates all their API keys and sends a notification email. Cannot block the last active member. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","email"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"email":{"description":"Email address of the member to block.","examples":["john@example.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","email"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"email":{"description":"Email address of the member to block.","examples":["john@example.com"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","email"],"properties":{"organisationSlug":{"description":"Slug of the organisation.","examples":["acme-corp"],"type":"string"},"email":{"description":"Email address of the member to block.","examples":["john@example.com"],"type":"string"}}}}}}}},"/bff/admin/user-organisations":{"get":{"parameters":[{"description":"Username (email) of the user to look up.","examples":["john@example.com"],"schema":{"type":"string"},"in":"query","name":"username","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"description":"The looked-up username.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["organisationName","organisationSlug","blocked","insertedDate"],"properties":{"organisationName":{"description":"Organisation display name.","type":"string"},"organisationSlug":{"description":"Organisation slug.","type":"string"},"blocked":{"description":"Whether the membership is blocked.","type":"boolean"},"insertedDate":{"description":"Date when the user joined the organisation.","anyOf":[{"description":"Date when the user joined the organisation.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["username","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"username":{"description":"The looked-up username.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["organisationName","organisationSlug","blocked","insertedDate"],"properties":{"organisationName":{"description":"Organisation display name.","type":"string"},"organisationSlug":{"description":"Organisation slug.","type":"string"},"blocked":{"description":"Whether the membership is blocked.","type":"boolean"},"insertedDate":{"description":"Date when the user joined the organisation.","anyOf":[{"description":"Date when the user joined the organisation.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["username","items"]}},"text/plain":{"schema":{"type":"object","properties":{"username":{"description":"The looked-up username.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["organisationName","organisationSlug","blocked","insertedDate"],"properties":{"organisationName":{"description":"Organisation display name.","type":"string"},"organisationSlug":{"description":"Organisation slug.","type":"string"},"blocked":{"description":"Whether the membership is blocked.","type":"boolean"},"insertedDate":{"description":"Date when the user joined the organisation.","anyOf":[{"description":"Date when the user joined the organisation.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["username","items"]}}}}},"operationId":"getBffAdminUser-organisations","tags":["Admin"],"summary":"List user organisations","description":"Returns all organisations a user belongs to, including blocked memberships. Useful for customer support to see a user's full organisation context. Requires internal admin membership."}},"/bff/admin/system-log":{"get":{"parameters":[{"description":"Slug of the organisation to fetch logs for.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"organisationSlug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","level","message","insertedDate"],"properties":{"id":{"description":"Log entry ID.","type":"number"},"level":{"description":"Log level (e.g. info, warning, error).","type":"string"},"message":{"description":"Log message.","type":"string"},"insertedDate":{"description":"Timestamp of the log entry.","type":"string"}}}},"itemCount":{"description":"Total number of log entries for this organisation.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","level","message","insertedDate"],"properties":{"id":{"description":"Log entry ID.","type":"number"},"level":{"description":"Log level (e.g. info, warning, error).","type":"string"},"message":{"description":"Log message.","type":"string"},"insertedDate":{"description":"Timestamp of the log entry.","type":"string"}}}},"itemCount":{"description":"Total number of log entries for this organisation.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","level","message","insertedDate"],"properties":{"id":{"description":"Log entry ID.","type":"number"},"level":{"description":"Log level (e.g. info, warning, error).","type":"string"},"message":{"description":"Log message.","type":"string"},"insertedDate":{"description":"Timestamp of the log entry.","type":"string"}}}},"itemCount":{"description":"Total number of log entries for this organisation.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffAdminSystem-log","tags":["Admin"],"summary":"View system log","description":"Returns a paginated system log for the specified organisation, ordered by newest first. Useful for debugging and auditing organisation activity. Requires internal admin membership."}},"/bff/admin/organisation-ai-spend":{"get":{"parameters":[{"description":"Organisation slug to look up.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"organisation":{"type":"object","required":["id","slug","name"],"properties":{"id":{"type":"number"},"slug":{"type":"string"},"name":{"type":"string"}}},"windows":{"type":"object","required":["lifetime","day","week","month","year"],"properties":{"lifetime":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"day":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"week":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"month":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"year":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}}}},"byModel":{"type":"array","items":{"type":"object","required":["model","promptsMonth","tokensMonth","inputTokensMonth","outputTokensMonth","costUsdMonth","costCzkMonth","promptsLifetime","tokensLifetime","costUsdLifetime","costCzkLifetime"],"properties":{"model":{"description":"Model identifier (e.g. `gemini-2.5-flash`).","type":"string"},"promptsMonth":{"type":"number"},"tokensMonth":{"type":"number"},"inputTokensMonth":{"type":"number"},"outputTokensMonth":{"type":"number"},"costUsdMonth":{"type":"number"},"costCzkMonth":{"type":"number"},"promptsLifetime":{"type":"number"},"tokensLifetime":{"type":"number"},"costUsdLifetime":{"type":"number"},"costCzkLifetime":{"type":"number"}}}},"fx":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"const":"CZK","type":"string"},"rate":{"description":"USD → CZK multiplier at today's fixing.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["organisation","windows","byModel","fx"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"organisation":{"type":"object","required":["id","slug","name"],"properties":{"id":{"type":"number"},"slug":{"type":"string"},"name":{"type":"string"}}},"windows":{"type":"object","required":["lifetime","day","week","month","year"],"properties":{"lifetime":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"day":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"week":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"month":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"year":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}}}},"byModel":{"type":"array","items":{"type":"object","required":["model","promptsMonth","tokensMonth","inputTokensMonth","outputTokensMonth","costUsdMonth","costCzkMonth","promptsLifetime","tokensLifetime","costUsdLifetime","costCzkLifetime"],"properties":{"model":{"description":"Model identifier (e.g. `gemini-2.5-flash`).","type":"string"},"promptsMonth":{"type":"number"},"tokensMonth":{"type":"number"},"inputTokensMonth":{"type":"number"},"outputTokensMonth":{"type":"number"},"costUsdMonth":{"type":"number"},"costCzkMonth":{"type":"number"},"promptsLifetime":{"type":"number"},"tokensLifetime":{"type":"number"},"costUsdLifetime":{"type":"number"},"costCzkLifetime":{"type":"number"}}}},"fx":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"const":"CZK","type":"string"},"rate":{"description":"USD → CZK multiplier at today's fixing.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["organisation","windows","byModel","fx"]}},"text/plain":{"schema":{"type":"object","properties":{"organisation":{"type":"object","required":["id","slug","name"],"properties":{"id":{"type":"number"},"slug":{"type":"string"},"name":{"type":"string"}}},"windows":{"type":"object","required":["lifetime","day","week","month","year"],"properties":{"lifetime":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"day":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"week":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"month":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}},"year":{"type":"object","required":["tokens","costUsd","costCzk","count"],"properties":{"tokens":{"type":"number"},"costUsd":{"type":"number"},"costCzk":{"type":"number"},"count":{"type":"number"}}}}},"byModel":{"type":"array","items":{"type":"object","required":["model","promptsMonth","tokensMonth","inputTokensMonth","outputTokensMonth","costUsdMonth","costCzkMonth","promptsLifetime","tokensLifetime","costUsdLifetime","costCzkLifetime"],"properties":{"model":{"description":"Model identifier (e.g. `gemini-2.5-flash`).","type":"string"},"promptsMonth":{"type":"number"},"tokensMonth":{"type":"number"},"inputTokensMonth":{"type":"number"},"outputTokensMonth":{"type":"number"},"costUsdMonth":{"type":"number"},"costCzkMonth":{"type":"number"},"promptsLifetime":{"type":"number"},"tokensLifetime":{"type":"number"},"costUsdLifetime":{"type":"number"},"costCzkLifetime":{"type":"number"}}}},"fx":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"const":"CZK","type":"string"},"rate":{"description":"USD → CZK multiplier at today's fixing.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["organisation","windows","byModel","fx"]}}}}},"operationId":"getBffAdminOrganisation-ai-spend","tags":["Admin"],"summary":"AI spend detail for a single organisation","description":"Returns per-model breakdown and rolling-window totals (lifetime + last 1/7/30/365 days) of AI prompts stored in `ai__question` for the given organisation. Pricing uses the `ai__model_price` SCD table matched by prompt date, with `margin_multiplier` applied so super-admin sees the BizKitHub-side cost rather than the raw provider cost the customer sees in their own `/settings/ai`. A CZK envelope is included at today's USD→CZK fixing. Requires internal admin membership."}},"/bff/admin/organisation-tariff":{"get":{"parameters":[{"description":"Organisation slug to look up.","examples":["acme-corp"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"operationId":"getBffAdminOrganisation-tariff","tags":["Admin","Tariff"],"summary":"Get organisation tariff, billing settings and usage (admin)","description":"Single payload for the admin \"Tarif\" tab: editable per-org tariff configuration (plan, custom price, discount, paid-until, salesperson, note), catalogue rules, limits vs. usage with 12-month history, metered spend for the current month, the tariff catalogue, salesperson candidates (internal members) and the last tariff change log entries. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/organisation-tariff-change":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"description":"False when the submitted values equal the current state (nothing written).","type":"boolean"},"tariffSwitched":{"description":"True when the plan itself changed.","type":"boolean"},"needsCustomPrice":{"description":"Plan requires a custom price (Enterprise) and none is set.","type":"boolean"}},"required":["changed","tariffSwitched","needsCustomPrice"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"changed":{"description":"False when the submitted values equal the current state (nothing written).","type":"boolean"},"tariffSwitched":{"description":"True when the plan itself changed.","type":"boolean"},"needsCustomPrice":{"description":"Plan requires a custom price (Enterprise) and none is set.","type":"boolean"}},"required":["changed","tariffSwitched","needsCustomPrice"]}},"text/plain":{"schema":{"type":"object","properties":{"changed":{"description":"False when the submitted values equal the current state (nothing written).","type":"boolean"},"tariffSwitched":{"description":"True when the plan itself changed.","type":"boolean"},"needsCustomPrice":{"description":"Plan requires a custom price (Enterprise) and none is set.","type":"boolean"}},"required":["changed","tariffSwitched","needsCustomPrice"]}}}}},"operationId":"postBffAdminOrganisation-tariff-change","tags":["Admin","Tariff"],"summary":"Change organisation tariff / billing settings (admin)","description":"Runs `changeTariff`: validates, writes the tariff + assignment in one transaction and, when something changed, records a critical ORG_TARIFF_CHG system log entry (before/after + actor) with a forced notification e-mail and activity rows naming the admin. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","tariffId"],"properties":{"slug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"},"tariffId":{"description":"Tariff to assign (may equal the current one to edit settings only).","examples":[3],"type":"number"},"customPriceCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Negotiated monthly price in whole CZK. Null = use catalogue price minus discount. Omit to keep.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Negotiated monthly price in whole CZK. Null = use catalogue price minus discount. Omit to keep.","type":"integer"}]},{"type":"null"}]},"discountPercent":{"minimum":0,"maximum":100,"description":"Discount off the catalogue price. Omit to keep.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"description":"Discount off the catalogue price. Omit to keep.","type":"integer"}]},"paidUntil":{"nullable":true,"anyOf":[{"description":"Paid-until / next renewal date (ISO). Null clears it. Omit to keep.","type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Admin note. Null clears it.","type":"string"},{"type":"null"}]},"salespersonUserId":{"nullable":true,"anyOf":[{"description":"cas__user id of the salesperson. Null = self-service.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__user id of the salesperson. Null = self-service.","type":"integer"}]},{"type":"null"}]},"salespersonCommissionCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Locked commission for the salesperson in whole CZK.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Locked commission for the salesperson in whole CZK.","type":"integer"}]},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","tariffId"],"properties":{"slug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"},"tariffId":{"description":"Tariff to assign (may equal the current one to edit settings only).","examples":[3],"type":"number"},"customPriceCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Negotiated monthly price in whole CZK. Null = use catalogue price minus discount. Omit to keep.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Negotiated monthly price in whole CZK. Null = use catalogue price minus discount. Omit to keep.","type":"integer"}]},{"type":"null"}]},"discountPercent":{"minimum":0,"maximum":100,"description":"Discount off the catalogue price. Omit to keep.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"description":"Discount off the catalogue price. Omit to keep.","type":"integer"}]},"paidUntil":{"nullable":true,"anyOf":[{"description":"Paid-until / next renewal date (ISO). Null clears it. Omit to keep.","type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Admin note. Null clears it.","type":"string"},{"type":"null"}]},"salespersonUserId":{"nullable":true,"anyOf":[{"description":"cas__user id of the salesperson. Null = self-service.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__user id of the salesperson. Null = self-service.","type":"integer"}]},{"type":"null"}]},"salespersonCommissionCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Locked commission for the salesperson in whole CZK.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Locked commission for the salesperson in whole CZK.","type":"integer"}]},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["slug","tariffId"],"properties":{"slug":{"description":"Slug of the target organisation.","examples":["acme-corp"],"type":"string"},"tariffId":{"description":"Tariff to assign (may equal the current one to edit settings only).","examples":[3],"type":"number"},"customPriceCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Negotiated monthly price in whole CZK. Null = use catalogue price minus discount. Omit to keep.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Negotiated monthly price in whole CZK. Null = use catalogue price minus discount. Omit to keep.","type":"integer"}]},{"type":"null"}]},"discountPercent":{"minimum":0,"maximum":100,"description":"Discount off the catalogue price. Omit to keep.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":100,"description":"Discount off the catalogue price. Omit to keep.","type":"integer"}]},"paidUntil":{"nullable":true,"anyOf":[{"description":"Paid-until / next renewal date (ISO). Null clears it. Omit to keep.","type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Admin note. Null clears it.","type":"string"},{"type":"null"}]},"salespersonUserId":{"nullable":true,"anyOf":[{"description":"cas__user id of the salesperson. Null = self-service.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"cas__user id of the salesperson. Null = self-service.","type":"integer"}]},{"type":"null"}]},"salespersonCommissionCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Locked commission for the salesperson in whole CZK.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Locked commission for the salesperson in whole CZK.","type":"integer"}]},{"type":"null"}]}}}}}}}},"/bff/admin/organisation-white-label":{"get":{"parameters":[{"description":"Organisation slug to look up.","examples":["7-napadu-s-r-o"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"isActive":{"description":"Licence is active and not expired — the org can act as an integration partner.","type":"boolean"},"licence":{"anyOf":[{"type":"object","required":["licenceKey","active","validTo","note","insertedDate"],"properties":{"licenceKey":{"description":"16-char licence key.","type":"string"},"active":{"description":"Raw `active` flag of the licence row.","type":"boolean"},"validTo":{"description":"Expiry (ISO) or null = no expiry.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the licence row was created (ISO).","type":"string"}}},{"type":"null"}]},"managedOrganisations":{"description":"Non-deleted organisations whose parent_id points at this org.","type":"array","items":{"type":"object","required":["slug","name","emoji"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["isActive","licence","managedOrganisations"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"isActive":{"description":"Licence is active and not expired — the org can act as an integration partner.","type":"boolean"},"licence":{"anyOf":[{"type":"object","required":["licenceKey","active","validTo","note","insertedDate"],"properties":{"licenceKey":{"description":"16-char licence key.","type":"string"},"active":{"description":"Raw `active` flag of the licence row.","type":"boolean"},"validTo":{"description":"Expiry (ISO) or null = no expiry.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the licence row was created (ISO).","type":"string"}}},{"type":"null"}]},"managedOrganisations":{"description":"Non-deleted organisations whose parent_id points at this org.","type":"array","items":{"type":"object","required":["slug","name","emoji"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["isActive","licence","managedOrganisations"]}},"text/plain":{"schema":{"type":"object","properties":{"isActive":{"description":"Licence is active and not expired — the org can act as an integration partner.","type":"boolean"},"licence":{"anyOf":[{"type":"object","required":["licenceKey","active","validTo","note","insertedDate"],"properties":{"licenceKey":{"description":"16-char licence key.","type":"string"},"active":{"description":"Raw `active` flag of the licence row.","type":"boolean"},"validTo":{"description":"Expiry (ISO) or null = no expiry.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the licence row was created (ISO).","type":"string"}}},{"type":"null"}]},"managedOrganisations":{"description":"Non-deleted organisations whose parent_id points at this org.","type":"array","items":{"type":"object","required":["slug","name","emoji"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["isActive","licence","managedOrganisations"]}}}}},"operationId":"getBffAdminOrganisation-white-label","tags":["Admin"],"summary":"Get white-label (integration partner) licence of an organisation (admin)","description":"Licence row (key, active flag, expiry, note) and the organisations currently managed by this org. Requires internal admin membership."},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"isActive":{"description":"Licence is active and not expired — the org can act as an integration partner.","type":"boolean"},"licence":{"anyOf":[{"type":"object","required":["licenceKey","active","validTo","note","insertedDate"],"properties":{"licenceKey":{"description":"16-char licence key.","type":"string"},"active":{"description":"Raw `active` flag of the licence row.","type":"boolean"},"validTo":{"description":"Expiry (ISO) or null = no expiry.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the licence row was created (ISO).","type":"string"}}},{"type":"null"}]},"managedOrganisations":{"description":"Non-deleted organisations whose parent_id points at this org.","type":"array","items":{"type":"object","required":["slug","name","emoji"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["isActive","licence","managedOrganisations"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"isActive":{"description":"Licence is active and not expired — the org can act as an integration partner.","type":"boolean"},"licence":{"anyOf":[{"type":"object","required":["licenceKey","active","validTo","note","insertedDate"],"properties":{"licenceKey":{"description":"16-char licence key.","type":"string"},"active":{"description":"Raw `active` flag of the licence row.","type":"boolean"},"validTo":{"description":"Expiry (ISO) or null = no expiry.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the licence row was created (ISO).","type":"string"}}},{"type":"null"}]},"managedOrganisations":{"description":"Non-deleted organisations whose parent_id points at this org.","type":"array","items":{"type":"object","required":["slug","name","emoji"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["isActive","licence","managedOrganisations"]}},"text/plain":{"schema":{"type":"object","properties":{"isActive":{"description":"Licence is active and not expired — the org can act as an integration partner.","type":"boolean"},"licence":{"anyOf":[{"type":"object","required":["licenceKey","active","validTo","note","insertedDate"],"properties":{"licenceKey":{"description":"16-char licence key.","type":"string"},"active":{"description":"Raw `active` flag of the licence row.","type":"boolean"},"validTo":{"description":"Expiry (ISO) or null = no expiry.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the licence row was created (ISO).","type":"string"}}},{"type":"null"}]},"managedOrganisations":{"description":"Non-deleted organisations whose parent_id points at this org.","type":"array","items":{"type":"object","required":["slug","name","emoji"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["isActive","licence","managedOrganisations"]}}}}},"operationId":"postBffAdminOrganisation-white-label","tags":["Admin"],"summary":"Grant or revoke the white-label (integration partner) licence (admin)","description":"Grant: members of the org may pick it as parent when creating an organisation, and it becomes a candidate in the \"change manager\" picker. Revoke keeps the row and key; child orgs keep parent_id but vendor privileges stop. Writes an activity row to the BizKitHub org. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","active"],"properties":{"slug":{"description":"Organisation slug.","examples":["7-napadu-s-r-o"],"type":"string"},"active":{"description":"true = grant / re-activate the licence, false = revoke it.","type":"boolean"},"validTo":{"nullable":true,"anyOf":[{"description":"Licence expiry (ISO date). Null = no expiry.","type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Admin note on the licence.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","active"],"properties":{"slug":{"description":"Organisation slug.","examples":["7-napadu-s-r-o"],"type":"string"},"active":{"description":"true = grant / re-activate the licence, false = revoke it.","type":"boolean"},"validTo":{"nullable":true,"anyOf":[{"description":"Licence expiry (ISO date). Null = no expiry.","type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Admin note on the licence.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["slug","active"],"properties":{"slug":{"description":"Organisation slug.","examples":["7-napadu-s-r-o"],"type":"string"},"active":{"description":"true = grant / re-activate the licence, false = revoke it.","type":"boolean"},"validTo":{"nullable":true,"anyOf":[{"description":"Licence expiry (ISO date). Null = no expiry.","type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Admin note on the licence.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/admin/usage-overview":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"systemMonthly":{"type":"array","items":{"type":"object","required":["periodStart","ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"periodStart":{"description":"First day of the calendar month (YYYY-MM-DD).","type":"string"},"ordersCount":{"description":"Orders created platform-wide in the month.","type":"number"},"emailsCount":{"description":"Transactional emails sent+received platform-wide in the month.","type":"number"},"aiTokensCount":{"description":"AI tokens consumed platform-wide in the month.","type":"number"},"apiRequestsCount":{"description":"Authenticated public API requests platform-wide in the month.","type":"number"},"estimatedCostCzk":{"description":"Estimated internal cost in CZK for the month (Phase-A model).","type":"number"}}}},"perOrg":{"type":"array","items":{"type":"object","required":["organisationId","name","slug","emoji","lifetime","currentMonth"],"properties":{"organisationId":{"description":"Internal organisation ID.","type":"number"},"name":{"description":"Organisation display name.","type":"string"},"slug":{"description":"Organisation slug.","type":"string"},"emoji":{"description":"Organisation emoji icon.","anyOf":[{"type":"string"},{"type":"null"}]},"lifetime":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}},"currentMonth":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}}}}},"totals":{"type":"object","required":["currentMonth","lifetime"],"properties":{"currentMonth":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}},"lifetime":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}}}},"costModel":{"type":"object","required":["perApiRequestCzk","perEmailCzk","perOrderCzk","perAiTokenCzk","isEstimate"],"properties":{"perApiRequestCzk":{"description":"CZK cost estimate per authenticated API request.","type":"number"},"perEmailCzk":{"description":"CZK cost estimate per transactional email.","type":"number"},"perOrderCzk":{"description":"CZK cost estimate per order created.","type":"number"},"perAiTokenCzk":{"description":"CZK cost estimate per AI token consumed.","type":"number"},"isEstimate":{"description":"True while running on the Phase-A placeholder model.","type":"boolean"}}}},"required":["systemMonthly","perOrg","totals","costModel"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"systemMonthly":{"type":"array","items":{"type":"object","required":["periodStart","ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"periodStart":{"description":"First day of the calendar month (YYYY-MM-DD).","type":"string"},"ordersCount":{"description":"Orders created platform-wide in the month.","type":"number"},"emailsCount":{"description":"Transactional emails sent+received platform-wide in the month.","type":"number"},"aiTokensCount":{"description":"AI tokens consumed platform-wide in the month.","type":"number"},"apiRequestsCount":{"description":"Authenticated public API requests platform-wide in the month.","type":"number"},"estimatedCostCzk":{"description":"Estimated internal cost in CZK for the month (Phase-A model).","type":"number"}}}},"perOrg":{"type":"array","items":{"type":"object","required":["organisationId","name","slug","emoji","lifetime","currentMonth"],"properties":{"organisationId":{"description":"Internal organisation ID.","type":"number"},"name":{"description":"Organisation display name.","type":"string"},"slug":{"description":"Organisation slug.","type":"string"},"emoji":{"description":"Organisation emoji icon.","anyOf":[{"type":"string"},{"type":"null"}]},"lifetime":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}},"currentMonth":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}}}}},"totals":{"type":"object","required":["currentMonth","lifetime"],"properties":{"currentMonth":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}},"lifetime":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}}}},"costModel":{"type":"object","required":["perApiRequestCzk","perEmailCzk","perOrderCzk","perAiTokenCzk","isEstimate"],"properties":{"perApiRequestCzk":{"description":"CZK cost estimate per authenticated API request.","type":"number"},"perEmailCzk":{"description":"CZK cost estimate per transactional email.","type":"number"},"perOrderCzk":{"description":"CZK cost estimate per order created.","type":"number"},"perAiTokenCzk":{"description":"CZK cost estimate per AI token consumed.","type":"number"},"isEstimate":{"description":"True while running on the Phase-A placeholder model.","type":"boolean"}}}},"required":["systemMonthly","perOrg","totals","costModel"]}},"text/plain":{"schema":{"type":"object","properties":{"systemMonthly":{"type":"array","items":{"type":"object","required":["periodStart","ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"periodStart":{"description":"First day of the calendar month (YYYY-MM-DD).","type":"string"},"ordersCount":{"description":"Orders created platform-wide in the month.","type":"number"},"emailsCount":{"description":"Transactional emails sent+received platform-wide in the month.","type":"number"},"aiTokensCount":{"description":"AI tokens consumed platform-wide in the month.","type":"number"},"apiRequestsCount":{"description":"Authenticated public API requests platform-wide in the month.","type":"number"},"estimatedCostCzk":{"description":"Estimated internal cost in CZK for the month (Phase-A model).","type":"number"}}}},"perOrg":{"type":"array","items":{"type":"object","required":["organisationId","name","slug","emoji","lifetime","currentMonth"],"properties":{"organisationId":{"description":"Internal organisation ID.","type":"number"},"name":{"description":"Organisation display name.","type":"string"},"slug":{"description":"Organisation slug.","type":"string"},"emoji":{"description":"Organisation emoji icon.","anyOf":[{"type":"string"},{"type":"null"}]},"lifetime":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}},"currentMonth":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}}}}},"totals":{"type":"object","required":["currentMonth","lifetime"],"properties":{"currentMonth":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}},"lifetime":{"type":"object","required":["ordersCount","emailsCount","aiTokensCount","apiRequestsCount","estimatedCostCzk"],"properties":{"ordersCount":{"type":"number"},"emailsCount":{"type":"number"},"aiTokensCount":{"type":"number"},"apiRequestsCount":{"type":"number"},"estimatedCostCzk":{"type":"number"}}}}},"costModel":{"type":"object","required":["perApiRequestCzk","perEmailCzk","perOrderCzk","perAiTokenCzk","isEstimate"],"properties":{"perApiRequestCzk":{"description":"CZK cost estimate per authenticated API request.","type":"number"},"perEmailCzk":{"description":"CZK cost estimate per transactional email.","type":"number"},"perOrderCzk":{"description":"CZK cost estimate per order created.","type":"number"},"perAiTokenCzk":{"description":"CZK cost estimate per AI token consumed.","type":"number"},"isEstimate":{"description":"True while running on the Phase-A placeholder model.","type":"boolean"}}}},"required":["systemMonthly","perOrg","totals","costModel"]}}}}},"operationId":"getBffAdminUsage-overview","tags":["Admin"],"summary":"Cross-organisation usage overview","description":"Returns aggregated platform usage for the internal admin dashboard: (a) system-wide totals per calendar month for the last 12 months, (b) one row per organisation with lifetime and current-month totals of API requests, transactional emails, orders and AI tokens, sorted by lifetime API requests descending, and (c) an estimated internal cost in CZK derived from a Phase-A cost model. The cost model per-unit prices are echoed back in `costModel` and flagged with `isEstimate: true` — this is a rough order-of-magnitude figure, not real billing. Requires internal admin membership."}},"/bff/admin/sync-documentation-repo":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed without a hard failure.","type":"boolean"},"owner":{"description":"Resolved GitHub owner from the configured repo URL.","type":"string"},"repo":{"description":"Resolved GitHub repository name.","type":"string"},"branch":{"description":"Resolved branch name; null when the default branch was used implicitly.","anyOf":[{"type":"string"},{"type":"null"}]},"filesFound":{"description":"Number of Markdown files discovered in the repo.","type":"number"},"created":{"description":"Posts inserted for the first time.","type":"number"},"updated":{"description":"Existing posts whose title or body changed.","type":"number"},"unchanged":{"description":"Existing posts whose title + body matched byte-for-byte.","type":"number"},"publishedCount":{"description":"Newly-created posts flipped from private to public.","type":"number"},"errorCount":{"description":"Number of files that could not be imported (see `errors`).","type":"number"},"warningCount":{"description":"Number of files that imported with a warning.","type":"number"},"errors":{"description":"Per-file errors that did NOT abort the run.","type":"array","items":{"type":"object","required":["path","message"],"properties":{"path":{"description":"Repository path of the failing file.","type":"string"},"message":{"description":"Reason the file was skipped.","type":"string"}}}}},"required":["success","owner","repo","branch","filesFound","created","updated","unchanged","publishedCount","errorCount","warningCount","errors"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed without a hard failure.","type":"boolean"},"owner":{"description":"Resolved GitHub owner from the configured repo URL.","type":"string"},"repo":{"description":"Resolved GitHub repository name.","type":"string"},"branch":{"description":"Resolved branch name; null when the default branch was used implicitly.","anyOf":[{"type":"string"},{"type":"null"}]},"filesFound":{"description":"Number of Markdown files discovered in the repo.","type":"number"},"created":{"description":"Posts inserted for the first time.","type":"number"},"updated":{"description":"Existing posts whose title or body changed.","type":"number"},"unchanged":{"description":"Existing posts whose title + body matched byte-for-byte.","type":"number"},"publishedCount":{"description":"Newly-created posts flipped from private to public.","type":"number"},"errorCount":{"description":"Number of files that could not be imported (see `errors`).","type":"number"},"warningCount":{"description":"Number of files that imported with a warning.","type":"number"},"errors":{"description":"Per-file errors that did NOT abort the run.","type":"array","items":{"type":"object","required":["path","message"],"properties":{"path":{"description":"Repository path of the failing file.","type":"string"},"message":{"description":"Reason the file was skipped.","type":"string"}}}}},"required":["success","owner","repo","branch","filesFound","created","updated","unchanged","publishedCount","errorCount","warningCount","errors"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed without a hard failure.","type":"boolean"},"owner":{"description":"Resolved GitHub owner from the configured repo URL.","type":"string"},"repo":{"description":"Resolved GitHub repository name.","type":"string"},"branch":{"description":"Resolved branch name; null when the default branch was used implicitly.","anyOf":[{"type":"string"},{"type":"null"}]},"filesFound":{"description":"Number of Markdown files discovered in the repo.","type":"number"},"created":{"description":"Posts inserted for the first time.","type":"number"},"updated":{"description":"Existing posts whose title or body changed.","type":"number"},"unchanged":{"description":"Existing posts whose title + body matched byte-for-byte.","type":"number"},"publishedCount":{"description":"Newly-created posts flipped from private to public.","type":"number"},"errorCount":{"description":"Number of files that could not be imported (see `errors`).","type":"number"},"warningCount":{"description":"Number of files that imported with a warning.","type":"number"},"errors":{"description":"Per-file errors that did NOT abort the run.","type":"array","items":{"type":"object","required":["path","message"],"properties":{"path":{"description":"Repository path of the failing file.","type":"string"},"message":{"description":"Reason the file was skipped.","type":"string"}}}}},"required":["success","owner","repo","branch","filesFound","created","updated","unchanged","publishedCount","errorCount","warningCount","errors"]}}}}},"operationId":"postBffAdminSync-documentation-repo","tags":["Admin"],"summary":"Force-sync the documentation repository into org 81 and auto-publish new posts","description":"One-click operator shortcut that always targets the `bizkithub-documentation` organisation (id 81) regardless of which organisation the caller is currently browsing. Reads the git repo URL and branch from that organisation's own configuration (`post_import_git_repo_url`, `post_import_git_branch`), runs the standard git-import pipeline, and immediately flips every NEWLY-CREATED post from `private` to `public`. Updated and unchanged posts keep whatever visibility an operator had already chosen. Requires internal admin membership."}},"/bff/admin/switch-to-organisation":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the switch was successful.","type":"boolean"},"identityId":{"description":"New identity ID after switching.","type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the switch was successful.","type":"boolean"},"identityId":{"description":"New identity ID after switching.","type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the switch was successful.","type":"boolean"},"identityId":{"description":"New identity ID after switching.","type":"string"}},"required":["success"]}}}}},"operationId":"postBffAdminSwitch-to-organisation","tags":["Admin"],"summary":"Switch to organisation","description":"Switches the admin's session context to the specified organisation. Creates a new login identity and sets an auth cookie. Useful for customer support to impersonate an organisation context. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation to switch into.","examples":["acme-corp"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation to switch into.","examples":["acme-corp"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation to switch into.","examples":["acme-corp"],"type":"string"}}}}}}}},"/bff/admin/manager-candidate-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","slug","name","emoji","licenceKey","licenceValidTo","managedOrgCount"],"properties":{"organisationId":{"description":"Internal id of the candidate organisation.","type":"number"},"slug":{"description":"URL slug of the candidate.","type":"string"},"name":{"description":"Display name.","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"licenceKey":{"description":"16-character licence key from `cas__white_label_licence.licence_key`.","type":"string"},"licenceValidTo":{"description":"Licence expiry (ISO-8601). NULL means the licence has no expiry set.","anyOf":[{"type":"string"},{"type":"null"}]},"managedOrgCount":{"description":"How many active (non-deleted) orgs currently list this candidate as their parent. Useful in the picker to show \"already manages N orgs\" at a glance.","type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","slug","name","emoji","licenceKey","licenceValidTo","managedOrgCount"],"properties":{"organisationId":{"description":"Internal id of the candidate organisation.","type":"number"},"slug":{"description":"URL slug of the candidate.","type":"string"},"name":{"description":"Display name.","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"licenceKey":{"description":"16-character licence key from `cas__white_label_licence.licence_key`.","type":"string"},"licenceValidTo":{"description":"Licence expiry (ISO-8601). NULL means the licence has no expiry set.","anyOf":[{"type":"string"},{"type":"null"}]},"managedOrgCount":{"description":"How many active (non-deleted) orgs currently list this candidate as their parent. Useful in the picker to show \"already manages N orgs\" at a glance.","type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","slug","name","emoji","licenceKey","licenceValidTo","managedOrgCount"],"properties":{"organisationId":{"description":"Internal id of the candidate organisation.","type":"number"},"slug":{"description":"URL slug of the candidate.","type":"string"},"name":{"description":"Display name.","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"licenceKey":{"description":"16-character licence key from `cas__white_label_licence.licence_key`.","type":"string"},"licenceValidTo":{"description":"Licence expiry (ISO-8601). NULL means the licence has no expiry set.","anyOf":[{"type":"string"},{"type":"null"}]},"managedOrgCount":{"description":"How many active (non-deleted) orgs currently list this candidate as their parent. Useful in the picker to show \"already manages N orgs\" at a glance.","type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffAdminManager-candidate-list","tags":["Admin"],"summary":"List organisations eligible to be assigned as a manager","description":"Returns every organisation currently holding an active row in `cas__white_label_licence` — i.e. the set of orgs the internal admin may pick from when assigning `parent_id` on another org (integration partner / manager relation). Excludes soft-deleted orgs. Ordered by name. `managedOrgCount` shows how many active orgs each candidate already manages, so the picker can display \"already manages 3 orgs\" alongside the name. Requires internal admin membership."}},"/bff/admin/user-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","username","firstName","lastName","active","hasOtp","hasPassword","avatarUrl","lastActivity","registerDate","activeMembershipCount","pendingInviteCount"],"properties":{"id":{"description":"16-char external id (wire form).","type":"string"},"username":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"hasOtp":{"description":"True when the user has a 2FA secret set.","type":"boolean"},"hasPassword":{"description":"False while the account is pending initial password setup.","type":"boolean"},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivity":{"anyOf":[{"type":"string"},{"type":"null"}]},"registerDate":{"type":"string"},"activeMembershipCount":{"type":"number"},"pendingInviteCount":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","username","firstName","lastName","active","hasOtp","hasPassword","avatarUrl","lastActivity","registerDate","activeMembershipCount","pendingInviteCount"],"properties":{"id":{"description":"16-char external id (wire form).","type":"string"},"username":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"hasOtp":{"description":"True when the user has a 2FA secret set.","type":"boolean"},"hasPassword":{"description":"False while the account is pending initial password setup.","type":"boolean"},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivity":{"anyOf":[{"type":"string"},{"type":"null"}]},"registerDate":{"type":"string"},"activeMembershipCount":{"type":"number"},"pendingInviteCount":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","username","firstName","lastName","active","hasOtp","hasPassword","avatarUrl","lastActivity","registerDate","activeMembershipCount","pendingInviteCount"],"properties":{"id":{"description":"16-char external id (wire form).","type":"string"},"username":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"hasOtp":{"description":"True when the user has a 2FA secret set.","type":"boolean"},"hasPassword":{"description":"False while the account is pending initial password setup.","type":"boolean"},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivity":{"anyOf":[{"type":"string"},{"type":"null"}]},"registerDate":{"type":"string"},"activeMembershipCount":{"type":"number"},"pendingInviteCount":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffAdminUser-list","tags":["Admin"],"summary":"List platform users","description":"Returns a paginated list of `cas__user` rows across the whole platform — not scoped to any organisation. Supports fulltext search (username / first name / last name / external id) and toggles for active/inactive, no-password, and 2FA-enabled. Each item carries derived counts of active memberships and pending invites so admins can tell at a glance who is onboarded and who is pending. Requires internal admin membership."}},"/bff/admin/user-detail":{"get":{"parameters":[{"description":"16-char external id of the user.","examples":["abcdef1234567890"],"schema":{"type":"string"},"in":"query","name":"userId","required":true}],"operationId":"getBffAdminUser-detail","tags":["Admin"],"summary":"Get user detail (admin)","description":"Returns the full `cas__user` profile — personal fields, security flags, memberships (one row per organisation with blocked / root / jobTitle metadata) and pending invitations. Requires internal admin membership.","responses":{"200":{}}}},"/bff/admin/user-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminUser-update","tags":["Admin"],"summary":"Update user profile (admin)","description":"Updates editable `cas__user` fields. Unknown or omitted fields are left alone. Writes an `admin.update_user` activity row. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"firstName":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"middleName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"personalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"birthday":{"nullable":true,"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"gender":{"nullable":true,"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"terms":{"type":"boolean"},"marketing":{"type":"boolean"},"primaryLocaleId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"timezoneId":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"firstName":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"middleName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"personalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"birthday":{"nullable":true,"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"gender":{"nullable":true,"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"terms":{"type":"boolean"},"marketing":{"type":"boolean"},"primaryLocaleId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"timezoneId":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"firstName":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}]},"middleName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"personalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"birthday":{"nullable":true,"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"gender":{"nullable":true,"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"terms":{"type":"boolean"},"marketing":{"type":"boolean"},"primaryLocaleId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"timezoneId":{"type":"number"}}}}}}}},"/bff/admin/user-upload-avatar":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","avatarUrl"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","avatarUrl"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"avatarUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","avatarUrl"]}}}}},"operationId":"postBffAdminUser-upload-avatar","tags":["Admin"],"summary":"Upload user avatar (admin)","description":"Uploads an image to blob storage and sets the canonical `cas__user.avatar_blob_id` (the only person avatar). Writes an `admin.upload_user_avatar` activity row. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","file"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"file":{"default":"File","description":"Image file to use as the new avatar.","type":"string","format":"binary"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId","file"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"file":{"default":"File","description":"Image file to use as the new avatar.","type":"string","format":"binary"}}}},"text/plain":{"schema":{"type":"object","required":["userId","file"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"file":{"default":"File","description":"Image file to use as the new avatar.","type":"string","format":"binary"}}}}}}}},"/bff/admin/user-remove-avatar":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminUser-remove-avatar","tags":["Admin"],"summary":"Remove user avatar (admin)","description":"Clears `cas__user.avatar_blob_id` (the stored blob is kept on disk but no longer linked). Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}}}}}},"/bff/admin/user-request-password-reset":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"email":{"type":"string"}},"required":["success","email"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"email":{"type":"string"}},"required":["success","email"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"email":{"type":"string"}},"required":["success","email"]}}}}},"operationId":"postBffAdminUser-request-password-reset","tags":["Admin"],"summary":"Send password-reset email (admin)","description":"Creates a `shop__contact_reset_password_request` for the user and sends the standard `customer-reset-password` e-mail. Bypasses the user-side rate limit. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}}}}}},"/bff/admin/user-toggle-active":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"active":{"type":"boolean"}},"required":["success","active"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"active":{"type":"boolean"}},"required":["success","active"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"active":{"type":"boolean"}},"required":["success","active"]}}}}},"operationId":"postBffAdminUser-toggle-active","tags":["Admin"],"summary":"Activate or deactivate a user (admin)","description":"Flips `cas__user.active`. A deactivated user cannot log in anywhere, but their data stays. Refuses to deactivate the calling admin. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","active"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"active":{"description":"True to activate, false to deactivate.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId","active"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"active":{"description":"True to activate, false to deactivate.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["userId","active"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"active":{"description":"True to activate, false to deactivate.","type":"boolean"}}}}}}}},"/bff/admin/user-disable-otp":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffAdminUser-disable-otp","tags":["Admin"],"summary":"Disable 2FA for a user (admin)","description":"Clears the OTP secret so the user can log in without a second factor. Used by support when a user loses their authenticator. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"}}}}}}}},"/bff/admin/user-toggle-member-blocked":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"blocked":{"type":"boolean"}},"required":["success","blocked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"blocked":{"type":"boolean"}},"required":["success","blocked"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"blocked":{"type":"boolean"}},"required":["success","blocked"]}}}}},"operationId":"postBffAdminUser-toggle-member-blocked","tags":["Admin"],"summary":"Block or unblock a single membership (admin)","description":"Toggles `cas__organisation_member.blocked` for the user in one organisation. Block delegates to the standard `blockMember` policy (invalidates API keys, sends notification, enforces last-root and last-active invariants). Unblock is a silent flip with an activity log entry. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","organisationSlug","blocked"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"organisationSlug":{"description":"Slug of the organisation whose membership is being toggled.","type":"string"},"blocked":{"description":"True to block the membership, false to unblock.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId","organisationSlug","blocked"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"organisationSlug":{"description":"Slug of the organisation whose membership is being toggled.","type":"string"},"blocked":{"description":"True to block the membership, false to unblock.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["userId","organisationSlug","blocked"],"properties":{"userId":{"description":"16-char external id of the user.","type":"string"},"organisationSlug":{"description":"Slug of the organisation whose membership is being toggled.","type":"string"},"blocked":{"description":"True to block the membership, false to unblock.","type":"boolean"}}}}}}}},"/bff/admin/update-organisation-manager":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"organisationId":{"description":"Id of the org whose manager was updated.","type":"number"},"parentOrganisationId":{"description":"New parent id after the update, or `null` if the manager was cleared.","anyOf":[{"type":"number"},{"type":"null"}]}},"required":["organisationId","parentOrganisationId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"organisationId":{"description":"Id of the org whose manager was updated.","type":"number"},"parentOrganisationId":{"description":"New parent id after the update, or `null` if the manager was cleared.","anyOf":[{"type":"number"},{"type":"null"}]}},"required":["organisationId","parentOrganisationId"]}},"text/plain":{"schema":{"type":"object","properties":{"organisationId":{"description":"Id of the org whose manager was updated.","type":"number"},"parentOrganisationId":{"description":"New parent id after the update, or `null` if the manager was cleared.","anyOf":[{"type":"number"},{"type":"null"}]}},"required":["organisationId","parentOrganisationId"]}}}}},"operationId":"postBffAdminUpdate-organisation-manager","tags":["Admin"],"summary":"Set or clear the manager (integration partner) of an organisation","description":"Updates `cas__organisation.parent_id` on the target organisation. When `managerOrganisationSlug` is `null`, clears the manager (org is then treated as directly managed by BizKitHub). When non-null, the parent MUST hold an active integration-partner licence — assigning a random non-licensed org as parent is rejected, since the manager relation exposes support / vendor privileges. Writes a `core__activity` row of type `admin.set_organisation_manager` to `INTERNAL_ORGANISATION_ID` for audit. Requires internal admin membership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","managerOrganisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation whose manager (`parent_id`) is being changed.","examples":["acme-shop"],"type":"string"},"managerOrganisationSlug":{"description":"Slug of the manager organisation to assign, or `null` to clear the relation (managed directly by BizKitHub). When non-null, the target org MUST hold an active integration-partner licence (row in `cas__white_label_licence` with `active = true` and `valid_to > now()` or NULL) — assignment is otherwise rejected. An org cannot be its own manager.","examples":["7-napadu-s-r-o",null],"anyOf":[{"type":"string"},{"type":"null"}]},"grantLicence":{"description":"When the chosen manager has no active integration-partner licence, grant it first (audited) instead of rejecting the assignment.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","managerOrganisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation whose manager (`parent_id`) is being changed.","examples":["acme-shop"],"type":"string"},"managerOrganisationSlug":{"description":"Slug of the manager organisation to assign, or `null` to clear the relation (managed directly by BizKitHub). When non-null, the target org MUST hold an active integration-partner licence (row in `cas__white_label_licence` with `active = true` and `valid_to > now()` or NULL) — assignment is otherwise rejected. An org cannot be its own manager.","examples":["7-napadu-s-r-o",null],"anyOf":[{"type":"string"},{"type":"null"}]},"grantLicence":{"description":"When the chosen manager has no active integration-partner licence, grant it first (audited) instead of rejecting the assignment.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","managerOrganisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the organisation whose manager (`parent_id`) is being changed.","examples":["acme-shop"],"type":"string"},"managerOrganisationSlug":{"description":"Slug of the manager organisation to assign, or `null` to clear the relation (managed directly by BizKitHub). When non-null, the target org MUST hold an active integration-partner licence (row in `cas__white_label_licence` with `active = true` and `valid_to > now()` or NULL) — assignment is otherwise rejected. An org cannot be its own manager.","examples":["7-napadu-s-r-o",null],"anyOf":[{"type":"string"},{"type":"null"}]},"grantLicence":{"description":"When the chosen manager has no active integration-partner licence, grant it first (audited) instead of rejecting the assignment.","type":"boolean"}}}}}}}},"/bff/bank-account/":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","iban","domesticLabel","displayName","bankCode","bankName","bic","source","isActive","isPrimary","isPubliclyListed","mfcrPublishedDate","mfcrLastCheckedDate","fraudHits","fraudSeverity","insertedDate","hasConnector","connectorType","connectorLastStatus","connectorLastRunDate","connectorLastError","connectorErrorKind","apiToken","lastFetchedDate","lastSyncSuccess","lastSyncErrorMessage","accountNumber","currency","openingBalance","closingBalance","dateStart","dateEnd","transactionCount","transactionsThisMonth","totalIncome","totalExpense","income30d","expense30d","matchedTransactions","unmatchedTransactions","lastTransactionDate"],"properties":{"externalId":{"description":"Stable external identifier of the bank account.","type":"string"},"iban":{"description":"Account IBAN (normalised, uppercase).","anyOf":[{"type":"string"},{"type":"null"}]},"domesticLabel":{"description":"Czech domestic representation (e.g. \"670100-2110572041/6210\"). Null for non-CZ/SK IBANs.","anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"description":"Optional user-facing label.","anyOf":[{"type":"string"},{"type":"null"}]},"bankCode":{"description":"4-digit Czech bank code.","anyOf":[{"type":"string"},{"type":"null"}]},"bankName":{"description":"Bank display name.","anyOf":[{"type":"string"},{"type":"null"}]},"bic":{"description":"Bank BIC/SWIFT.","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"Where the account record originated.","examples":["manual","mfcr","fio_api","gpc"],"type":"string"},"isActive":{"description":"Whether the account is active (false = soft-deleted).","type":"boolean"},"isPrimary":{"description":"Marked as the organisation primary account.","type":"boolean"},"isPubliclyListed":{"description":"True when this account is currently published in the MFCR VAT-payer registry for the organisation.","type":"boolean"},"mfcrPublishedDate":{"description":"Date the account was published in the MFCR registry (ISO date).","anyOf":[{"type":"string"},{"type":"null"}]},"mfcrLastCheckedDate":{"description":"Last time the MFCR registry was checked (ISO timestamp).","anyOf":[{"type":"string"},{"type":"null"}]},"fraudHits":{"description":"Number of active fraud-list entries linked to this normalised account.","type":"number"},"fraudSeverity":{"description":"Highest fraud severity (\"info\", \"warning\", \"critical\") or null when not on any list.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the account was first added (ISO).","type":"string"},"hasConnector":{"description":"True if an active sync connector (e.g. FIO API token) is attached.","type":"boolean"},"connectorType":{"description":"Connector type, e.g. \"fio_v2\".","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastStatus":{"description":"Connector state: \"pending\" (first sync queued / running in the background), \"success\" or \"error\".","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastRunDate":{"description":"Last connector run timestamp (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastError":{"description":"Short reason of the last failed run (or of the failed attempt a pending retry follows).","anyOf":[{"type":"string"},{"type":"null"}]},"connectorErrorKind":{"description":"Stable category of `connectorLastError` for localized UI messages.","anyOf":[{"const":"rateLimited","type":"string"},{"const":"timeout","type":"string"},{"const":"unavailable","type":"string"},{"const":"tokenInactive","type":"string"},{"const":"other","type":"string"},{"type":"null"}]},"apiToken":{"description":"Masked API token (for display only).","anyOf":[{"type":"string"},{"type":"null"}]},"lastFetchedDate":{"description":"Timestamp of the last connector fetch attempt (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncSuccess":{"description":"True when the last connector run completed without error.","type":"boolean"},"lastSyncErrorMessage":{"description":"Human-readable error message from the last failed sync.","anyOf":[{"type":"string"},{"type":"null"}]},"accountNumber":{"description":"Bank account number as reported by the connector (digits before the slash).","anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Account currency code (e.g. \"CZK\", \"EUR\").","anyOf":[{"type":"string"},{"type":"null"}]},"openingBalance":{"description":"Opening balance from the most recent synced period.","anyOf":[{"type":"number"},{"type":"null"}]},"closingBalance":{"description":"Closing balance from the most recent synced period.","anyOf":[{"type":"number"},{"type":"null"}]},"dateStart":{"description":"Start of the most recent synced period (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"dateEnd":{"description":"End of the most recent synced period (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"transactionCount":{"description":"Total number of stored transactions for this account.","type":"number"},"transactionsThisMonth":{"description":"Transactions falling within the current calendar month.","type":"number"},"totalIncome":{"description":"All-time sum of incoming payments.","type":"number"},"totalExpense":{"description":"All-time sum of outgoing payments (absolute value).","type":"number"},"income30d":{"description":"Incoming payments in the last 30 days.","type":"number"},"expense30d":{"description":"Outgoing payments in the last 30 days (absolute value).","type":"number"},"matchedTransactions":{"description":"Transactions automatically matched to an order.","type":"number"},"unmatchedTransactions":{"description":"Transactions not yet matched to any order.","type":"number"},"lastTransactionDate":{"description":"Date of the most recent transaction (ISO) or null.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","iban","domesticLabel","displayName","bankCode","bankName","bic","source","isActive","isPrimary","isPubliclyListed","mfcrPublishedDate","mfcrLastCheckedDate","fraudHits","fraudSeverity","insertedDate","hasConnector","connectorType","connectorLastStatus","connectorLastRunDate","connectorLastError","connectorErrorKind","apiToken","lastFetchedDate","lastSyncSuccess","lastSyncErrorMessage","accountNumber","currency","openingBalance","closingBalance","dateStart","dateEnd","transactionCount","transactionsThisMonth","totalIncome","totalExpense","income30d","expense30d","matchedTransactions","unmatchedTransactions","lastTransactionDate"],"properties":{"externalId":{"description":"Stable external identifier of the bank account.","type":"string"},"iban":{"description":"Account IBAN (normalised, uppercase).","anyOf":[{"type":"string"},{"type":"null"}]},"domesticLabel":{"description":"Czech domestic representation (e.g. \"670100-2110572041/6210\"). Null for non-CZ/SK IBANs.","anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"description":"Optional user-facing label.","anyOf":[{"type":"string"},{"type":"null"}]},"bankCode":{"description":"4-digit Czech bank code.","anyOf":[{"type":"string"},{"type":"null"}]},"bankName":{"description":"Bank display name.","anyOf":[{"type":"string"},{"type":"null"}]},"bic":{"description":"Bank BIC/SWIFT.","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"Where the account record originated.","examples":["manual","mfcr","fio_api","gpc"],"type":"string"},"isActive":{"description":"Whether the account is active (false = soft-deleted).","type":"boolean"},"isPrimary":{"description":"Marked as the organisation primary account.","type":"boolean"},"isPubliclyListed":{"description":"True when this account is currently published in the MFCR VAT-payer registry for the organisation.","type":"boolean"},"mfcrPublishedDate":{"description":"Date the account was published in the MFCR registry (ISO date).","anyOf":[{"type":"string"},{"type":"null"}]},"mfcrLastCheckedDate":{"description":"Last time the MFCR registry was checked (ISO timestamp).","anyOf":[{"type":"string"},{"type":"null"}]},"fraudHits":{"description":"Number of active fraud-list entries linked to this normalised account.","type":"number"},"fraudSeverity":{"description":"Highest fraud severity (\"info\", \"warning\", \"critical\") or null when not on any list.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the account was first added (ISO).","type":"string"},"hasConnector":{"description":"True if an active sync connector (e.g. FIO API token) is attached.","type":"boolean"},"connectorType":{"description":"Connector type, e.g. \"fio_v2\".","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastStatus":{"description":"Connector state: \"pending\" (first sync queued / running in the background), \"success\" or \"error\".","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastRunDate":{"description":"Last connector run timestamp (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastError":{"description":"Short reason of the last failed run (or of the failed attempt a pending retry follows).","anyOf":[{"type":"string"},{"type":"null"}]},"connectorErrorKind":{"description":"Stable category of `connectorLastError` for localized UI messages.","anyOf":[{"const":"rateLimited","type":"string"},{"const":"timeout","type":"string"},{"const":"unavailable","type":"string"},{"const":"tokenInactive","type":"string"},{"const":"other","type":"string"},{"type":"null"}]},"apiToken":{"description":"Masked API token (for display only).","anyOf":[{"type":"string"},{"type":"null"}]},"lastFetchedDate":{"description":"Timestamp of the last connector fetch attempt (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncSuccess":{"description":"True when the last connector run completed without error.","type":"boolean"},"lastSyncErrorMessage":{"description":"Human-readable error message from the last failed sync.","anyOf":[{"type":"string"},{"type":"null"}]},"accountNumber":{"description":"Bank account number as reported by the connector (digits before the slash).","anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Account currency code (e.g. \"CZK\", \"EUR\").","anyOf":[{"type":"string"},{"type":"null"}]},"openingBalance":{"description":"Opening balance from the most recent synced period.","anyOf":[{"type":"number"},{"type":"null"}]},"closingBalance":{"description":"Closing balance from the most recent synced period.","anyOf":[{"type":"number"},{"type":"null"}]},"dateStart":{"description":"Start of the most recent synced period (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"dateEnd":{"description":"End of the most recent synced period (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"transactionCount":{"description":"Total number of stored transactions for this account.","type":"number"},"transactionsThisMonth":{"description":"Transactions falling within the current calendar month.","type":"number"},"totalIncome":{"description":"All-time sum of incoming payments.","type":"number"},"totalExpense":{"description":"All-time sum of outgoing payments (absolute value).","type":"number"},"income30d":{"description":"Incoming payments in the last 30 days.","type":"number"},"expense30d":{"description":"Outgoing payments in the last 30 days (absolute value).","type":"number"},"matchedTransactions":{"description":"Transactions automatically matched to an order.","type":"number"},"unmatchedTransactions":{"description":"Transactions not yet matched to any order.","type":"number"},"lastTransactionDate":{"description":"Date of the most recent transaction (ISO) or null.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","iban","domesticLabel","displayName","bankCode","bankName","bic","source","isActive","isPrimary","isPubliclyListed","mfcrPublishedDate","mfcrLastCheckedDate","fraudHits","fraudSeverity","insertedDate","hasConnector","connectorType","connectorLastStatus","connectorLastRunDate","connectorLastError","connectorErrorKind","apiToken","lastFetchedDate","lastSyncSuccess","lastSyncErrorMessage","accountNumber","currency","openingBalance","closingBalance","dateStart","dateEnd","transactionCount","transactionsThisMonth","totalIncome","totalExpense","income30d","expense30d","matchedTransactions","unmatchedTransactions","lastTransactionDate"],"properties":{"externalId":{"description":"Stable external identifier of the bank account.","type":"string"},"iban":{"description":"Account IBAN (normalised, uppercase).","anyOf":[{"type":"string"},{"type":"null"}]},"domesticLabel":{"description":"Czech domestic representation (e.g. \"670100-2110572041/6210\"). Null for non-CZ/SK IBANs.","anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"description":"Optional user-facing label.","anyOf":[{"type":"string"},{"type":"null"}]},"bankCode":{"description":"4-digit Czech bank code.","anyOf":[{"type":"string"},{"type":"null"}]},"bankName":{"description":"Bank display name.","anyOf":[{"type":"string"},{"type":"null"}]},"bic":{"description":"Bank BIC/SWIFT.","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"Where the account record originated.","examples":["manual","mfcr","fio_api","gpc"],"type":"string"},"isActive":{"description":"Whether the account is active (false = soft-deleted).","type":"boolean"},"isPrimary":{"description":"Marked as the organisation primary account.","type":"boolean"},"isPubliclyListed":{"description":"True when this account is currently published in the MFCR VAT-payer registry for the organisation.","type":"boolean"},"mfcrPublishedDate":{"description":"Date the account was published in the MFCR registry (ISO date).","anyOf":[{"type":"string"},{"type":"null"}]},"mfcrLastCheckedDate":{"description":"Last time the MFCR registry was checked (ISO timestamp).","anyOf":[{"type":"string"},{"type":"null"}]},"fraudHits":{"description":"Number of active fraud-list entries linked to this normalised account.","type":"number"},"fraudSeverity":{"description":"Highest fraud severity (\"info\", \"warning\", \"critical\") or null when not on any list.","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the account was first added (ISO).","type":"string"},"hasConnector":{"description":"True if an active sync connector (e.g. FIO API token) is attached.","type":"boolean"},"connectorType":{"description":"Connector type, e.g. \"fio_v2\".","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastStatus":{"description":"Connector state: \"pending\" (first sync queued / running in the background), \"success\" or \"error\".","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastRunDate":{"description":"Last connector run timestamp (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"connectorLastError":{"description":"Short reason of the last failed run (or of the failed attempt a pending retry follows).","anyOf":[{"type":"string"},{"type":"null"}]},"connectorErrorKind":{"description":"Stable category of `connectorLastError` for localized UI messages.","anyOf":[{"const":"rateLimited","type":"string"},{"const":"timeout","type":"string"},{"const":"unavailable","type":"string"},{"const":"tokenInactive","type":"string"},{"const":"other","type":"string"},{"type":"null"}]},"apiToken":{"description":"Masked API token (for display only).","anyOf":[{"type":"string"},{"type":"null"}]},"lastFetchedDate":{"description":"Timestamp of the last connector fetch attempt (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncSuccess":{"description":"True when the last connector run completed without error.","type":"boolean"},"lastSyncErrorMessage":{"description":"Human-readable error message from the last failed sync.","anyOf":[{"type":"string"},{"type":"null"}]},"accountNumber":{"description":"Bank account number as reported by the connector (digits before the slash).","anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"description":"Account currency code (e.g. \"CZK\", \"EUR\").","anyOf":[{"type":"string"},{"type":"null"}]},"openingBalance":{"description":"Opening balance from the most recent synced period.","anyOf":[{"type":"number"},{"type":"null"}]},"closingBalance":{"description":"Closing balance from the most recent synced period.","anyOf":[{"type":"number"},{"type":"null"}]},"dateStart":{"description":"Start of the most recent synced period (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"dateEnd":{"description":"End of the most recent synced period (ISO).","anyOf":[{"type":"string"},{"type":"null"}]},"transactionCount":{"description":"Total number of stored transactions for this account.","type":"number"},"transactionsThisMonth":{"description":"Transactions falling within the current calendar month.","type":"number"},"totalIncome":{"description":"All-time sum of incoming payments.","type":"number"},"totalExpense":{"description":"All-time sum of outgoing payments (absolute value).","type":"number"},"income30d":{"description":"Incoming payments in the last 30 days.","type":"number"},"expense30d":{"description":"Outgoing payments in the last 30 days (absolute value).","type":"number"},"matchedTransactions":{"description":"Transactions automatically matched to an order.","type":"number"},"unmatchedTransactions":{"description":"Transactions not yet matched to any order.","type":"number"},"lastTransactionDate":{"description":"Date of the most recent transaction (ISO) or null.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getBffBank-account","tags":["Bank account"],"summary":"List organisation bank accounts","description":"Single source of truth for organisation bank accounts. Returns every account ever attached (active + soft-deleted), regardless of source (manual / MFCR / Fio API / GPC). Each row carries identity metadata, optional connector status, optional Fio-style live metadata (balance, sync period), and transaction analytics (counts, last 30d income/expense, match rate, last transaction date). Consumers (Settings page, Bank Transactions page) filter and sort client-side."},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string"},"iban":{"type":"string"},"bankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"fraudHits":{"type":"array","items":{"type":"object","required":["id","source","severity","reason"],"properties":{"id":{"type":"number"},"source":{"type":"string"},"severity":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["externalId","iban","bankCode","fraudHits"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"externalId":{"type":"string"},"iban":{"type":"string"},"bankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"fraudHits":{"type":"array","items":{"type":"object","required":["id","source","severity","reason"],"properties":{"id":{"type":"number"},"source":{"type":"string"},"severity":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["externalId","iban","bankCode","fraudHits"]}},"text/plain":{"schema":{"type":"object","properties":{"externalId":{"type":"string"},"iban":{"type":"string"},"bankCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"fraudHits":{"type":"array","items":{"type":"object","required":["id","source","severity","reason"],"properties":{"id":{"type":"number"},"source":{"type":"string"},"severity":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["externalId","iban","bankCode","fraudHits"]}}}}},"operationId":"postBffBank-account","tags":["Bank account"],"summary":"Add or re-activate an organisation bank account","description":"Adds a manually entered bank account. If the same IBAN is already attached to this organisation it is re-activated. Always returns fraud-list hits associated with the normalised IBAN so the UI can warn the user.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["bankAccount"],"properties":{"bankAccount":{"description":"IBAN (any country) or Czech domestic format (\"670100-2110572041/6210\"). Will be normalised.","examples":["670100-2110572041/6210","CZ6520100000002901234567"],"type":"string"},"displayName":{"description":"Optional user-facing label.","type":"string"},"isPrimary":{"description":"Mark as the organisation primary account.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["bankAccount"],"properties":{"bankAccount":{"description":"IBAN (any country) or Czech domestic format (\"670100-2110572041/6210\"). Will be normalised.","examples":["670100-2110572041/6210","CZ6520100000002901234567"],"type":"string"},"displayName":{"description":"Optional user-facing label.","type":"string"},"isPrimary":{"description":"Mark as the organisation primary account.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["bankAccount"],"properties":{"bankAccount":{"description":"IBAN (any country) or Czech domestic format (\"670100-2110572041/6210\"). Will be normalised.","examples":["670100-2110572041/6210","CZ6520100000002901234567"],"type":"string"},"displayName":{"description":"Optional user-facing label.","type":"string"},"isPrimary":{"description":"Mark as the organisation primary account.","type":"boolean"}}}}}}}},"/bff/bank-account/{externalId}/update":{"post":{"parameters":[{"description":"Bank account external ID returned by the list endpoint.","schema":{"type":"string"},"in":"path","name":"externalId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBank-accountByExternalIdUpdate","tags":["Bank account"],"summary":"Update editable bank account fields","description":"Partial-update of organisation-scoped, user-editable fields on a bank account. Currently exposes `displayName`. Designed to grow safely: unspecified fields are left untouched, `null` / `\"\"` clears the value.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"description":"Custom user-facing label for the account. Empty string or null clears it (the UI will then fall back to domesticLabel / IBAN / external ID).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"displayName":{"description":"Custom user-facing label for the account. Empty string or null clears it (the UI will then fall back to domesticLabel / IBAN / external ID).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"displayName":{"description":"Custom user-facing label for the account. Empty string or null clears it (the UI will then fall back to domesticLabel / IBAN / external ID).","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/bank-account/{externalId}":{"delete":{"parameters":[{"description":"Bank account external ID returned by the list endpoint.","schema":{"type":"string"},"in":"path","name":"externalId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"deleteBffBank-accountByExternalId","tags":["Bank account"],"summary":"Soft-delete a bank account","description":"Marks the account inactive and disables any attached sync connectors. The row is preserved."}},"/bff/bank-account/{externalId}/sync":{"post":{"parameters":[{"description":"Bank account external ID returned by the list endpoint.","schema":{"type":"string"},"in":"path","name":"externalId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"imported":{"description":"Number of new transactions imported in this run.","type":"number"},"iban":{"description":"IBAN after the sync (newly discovered for a brand-new placeholder).","anyOf":[{"type":"string"},{"type":"null"}]},"pending":{"description":"True when the account never completed its first sync: the retry was started in the background and the outcome appears in `connectorLastStatus` of the list endpoint.","type":"boolean"}},"required":["success","imported","iban","pending"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"imported":{"description":"Number of new transactions imported in this run.","type":"number"},"iban":{"description":"IBAN after the sync (newly discovered for a brand-new placeholder).","anyOf":[{"type":"string"},{"type":"null"}]},"pending":{"description":"True when the account never completed its first sync: the retry was started in the background and the outcome appears in `connectorLastStatus` of the list endpoint.","type":"boolean"}},"required":["success","imported","iban","pending"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"imported":{"description":"Number of new transactions imported in this run.","type":"number"},"iban":{"description":"IBAN after the sync (newly discovered for a brand-new placeholder).","anyOf":[{"type":"string"},{"type":"null"}]},"pending":{"description":"True when the account never completed its first sync: the retry was started in the background and the outcome appears in `connectorLastStatus` of the list endpoint.","type":"boolean"}},"required":["success","imported","iban","pending"]}}}}},"operationId":"postBffBank-accountByExternalIdSync","tags":["Bank account"],"summary":"Force-sync a single bank account now","description":"Immediately re-fetches the latest Fio feed for one account, bypassing the adaptive-scheduler `next_sync_date` and the 2 h in-memory cache. Returns the number of newly imported transactions. For an account whose first sync never succeeded (no IBAN yet), the first-sync flow is restarted in the background instead and `pending: true` is returned. Lets an operator recover from a stuck first sync (BIZKIT-35) without waiting for the hourly cron."}},"/bff/bank-account/sync-mfcr":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"vatNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"imported":{"type":"number"},"matched":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["vatNumber","imported","matched","errors"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"vatNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"imported":{"type":"number"},"matched":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["vatNumber","imported","matched","errors"]}},"text/plain":{"schema":{"type":"object","properties":{"vatNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"imported":{"type":"number"},"matched":{"type":"number"},"errors":{"type":"array","items":{"type":"string"}}},"required":["vatNumber","imported","matched","errors"]}}}}},"operationId":"postBffBank-accountSync-mfcr","tags":["Bank account"],"summary":"Sync MFCR-published bank accounts","description":"Calls the Czech tax authority (MFCR) registr plátců DPH SOAP API for the organisation's DIČ and imports any officially published bank accounts. Updates the publicly-listed flag on existing accounts. No-op when the organisation has no DIČ or is not a VAT payer."}},"/bff/bank-statement/":{"get":{"parameters":[{"description":"Restrict to statements of one bank account.","schema":{"type":"string"},"in":"query","name":"bankAccountExternalId","required":false},{"description":"Statements whose period overlaps this calendar year (e.g. 2026).","schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"description":"Statements whose period overlaps this calendar year (e.g. 2026).","type":"number"}]},"in":"query","name":"year","required":false},{"description":"With `year`: statements whose period overlaps this month (1-12).","schema":{"minimum":1,"maximum":12,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"description":"With `year`: statements whose period overlaps this month (1-12).","minimum":1,"maximum":12,"type":"number"}]},"in":"query","name":"month","required":false},{"description":"Search in account name, IBAN, account number or \"N/YYYY\".","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","externalId","bankAccountExternalId","bankAccountDisplayName","iban","accountNumber","bankCode","statementYear","statementNumber","year","month","periodStart","periodEnd","openingBalance","closingBalance","currency","byteSize","source","downloadedDate","filename","contentType","downloadUrl"],"properties":{"id":{"description":"Row key for data grids, equal to `externalId`.","type":"string"},"externalId":{"description":"Blob token (immutable). Use as row key and download identifier.","type":"string"},"bankAccountExternalId":{"description":"16-char external id of the source bank account.","anyOf":[{"type":"string"},{"type":"null"}]},"bankAccountDisplayName":{"description":"Human-readable label of the source account.","anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountNumber":{"description":"Domestic account number without slash.","anyOf":[{"type":"string"},{"type":"null"}]},"bankCode":{"description":"4-digit Czech bank code.","anyOf":[{"type":"string"},{"type":"null"}]},"statementYear":{"description":"Bank numbering year of the statement (\"8/2026\" → 2026).","type":"number"},"statementNumber":{"description":"Statement number within its numbering year (\"8/2026\" → 8). Not the calendar month.","type":"number"},"year":{"description":"Calendar year the statement period ends in.","type":"number"},"month":{"description":"Calendar month (1-12) the statement period ends in.","type":"number"},"periodStart":{"description":"ISO date of the first day covered by the statement.","type":"string"},"periodEnd":{"description":"ISO date of the last day covered by the statement.","type":"string"},"openingBalance":{"description":"Balance at the start of the period, from the PDF header.","anyOf":[{"type":"number"},{"type":"null"}]},"closingBalance":{"description":"Balance at the end of the period, from the PDF header.","anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency of the account.","examples":["CZK"],"anyOf":[{"type":"string"},{"type":"null"}]},"byteSize":{"description":"PDF size in bytes.","type":"number"},"source":{"description":"Origin of the PDF (e.g. \"fio_api\").","examples":["fio_api"],"type":"string"},"downloadedDate":{"description":"ISO timestamp when the PDF was pulled from the bank.","type":"string"},"filename":{"description":"Human-facing filename for downloads.","type":"string"},"contentType":{"description":"Blob content type, always application/pdf for statements.","type":"string"},"downloadUrl":{"description":"Authenticated BFF download URL (`/bff/bank-statement/file?token=…`).","type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","externalId","bankAccountExternalId","bankAccountDisplayName","iban","accountNumber","bankCode","statementYear","statementNumber","year","month","periodStart","periodEnd","openingBalance","closingBalance","currency","byteSize","source","downloadedDate","filename","contentType","downloadUrl"],"properties":{"id":{"description":"Row key for data grids, equal to `externalId`.","type":"string"},"externalId":{"description":"Blob token (immutable). Use as row key and download identifier.","type":"string"},"bankAccountExternalId":{"description":"16-char external id of the source bank account.","anyOf":[{"type":"string"},{"type":"null"}]},"bankAccountDisplayName":{"description":"Human-readable label of the source account.","anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountNumber":{"description":"Domestic account number without slash.","anyOf":[{"type":"string"},{"type":"null"}]},"bankCode":{"description":"4-digit Czech bank code.","anyOf":[{"type":"string"},{"type":"null"}]},"statementYear":{"description":"Bank numbering year of the statement (\"8/2026\" → 2026).","type":"number"},"statementNumber":{"description":"Statement number within its numbering year (\"8/2026\" → 8). Not the calendar month.","type":"number"},"year":{"description":"Calendar year the statement period ends in.","type":"number"},"month":{"description":"Calendar month (1-12) the statement period ends in.","type":"number"},"periodStart":{"description":"ISO date of the first day covered by the statement.","type":"string"},"periodEnd":{"description":"ISO date of the last day covered by the statement.","type":"string"},"openingBalance":{"description":"Balance at the start of the period, from the PDF header.","anyOf":[{"type":"number"},{"type":"null"}]},"closingBalance":{"description":"Balance at the end of the period, from the PDF header.","anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency of the account.","examples":["CZK"],"anyOf":[{"type":"string"},{"type":"null"}]},"byteSize":{"description":"PDF size in bytes.","type":"number"},"source":{"description":"Origin of the PDF (e.g. \"fio_api\").","examples":["fio_api"],"type":"string"},"downloadedDate":{"description":"ISO timestamp when the PDF was pulled from the bank.","type":"string"},"filename":{"description":"Human-facing filename for downloads.","type":"string"},"contentType":{"description":"Blob content type, always application/pdf for statements.","type":"string"},"downloadUrl":{"description":"Authenticated BFF download URL (`/bff/bank-statement/file?token=…`).","type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","externalId","bankAccountExternalId","bankAccountDisplayName","iban","accountNumber","bankCode","statementYear","statementNumber","year","month","periodStart","periodEnd","openingBalance","closingBalance","currency","byteSize","source","downloadedDate","filename","contentType","downloadUrl"],"properties":{"id":{"description":"Row key for data grids, equal to `externalId`.","type":"string"},"externalId":{"description":"Blob token (immutable). Use as row key and download identifier.","type":"string"},"bankAccountExternalId":{"description":"16-char external id of the source bank account.","anyOf":[{"type":"string"},{"type":"null"}]},"bankAccountDisplayName":{"description":"Human-readable label of the source account.","anyOf":[{"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountNumber":{"description":"Domestic account number without slash.","anyOf":[{"type":"string"},{"type":"null"}]},"bankCode":{"description":"4-digit Czech bank code.","anyOf":[{"type":"string"},{"type":"null"}]},"statementYear":{"description":"Bank numbering year of the statement (\"8/2026\" → 2026).","type":"number"},"statementNumber":{"description":"Statement number within its numbering year (\"8/2026\" → 8). Not the calendar month.","type":"number"},"year":{"description":"Calendar year the statement period ends in.","type":"number"},"month":{"description":"Calendar month (1-12) the statement period ends in.","type":"number"},"periodStart":{"description":"ISO date of the first day covered by the statement.","type":"string"},"periodEnd":{"description":"ISO date of the last day covered by the statement.","type":"string"},"openingBalance":{"description":"Balance at the start of the period, from the PDF header.","anyOf":[{"type":"number"},{"type":"null"}]},"closingBalance":{"description":"Balance at the end of the period, from the PDF header.","anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"description":"ISO 4217 currency of the account.","examples":["CZK"],"anyOf":[{"type":"string"},{"type":"null"}]},"byteSize":{"description":"PDF size in bytes.","type":"number"},"source":{"description":"Origin of the PDF (e.g. \"fio_api\").","examples":["fio_api"],"type":"string"},"downloadedDate":{"description":"ISO timestamp when the PDF was pulled from the bank.","type":"string"},"filename":{"description":"Human-facing filename for downloads.","type":"string"},"contentType":{"description":"Blob content type, always application/pdf for statements.","type":"string"},"downloadUrl":{"description":"Authenticated BFF download URL (`/bff/bank-statement/file?token=…`).","type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffBank-statement","tags":["Bank statement"],"summary":"List downloaded bank statement PDFs","description":"Paginated list of stored statement PDFs for the caller organisation, newest period first. Filter by bank account (external id), by calendar year / month (period overlap, so a quarterly statement appears in each month it covers) and by full-text query."}},"/bff/bank-statement/accounts":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","required":["bankAccountExternalId","status","statementCount","latestPeriodStart","latestPeriodEnd","fioLastStatement","missingCount","hasUnknownYears","scaBlockedAt","lastRunDate","lastError"],"properties":{"bankAccountExternalId":{"description":"16-char external id of the bank account.","type":"string"},"status":{"description":"Completeness of the downloaded statements for this account.","anyOf":[{"const":"no-connector","type":"string"},{"const":"unhealthy","type":"string"},{"const":"running","type":"string"},{"const":"waiting","type":"string"},{"const":"backfilling","type":"string"},{"const":"sca-required","type":"string"},{"const":"complete","type":"string"}]},"statementCount":{"description":"Stored statements.","type":"number"},"latestPeriodStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"latestPeriodEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"fioLastStatement":{"description":"Newest statement issued by Fio, \"N/YYYY\".","anyOf":[{"type":"string"},{"type":"null"}]},"missingCount":{"description":"Statements issued by Fio inside the backfill horizon but not stored yet.","type":"number"},"hasUnknownYears":{"description":"A past year has not been probed yet, the gap may be larger.","type":"boolean"},"scaBlockedAt":{"description":"Newest statement that needs a strong authorization, \"N/YYYY\".","anyOf":[{"type":"string"},{"type":"null"}]},"lastRunDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"years":{"type":"array","items":{"type":"number"}}},"required":["accounts","years"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","required":["bankAccountExternalId","status","statementCount","latestPeriodStart","latestPeriodEnd","fioLastStatement","missingCount","hasUnknownYears","scaBlockedAt","lastRunDate","lastError"],"properties":{"bankAccountExternalId":{"description":"16-char external id of the bank account.","type":"string"},"status":{"description":"Completeness of the downloaded statements for this account.","anyOf":[{"const":"no-connector","type":"string"},{"const":"unhealthy","type":"string"},{"const":"running","type":"string"},{"const":"waiting","type":"string"},{"const":"backfilling","type":"string"},{"const":"sca-required","type":"string"},{"const":"complete","type":"string"}]},"statementCount":{"description":"Stored statements.","type":"number"},"latestPeriodStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"latestPeriodEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"fioLastStatement":{"description":"Newest statement issued by Fio, \"N/YYYY\".","anyOf":[{"type":"string"},{"type":"null"}]},"missingCount":{"description":"Statements issued by Fio inside the backfill horizon but not stored yet.","type":"number"},"hasUnknownYears":{"description":"A past year has not been probed yet, the gap may be larger.","type":"boolean"},"scaBlockedAt":{"description":"Newest statement that needs a strong authorization, \"N/YYYY\".","anyOf":[{"type":"string"},{"type":"null"}]},"lastRunDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"years":{"type":"array","items":{"type":"number"}}},"required":["accounts","years"]}},"text/plain":{"schema":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","required":["bankAccountExternalId","status","statementCount","latestPeriodStart","latestPeriodEnd","fioLastStatement","missingCount","hasUnknownYears","scaBlockedAt","lastRunDate","lastError"],"properties":{"bankAccountExternalId":{"description":"16-char external id of the bank account.","type":"string"},"status":{"description":"Completeness of the downloaded statements for this account.","anyOf":[{"const":"no-connector","type":"string"},{"const":"unhealthy","type":"string"},{"const":"running","type":"string"},{"const":"waiting","type":"string"},{"const":"backfilling","type":"string"},{"const":"sca-required","type":"string"},{"const":"complete","type":"string"}]},"statementCount":{"description":"Stored statements.","type":"number"},"latestPeriodStart":{"anyOf":[{"type":"string"},{"type":"null"}]},"latestPeriodEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"fioLastStatement":{"description":"Newest statement issued by Fio, \"N/YYYY\".","anyOf":[{"type":"string"},{"type":"null"}]},"missingCount":{"description":"Statements issued by Fio inside the backfill horizon but not stored yet.","type":"number"},"hasUnknownYears":{"description":"A past year has not been probed yet, the gap may be larger.","type":"boolean"},"scaBlockedAt":{"description":"Newest statement that needs a strong authorization, \"N/YYYY\".","anyOf":[{"type":"string"},{"type":"null"}]},"lastRunDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"years":{"type":"array","items":{"type":"number"}}},"required":["accounts","years"]}}}}},"operationId":"getBffBank-statementAccounts","tags":["Bank statement"],"summary":"Statement completeness per bank account","description":"For every bank account of the organisation: how many statements are stored, how many Fio has issued but are still missing, and whether the backfill waits for a strong authorization (SCA) in Fio internet banking. Also returns the calendar years that have statements (filter options)."}},"/bff/bank-statement/sync":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"const":"started","type":"string"},{"const":"already-running","type":"string"}]}},"required":["status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"const":"started","type":"string"},{"const":"already-running","type":"string"}]}},"required":["status"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"anyOf":[{"const":"started","type":"string"},{"const":"already-running","type":"string"}]}},"required":["status"]}}}}},"operationId":"postBffBank-statementSync","tags":["Bank statement"],"summary":"Start a statement backfill run for one bank account","description":"Runs in the background (up to ~10 minutes because Fio allows one request per token per 30 s). Refreshes the list of issued statements, retries PDFs that failed before and ignores the remembered SCA boundary, so statements older than 90 days download when the operator has authorized data access in Fio internet banking within the last 10 minutes. Poll `/bank-statement/accounts` for progress.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["bankAccountExternalId"],"properties":{"bankAccountExternalId":{"description":"16-char external id of the target bank account.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["bankAccountExternalId"],"properties":{"bankAccountExternalId":{"description":"16-char external id of the target bank account.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["bankAccountExternalId"],"properties":{"bankAccountExternalId":{"description":"16-char external id of the target bank account.","type":"string"}}}}}}}},"/bff/bank-statement/file":{"get":{"parameters":[{"description":"Blob token of the statement (`externalId` from the list).","schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getBffBank-statementFile","tags":["Bank statement"],"summary":"Download one bank statement PDF","description":"Streams the stored PDF as an attachment. Requires the bank-transaction module permission.","responses":{"200":{}}}},"/bff/billing/usage-report":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"organisationId":{"description":"Organisation the report belongs to.","type":"number"},"tariff":{"description":"Assigned tariff snapshot. NULL when the org has no cas__organisation_tariff row.","anyOf":[{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"monthlyPriceCzk":{"description":"Catalogue monthly price in WHOLE CZK. For Enterprise this is the lower bound.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" and the real price is negotiated per org.","type":"boolean"}}},{"type":"null"}]},"billingPeriod":{"type":"object","required":["start","end"],"properties":{"start":{"description":"First day of the current calendar month (UTC, ISO date).","type":"string"},"end":{"description":"First day of the next calendar month (UTC, ISO date, exclusive).","type":"string"}}},"totalChargeCzk":{"description":"Sum of per-metric overage charges in whole CZK for the current billing period.","type":"number"},"metrics":{"type":"array","items":{"type":"object","required":["code","labelCs","labelEn","unitCode","aggregation","position","includedUnits","packageSize","packagePriceCzk","isUnlimited","isEnabled","usage","overageUnits","chargePackages","chargeCzk","dailyPoints"],"properties":{"code":{"description":"Stable machine code (e.g. `storage_bytes`, `api_requests`).","type":"string"},"labelCs":{"description":"Czech display label.","type":"string"},"labelEn":{"description":"English display label.","type":"string"},"unitCode":{"description":"Raw base unit (`B`, `requests`, `tokens`, `emails`, `orders`).","type":"string"},"aggregation":{"description":"How usage was aggregated: sum of deltas or latest snapshot.","anyOf":[{"const":"sum","type":"string"},{"const":"snapshot","type":"string"}]},"position":{"description":"Display order in the report.","type":"number"},"includedUnits":{"description":"Units included in the tariff at no extra cost.","type":"number"},"packageSize":{"description":"Overage batch size in the metric's base unit.","type":"number"},"packagePriceCzk":{"description":"Price per overage package in whole CZK.","type":"number"},"isUnlimited":{"description":"True = no cap, no charge (Enterprise).","type":"boolean"},"isEnabled":{"description":"False = metric is not sold on this tariff (hidden from report).","type":"boolean"},"usage":{"description":"Current-period usage in the metric's base unit.","type":"number"},"overageUnits":{"description":"Units billed above the included allowance. 0 when within tariff.","type":"number"},"chargePackages":{"description":"Number of overage packages the org will be billed for.","type":"number"},"chargeCzk":{"description":"Total overage charge for this metric in whole CZK.","type":"number"},"dailyPoints":{"description":"Last 30 days ordered oldest → newest. Missing days are filled with 0.","type":"array","items":{"type":"object","required":["day","amount"],"properties":{"day":{"description":"ISO date (YYYY-MM-DD, UTC).","type":"string"},"amount":{"description":"Value recorded for that day in the metric's base unit.","type":"number"}}}}}}}},"required":["organisationId","tariff","billingPeriod","totalChargeCzk","metrics"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"organisationId":{"description":"Organisation the report belongs to.","type":"number"},"tariff":{"description":"Assigned tariff snapshot. NULL when the org has no cas__organisation_tariff row.","anyOf":[{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"monthlyPriceCzk":{"description":"Catalogue monthly price in WHOLE CZK. For Enterprise this is the lower bound.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" and the real price is negotiated per org.","type":"boolean"}}},{"type":"null"}]},"billingPeriod":{"type":"object","required":["start","end"],"properties":{"start":{"description":"First day of the current calendar month (UTC, ISO date).","type":"string"},"end":{"description":"First day of the next calendar month (UTC, ISO date, exclusive).","type":"string"}}},"totalChargeCzk":{"description":"Sum of per-metric overage charges in whole CZK for the current billing period.","type":"number"},"metrics":{"type":"array","items":{"type":"object","required":["code","labelCs","labelEn","unitCode","aggregation","position","includedUnits","packageSize","packagePriceCzk","isUnlimited","isEnabled","usage","overageUnits","chargePackages","chargeCzk","dailyPoints"],"properties":{"code":{"description":"Stable machine code (e.g. `storage_bytes`, `api_requests`).","type":"string"},"labelCs":{"description":"Czech display label.","type":"string"},"labelEn":{"description":"English display label.","type":"string"},"unitCode":{"description":"Raw base unit (`B`, `requests`, `tokens`, `emails`, `orders`).","type":"string"},"aggregation":{"description":"How usage was aggregated: sum of deltas or latest snapshot.","anyOf":[{"const":"sum","type":"string"},{"const":"snapshot","type":"string"}]},"position":{"description":"Display order in the report.","type":"number"},"includedUnits":{"description":"Units included in the tariff at no extra cost.","type":"number"},"packageSize":{"description":"Overage batch size in the metric's base unit.","type":"number"},"packagePriceCzk":{"description":"Price per overage package in whole CZK.","type":"number"},"isUnlimited":{"description":"True = no cap, no charge (Enterprise).","type":"boolean"},"isEnabled":{"description":"False = metric is not sold on this tariff (hidden from report).","type":"boolean"},"usage":{"description":"Current-period usage in the metric's base unit.","type":"number"},"overageUnits":{"description":"Units billed above the included allowance. 0 when within tariff.","type":"number"},"chargePackages":{"description":"Number of overage packages the org will be billed for.","type":"number"},"chargeCzk":{"description":"Total overage charge for this metric in whole CZK.","type":"number"},"dailyPoints":{"description":"Last 30 days ordered oldest → newest. Missing days are filled with 0.","type":"array","items":{"type":"object","required":["day","amount"],"properties":{"day":{"description":"ISO date (YYYY-MM-DD, UTC).","type":"string"},"amount":{"description":"Value recorded for that day in the metric's base unit.","type":"number"}}}}}}}},"required":["organisationId","tariff","billingPeriod","totalChargeCzk","metrics"]}},"text/plain":{"schema":{"type":"object","properties":{"organisationId":{"description":"Organisation the report belongs to.","type":"number"},"tariff":{"description":"Assigned tariff snapshot. NULL when the org has no cas__organisation_tariff row.","anyOf":[{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"monthlyPriceCzk":{"description":"Catalogue monthly price in WHOLE CZK. For Enterprise this is the lower bound.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" and the real price is negotiated per org.","type":"boolean"}}},{"type":"null"}]},"billingPeriod":{"type":"object","required":["start","end"],"properties":{"start":{"description":"First day of the current calendar month (UTC, ISO date).","type":"string"},"end":{"description":"First day of the next calendar month (UTC, ISO date, exclusive).","type":"string"}}},"totalChargeCzk":{"description":"Sum of per-metric overage charges in whole CZK for the current billing period.","type":"number"},"metrics":{"type":"array","items":{"type":"object","required":["code","labelCs","labelEn","unitCode","aggregation","position","includedUnits","packageSize","packagePriceCzk","isUnlimited","isEnabled","usage","overageUnits","chargePackages","chargeCzk","dailyPoints"],"properties":{"code":{"description":"Stable machine code (e.g. `storage_bytes`, `api_requests`).","type":"string"},"labelCs":{"description":"Czech display label.","type":"string"},"labelEn":{"description":"English display label.","type":"string"},"unitCode":{"description":"Raw base unit (`B`, `requests`, `tokens`, `emails`, `orders`).","type":"string"},"aggregation":{"description":"How usage was aggregated: sum of deltas or latest snapshot.","anyOf":[{"const":"sum","type":"string"},{"const":"snapshot","type":"string"}]},"position":{"description":"Display order in the report.","type":"number"},"includedUnits":{"description":"Units included in the tariff at no extra cost.","type":"number"},"packageSize":{"description":"Overage batch size in the metric's base unit.","type":"number"},"packagePriceCzk":{"description":"Price per overage package in whole CZK.","type":"number"},"isUnlimited":{"description":"True = no cap, no charge (Enterprise).","type":"boolean"},"isEnabled":{"description":"False = metric is not sold on this tariff (hidden from report).","type":"boolean"},"usage":{"description":"Current-period usage in the metric's base unit.","type":"number"},"overageUnits":{"description":"Units billed above the included allowance. 0 when within tariff.","type":"number"},"chargePackages":{"description":"Number of overage packages the org will be billed for.","type":"number"},"chargeCzk":{"description":"Total overage charge for this metric in whole CZK.","type":"number"},"dailyPoints":{"description":"Last 30 days ordered oldest → newest. Missing days are filled with 0.","type":"array","items":{"type":"object","required":["day","amount"],"properties":{"day":{"description":"ISO date (YYYY-MM-DD, UTC).","type":"string"},"amount":{"description":"Value recorded for that day in the metric's base unit.","type":"number"}}}}}}}},"required":["organisationId","tariff","billingPeriod","totalChargeCzk","metrics"]}}}}},"operationId":"getBffBillingUsage-report","tags":["Billing","Usage"],"summary":"Get billing usage report for the current organisation","description":"Returns the per-metric spend against the assigned tariff for the current calendar month. Includes the tariff snapshot, the billing-period window, per-metric usage vs included limit, overage packages, CZK charge, and a 30-day daily series (oldest → newest) for sparklines."}},"/bff/billing/pricing-matrix":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"tariffs":{"description":"Tariffs ordered by display position, then id.","type":"array","items":{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom","isMine"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"monthlyPriceCzk":{"description":"Catalogue monthly price in whole CZK.","type":"number"},"priceFrom":{"description":"True = \"od\" pricing (Enterprise), real price negotiated per org.","type":"boolean"},"isMine":{"description":"True when this tariff is the one currently assigned to the caller.","type":"boolean"}}}},"metrics":{"type":"array","items":{"type":"object","required":["code","labelCs","labelEn","unitCode","aggregation","position","cells"],"properties":{"code":{"description":"Metric code (e.g. `storage_bytes`).","type":"string"},"labelCs":{"description":"Czech display label.","type":"string"},"labelEn":{"description":"English display label.","type":"string"},"unitCode":{"description":"Raw base unit (`B`, `requests`, `tokens`, `emails`, `orders`).","type":"string"},"aggregation":{"description":"How usage is aggregated for this metric.","anyOf":[{"const":"sum","type":"string"},{"const":"snapshot","type":"string"}]},"position":{"description":"Display order in the report.","type":"number"},"cells":{"description":"Same length and order as `tariffs`.","type":"array","items":{"type":"object","required":["tariffCode","includedUnits","packageSize","packagePriceCzk","isUnlimited","isEnabled"],"properties":{"tariffCode":{"description":"Tariff this cell belongs to (matches tariffs[].code).","type":"string"},"includedUnits":{"description":"Free allowance included in the tariff.","type":"number"},"packageSize":{"description":"Overage package size in the metric's base unit.","type":"number"},"packagePriceCzk":{"description":"Price per overage package in whole CZK.","type":"number"},"isUnlimited":{"description":"True = no cap, no charge (Enterprise).","type":"boolean"},"isEnabled":{"description":"False = metric not sold on this tariff.","type":"boolean"}}}}}}}},"required":["tariffs","metrics"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"tariffs":{"description":"Tariffs ordered by display position, then id.","type":"array","items":{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom","isMine"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"monthlyPriceCzk":{"description":"Catalogue monthly price in whole CZK.","type":"number"},"priceFrom":{"description":"True = \"od\" pricing (Enterprise), real price negotiated per org.","type":"boolean"},"isMine":{"description":"True when this tariff is the one currently assigned to the caller.","type":"boolean"}}}},"metrics":{"type":"array","items":{"type":"object","required":["code","labelCs","labelEn","unitCode","aggregation","position","cells"],"properties":{"code":{"description":"Metric code (e.g. `storage_bytes`).","type":"string"},"labelCs":{"description":"Czech display label.","type":"string"},"labelEn":{"description":"English display label.","type":"string"},"unitCode":{"description":"Raw base unit (`B`, `requests`, `tokens`, `emails`, `orders`).","type":"string"},"aggregation":{"description":"How usage is aggregated for this metric.","anyOf":[{"const":"sum","type":"string"},{"const":"snapshot","type":"string"}]},"position":{"description":"Display order in the report.","type":"number"},"cells":{"description":"Same length and order as `tariffs`.","type":"array","items":{"type":"object","required":["tariffCode","includedUnits","packageSize","packagePriceCzk","isUnlimited","isEnabled"],"properties":{"tariffCode":{"description":"Tariff this cell belongs to (matches tariffs[].code).","type":"string"},"includedUnits":{"description":"Free allowance included in the tariff.","type":"number"},"packageSize":{"description":"Overage package size in the metric's base unit.","type":"number"},"packagePriceCzk":{"description":"Price per overage package in whole CZK.","type":"number"},"isUnlimited":{"description":"True = no cap, no charge (Enterprise).","type":"boolean"},"isEnabled":{"description":"False = metric not sold on this tariff.","type":"boolean"}}}}}}}},"required":["tariffs","metrics"]}},"text/plain":{"schema":{"type":"object","properties":{"tariffs":{"description":"Tariffs ordered by display position, then id.","type":"array","items":{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom","isMine"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"monthlyPriceCzk":{"description":"Catalogue monthly price in whole CZK.","type":"number"},"priceFrom":{"description":"True = \"od\" pricing (Enterprise), real price negotiated per org.","type":"boolean"},"isMine":{"description":"True when this tariff is the one currently assigned to the caller.","type":"boolean"}}}},"metrics":{"type":"array","items":{"type":"object","required":["code","labelCs","labelEn","unitCode","aggregation","position","cells"],"properties":{"code":{"description":"Metric code (e.g. `storage_bytes`).","type":"string"},"labelCs":{"description":"Czech display label.","type":"string"},"labelEn":{"description":"English display label.","type":"string"},"unitCode":{"description":"Raw base unit (`B`, `requests`, `tokens`, `emails`, `orders`).","type":"string"},"aggregation":{"description":"How usage is aggregated for this metric.","anyOf":[{"const":"sum","type":"string"},{"const":"snapshot","type":"string"}]},"position":{"description":"Display order in the report.","type":"number"},"cells":{"description":"Same length and order as `tariffs`.","type":"array","items":{"type":"object","required":["tariffCode","includedUnits","packageSize","packagePriceCzk","isUnlimited","isEnabled"],"properties":{"tariffCode":{"description":"Tariff this cell belongs to (matches tariffs[].code).","type":"string"},"includedUnits":{"description":"Free allowance included in the tariff.","type":"number"},"packageSize":{"description":"Overage package size in the metric's base unit.","type":"number"},"packagePriceCzk":{"description":"Price per overage package in whole CZK.","type":"number"},"isUnlimited":{"description":"True = no cap, no charge (Enterprise).","type":"boolean"},"isEnabled":{"description":"False = metric not sold on this tariff.","type":"boolean"}}}}}}}},"required":["tariffs","metrics"]}}}}},"operationId":"getBffBillingPricing-matrix","tags":["Billing","Usage"],"summary":"Get full pricing matrix (metrics × tariffs)","description":"Returns the pricing catalogue for every active metric across every tariff. The `tariffs[].isMine` flag marks the tariff currently assigned to the calling organisation so the UI can highlight the relevant column."}},"/bff/ai/question":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"description":"The AI-generated response text","type":"string"}},"required":["answer"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"answer":{"description":"The AI-generated response text","type":"string"}},"required":["answer"]}},"text/plain":{"schema":{"type":"object","properties":{"answer":{"description":"The AI-generated response text","type":"string"}},"required":["answer"]}}}}},"operationId":"postBffAiQuestion","tags":["bff"],"summary":"Ask AI a question and get a complete response","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"maxLength":20000,"description":"The question or prompt to send to the AI model","examples":["What is the capital of France?"],"type":"string"},"model":{"description":"Allowed AI model identifier. Defaults to gpt-5-mini.","examples":["gpt-5-mini"],"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"maxLength":20000,"description":"The question or prompt to send to the AI model","examples":["What is the capital of France?"],"type":"string"},"model":{"description":"Allowed AI model identifier. Defaults to gpt-5-mini.","examples":["gpt-5-mini"],"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"maxLength":20000,"description":"The question or prompt to send to the AI model","examples":["What is the capital of France?"],"type":"string"},"model":{"description":"Allowed AI model identifier. Defaults to gpt-5-mini.","examples":["gpt-5-mini"],"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]}}}}}}}},"/bff/ai/question-stream":{"post":{"parameters":[],"operationId":"postBffAiQuestion-stream","tags":["bff"],"summary":"Ask AI a question with SSE streaming response","description":"Returns a Server-Sent Events stream. Events: \"token\" ({ text }) for partial chunks, \"done\" ({ answer }) for the complete response, \"error\" ({ message }) on failure. Pass `messages` for multi-turn chat.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"maxLength":20000,"description":"Single-turn prompt. Ignored when `messages` is provided.","examples":["Hello!"],"type":"string"},"model":{"description":"Allowed AI model identifier. Defaults to gemini-flash-latest.","examples":["gemini-flash-latest"],"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"messages":{"maxItems":50,"description":"Full conversation history including the last user turn. When present, the endpoint runs a proper multi-turn request and bypasses the ai__question cache.","type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"maxLength":20000,"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["question"],"properties":{"question":{"maxLength":20000,"description":"Single-turn prompt. Ignored when `messages` is provided.","examples":["Hello!"],"type":"string"},"model":{"description":"Allowed AI model identifier. Defaults to gemini-flash-latest.","examples":["gemini-flash-latest"],"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"messages":{"maxItems":50,"description":"Full conversation history including the last user turn. When present, the endpoint runs a proper multi-turn request and bypasses the ai__question cache.","type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"maxLength":20000,"type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","required":["question"],"properties":{"question":{"maxLength":20000,"description":"Single-turn prompt. Ignored when `messages` is provided.","examples":["Hello!"],"type":"string"},"model":{"description":"Allowed AI model identifier. Defaults to gemini-flash-latest.","examples":["gemini-flash-latest"],"anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"messages":{"maxItems":50,"description":"Full conversation history including the last user turn. When present, the endpoint runs a proper multi-turn request and bypasses the ai__question cache.","type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"maxLength":20000,"type":"string"}}}}}}}}},"responses":{"200":{}}}},"/bff/ai/agent-stream":{"post":{"parameters":[],"operationId":"postBffAiAgent-stream","tags":["bff"],"summary":"Agent-mode AI turn with tool-calling and SSE streaming","description":"Runs a multi-step agent loop. Model must be one of the allowed identifiers (see body.model). Max steps default 10, hard cap 12. SSE events: start, step-start, text-delta, reasoning-delta, tool-input-start, tool-call, tool-result, step-finish, finish, error.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"messages":{"minItems":1,"maxItems":60,"description":"Full multi-turn conversation history including the last user turn.","type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"minLength":1,"maxLength":24000,"type":"string"}}}},"model":{"description":"Allowed model identifier. Defaults to gemini-flash-latest.","anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"maxSteps":{"minimum":1,"maximum":12,"description":"Maximum agent-loop steps before stopping. Hard-capped at 12 to bound cost per turn.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"description":"Maximum agent-loop steps before stopping. Hard-capped at 12 to bound cost per turn.","type":"integer"}]},"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["messages"],"properties":{"messages":{"minItems":1,"maxItems":60,"description":"Full multi-turn conversation history including the last user turn.","type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"minLength":1,"maxLength":24000,"type":"string"}}}},"model":{"description":"Allowed model identifier. Defaults to gemini-flash-latest.","anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"maxSteps":{"minimum":1,"maximum":12,"description":"Maximum agent-loop steps before stopping. Hard-capped at 12 to bound cost per turn.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"description":"Maximum agent-loop steps before stopping. Hard-capped at 12 to bound cost per turn.","type":"integer"}]},"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["messages"],"properties":{"messages":{"minItems":1,"maxItems":60,"description":"Full multi-turn conversation history including the last user turn.","type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"minLength":1,"maxLength":24000,"type":"string"}}}},"model":{"description":"Allowed model identifier. Defaults to gemini-flash-latest.","anyOf":[{"const":"gemini-flash-latest","type":"string"},{"const":"gemini-2.5-flash-lite","type":"string"},{"const":"gpt-5","type":"string"},{"const":"gpt-4o","type":"string"},{"const":"gpt-5-mini","type":"string"}]},"maxSteps":{"minimum":1,"maximum":12,"description":"Maximum agent-loop steps before stopping. Hard-capped at 12 to bound cost per turn.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"description":"Maximum agent-loop steps before stopping. Hard-capped at 12 to bound cost per turn.","type":"integer"}]},"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ai/agent-suggestions":{"get":{"responses":{"200":{"description":"List of grounded suggestion chips ordered by domain relevance.","content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"anyOf":[{"type":"object","required":["kind","count","sum","currency"],"properties":{"kind":{"const":"unpaidOrders","type":"string"},"count":{"description":"Number of unpaid orders in \"new\" status.","type":"number"},"sum":{"description":"Sum of unpaid order prices in `currency`.","type":"number"},"currency":{"description":"ISO code of the dominant unpaid-order currency (fallback CZK).","type":"string"}}},{"type":"object","required":["kind","count","sum","currency"],"properties":{"kind":{"const":"overdueInvoices","type":"string"},"count":{"description":"Number of overdue (past due_date, unpaid, non-cancelled) issued invoices.","type":"number"},"sum":{"description":"Sum of overdue invoice totals converted to CZK base.","type":"number"},"currency":{"description":"Currency code of `sum` — always CZK.","type":"string"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"upcomingEventsWeek","type":"string"},"count":{"description":"Non-cancelled calendar events starting in the next 7 days.","type":"number"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"openIssues","type":"string"},"count":{"description":"Non-done issues across every project of this organisation.","type":"number"}}},{"type":"object","required":["kind","code"],"properties":{"kind":{"const":"latestOrder","type":"string"},"code":{"description":"Order number of the most recently inserted order.","type":"string"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"newContactsThisMonth","type":"string"},"count":{"description":"Contacts inserted since the first day of the current month.","type":"number"}}}]}}},"required":["suggestions"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"anyOf":[{"type":"object","required":["kind","count","sum","currency"],"properties":{"kind":{"const":"unpaidOrders","type":"string"},"count":{"description":"Number of unpaid orders in \"new\" status.","type":"number"},"sum":{"description":"Sum of unpaid order prices in `currency`.","type":"number"},"currency":{"description":"ISO code of the dominant unpaid-order currency (fallback CZK).","type":"string"}}},{"type":"object","required":["kind","count","sum","currency"],"properties":{"kind":{"const":"overdueInvoices","type":"string"},"count":{"description":"Number of overdue (past due_date, unpaid, non-cancelled) issued invoices.","type":"number"},"sum":{"description":"Sum of overdue invoice totals converted to CZK base.","type":"number"},"currency":{"description":"Currency code of `sum` — always CZK.","type":"string"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"upcomingEventsWeek","type":"string"},"count":{"description":"Non-cancelled calendar events starting in the next 7 days.","type":"number"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"openIssues","type":"string"},"count":{"description":"Non-done issues across every project of this organisation.","type":"number"}}},{"type":"object","required":["kind","code"],"properties":{"kind":{"const":"latestOrder","type":"string"},"code":{"description":"Order number of the most recently inserted order.","type":"string"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"newContactsThisMonth","type":"string"},"count":{"description":"Contacts inserted since the first day of the current month.","type":"number"}}}]}}},"required":["suggestions"]}},"text/plain":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"anyOf":[{"type":"object","required":["kind","count","sum","currency"],"properties":{"kind":{"const":"unpaidOrders","type":"string"},"count":{"description":"Number of unpaid orders in \"new\" status.","type":"number"},"sum":{"description":"Sum of unpaid order prices in `currency`.","type":"number"},"currency":{"description":"ISO code of the dominant unpaid-order currency (fallback CZK).","type":"string"}}},{"type":"object","required":["kind","count","sum","currency"],"properties":{"kind":{"const":"overdueInvoices","type":"string"},"count":{"description":"Number of overdue (past due_date, unpaid, non-cancelled) issued invoices.","type":"number"},"sum":{"description":"Sum of overdue invoice totals converted to CZK base.","type":"number"},"currency":{"description":"Currency code of `sum` — always CZK.","type":"string"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"upcomingEventsWeek","type":"string"},"count":{"description":"Non-cancelled calendar events starting in the next 7 days.","type":"number"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"openIssues","type":"string"},"count":{"description":"Non-done issues across every project of this organisation.","type":"number"}}},{"type":"object","required":["kind","code"],"properties":{"kind":{"const":"latestOrder","type":"string"},"code":{"description":"Order number of the most recently inserted order.","type":"string"}}},{"type":"object","required":["kind","count"],"properties":{"kind":{"const":"newContactsThisMonth","type":"string"},"count":{"description":"Contacts inserted since the first day of the current month.","type":"number"}}}]}}},"required":["suggestions"]}}}}},"operationId":"getBffAiAgent-suggestions","tags":["bff"],"summary":"Grounded suggestion chips for the Assistant empty state","description":"Returns a compact list of concrete, org-scoped suggestion prompts derived from the tenant's current data (unpaid orders, overdue invoices, upcoming events, open issues, latest order code, new contacts this month). Only branches with non-zero facts are returned so the empty state never fabricates a suggestion. Cached in-memory for 60 s per organisation."}},"/bff/ai/test":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"answer":{"description":"The AI-generated response text","type":"string"}},"required":["answer"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"answer":{"description":"The AI-generated response text","type":"string"}},"required":["answer"]}},"text/plain":{"schema":{"type":"object","properties":{"answer":{"description":"The AI-generated response text","type":"string"}},"required":["answer"]}}}}},"operationId":"getBffAiTest","tags":["bff"],"summary":"Test AI connectivity with a sample question"}},"/bff/ai-agent/provision":{"post":{"parameters":[],"responses":{"200":{"description":"Ready-to-copy system prompt for an external AI agent.","content":{"application/json":{"schema":{"type":"object","properties":{"systemPrompt":{"description":"Multi-line English system prompt with the AI-agent credential, agent name, organisation, user identity and operational rules baked in.","type":"string"},"generatedAt":{"description":"Date the prompt was generated (YYYY-MM-DD).","type":"string"},"expiresAt":{"description":"Date the embedded credential expires (YYYY-MM-DD).","type":"string"},"agent":{"type":"object","required":["id","name","connectedByLabel","connectedByMemberExternalId","isMine","isCurrent","insertedDate","expirationDate","lastUsedDate"],"properties":{"id":{"description":"Row id of the agent credential (the secret itself never leaves core after provisioning).","type":"number"},"name":{"description":"Name the person gave the agent.","type":"string"},"connectedByLabel":{"description":"Full name (or e-mail) of the person who connected the agent.","type":"string"},"connectedByMemberExternalId":{"description":"`shop__contact.external_id` of the member profile of the person who connected the agent.","anyOf":[{"type":"string"},{"type":"null"}]},"isMine":{"description":"True when the agent belongs to the caller.","type":"boolean"},"isCurrent":{"description":"True when this is the credential the current request was made with.","type":"boolean"},"insertedDate":{"description":"When the agent was connected (ISO 8601).","type":"string"},"expirationDate":{"description":"When the credential expires (ISO 8601).","type":"string"},"lastUsedDate":{"description":"Last authenticated call (ISO 8601, minute precision), NULL when never used.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"required":["systemPrompt","generatedAt","expiresAt","agent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"systemPrompt":{"description":"Multi-line English system prompt with the AI-agent credential, agent name, organisation, user identity and operational rules baked in.","type":"string"},"generatedAt":{"description":"Date the prompt was generated (YYYY-MM-DD).","type":"string"},"expiresAt":{"description":"Date the embedded credential expires (YYYY-MM-DD).","type":"string"},"agent":{"type":"object","required":["id","name","connectedByLabel","connectedByMemberExternalId","isMine","isCurrent","insertedDate","expirationDate","lastUsedDate"],"properties":{"id":{"description":"Row id of the agent credential (the secret itself never leaves core after provisioning).","type":"number"},"name":{"description":"Name the person gave the agent.","type":"string"},"connectedByLabel":{"description":"Full name (or e-mail) of the person who connected the agent.","type":"string"},"connectedByMemberExternalId":{"description":"`shop__contact.external_id` of the member profile of the person who connected the agent.","anyOf":[{"type":"string"},{"type":"null"}]},"isMine":{"description":"True when the agent belongs to the caller.","type":"boolean"},"isCurrent":{"description":"True when this is the credential the current request was made with.","type":"boolean"},"insertedDate":{"description":"When the agent was connected (ISO 8601).","type":"string"},"expirationDate":{"description":"When the credential expires (ISO 8601).","type":"string"},"lastUsedDate":{"description":"Last authenticated call (ISO 8601, minute precision), NULL when never used.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"required":["systemPrompt","generatedAt","expiresAt","agent"]}},"text/plain":{"schema":{"type":"object","properties":{"systemPrompt":{"description":"Multi-line English system prompt with the AI-agent credential, agent name, organisation, user identity and operational rules baked in.","type":"string"},"generatedAt":{"description":"Date the prompt was generated (YYYY-MM-DD).","type":"string"},"expiresAt":{"description":"Date the embedded credential expires (YYYY-MM-DD).","type":"string"},"agent":{"type":"object","required":["id","name","connectedByLabel","connectedByMemberExternalId","isMine","isCurrent","insertedDate","expirationDate","lastUsedDate"],"properties":{"id":{"description":"Row id of the agent credential (the secret itself never leaves core after provisioning).","type":"number"},"name":{"description":"Name the person gave the agent.","type":"string"},"connectedByLabel":{"description":"Full name (or e-mail) of the person who connected the agent.","type":"string"},"connectedByMemberExternalId":{"description":"`shop__contact.external_id` of the member profile of the person who connected the agent.","anyOf":[{"type":"string"},{"type":"null"}]},"isMine":{"description":"True when the agent belongs to the caller.","type":"boolean"},"isCurrent":{"description":"True when this is the credential the current request was made with.","type":"boolean"},"insertedDate":{"description":"When the agent was connected (ISO 8601).","type":"string"},"expirationDate":{"description":"When the credential expires (ISO 8601).","type":"string"},"lastUsedDate":{"description":"Last authenticated call (ISO 8601, minute precision), NULL when never used.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"required":["systemPrompt","generatedAt","expiresAt","agent"]}}}}},"operationId":"postBffAi-agentProvision","tags":["AI Agent"],"summary":"Connect a new named AI agent and return its system prompt","description":"Mints a new, independent AI-agent credential for the current (user, member) pair and returns a ready-to-paste system prompt with it embedded. Existing agents are NOT revoked: every agent has its own credential and can be disconnected individually. The secret is shown only in this response; core stores only its SHA-256 fingerprint. Lifetime 30/60/90 days (default 90). At most 25 active agents per person and organisation. Only human sessions may call this — an AI-agent credential cannot mint further credentials.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"maxLength":200,"description":"Name for the agent (\"Support\", \"Claude Code\", …). Trimmed to 80 chars; empty = \"AI agent N\".","type":"string"},"lifetimeDays":{"description":"Credential lifetime in days: 30, 60 or 90 (default 90).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"maxLength":200,"description":"Name for the agent (\"Support\", \"Claude Code\", …). Trimmed to 80 chars; empty = \"AI agent N\".","type":"string"},"lifetimeDays":{"description":"Credential lifetime in days: 30, 60 or 90 (default 90).","type":"number"}}}},"text/plain":{"schema":{"type":"object","properties":{"name":{"maxLength":200,"description":"Name for the agent (\"Support\", \"Claude Code\", …). Trimmed to 80 chars; empty = \"AI agent N\".","type":"string"},"lifetimeDays":{"description":"Credential lifetime in days: 30, 60 or 90 (default 90).","type":"number"}}}}}}}},"/bff/ai-agent/list":{"get":{"parameters":[{"description":"`mine` (default) = the caller's agents in this organisation; `organisation` = every member's agents (root only).","schema":{"anyOf":[{"const":"mine","type":"string"},{"const":"organisation","type":"string"}]},"in":"query","name":"scope","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","connectedByLabel","connectedByMemberExternalId","isMine","isCurrent","insertedDate","expirationDate","lastUsedDate"],"properties":{"id":{"description":"Row id of the agent credential (the secret itself never leaves core after provisioning).","type":"number"},"name":{"description":"Name the person gave the agent.","type":"string"},"connectedByLabel":{"description":"Full name (or e-mail) of the person who connected the agent.","type":"string"},"connectedByMemberExternalId":{"description":"`shop__contact.external_id` of the member profile of the person who connected the agent.","anyOf":[{"type":"string"},{"type":"null"}]},"isMine":{"description":"True when the agent belongs to the caller.","type":"boolean"},"isCurrent":{"description":"True when this is the credential the current request was made with.","type":"boolean"},"insertedDate":{"description":"When the agent was connected (ISO 8601).","type":"string"},"expirationDate":{"description":"When the credential expires (ISO 8601).","type":"string"},"lastUsedDate":{"description":"Last authenticated call (ISO 8601, minute precision), NULL when never used.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"canManageOrganisation":{"description":"Caller may list and disconnect every agent in the organisation.","type":"boolean"},"maxActivePerMember":{"description":"Cap on active agents per person and organisation.","type":"number"}},"required":["items","canManageOrganisation","maxActivePerMember"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","connectedByLabel","connectedByMemberExternalId","isMine","isCurrent","insertedDate","expirationDate","lastUsedDate"],"properties":{"id":{"description":"Row id of the agent credential (the secret itself never leaves core after provisioning).","type":"number"},"name":{"description":"Name the person gave the agent.","type":"string"},"connectedByLabel":{"description":"Full name (or e-mail) of the person who connected the agent.","type":"string"},"connectedByMemberExternalId":{"description":"`shop__contact.external_id` of the member profile of the person who connected the agent.","anyOf":[{"type":"string"},{"type":"null"}]},"isMine":{"description":"True when the agent belongs to the caller.","type":"boolean"},"isCurrent":{"description":"True when this is the credential the current request was made with.","type":"boolean"},"insertedDate":{"description":"When the agent was connected (ISO 8601).","type":"string"},"expirationDate":{"description":"When the credential expires (ISO 8601).","type":"string"},"lastUsedDate":{"description":"Last authenticated call (ISO 8601, minute precision), NULL when never used.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"canManageOrganisation":{"description":"Caller may list and disconnect every agent in the organisation.","type":"boolean"},"maxActivePerMember":{"description":"Cap on active agents per person and organisation.","type":"number"}},"required":["items","canManageOrganisation","maxActivePerMember"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","connectedByLabel","connectedByMemberExternalId","isMine","isCurrent","insertedDate","expirationDate","lastUsedDate"],"properties":{"id":{"description":"Row id of the agent credential (the secret itself never leaves core after provisioning).","type":"number"},"name":{"description":"Name the person gave the agent.","type":"string"},"connectedByLabel":{"description":"Full name (or e-mail) of the person who connected the agent.","type":"string"},"connectedByMemberExternalId":{"description":"`shop__contact.external_id` of the member profile of the person who connected the agent.","anyOf":[{"type":"string"},{"type":"null"}]},"isMine":{"description":"True when the agent belongs to the caller.","type":"boolean"},"isCurrent":{"description":"True when this is the credential the current request was made with.","type":"boolean"},"insertedDate":{"description":"When the agent was connected (ISO 8601).","type":"string"},"expirationDate":{"description":"When the credential expires (ISO 8601).","type":"string"},"lastUsedDate":{"description":"Last authenticated call (ISO 8601, minute precision), NULL when never used.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"canManageOrganisation":{"description":"Caller may list and disconnect every agent in the organisation.","type":"boolean"},"maxActivePerMember":{"description":"Cap on active agents per person and organisation.","type":"number"}},"required":["items","canManageOrganisation","maxActivePerMember"]}}}}},"operationId":"getBffAi-agentList","tags":["AI Agent"],"summary":"List connected AI agents","description":"Active AI-agent credentials in the current organisation with name, owner, expiry and last use. `scope=organisation` (root only, human session) lists every member's agents so an administrator can disconnect any of them."}},"/bff/ai-agent/whoami":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai_agent","type":"string"},{"const":"session","type":"string"}]},"agent":{"anyOf":[{"type":"object","required":["id","name","insertedDate","expirationDate","lastUsedDate","daysRemaining"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"insertedDate":{"type":"string"},"expirationDate":{"type":"string"},"lastUsedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysRemaining":{"description":"Whole days until the credential expires.","type":"number"}}},{"type":"null"}]},"user":{"type":"object","required":["name","email"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"organisation":{"anyOf":[{"type":"object","required":["name","slug"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["kind","agent","user","organisation"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai_agent","type":"string"},{"const":"session","type":"string"}]},"agent":{"anyOf":[{"type":"object","required":["id","name","insertedDate","expirationDate","lastUsedDate","daysRemaining"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"insertedDate":{"type":"string"},"expirationDate":{"type":"string"},"lastUsedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysRemaining":{"description":"Whole days until the credential expires.","type":"number"}}},{"type":"null"}]},"user":{"type":"object","required":["name","email"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"organisation":{"anyOf":[{"type":"object","required":["name","slug"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["kind","agent","user","organisation"]}},"text/plain":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai_agent","type":"string"},{"const":"session","type":"string"}]},"agent":{"anyOf":[{"type":"object","required":["id","name","insertedDate","expirationDate","lastUsedDate","daysRemaining"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"insertedDate":{"type":"string"},"expirationDate":{"type":"string"},"lastUsedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysRemaining":{"description":"Whole days until the credential expires.","type":"number"}}},{"type":"null"}]},"user":{"type":"object","required":["name","email"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"organisation":{"anyOf":[{"type":"object","required":["name","slug"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["kind","agent","user","organisation"]}}}}},"operationId":"getBffAi-agentWhoami","tags":["AI Agent"],"summary":"Who am I: the calling AI agent, its owner and credential validity","description":"For an AI-agent credential returns the agent name, when it was connected, when it expires (and days remaining) and when it was last used, plus the person and organisation it acts for. Human sessions get `kind: \"session\"` and `agent: null`."}},"/bff/ai-agent/rename":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"name":{"type":"string"}},"required":["success","name"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"name":{"type":"string"}},"required":["success","name"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"name":{"type":"string"}},"required":["success","name"]}}}}},"operationId":"postBffAi-agentRename","tags":["AI Agent"],"summary":"Rename a connected AI agent","description":"Own agents, or any agent in the organisation for root. Human session only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Agent id from `/bff/ai-agent/list`.","type":"number"},"name":{"minLength":1,"maxLength":200,"description":"New name, trimmed to 80 chars.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Agent id from `/bff/ai-agent/list`.","type":"number"},"name":{"minLength":1,"maxLength":200,"description":"New name, trimmed to 80 chars.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Agent id from `/bff/ai-agent/list`.","type":"number"},"name":{"minLength":1,"maxLength":200,"description":"New name, trimmed to 80 chars.","type":"string"}}}}}}}},"/bff/ai-agent/revoke":{"post":{"parameters":[],"responses":{"200":{"description":"Result of the revoke operation.","content":{"application/json":{"schema":{"type":"object","properties":{"revokedCount":{"description":"Number of AI-agent credentials that were active and are now revoked.","type":"number"}},"required":["revokedCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"revokedCount":{"description":"Number of AI-agent credentials that were active and are now revoked.","type":"number"}},"required":["revokedCount"]}},"text/plain":{"schema":{"type":"object","properties":{"revokedCount":{"description":"Number of AI-agent credentials that were active and are now revoked.","type":"number"}},"required":["revokedCount"]}}}}},"operationId":"postBffAi-agentRevoke","tags":["AI Agent"],"summary":"Disconnect one AI agent, or all of the caller's agents","description":"With `id` disconnects that single agent; the others keep working. Without `id` disconnects every agent of the caller in the current organisation. Effective immediately. Human session only. Idempotent for the bulk form (`revokedCount: 0` when nothing was active).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Agent id from `/bff/ai-agent/list`. Own agents, or any agent in the organisation for root. Omit to disconnect all of the caller's agents in this organisation.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Agent id from `/bff/ai-agent/list`. Own agents, or any agent in the organisation for root. Omit to disconnect all of the caller's agents in this organisation.","type":"number"}}}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Agent id from `/bff/ai-agent/list`. Own agents, or any agent in the organisation for root. Omit to disconnect all of the caller's agents in this organisation.","type":"number"}}}}}}}},"/bff/ai-context/document":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"markdown":{"description":"All notes rendered as one Markdown document, each note a `##` section with its id.","type":"string"},"noteCount":{"type":"number"},"lastUpdatedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["markdown","noteCount","lastUpdatedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"markdown":{"description":"All notes rendered as one Markdown document, each note a `##` section with its id.","type":"string"},"noteCount":{"type":"number"},"lastUpdatedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["markdown","noteCount","lastUpdatedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"markdown":{"description":"All notes rendered as one Markdown document, each note a `##` section with its id.","type":"string"},"noteCount":{"type":"number"},"lastUpdatedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["markdown","noteCount","lastUpdatedDate"]}}}}},"operationId":"getBffAi-contextDocument","tags":["AI Agent"],"summary":"Shared organisation context as one Markdown document","description":"The team-wide context for AI agents (a shared CLAUDE.md). AI agents should load this at the start of every session and treat it as background knowledge about the organisation. Each `##` section is one note; its id is in the HTML comment below the heading and can be passed to `/update`."}},"/bff/ai-context/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","content","isPinned","version","insertedDate","updatedDate","createdByName","createdViaAiAgent","updatedByName","updatedViaAiAgent"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"isPinned":{"type":"boolean"},"version":{"description":"Current version; send it back as `expectedVersion` when updating.","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdViaAiAgent":{"type":"boolean"},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedViaAiAgent":{"type":"boolean"}}}},"limits":{"type":"object","required":["titleMaxLength","contentMaxLength","maxNotesPerOrganisation","promptMaxLength"],"properties":{"titleMaxLength":{"type":"number"},"contentMaxLength":{"type":"number"},"maxNotesPerOrganisation":{"type":"number"},"promptMaxLength":{"type":"number"}}}},"required":["items","limits"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","content","isPinned","version","insertedDate","updatedDate","createdByName","createdViaAiAgent","updatedByName","updatedViaAiAgent"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"isPinned":{"type":"boolean"},"version":{"description":"Current version; send it back as `expectedVersion` when updating.","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdViaAiAgent":{"type":"boolean"},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedViaAiAgent":{"type":"boolean"}}}},"limits":{"type":"object","required":["titleMaxLength","contentMaxLength","maxNotesPerOrganisation","promptMaxLength"],"properties":{"titleMaxLength":{"type":"number"},"contentMaxLength":{"type":"number"},"maxNotesPerOrganisation":{"type":"number"},"promptMaxLength":{"type":"number"}}}},"required":["items","limits"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","content","isPinned","version","insertedDate","updatedDate","createdByName","createdViaAiAgent","updatedByName","updatedViaAiAgent"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"isPinned":{"type":"boolean"},"version":{"description":"Current version; send it back as `expectedVersion` when updating.","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdViaAiAgent":{"type":"boolean"},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedViaAiAgent":{"type":"boolean"}}}},"limits":{"type":"object","required":["titleMaxLength","contentMaxLength","maxNotesPerOrganisation","promptMaxLength"],"properties":{"titleMaxLength":{"type":"number"},"contentMaxLength":{"type":"number"},"maxNotesPerOrganisation":{"type":"number"},"promptMaxLength":{"type":"number"}}}},"required":["items","limits"]}}}}},"operationId":"getBffAi-contextList","tags":["AI Agent"],"summary":"List organisation context notes","description":"Every live note with version and author attribution, pinned first, then by title."}},"/bff/ai-context/detail":{"get":{"parameters":[{"description":"Note id (16 characters), as returned by `/list` or shown in the `/document` markdown.","schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"isPinned":{"type":"boolean"},"version":{"description":"Current version; send it back as `expectedVersion` when updating.","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdViaAiAgent":{"type":"boolean"},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedViaAiAgent":{"type":"boolean"}},"required":["id","title","content","isPinned","version","insertedDate","updatedDate","createdByName","createdViaAiAgent","updatedByName","updatedViaAiAgent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"isPinned":{"type":"boolean"},"version":{"description":"Current version; send it back as `expectedVersion` when updating.","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdViaAiAgent":{"type":"boolean"},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedViaAiAgent":{"type":"boolean"}},"required":["id","title","content","isPinned","version","insertedDate","updatedDate","createdByName","createdViaAiAgent","updatedByName","updatedViaAiAgent"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"isPinned":{"type":"boolean"},"version":{"description":"Current version; send it back as `expectedVersion` when updating.","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdViaAiAgent":{"type":"boolean"},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedViaAiAgent":{"type":"boolean"}},"required":["id","title","content","isPinned","version","insertedDate","updatedDate","createdByName","createdViaAiAgent","updatedByName","updatedViaAiAgent"]}}}}},"operationId":"getBffAi-contextDetail","tags":["AI Agent"],"summary":"Get one organisation context note","description":"Read a note including its current `version` before updating it."}},"/bff/ai-context/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"}},"required":["id","version"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"}},"required":["id","version"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"}},"required":["id","version"]}}}}},"operationId":"postBffAi-contextCreate","tags":["AI Agent"],"summary":"Create an organisation context note","description":"Add a new topic to the shared context. Before creating, check `/document` for an existing note on the same topic and prefer `/update`. Never store secrets (passwords, API keys, tokens) or sensitive personal data.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","content"],"properties":{"title":{"minLength":1,"maxLength":160,"description":"Short topic title, e.g. \"Invoicing conventions\" or \"Warehouse and shipping\".","type":"string"},"content":{"maxLength":20000,"description":"Markdown body. Keep it concise and factual; it is loaded into every agent session.","type":"string"},"isPinned":{"description":"Pinned notes render first. Default false.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["title","content"],"properties":{"title":{"minLength":1,"maxLength":160,"description":"Short topic title, e.g. \"Invoicing conventions\" or \"Warehouse and shipping\".","type":"string"},"content":{"maxLength":20000,"description":"Markdown body. Keep it concise and factual; it is loaded into every agent session.","type":"string"},"isPinned":{"description":"Pinned notes render first. Default false.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["title","content"],"properties":{"title":{"minLength":1,"maxLength":160,"description":"Short topic title, e.g. \"Invoicing conventions\" or \"Warehouse and shipping\".","type":"string"},"content":{"maxLength":20000,"description":"Markdown body. Keep it concise and factual; it is loaded into every agent session.","type":"string"},"isPinned":{"description":"Pinned notes render first. Default false.","type":"boolean"}}}}}}}},"/bff/ai-context/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"}},"required":["id","version"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"}},"required":["id","version"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"number"}},"required":["id","version"]}}}}},"operationId":"postBffAi-contextUpdate","tags":["AI Agent"],"summary":"Update an organisation context note","description":"Replace title / content / pin of an existing note. `content` replaces the whole body, so read the note first, edit it, and send `expectedVersion` to avoid overwriting a colleague’s concurrent change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Note id (16 characters), as returned by `/list` or shown in the `/document` markdown.","type":"string"},"title":{"minLength":1,"maxLength":160,"description":"Short topic title, e.g. \"Invoicing conventions\" or \"Warehouse and shipping\".","type":"string"},"content":{"maxLength":20000,"description":"Full new Markdown body (replaces the old one).","type":"string"},"isPinned":{"type":"boolean"},"expectedVersion":{"description":"Version you based your edit on. When it no longer matches, nothing is written and HTTP 409 is returned: re-read, merge, retry.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Note id (16 characters), as returned by `/list` or shown in the `/document` markdown.","type":"string"},"title":{"minLength":1,"maxLength":160,"description":"Short topic title, e.g. \"Invoicing conventions\" or \"Warehouse and shipping\".","type":"string"},"content":{"maxLength":20000,"description":"Full new Markdown body (replaces the old one).","type":"string"},"isPinned":{"type":"boolean"},"expectedVersion":{"description":"Version you based your edit on. When it no longer matches, nothing is written and HTTP 409 is returned: re-read, merge, retry.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Note id (16 characters), as returned by `/list` or shown in the `/document` markdown.","type":"string"},"title":{"minLength":1,"maxLength":160,"description":"Short topic title, e.g. \"Invoicing conventions\" or \"Warehouse and shipping\".","type":"string"},"content":{"maxLength":20000,"description":"Full new Markdown body (replaces the old one).","type":"string"},"isPinned":{"type":"boolean"},"expectedVersion":{"description":"Version you based your edit on. When it no longer matches, nothing is written and HTTP 409 is returned: re-read, merge, retry.","type":"number"}}}}}}}},"/bff/ai-context/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}},"text/plain":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}},"operationId":"postBffAi-contextDelete","tags":["AI Agent"],"summary":"Delete an organisation context note","description":"Soft-deletes a note. Human sessions only; AI-agent credentials get 403.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Note id (16 characters), as returned by `/list` or shown in the `/document` markdown.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Note id (16 characters), as returned by `/list` or shown in the `/document` markdown.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Note id (16 characters), as returned by `/list` or shown in the `/document` markdown.","type":"string"}}}}}}}},"/bff/analytics/category-list":{"get":{"parameters":[{"description":"Locale for category/report copy.","examples":["en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","color","bgColor","analytics"],"properties":{"id":{"description":"Category identifier.","type":"string"},"title":{"description":"Category title.","type":"string"},"description":{"type":"string"},"color":{"description":"Tailwind text color class.","type":"string"},"bgColor":{"description":"Tailwind background color class.","type":"string"},"analytics":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"popular":{"type":"boolean"}}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","color","bgColor","analytics"],"properties":{"id":{"description":"Category identifier.","type":"string"},"title":{"description":"Category title.","type":"string"},"description":{"type":"string"},"color":{"description":"Tailwind text color class.","type":"string"},"bgColor":{"description":"Tailwind background color class.","type":"string"},"analytics":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"popular":{"type":"boolean"}}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","color","bgColor","analytics"],"properties":{"id":{"description":"Category identifier.","type":"string"},"title":{"description":"Category title.","type":"string"},"description":{"type":"string"},"color":{"description":"Tailwind text color class.","type":"string"},"bgColor":{"description":"Tailwind background color class.","type":"string"},"analytics":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"popular":{"type":"boolean"}}}}}}}},"required":["items"]}}}}},"operationId":"getBffAnalyticsCategory-list","tags":["Analytics"],"summary":"List analytics categories","description":"Returns analytics categories with reports the caller has permission to read. Empty categories are pruned. Category and report copy honours the optional `locale` query param."}},"/bff/analytics/detail":{"get":{"parameters":[{"description":"Report slug.","examples":["sales-daily-revenue"],"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"schema":{"minimum":1,"default":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"default":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":500,"default":50,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"default":50,"type":"number"}]},"in":"query","name":"pageSize","required":false},{"schema":{"type":"string"},"in":"query","name":"sortBy","required":false},{"schema":{"anyOf":[{"const":"asc","type":"string"},{"const":"desc","type":"string"}]},"in":"query","name":"sortDir","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"headerLabels":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"rows":{"type":"array","items":{}},"columns":{"type":"array","items":{}},"kpis":{"type":"array","items":{}},"chart":{},"pagination":{"type":"object","required":["page","pageSize","total"],"properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}}},"meta":{"type":"object","required":["generatedAt"],"properties":{"generatedAt":{"type":"string"},"cached":{"type":"boolean"},"truncated":{"type":"boolean"}}}},"required":["slug","headerLabels","rows","pagination","meta"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"headerLabels":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"rows":{"type":"array","items":{}},"columns":{"type":"array","items":{}},"kpis":{"type":"array","items":{}},"chart":{},"pagination":{"type":"object","required":["page","pageSize","total"],"properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}}},"meta":{"type":"object","required":["generatedAt"],"properties":{"generatedAt":{"type":"string"},"cached":{"type":"boolean"},"truncated":{"type":"boolean"}}}},"required":["slug","headerLabels","rows","pagination","meta"]}},"text/plain":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"headerLabels":{"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"rows":{"type":"array","items":{}},"columns":{"type":"array","items":{}},"kpis":{"type":"array","items":{}},"chart":{},"pagination":{"type":"object","required":["page","pageSize","total"],"properties":{"page":{"type":"number"},"pageSize":{"type":"number"},"total":{"type":"number"}}},"meta":{"type":"object","required":["generatedAt"],"properties":{"generatedAt":{"type":"string"},"cached":{"type":"boolean"},"truncated":{"type":"boolean"}}}},"required":["slug","headerLabels","rows","pagination","meta"]}}}}},"operationId":"getBffAnalyticsDetail","tags":["Analytics"],"summary":"Get analytics report detail","description":"Runs a specific analytics report. Supports per-report query params, pagination, sorting and free-text search. Permission is checked per report."}},"/bff/api-key/list":{"get":{"responses":{"200":{"description":"List of API keys with metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of API keys.","type":"array","items":{"description":"Single API key item.","type":"object","required":["id","apiKey","environment","usedCountToday","isActive","isDeleted","expirationDate","insertedDate"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","type":"string"},"apiKey":{"description":"Masked API key value (shows first 10 chars, rest masked).","type":"string"},"environment":{"description":"Environment type: \"PROD\" for production, \"DEV\" for development/sandbox, \"ROOT\" for system-level access.","anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"usedCountToday":{"description":"Number of API calls made with this key today.","type":"number"},"member":{"description":"Member information if key is member-specific.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the member this key is assigned to.","type":"string"}}},"isActive":{"description":"Whether the key is currently active and can be used.","type":"boolean"},"isDeleted":{"description":"Whether the key has been deleted (invalidated).","type":"boolean"},"description":{"description":"Human-readable description of the key purpose.","type":"string"},"expirationDate":{"description":"Date when the key will expire and become unusable.","anyOf":[{"description":"Date when the key will expire and become unusable.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the key was created.","anyOf":[{"description":"Date when the key was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of API keys.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of API keys.","type":"array","items":{"description":"Single API key item.","type":"object","required":["id","apiKey","environment","usedCountToday","isActive","isDeleted","expirationDate","insertedDate"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","type":"string"},"apiKey":{"description":"Masked API key value (shows first 10 chars, rest masked).","type":"string"},"environment":{"description":"Environment type: \"PROD\" for production, \"DEV\" for development/sandbox, \"ROOT\" for system-level access.","anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"usedCountToday":{"description":"Number of API calls made with this key today.","type":"number"},"member":{"description":"Member information if key is member-specific.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the member this key is assigned to.","type":"string"}}},"isActive":{"description":"Whether the key is currently active and can be used.","type":"boolean"},"isDeleted":{"description":"Whether the key has been deleted (invalidated).","type":"boolean"},"description":{"description":"Human-readable description of the key purpose.","type":"string"},"expirationDate":{"description":"Date when the key will expire and become unusable.","anyOf":[{"description":"Date when the key will expire and become unusable.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the key was created.","anyOf":[{"description":"Date when the key was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of API keys.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of API keys.","type":"array","items":{"description":"Single API key item.","type":"object","required":["id","apiKey","environment","usedCountToday","isActive","isDeleted","expirationDate","insertedDate"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","type":"string"},"apiKey":{"description":"Masked API key value (shows first 10 chars, rest masked).","type":"string"},"environment":{"description":"Environment type: \"PROD\" for production, \"DEV\" for development/sandbox, \"ROOT\" for system-level access.","anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"usedCountToday":{"description":"Number of API calls made with this key today.","type":"number"},"member":{"description":"Member information if key is member-specific.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the member this key is assigned to.","type":"string"}}},"isActive":{"description":"Whether the key is currently active and can be used.","type":"boolean"},"isDeleted":{"description":"Whether the key has been deleted (invalidated).","type":"boolean"},"description":{"description":"Human-readable description of the key purpose.","type":"string"},"expirationDate":{"description":"Date when the key will expire and become unusable.","anyOf":[{"description":"Date when the key will expire and become unusable.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the key was created.","anyOf":[{"description":"Date when the key was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of API keys.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffApi-keyList","tags":["API Key"],"summary":"List API keys","description":"Returns a list of all API keys for the organisation. Each key includes basic information, masked key value, environment, description, and expiration date. Active and deleted keys are both included - use the isDeleted flag to filter."}},"/bff/api-key/detail":{"get":{"parameters":[{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"description":"Complete API key detail with metadata, ownership information, and usage statistics. Includes all information about the key including when it was created, when it expires, who owns it, and detailed usage history.","content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"description":"External identifier (UUID) of the API key.","type":"string"},"apiKey":{"description":"Masked API key value (shows first 10 chars, rest masked).","type":"string"},"environment":{"description":"Environment type: PROD for production, DEV for development, ROOT for system-level access.","anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"description":{"description":"Human-readable description of the key purpose. Null if not set.","anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"description":"Whether the key is currently active and can be used for API requests.","type":"boolean"},"isDeleted":{"description":"Whether the key has been deleted/invalidated. Deleted keys cannot be used.","type":"boolean"},"insertedDate":{"description":"Date and time when the API key was created.","anyOf":[{"description":"Date and time when the API key was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"description":"Date and time when the key will expire and become unusable.","anyOf":[{"description":"Date and time when the key will expire and become unusable.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"member":{"description":"Member information if key is member-specific. Undefined for organisation-wide keys.","type":"object","required":["id","name"],"properties":{"id":{"description":"Internal member ID.","type":"number"},"name":{"description":"Full name of the member this key is assigned to.","type":"string"}}},"usedCountToday":{"description":"Number of API calls made with this key today.","type":"number"},"usedCountTotal":{"description":"Total number of days this key has been used (including today).","type":"number"},"usedSumTotal":{"description":"Total number of API calls made with this key (all time).","type":"number"},"usageList":{"description":"Daily usage history for the last 90 days, ordered by date (newest first). Can be used to generate usage charts.","type":"array","items":{"description":"Daily usage record.","type":"object","required":["date","count"],"properties":{"date":{"description":"Date of usage.","anyOf":[{"description":"Date of usage.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"count":{"description":"Number of API calls made on this date.","type":"number"}}}},"scopes":{"description":"List of scope codes assigned to this key. Empty array means full access (no restrictions).","type":"array","items":{"type":"string"}}},"required":["externalId","apiKey","environment","description","isActive","isDeleted","insertedDate","expirationDate","usedCountToday","usedCountTotal","usedSumTotal","usageList","scopes"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"externalId":{"description":"External identifier (UUID) of the API key.","type":"string"},"apiKey":{"description":"Masked API key value (shows first 10 chars, rest masked).","type":"string"},"environment":{"description":"Environment type: PROD for production, DEV for development, ROOT for system-level access.","anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"description":{"description":"Human-readable description of the key purpose. Null if not set.","anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"description":"Whether the key is currently active and can be used for API requests.","type":"boolean"},"isDeleted":{"description":"Whether the key has been deleted/invalidated. Deleted keys cannot be used.","type":"boolean"},"insertedDate":{"description":"Date and time when the API key was created.","anyOf":[{"description":"Date and time when the API key was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"description":"Date and time when the key will expire and become unusable.","anyOf":[{"description":"Date and time when the key will expire and become unusable.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"member":{"description":"Member information if key is member-specific. Undefined for organisation-wide keys.","type":"object","required":["id","name"],"properties":{"id":{"description":"Internal member ID.","type":"number"},"name":{"description":"Full name of the member this key is assigned to.","type":"string"}}},"usedCountToday":{"description":"Number of API calls made with this key today.","type":"number"},"usedCountTotal":{"description":"Total number of days this key has been used (including today).","type":"number"},"usedSumTotal":{"description":"Total number of API calls made with this key (all time).","type":"number"},"usageList":{"description":"Daily usage history for the last 90 days, ordered by date (newest first). Can be used to generate usage charts.","type":"array","items":{"description":"Daily usage record.","type":"object","required":["date","count"],"properties":{"date":{"description":"Date of usage.","anyOf":[{"description":"Date of usage.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"count":{"description":"Number of API calls made on this date.","type":"number"}}}},"scopes":{"description":"List of scope codes assigned to this key. Empty array means full access (no restrictions).","type":"array","items":{"type":"string"}}},"required":["externalId","apiKey","environment","description","isActive","isDeleted","insertedDate","expirationDate","usedCountToday","usedCountTotal","usedSumTotal","usageList","scopes"]}},"text/plain":{"schema":{"type":"object","properties":{"externalId":{"description":"External identifier (UUID) of the API key.","type":"string"},"apiKey":{"description":"Masked API key value (shows first 10 chars, rest masked).","type":"string"},"environment":{"description":"Environment type: PROD for production, DEV for development, ROOT for system-level access.","anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"description":{"description":"Human-readable description of the key purpose. Null if not set.","anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"description":"Whether the key is currently active and can be used for API requests.","type":"boolean"},"isDeleted":{"description":"Whether the key has been deleted/invalidated. Deleted keys cannot be used.","type":"boolean"},"insertedDate":{"description":"Date and time when the API key was created.","anyOf":[{"description":"Date and time when the API key was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"expirationDate":{"description":"Date and time when the key will expire and become unusable.","anyOf":[{"description":"Date and time when the key will expire and become unusable.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"member":{"description":"Member information if key is member-specific. Undefined for organisation-wide keys.","type":"object","required":["id","name"],"properties":{"id":{"description":"Internal member ID.","type":"number"},"name":{"description":"Full name of the member this key is assigned to.","type":"string"}}},"usedCountToday":{"description":"Number of API calls made with this key today.","type":"number"},"usedCountTotal":{"description":"Total number of days this key has been used (including today).","type":"number"},"usedSumTotal":{"description":"Total number of API calls made with this key (all time).","type":"number"},"usageList":{"description":"Daily usage history for the last 90 days, ordered by date (newest first). Can be used to generate usage charts.","type":"array","items":{"description":"Daily usage record.","type":"object","required":["date","count"],"properties":{"date":{"description":"Date of usage.","anyOf":[{"description":"Date of usage.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"count":{"description":"Number of API calls made on this date.","type":"number"}}}},"scopes":{"description":"List of scope codes assigned to this key. Empty array means full access (no restrictions).","type":"array","items":{"type":"string"}}},"required":["externalId","apiKey","environment","description","isActive","isDeleted","insertedDate","expirationDate","usedCountToday","usedCountTotal","usedSumTotal","usageList","scopes"]}}}}},"operationId":"getBffApi-keyDetail","tags":["API Key"],"summary":"Get API key detail with usage statistics","description":"Returns detailed information about a specific API key including usage statistics. Shows the masked key value, total usage count, total API calls made, and daily usage history for the last 90 days. Useful for monitoring API key usage and identifying patterns."}},"/bff/api-key/generate-key":{"post":{"parameters":[],"responses":{"200":{"description":"Newly generated API key.","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"description":"The generated API key (32 character string). IMPORTANT: Store this securely - it will not be shown again.","type":"string"}},"required":["apiKey"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"apiKey":{"description":"The generated API key (32 character string). IMPORTANT: Store this securely - it will not be shown again.","type":"string"}},"required":["apiKey"]}},"text/plain":{"schema":{"type":"object","properties":{"apiKey":{"description":"The generated API key (32 character string). IMPORTANT: Store this securely - it will not be shown again.","type":"string"}},"required":["apiKey"]}}}}},"operationId":"postBffApi-keyGenerate-key","tags":["API Key"],"summary":"Generate new API key","description":"Creates a new API key for programmatic access to the API. The key is a random 32-character string that must be included in API requests. Keys can be organisation-wide or member-specific, and are associated with an environment (production, sandbox, or test). Store the returned key securely - it cannot be retrieved later, only viewed in masked form.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["environment"],"properties":{"environment":{"description":"Environment for the key: \"PROD\" for production, \"DEV\" for development/sandbox, \"ROOT\" for system-level access.","examples":["PROD"],"anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"relatedToMember":{"description":"Whether to associate this key with the current member. If true, key is member-specific.","type":"boolean"},"description":{"description":"Human-readable description of the key purpose (e.g., \"Mobile app integration\", \"Partner API access\").","examples":["Mobile app integration"],"type":"string"},"expirationDate":{"description":"Expiration date in ISO format (YYYY-MM-DD). If not provided, key expires in 90 days from creation.","examples":["2026-07-18"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["environment"],"properties":{"environment":{"description":"Environment for the key: \"PROD\" for production, \"DEV\" for development/sandbox, \"ROOT\" for system-level access.","examples":["PROD"],"anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"relatedToMember":{"description":"Whether to associate this key with the current member. If true, key is member-specific.","type":"boolean"},"description":{"description":"Human-readable description of the key purpose (e.g., \"Mobile app integration\", \"Partner API access\").","examples":["Mobile app integration"],"type":"string"},"expirationDate":{"description":"Expiration date in ISO format (YYYY-MM-DD). If not provided, key expires in 90 days from creation.","examples":["2026-07-18"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["environment"],"properties":{"environment":{"description":"Environment for the key: \"PROD\" for production, \"DEV\" for development/sandbox, \"ROOT\" for system-level access.","examples":["PROD"],"anyOf":[{"const":"PROD","type":"string"},{"const":"DEV","type":"string"},{"const":"ROOT","type":"string"}]},"relatedToMember":{"description":"Whether to associate this key with the current member. If true, key is member-specific.","type":"boolean"},"description":{"description":"Human-readable description of the key purpose (e.g., \"Mobile app integration\", \"Partner API access\").","examples":["Mobile app integration"],"type":"string"},"expirationDate":{"description":"Expiration date in ISO format (YYYY-MM-DD). If not provided, key expires in 90 days from creation.","examples":["2026-07-18"],"type":"string"}}}}}}}},"/bff/api-key/invalidate-key":{"post":{"parameters":[],"responses":{"200":{"description":"Key invalidated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffApi-keyInvalidate-key","tags":["API Key"],"summary":"Invalidate API key","description":"Marks an API key as deleted, making it immediately unusable for API requests. This action is permanent and cannot be undone. The key will still appear in the list but with isDeleted: true. Use this when a key has been compromised or is no longer needed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External identifier (UUID) of the API key to invalidate.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External identifier (UUID) of the API key to invalidate.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External identifier (UUID) of the API key to invalidate.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"}}}}}}}},"/bff/api-key/set-expiration-date":{"post":{"parameters":[],"responses":{"200":{"description":"Expiration date updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffApi-keySet-expiration-date","tags":["API Key"],"summary":"Set / extend API key expiration date","description":"Moves the expiration date of an API key. The new date must be strictly in the future — you cannot backdate a key. Deleted keys cannot be extended; generate a new key instead. The action is audited with an e-mail notification.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","expirationDate"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"expirationDate":{"description":"New expiration date in ISO format. Must be strictly in the future.","examples":["2027-07-16T00:00:00.000Z"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","expirationDate"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"expirationDate":{"description":"New expiration date in ISO format. Must be strictly in the future.","examples":["2027-07-16T00:00:00.000Z"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","expirationDate"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"expirationDate":{"description":"New expiration date in ISO format. Must be strictly in the future.","examples":["2027-07-16T00:00:00.000Z"],"type":"string"}}}}}}}},"/bff/api-key/set-active":{"post":{"parameters":[],"responses":{"200":{"description":"Active flag updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffApi-keySet-active","tags":["API Key"],"summary":"Activate or deactivate API key","description":"Toggles the `is_active` flag of an API key. A deactivated key rejects new requests but remains stored, so it can be reactivated later. Use this to temporarily pause an integration without discarding the credential. Deleted keys (`isDeleted: true`) cannot be toggled — generate a new key instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","active"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"active":{"description":"True to reactivate, false to deactivate. Deleted keys cannot be toggled.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","active"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"active":{"description":"True to reactivate, false to deactivate. Deleted keys cannot be toggled.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","active"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"active":{"description":"True to reactivate, false to deactivate. Deleted keys cannot be toggled.","type":"boolean"}}}}}}}},"/bff/api-key/scope/list":{"get":{"parameters":[{"description":"BCP-47 locale (cs, en, de, sk, pl). Defaults to `cs`.","examples":["en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"description":"List of available API key scopes.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of available scopes.","type":"array","items":{"type":"object","required":["code","label","description"],"properties":{"code":{"description":"Scope code used for assignment.","type":"string"},"label":{"description":"Human-readable label for the scope.","type":"string"},"description":{"description":"Description of what the scope grants access to.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of available scopes.","type":"array","items":{"type":"object","required":["code","label","description"],"properties":{"code":{"description":"Scope code used for assignment.","type":"string"},"label":{"description":"Human-readable label for the scope.","type":"string"},"description":{"description":"Description of what the scope grants access to.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of available scopes.","type":"array","items":{"type":"object","required":["code","label","description"],"properties":{"code":{"description":"Scope code used for assignment.","type":"string"},"label":{"description":"Human-readable label for the scope.","type":"string"},"description":{"description":"Description of what the scope grants access to.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffApi-keyScopeList","tags":["API Key"],"summary":"List available API key scopes","description":"Returns a list of all available scope codes that can be assigned to an API key. Labels + descriptions honour the optional `locale` query param (cs/en/de/sk/pl). Use the codes when setting scopes via the /scope/set endpoint."}},"/bff/api-key/scope/detail":{"get":{"parameters":[{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"description":"Scopes assigned to the API key.","content":{"application/json":{"schema":{"type":"object","properties":{"scopes":{"description":"Array of scope codes assigned to this key. Empty means full access.","type":"array","items":{"type":"string"}}},"required":["scopes"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"scopes":{"description":"Array of scope codes assigned to this key. Empty means full access.","type":"array","items":{"type":"string"}}},"required":["scopes"]}},"text/plain":{"schema":{"type":"object","properties":{"scopes":{"description":"Array of scope codes assigned to this key. Empty means full access.","type":"array","items":{"type":"string"}}},"required":["scopes"]}}}}},"operationId":"getBffApi-keyScopeDetail","tags":["API Key"],"summary":"Get scopes assigned to an API key","description":"Returns a list of scope codes currently assigned to the specified API key. An empty array means the key has full access (no scope restrictions)."}},"/bff/api-key/scope/set":{"post":{"parameters":[],"responses":{"200":{"description":"Scopes updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffApi-keyScopeSet","tags":["API Key"],"summary":"Set API key scopes","description":"Replaces all scopes assigned to an API key. Pass an empty array to remove all scope restrictions (key gets full access). Only valid scope codes from /scope/list are accepted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","scopes"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"scopes":{"description":"Array of scope codes to assign. Empty array removes all restrictions (full access).","type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","scopes"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"scopes":{"description":"Array of scope codes to assign. Empty array removes all restrictions (full access).","type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["id","scopes"],"properties":{"id":{"description":"External identifier (UUID) of the API key.","examples":["550e8400-e29b-41d4-a716-446655440000"],"type":"string"},"scopes":{"description":"Array of scope codes to assign. Empty array removes all restrictions (full access).","type":"array","items":{"type":"string"}}}}}}}}},"/bff/blob/upload":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"blobToken":{"description":"Token to reference the uploaded blob.","examples":["blb_abc123xyz"],"type":"string"},"filename":{"description":"Final display name (may carry a \"(2)\" counter).","type":"string"},"replaced":{"description":"Drive replace: existing files that got a new version (blobToken = that file).","type":"number"},"replaceBlocked":{"description":"Drive replace: old files kept because records use them.","type":"number"}},"required":["blobToken"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"blobToken":{"description":"Token to reference the uploaded blob.","examples":["blb_abc123xyz"],"type":"string"},"filename":{"description":"Final display name (may carry a \"(2)\" counter).","type":"string"},"replaced":{"description":"Drive replace: existing files that got a new version (blobToken = that file).","type":"number"},"replaceBlocked":{"description":"Drive replace: old files kept because records use them.","type":"number"}},"required":["blobToken"]}},"text/plain":{"schema":{"type":"object","properties":{"blobToken":{"description":"Token to reference the uploaded blob.","examples":["blb_abc123xyz"],"type":"string"},"filename":{"description":"Final display name (may carry a \"(2)\" counter).","type":"string"},"replaced":{"description":"Drive replace: existing files that got a new version (blobToken = that file).","type":"number"},"replaceBlocked":{"description":"Drive replace: old files kept because records use them.","type":"number"}},"required":["blobToken"]}}}}},"operationId":"postBffBlobUpload","tags":["Blob"],"summary":"Upload a file","description":"Uploads a file via multipart/form-data. The request body must contain a \"file\" field with the binary data, an optional \"blobPath\" for storage path prefix, and an optional \"tag\" for categorization. Returns a blob token for referencing the uploaded file.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload.","type":"string","format":"binary"},"blobPath":{"description":"Optional storage path prefix.","examples":["post/N195wg3F34tFierY"],"type":"string"},"tag":{"description":"Optional categorization tag.","examples":["post"],"type":"string"},"conflict":{"description":"Drive only: what to do when the folder already has a file with this name. Default 'keepBoth' (\"Report (2).pdf\"); 'replace' uploads a new version of the existing file (kept in its history) unless records use it.","anyOf":[{"const":"keepBoth","type":"string"},{"const":"replace","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload.","type":"string","format":"binary"},"blobPath":{"description":"Optional storage path prefix.","examples":["post/N195wg3F34tFierY"],"type":"string"},"tag":{"description":"Optional categorization tag.","examples":["post"],"type":"string"},"conflict":{"description":"Drive only: what to do when the folder already has a file with this name. Default 'keepBoth' (\"Report (2).pdf\"); 'replace' uploads a new version of the existing file (kept in its history) unless records use it.","anyOf":[{"const":"keepBoth","type":"string"},{"const":"replace","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload.","type":"string","format":"binary"},"blobPath":{"description":"Optional storage path prefix.","examples":["post/N195wg3F34tFierY"],"type":"string"},"tag":{"description":"Optional categorization tag.","examples":["post"],"type":"string"},"conflict":{"description":"Drive only: what to do when the folder already has a file with this name. Default 'keepBoth' (\"Report (2).pdf\"); 'replace' uploads a new version of the existing file (kept in its history) unless records use it.","anyOf":[{"const":"keepBoth","type":"string"},{"const":"replace","type":"string"}]}}}}}}}},"/bff/blob/upload-user-avatar":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBlobUpload-user-avatar","tags":["Blob"],"summary":"Upload user avatar","description":"Uploads an image file as the current user's avatar via multipart/form-data. Stored only as the canonical `cas__user.avatar_blob_id`. Only image content types are accepted. The request body must contain \"file\" and \"blobPath\" fields.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file","blobPath"],"properties":{"file":{"default":"File","description":"Image binary to use as the avatar.","type":"string","format":"binary"},"blobPath":{"description":"Storage path prefix.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["file","blobPath"],"properties":{"file":{"default":"File","description":"Image binary to use as the avatar.","type":"string","format":"binary"},"blobPath":{"description":"Storage path prefix.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["file","blobPath"],"properties":{"file":{"default":"File","description":"Image binary to use as the avatar.","type":"string","format":"binary"},"blobPath":{"description":"Storage path prefix.","type":"string"}}}}}}}},"/bff/blob/viewer":{"get":{"parameters":[{"description":"Blob token identifying the file to view.","examples":["blb_abc123xyz"],"schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getBffBlobViewer","tags":["Blob"],"summary":"View/download a blob","description":"Streams the blob content with a safe Content-Type header (supports `Range`). Returns the raw file bytes — response schema is not typed as the content type varies (images, PDFs, etc.).","responses":{"200":{}}}},"/bff/branch/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","active","openingHoursRegular","branchType","insertedDate","updatedDate"],"properties":{"id":{"description":"Branch slug (used as identifier in other endpoints).","type":"string"},"slug":{"description":"URL-safe unique branch slug.","type":"string"},"name":{"description":"Branch display name.","type":"string"},"description":{"description":"Short branch description.","type":"string"},"internalCode":{"description":"Organisation-internal branch code.","type":"string"},"active":{"description":"Whether the branch is active and visible.","type":"boolean"},"archivedDate":{"description":"ISO timestamp when the branch was archived (BIZKIT-109); absent = not archived.","type":"string"},"url":{"description":"Branch public URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","type":"number"},"longitude":{"description":"Branch GPS longitude.","type":"number"},"mainPhotoUrl":{"description":"URL of the main photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","type":"string"},"openingHoursRegular":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition","active"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday … 6 = Sunday.","type":"number"},"definition":{"description":"Time-range definition, e.g. \"08:00-17:00\".","type":"string"},"active":{"type":"boolean"}}}},"openingHoursExceptionToday":{"type":"object","required":["isOpen"],"properties":{"isOpen":{"type":"boolean"},"reason":{"type":"string"}}},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"parentBranchSlug":{"description":"Slug of the operational parent branch, if any.","type":"string"},"operatingCompanyName":{"description":"Display name of the legal entity operating this branch. Doubles as the franchise brand label.","type":"string"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update date.","anyOf":[{"description":"Last update date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of branches matching the query.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","active","openingHoursRegular","branchType","insertedDate","updatedDate"],"properties":{"id":{"description":"Branch slug (used as identifier in other endpoints).","type":"string"},"slug":{"description":"URL-safe unique branch slug.","type":"string"},"name":{"description":"Branch display name.","type":"string"},"description":{"description":"Short branch description.","type":"string"},"internalCode":{"description":"Organisation-internal branch code.","type":"string"},"active":{"description":"Whether the branch is active and visible.","type":"boolean"},"archivedDate":{"description":"ISO timestamp when the branch was archived (BIZKIT-109); absent = not archived.","type":"string"},"url":{"description":"Branch public URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","type":"number"},"longitude":{"description":"Branch GPS longitude.","type":"number"},"mainPhotoUrl":{"description":"URL of the main photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","type":"string"},"openingHoursRegular":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition","active"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday … 6 = Sunday.","type":"number"},"definition":{"description":"Time-range definition, e.g. \"08:00-17:00\".","type":"string"},"active":{"type":"boolean"}}}},"openingHoursExceptionToday":{"type":"object","required":["isOpen"],"properties":{"isOpen":{"type":"boolean"},"reason":{"type":"string"}}},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"parentBranchSlug":{"description":"Slug of the operational parent branch, if any.","type":"string"},"operatingCompanyName":{"description":"Display name of the legal entity operating this branch. Doubles as the franchise brand label.","type":"string"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update date.","anyOf":[{"description":"Last update date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of branches matching the query.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","active","openingHoursRegular","branchType","insertedDate","updatedDate"],"properties":{"id":{"description":"Branch slug (used as identifier in other endpoints).","type":"string"},"slug":{"description":"URL-safe unique branch slug.","type":"string"},"name":{"description":"Branch display name.","type":"string"},"description":{"description":"Short branch description.","type":"string"},"internalCode":{"description":"Organisation-internal branch code.","type":"string"},"active":{"description":"Whether the branch is active and visible.","type":"boolean"},"archivedDate":{"description":"ISO timestamp when the branch was archived (BIZKIT-109); absent = not archived.","type":"string"},"url":{"description":"Branch public URL.","type":"string"},"latitude":{"description":"Branch GPS latitude.","type":"number"},"longitude":{"description":"Branch GPS longitude.","type":"number"},"mainPhotoUrl":{"description":"URL of the main photo.","type":"string"},"addressSummary":{"description":"Short rendered address (street, ZIP, city).","type":"string"},"openingHoursRegular":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition","active"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday … 6 = Sunday.","type":"number"},"definition":{"description":"Time-range definition, e.g. \"08:00-17:00\".","type":"string"},"active":{"type":"boolean"}}}},"openingHoursExceptionToday":{"type":"object","required":["isOpen"],"properties":{"isOpen":{"type":"boolean"},"reason":{"type":"string"}}},"branchType":{"description":"Branch kind. Defaults to \"own\" for historical rows.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"parentBranchSlug":{"description":"Slug of the operational parent branch, if any.","type":"string"},"operatingCompanyName":{"description":"Display name of the legal entity operating this branch. Doubles as the franchise brand label.","type":"string"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update date.","anyOf":[{"description":"Last update date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of branches matching the query.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffBranchList","tags":["Branch"],"description":"Returns a paginated list of branches for the authenticated organisation. Branches are ordered by active status first, then by name ascending. Supports fulltext filter on name, slug, internal code and city. Non-root members only see branches they have an explicit entity grant on (`cas__organisation_entity_permission`).","summary":"List branches"}},"/bff/branch/detail":{"get":{"parameters":[{"description":"Branch slug.","examples":["prague-central"],"schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Locale code (e.g. 'cs', 'en') used to pick the preview text on the Documents tab. Falls back to any available translation and reports which locale it picked via `documents[].previewLocaleCode`. Omit to disable preferential ordering.","schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"internalCode":{"type":"string"},"active":{"type":"boolean"},"archivedDate":{"description":"ISO timestamp when archived (BIZKIT-109).","type":"string"},"url":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"branchContact":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"CuRefNo of the linked contact.","type":"string"},"name":{"type":"string"},"email":{"type":"string"},"companyName":{"type":"string"}}},"branchType":{"description":"Branch kind declared by the operator. \"own\" = the organisation runs the branch directly; \"franchise\" = a third-party franchisee runs it under the organisation's brand; \"partner\" = a cooperating but independent business (e.g. white-label outlet).","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"issueInvolvement":{"description":"BIZKIT-124: which tickets of this branch its people see (franchisee API) and get e-mails about. Absent = the organisation default applies.","anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},"parentBranch":{"type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the operational parent (regional flagship / HQ).","type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]}}},"operatingCompany":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"CuRefNo of the legal entity operating this branch.","type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"description":"Czech IČO (or local equivalent).","type":"string"},"taxIdentificationNumber":{"description":"Czech DIČ (or local equivalent).","type":"string"}}},"franchiseFeePercentage":{"description":"Franchise fee percent skimmed off the branch turnover (0–100). Omitted when the branch has no franchise economics configured.","type":"number"},"people":{"type":"array","items":{"type":"object","required":["id","contactId","role","position"],"properties":{"id":{"description":"Internal id of the link row (used to update/remove).","type":"string"},"contactId":{"description":"CuRefNo of the linked contact.","type":"string"},"role":{"description":"Role enum — see BRANCH_PERSON_ROLES.","type":"string"},"customLabel":{"description":"Free-text label that overrides the role display.","type":"string"},"position":{"description":"Sort position.","type":"number"},"name":{"type":"string"},"email":{"type":"string"},"companyName":{"type":"string"}}}},"establishedDate":{"description":"Legal incorporation / business-registry date (ISO timestamp). Optional — nullable in DB.","type":"string"},"openedDate":{"description":"Date the branch started serving customers (ISO timestamp). Required — drives the financial roll-up bucket key.","type":"string"},"currentClosure":{"type":"object","required":["id","startDate","reason"],"properties":{"id":{"description":"External id (24-char) — use it for /closure-update or /closure-delete.","type":"string"},"startDate":{"description":"ISO timestamp the closure began.","type":"string"},"endDate":{"description":"ISO timestamp the closure ends. Omitted = open-ended.","type":"string"},"reason":{"description":"Operator-supplied reason for the closure.","type":"string"}}},"mainPhotoUrl":{"type":"string"},"address":{"type":"object","required":["id"],"properties":{"id":{"description":"External address identifier.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"type":"string"}}},"openingHours":{"type":"object","required":["regular","exceptions"],"properties":{"regular":{"type":"array","items":{"type":"object","required":["id","dayOfWeek","definition","active"],"properties":{"id":{"type":"string"},"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday, 6 = Sunday.","type":"number"},"definition":{"description":"Time range definition (e.g. \"08:00-17:00\").","type":"string"},"description":{"type":"string"},"validFrom":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"type":"boolean"}}}},"exceptions":{"type":"array","items":{"type":"object","required":["id","date","isOpen"],"properties":{"id":{"type":"string"},"date":{"description":"Exception date (ISO YYYY-MM-DD).","type":"string"},"isOpen":{"type":"boolean"},"reason":{"type":"string"}}}}}},"emails":{"type":"array","items":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"verifiedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"phones":{"type":"array","items":{"type":"object","required":["id","phone"],"properties":{"id":{"type":"string"},"phone":{"type":"string"},"role":{"type":"string"},"verifiedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"calendars":{"type":"array","items":{"type":"object","required":["id","name","code"],"properties":{"id":{"description":"Calendar ID.","type":"string"},"name":{"type":"string"},"code":{"type":"string"},"colorHex":{"description":"6-char hex color without # prefix.","type":"string"}}}},"products":{"type":"array","items":{"type":"object","required":["id","code","slug","active"],"properties":{"id":{"description":"Product ID.","type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"},"mainImageId":{"type":"number"}}}},"locks":{"type":"array","items":{"type":"object","required":["lockId","active"],"properties":{"lockId":{"description":"External TTLock identifier (matches the lock detail URL).","type":"number"},"alias":{"description":"Operator-defined display name.","type":"string"},"electricQuantity":{"description":"Battery level in percent (0–100), if reported.","type":"number"},"hasGateway":{"description":"Whether the lock is reachable via a Wi-Fi gateway.","type":"boolean"},"active":{"description":"Whether the lock is actively monitored.","type":"boolean"}}}},"documents":{"type":"array","items":{"type":"object","required":["slotKey","postExternalId","postId","visibility","localeCodes","updatedDate","previewText","previewLocaleCode"],"properties":{"slotKey":{"description":"Which document slot this row represents. Fixed 7-way enum — mirrors the FK columns on shop__branch.","anyOf":[{"const":"terms","type":"string"},{"const":"complaints","type":"string"},{"const":"privacy","type":"string"},{"const":"operational","type":"string"},{"const":"internalDescription","type":"string"},{"const":"staff","type":"string"},{"const":"ai","type":"string"}]},"postExternalId":{"description":"Post external id (16 chars). Null when the slot has no linked post yet.","anyOf":[{"type":"string"},{"type":"null"}]},"postId":{"description":"Post internal id — used by BFF calls that address the post directly (e.g. auto-translate).","anyOf":[{"type":"number"},{"type":"null"}]},"visibility":{"description":"Post visibility. Null for empty slots. Branch docs default to public/private per slot (see createBranchDocuments).","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"},{"type":"null"}]},"localeCodes":{"description":"Locale codes (e.g. 'cs', 'en') whose content__post_locale row has non-empty content.","type":"array","items":{"type":"string"}},"updatedDate":{"description":"Parent post's updated_date (ISO). Null for empty slots.","anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"description":"First ~140 chars of the preview locale, markdown-stripped. Null when no locale has any content.","anyOf":[{"type":"string"},{"type":"null"}]},"previewLocaleCode":{"description":"Locale the preview text was taken from. Equals the requested `locale` when it has content; otherwise a fallback locale. Null when no locale has content (in which case previewText is also null).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","slug","name","active","branchType","people","openedDate","openingHours","emails","phones","calendars","products","locks","documents","insertedDate","updatedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"internalCode":{"type":"string"},"active":{"type":"boolean"},"archivedDate":{"description":"ISO timestamp when archived (BIZKIT-109).","type":"string"},"url":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"branchContact":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"CuRefNo of the linked contact.","type":"string"},"name":{"type":"string"},"email":{"type":"string"},"companyName":{"type":"string"}}},"branchType":{"description":"Branch kind declared by the operator. \"own\" = the organisation runs the branch directly; \"franchise\" = a third-party franchisee runs it under the organisation's brand; \"partner\" = a cooperating but independent business (e.g. white-label outlet).","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"issueInvolvement":{"description":"BIZKIT-124: which tickets of this branch its people see (franchisee API) and get e-mails about. Absent = the organisation default applies.","anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},"parentBranch":{"type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the operational parent (regional flagship / HQ).","type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]}}},"operatingCompany":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"CuRefNo of the legal entity operating this branch.","type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"description":"Czech IČO (or local equivalent).","type":"string"},"taxIdentificationNumber":{"description":"Czech DIČ (or local equivalent).","type":"string"}}},"franchiseFeePercentage":{"description":"Franchise fee percent skimmed off the branch turnover (0–100). Omitted when the branch has no franchise economics configured.","type":"number"},"people":{"type":"array","items":{"type":"object","required":["id","contactId","role","position"],"properties":{"id":{"description":"Internal id of the link row (used to update/remove).","type":"string"},"contactId":{"description":"CuRefNo of the linked contact.","type":"string"},"role":{"description":"Role enum — see BRANCH_PERSON_ROLES.","type":"string"},"customLabel":{"description":"Free-text label that overrides the role display.","type":"string"},"position":{"description":"Sort position.","type":"number"},"name":{"type":"string"},"email":{"type":"string"},"companyName":{"type":"string"}}}},"establishedDate":{"description":"Legal incorporation / business-registry date (ISO timestamp). Optional — nullable in DB.","type":"string"},"openedDate":{"description":"Date the branch started serving customers (ISO timestamp). Required — drives the financial roll-up bucket key.","type":"string"},"currentClosure":{"type":"object","required":["id","startDate","reason"],"properties":{"id":{"description":"External id (24-char) — use it for /closure-update or /closure-delete.","type":"string"},"startDate":{"description":"ISO timestamp the closure began.","type":"string"},"endDate":{"description":"ISO timestamp the closure ends. Omitted = open-ended.","type":"string"},"reason":{"description":"Operator-supplied reason for the closure.","type":"string"}}},"mainPhotoUrl":{"type":"string"},"address":{"type":"object","required":["id"],"properties":{"id":{"description":"External address identifier.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"type":"string"}}},"openingHours":{"type":"object","required":["regular","exceptions"],"properties":{"regular":{"type":"array","items":{"type":"object","required":["id","dayOfWeek","definition","active"],"properties":{"id":{"type":"string"},"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday, 6 = Sunday.","type":"number"},"definition":{"description":"Time range definition (e.g. \"08:00-17:00\").","type":"string"},"description":{"type":"string"},"validFrom":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"type":"boolean"}}}},"exceptions":{"type":"array","items":{"type":"object","required":["id","date","isOpen"],"properties":{"id":{"type":"string"},"date":{"description":"Exception date (ISO YYYY-MM-DD).","type":"string"},"isOpen":{"type":"boolean"},"reason":{"type":"string"}}}}}},"emails":{"type":"array","items":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"verifiedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"phones":{"type":"array","items":{"type":"object","required":["id","phone"],"properties":{"id":{"type":"string"},"phone":{"type":"string"},"role":{"type":"string"},"verifiedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"calendars":{"type":"array","items":{"type":"object","required":["id","name","code"],"properties":{"id":{"description":"Calendar ID.","type":"string"},"name":{"type":"string"},"code":{"type":"string"},"colorHex":{"description":"6-char hex color without # prefix.","type":"string"}}}},"products":{"type":"array","items":{"type":"object","required":["id","code","slug","active"],"properties":{"id":{"description":"Product ID.","type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"},"mainImageId":{"type":"number"}}}},"locks":{"type":"array","items":{"type":"object","required":["lockId","active"],"properties":{"lockId":{"description":"External TTLock identifier (matches the lock detail URL).","type":"number"},"alias":{"description":"Operator-defined display name.","type":"string"},"electricQuantity":{"description":"Battery level in percent (0–100), if reported.","type":"number"},"hasGateway":{"description":"Whether the lock is reachable via a Wi-Fi gateway.","type":"boolean"},"active":{"description":"Whether the lock is actively monitored.","type":"boolean"}}}},"documents":{"type":"array","items":{"type":"object","required":["slotKey","postExternalId","postId","visibility","localeCodes","updatedDate","previewText","previewLocaleCode"],"properties":{"slotKey":{"description":"Which document slot this row represents. Fixed 7-way enum — mirrors the FK columns on shop__branch.","anyOf":[{"const":"terms","type":"string"},{"const":"complaints","type":"string"},{"const":"privacy","type":"string"},{"const":"operational","type":"string"},{"const":"internalDescription","type":"string"},{"const":"staff","type":"string"},{"const":"ai","type":"string"}]},"postExternalId":{"description":"Post external id (16 chars). Null when the slot has no linked post yet.","anyOf":[{"type":"string"},{"type":"null"}]},"postId":{"description":"Post internal id — used by BFF calls that address the post directly (e.g. auto-translate).","anyOf":[{"type":"number"},{"type":"null"}]},"visibility":{"description":"Post visibility. Null for empty slots. Branch docs default to public/private per slot (see createBranchDocuments).","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"},{"type":"null"}]},"localeCodes":{"description":"Locale codes (e.g. 'cs', 'en') whose content__post_locale row has non-empty content.","type":"array","items":{"type":"string"}},"updatedDate":{"description":"Parent post's updated_date (ISO). Null for empty slots.","anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"description":"First ~140 chars of the preview locale, markdown-stripped. Null when no locale has any content.","anyOf":[{"type":"string"},{"type":"null"}]},"previewLocaleCode":{"description":"Locale the preview text was taken from. Equals the requested `locale` when it has content; otherwise a fallback locale. Null when no locale has content (in which case previewText is also null).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","slug","name","active","branchType","people","openedDate","openingHours","emails","phones","calendars","products","locks","documents","insertedDate","updatedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"internalCode":{"type":"string"},"active":{"type":"boolean"},"archivedDate":{"description":"ISO timestamp when archived (BIZKIT-109).","type":"string"},"url":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"branchContact":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"CuRefNo of the linked contact.","type":"string"},"name":{"type":"string"},"email":{"type":"string"},"companyName":{"type":"string"}}},"branchType":{"description":"Branch kind declared by the operator. \"own\" = the organisation runs the branch directly; \"franchise\" = a third-party franchisee runs it under the organisation's brand; \"partner\" = a cooperating but independent business (e.g. white-label outlet).","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"issueInvolvement":{"description":"BIZKIT-124: which tickets of this branch its people see (franchisee API) and get e-mails about. Absent = the organisation default applies.","anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},"parentBranch":{"type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the operational parent (regional flagship / HQ).","type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]}}},"operatingCompany":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"CuRefNo of the legal entity operating this branch.","type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"description":"Czech IČO (or local equivalent).","type":"string"},"taxIdentificationNumber":{"description":"Czech DIČ (or local equivalent).","type":"string"}}},"franchiseFeePercentage":{"description":"Franchise fee percent skimmed off the branch turnover (0–100). Omitted when the branch has no franchise economics configured.","type":"number"},"people":{"type":"array","items":{"type":"object","required":["id","contactId","role","position"],"properties":{"id":{"description":"Internal id of the link row (used to update/remove).","type":"string"},"contactId":{"description":"CuRefNo of the linked contact.","type":"string"},"role":{"description":"Role enum — see BRANCH_PERSON_ROLES.","type":"string"},"customLabel":{"description":"Free-text label that overrides the role display.","type":"string"},"position":{"description":"Sort position.","type":"number"},"name":{"type":"string"},"email":{"type":"string"},"companyName":{"type":"string"}}}},"establishedDate":{"description":"Legal incorporation / business-registry date (ISO timestamp). Optional — nullable in DB.","type":"string"},"openedDate":{"description":"Date the branch started serving customers (ISO timestamp). Required — drives the financial roll-up bucket key.","type":"string"},"currentClosure":{"type":"object","required":["id","startDate","reason"],"properties":{"id":{"description":"External id (24-char) — use it for /closure-update or /closure-delete.","type":"string"},"startDate":{"description":"ISO timestamp the closure began.","type":"string"},"endDate":{"description":"ISO timestamp the closure ends. Omitted = open-ended.","type":"string"},"reason":{"description":"Operator-supplied reason for the closure.","type":"string"}}},"mainPhotoUrl":{"type":"string"},"address":{"type":"object","required":["id"],"properties":{"id":{"description":"External address identifier.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code.","type":"string"},"notice":{"type":"string"}}},"openingHours":{"type":"object","required":["regular","exceptions"],"properties":{"regular":{"type":"array","items":{"type":"object","required":["id","dayOfWeek","definition","active"],"properties":{"id":{"type":"string"},"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday, 6 = Sunday.","type":"number"},"definition":{"description":"Time range definition (e.g. \"08:00-17:00\").","type":"string"},"description":{"type":"string"},"validFrom":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"type":"boolean"}}}},"exceptions":{"type":"array","items":{"type":"object","required":["id","date","isOpen"],"properties":{"id":{"type":"string"},"date":{"description":"Exception date (ISO YYYY-MM-DD).","type":"string"},"isOpen":{"type":"boolean"},"reason":{"type":"string"}}}}}},"emails":{"type":"array","items":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"verifiedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"phones":{"type":"array","items":{"type":"object","required":["id","phone"],"properties":{"id":{"type":"string"},"phone":{"type":"string"},"role":{"type":"string"},"verifiedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"calendars":{"type":"array","items":{"type":"object","required":["id","name","code"],"properties":{"id":{"description":"Calendar ID.","type":"string"},"name":{"type":"string"},"code":{"type":"string"},"colorHex":{"description":"6-char hex color without # prefix.","type":"string"}}}},"products":{"type":"array","items":{"type":"object","required":["id","code","slug","active"],"properties":{"id":{"description":"Product ID.","type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"},"mainImageId":{"type":"number"}}}},"locks":{"type":"array","items":{"type":"object","required":["lockId","active"],"properties":{"lockId":{"description":"External TTLock identifier (matches the lock detail URL).","type":"number"},"alias":{"description":"Operator-defined display name.","type":"string"},"electricQuantity":{"description":"Battery level in percent (0–100), if reported.","type":"number"},"hasGateway":{"description":"Whether the lock is reachable via a Wi-Fi gateway.","type":"boolean"},"active":{"description":"Whether the lock is actively monitored.","type":"boolean"}}}},"documents":{"type":"array","items":{"type":"object","required":["slotKey","postExternalId","postId","visibility","localeCodes","updatedDate","previewText","previewLocaleCode"],"properties":{"slotKey":{"description":"Which document slot this row represents. Fixed 7-way enum — mirrors the FK columns on shop__branch.","anyOf":[{"const":"terms","type":"string"},{"const":"complaints","type":"string"},{"const":"privacy","type":"string"},{"const":"operational","type":"string"},{"const":"internalDescription","type":"string"},{"const":"staff","type":"string"},{"const":"ai","type":"string"}]},"postExternalId":{"description":"Post external id (16 chars). Null when the slot has no linked post yet.","anyOf":[{"type":"string"},{"type":"null"}]},"postId":{"description":"Post internal id — used by BFF calls that address the post directly (e.g. auto-translate).","anyOf":[{"type":"number"},{"type":"null"}]},"visibility":{"description":"Post visibility. Null for empty slots. Branch docs default to public/private per slot (see createBranchDocuments).","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"},{"type":"null"}]},"localeCodes":{"description":"Locale codes (e.g. 'cs', 'en') whose content__post_locale row has non-empty content.","type":"array","items":{"type":"string"}},"updatedDate":{"description":"Parent post's updated_date (ISO). Null for empty slots.","anyOf":[{"type":"string"},{"type":"null"}]},"previewText":{"description":"First ~140 chars of the preview locale, markdown-stripped. Null when no locale has any content.","anyOf":[{"type":"string"},{"type":"null"}]},"previewLocaleCode":{"description":"Locale the preview text was taken from. Equals the requested `locale` when it has content; otherwise a fallback locale. Null when no locale has content (in which case previewText is also null).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","slug","name","active","branchType","people","openedDate","openingHours","emails","phones","calendars","products","locks","documents","insertedDate","updatedDate"]}}}}},"operationId":"getBffBranchDetail","tags":["Branch"],"description":"Returns full branch detail including basic fields, address, manager contact, regular opening hours, opening hour exceptions, emails, phones and main photo URL.","summary":"Get branch detail"}},"/bff/branch/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"description":"Final slug of the created branch.","type":"string"}},"required":["success","slug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"description":"Final slug of the created branch.","type":"string"}},"required":["success","slug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"description":"Final slug of the created branch.","type":"string"}},"required":["success","slug"]}}}}},"operationId":"postBffBranchCreate","tags":["Branch"],"description":"Creates a new branch for the authenticated organisation. Generates a unique slug and validates internal code uniqueness. The branch_contact link and the list of associated people are set afterwards via the dedicated endpoints (`/set-branch-contact`, `/add-branch-person`).","summary":"Create branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"slug":{"description":"Preferred URL slug. Generated from name if empty.","type":"string"},"internalCode":{"description":"Organisation-internal code (unique per organisation).","type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"slug":{"description":"Preferred URL slug. Generated from name if empty.","type":"string"},"internalCode":{"description":"Organisation-internal code (unique per organisation).","type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Branch display name.","examples":["Prague Central"],"type":"string"},"slug":{"description":"Preferred URL slug. Generated from name if empty.","type":"string"},"internalCode":{"description":"Organisation-internal code (unique per organisation).","type":"string"},"description":{"description":"Short branch description.","type":"string"},"url":{"description":"Public branch URL.","type":"string"}}}}}}}},"/bff/branch/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"type":"string"}},"required":["success","slug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"type":"string"}},"required":["success","slug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"type":"string"}},"required":["success","slug"]}}}}},"operationId":"postBffBranchUpdate","tags":["Branch"],"description":"Updates editable fields of a branch. Only provided fields are changed; undefined fields are preserved. Null values explicitly clear nullable fields.","summary":"Update branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug (used to identify the branch).","examples":["prague-central"],"type":"string"},"name":{"minLength":1,"description":"New branch display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"New description. Null to clear.","type":"string"},{"type":"null"}]},"internalCode":{"nullable":true,"anyOf":[{"description":"Internal code (unique per org). Null to clear.","type":"string"},{"type":"null"}]},"url":{"nullable":true,"anyOf":[{"description":"Public URL. Null to clear.","type":"string"},{"type":"null"}]},"active":{"description":"Whether the branch is active.","type":"boolean"},"latitude":{"nullable":true,"anyOf":[{"description":"GPS latitude.","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"GPS longitude.","type":"number"},{"type":"null"}]},"branchContactId":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact representing the branch itself (technical mail / accounting target). Null to unlink.","type":"string"},{"type":"null"}]},"establishedDate":{"nullable":true,"anyOf":[{"description":"Legal incorporation / business-registry date (ISO timestamp). Null clears.","type":"string"},{"type":"null"}]},"openedDate":{"minLength":1,"description":"Date the branch started serving customers (ISO timestamp). Drives the financial roll-up bucket key. Cannot be null — every branch must have an opened date.","type":"string"},"branchType":{"description":"Branch kind. Cannot be null — defaults to \"own\" if never set.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"issueInvolvement":{"nullable":true,"anyOf":[{"description":"BIZKIT-124: `all` = every ticket of the branch, `flagged` = only tickets flagged \"branch must act\" (AI or operator), `manual` = only tickets an operator flagged. Null = organisation default.","anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"parentBranchSlug":{"nullable":true,"anyOf":[{"description":"Slug of the operational parent branch. Null detaches. Setting a slug that would create a cycle is rejected.","type":"string"},{"type":"null"}]},"operatingCompanyContactRef":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact representing the legal entity operating this branch. Null unlinks (admin then shows a missing-operator warning).","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug (used to identify the branch).","examples":["prague-central"],"type":"string"},"name":{"minLength":1,"description":"New branch display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"New description. Null to clear.","type":"string"},{"type":"null"}]},"internalCode":{"nullable":true,"anyOf":[{"description":"Internal code (unique per org). Null to clear.","type":"string"},{"type":"null"}]},"url":{"nullable":true,"anyOf":[{"description":"Public URL. Null to clear.","type":"string"},{"type":"null"}]},"active":{"description":"Whether the branch is active.","type":"boolean"},"latitude":{"nullable":true,"anyOf":[{"description":"GPS latitude.","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"GPS longitude.","type":"number"},{"type":"null"}]},"branchContactId":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact representing the branch itself (technical mail / accounting target). Null to unlink.","type":"string"},{"type":"null"}]},"establishedDate":{"nullable":true,"anyOf":[{"description":"Legal incorporation / business-registry date (ISO timestamp). Null clears.","type":"string"},{"type":"null"}]},"openedDate":{"minLength":1,"description":"Date the branch started serving customers (ISO timestamp). Drives the financial roll-up bucket key. Cannot be null — every branch must have an opened date.","type":"string"},"branchType":{"description":"Branch kind. Cannot be null — defaults to \"own\" if never set.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"issueInvolvement":{"nullable":true,"anyOf":[{"description":"BIZKIT-124: `all` = every ticket of the branch, `flagged` = only tickets flagged \"branch must act\" (AI or operator), `manual` = only tickets an operator flagged. Null = organisation default.","anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"parentBranchSlug":{"nullable":true,"anyOf":[{"description":"Slug of the operational parent branch. Null detaches. Setting a slug that would create a cycle is rejected.","type":"string"},{"type":"null"}]},"operatingCompanyContactRef":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact representing the legal entity operating this branch. Null unlinks (admin then shows a missing-operator warning).","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug (used to identify the branch).","examples":["prague-central"],"type":"string"},"name":{"minLength":1,"description":"New branch display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"New description. Null to clear.","type":"string"},{"type":"null"}]},"internalCode":{"nullable":true,"anyOf":[{"description":"Internal code (unique per org). Null to clear.","type":"string"},{"type":"null"}]},"url":{"nullable":true,"anyOf":[{"description":"Public URL. Null to clear.","type":"string"},{"type":"null"}]},"active":{"description":"Whether the branch is active.","type":"boolean"},"latitude":{"nullable":true,"anyOf":[{"description":"GPS latitude.","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"GPS longitude.","type":"number"},{"type":"null"}]},"branchContactId":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact representing the branch itself (technical mail / accounting target). Null to unlink.","type":"string"},{"type":"null"}]},"establishedDate":{"nullable":true,"anyOf":[{"description":"Legal incorporation / business-registry date (ISO timestamp). Null clears.","type":"string"},{"type":"null"}]},"openedDate":{"minLength":1,"description":"Date the branch started serving customers (ISO timestamp). Drives the financial roll-up bucket key. Cannot be null — every branch must have an opened date.","type":"string"},"branchType":{"description":"Branch kind. Cannot be null — defaults to \"own\" if never set.","anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"issueInvolvement":{"nullable":true,"anyOf":[{"description":"BIZKIT-124: `all` = every ticket of the branch, `flagged` = only tickets flagged \"branch must act\" (AI or operator), `manual` = only tickets an operator flagged. Null = organisation default.","anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"parentBranchSlug":{"nullable":true,"anyOf":[{"description":"Slug of the operational parent branch. Null detaches. Setting a slug that would create a cycle is rejected.","type":"string"},{"type":"null"}]},"operatingCompanyContactRef":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact representing the legal entity operating this branch. Null unlinks (admin then shows a missing-operator warning).","type":"string"},{"type":"null"}]}}}}}}}},"/bff/branch/change-slug":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"type":"string"}},"required":["success","slug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"type":"string"}},"required":["success","slug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"slug":{"type":"string"}},"required":["success","slug"]}}}}},"operationId":"postBffBranchChange-slug","tags":["Branch"],"description":"Renames the slug of a branch. The new slug is sanitized and deduplicated so that it remains unique within the organisation.","summary":"Change branch slug","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["currentSlug","newSlug"],"properties":{"currentSlug":{"description":"Current branch slug.","type":"string"},"newSlug":{"minLength":1,"description":"Desired new slug (will be slugified/deduplicated).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["currentSlug","newSlug"],"properties":{"currentSlug":{"description":"Current branch slug.","type":"string"},"newSlug":{"minLength":1,"description":"Desired new slug (will be slugified/deduplicated).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["currentSlug","newSlug"],"properties":{"currentSlug":{"description":"Current branch slug.","type":"string"},"newSlug":{"minLength":1,"description":"Desired new slug (will be slugified/deduplicated).","type":"string"}}}}}}}},"/bff/branch/archive":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"archived":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","archived","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"archived":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","archived","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"archived":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","archived","changed"]}}}}},"operationId":"postBffBranchArchive","tags":["Branch"],"description":"Archived branches keep orders, accounting entries and calendars, but are hidden from the branch list (unless `includeArchived=true`), the branch pickers (`/tree`) and the public API. Calendars of the branch are not archived automatically.","summary":"Archive or restore a branch (BIZKIT-109)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","archived"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"archived":{"description":"`true` = archive, `false` = restore.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","archived"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"archived":{"description":"`true` = archive, `false` = restore.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["slug","archived"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"archived":{"description":"`true` = archive, `false` = restore.","type":"boolean"}}}}}}}},"/bff/branch/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchDelete","tags":["Branch"],"description":"Sets the branch to inactive. The branch and all its related data (address, opening hours, images) are kept; only the active flag is flipped to false.","summary":"Deactivate branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug to deactivate.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug to deactivate.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug to deactivate.","type":"string"}}}}}}}},"/bff/branch/save-address":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"addressId":{"type":"string"}},"required":["success","addressId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"addressId":{"type":"string"}},"required":["success","addressId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"addressId":{"type":"string"}},"required":["success","addressId"]}}}}},"operationId":"postBffBranchSave-address","tags":["Branch"],"description":"Creates or updates the address linked to a branch. If the branch already has an address, its fields are updated. Otherwise a new address record is created and linked. Returns the external address ID.","summary":"Save branch address","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code. Defaults to org default.","type":"string"},"notice":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code. Defaults to org default.","type":"string"},"notice":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"streetAddress":{"type":"string"},"city":{"type":"string"},"cityPart":{"type":"string"},"stateRegion":{"type":"string"},"postalCode":{"type":"string"},"country":{"description":"ISO 3166-1 alpha-2 country code. Defaults to org default.","type":"string"},"notice":{"type":"string"}}}}}}}},"/bff/branch/save-opening-hours":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchSave-opening-hours","tags":["Branch"],"description":"Replaces ALL existing regular opening hours for the branch in a single batch. Previous rows are soft-deleted (deleted_date set) and fresh rows are inserted. Exceptions are not affected.","summary":"Save regular opening hours","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","hours"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"hours":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday ... 6 = Sunday.","type":"number"},"definition":{"minLength":1,"description":"Time range definition (e.g. \"08:00-17:00\", or OSM-compatible string).","type":"string"},"description":{"type":"string"},"validFrom":{"nullable":true,"anyOf":[{"description":"ISO datetime the hours are valid from.","type":"string"},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"ISO datetime the hours are valid to.","type":"string"},{"type":"null"}]},"active":{"description":"Whether the hour record is active. Defaults to true.","type":"boolean"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","hours"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"hours":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday ... 6 = Sunday.","type":"number"},"definition":{"minLength":1,"description":"Time range definition (e.g. \"08:00-17:00\", or OSM-compatible string).","type":"string"},"description":{"type":"string"},"validFrom":{"nullable":true,"anyOf":[{"description":"ISO datetime the hours are valid from.","type":"string"},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"ISO datetime the hours are valid to.","type":"string"},{"type":"null"}]},"active":{"description":"Whether the hour record is active. Defaults to true.","type":"boolean"}}}}}}},"text/plain":{"schema":{"type":"object","required":["slug","hours"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"hours":{"type":"array","items":{"type":"object","required":["dayOfWeek","definition"],"properties":{"dayOfWeek":{"minimum":0,"maximum":6,"description":"0 = Monday ... 6 = Sunday.","type":"number"},"definition":{"minLength":1,"description":"Time range definition (e.g. \"08:00-17:00\", or OSM-compatible string).","type":"string"},"description":{"type":"string"},"validFrom":{"nullable":true,"anyOf":[{"description":"ISO datetime the hours are valid from.","type":"string"},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"ISO datetime the hours are valid to.","type":"string"},{"type":"null"}]},"active":{"description":"Whether the hour record is active. Defaults to true.","type":"boolean"}}}}}}}}}}},"/bff/branch/auto-parse-opening-hours":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"appliedRegularRows":{"type":"number"},"appliedExceptions":{"type":"number"}},"required":["success","appliedRegularRows","appliedExceptions"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"appliedRegularRows":{"type":"number"},"appliedExceptions":{"type":"number"}},"required":["success","appliedRegularRows","appliedExceptions"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"appliedRegularRows":{"type":"number"},"appliedExceptions":{"type":"number"}},"required":["success","appliedRegularRows","appliedExceptions"]}}}}},"operationId":"postBffBranchAuto-parse-opening-hours","tags":["Branch"],"description":"Sends the user prompt to the LLM, validates the structured output and applies it as a full replace of the regular hours plus an idempotent upsert of the exceptions. Returns the counts that were actually persisted (the model may drop or skip rows that fail server-side validation).","summary":"Auto-fill opening hours from a free-text description (AI)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","prompt"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"prompt":{"minLength":1,"maxLength":4000,"description":"Free-text description of the opening hours in any language and format. The AI will parse it into a structured weekly schedule plus optional date-specific exceptions.","examples":["Po–Pá 8:00–17:00, So 9–12, Ne zavřeno. Na vánoce (24.-26.12.) zavřeno."],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","prompt"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"prompt":{"minLength":1,"maxLength":4000,"description":"Free-text description of the opening hours in any language and format. The AI will parse it into a structured weekly schedule plus optional date-specific exceptions.","examples":["Po–Pá 8:00–17:00, So 9–12, Ne zavřeno. Na vánoce (24.-26.12.) zavřeno."],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","prompt"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"prompt":{"minLength":1,"maxLength":4000,"description":"Free-text description of the opening hours in any language and format. The AI will parse it into a structured weekly schedule plus optional date-specific exceptions.","examples":["Po–Pá 8:00–17:00, So 9–12, Ne zavřeno. Na vánoce (24.-26.12.) zavřeno."],"type":"string"}}}}}}}},"/bff/branch/add-opening-hour-exception":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchAdd-opening-hour-exception","tags":["Branch"],"description":"Creates a new opening hour exception for a specific date. Idempotent per (branch, date) pair.","summary":"Add opening hour exception","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","exceptionDate","isOpen"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"exceptionDate":{"description":"Exception date in ISO YYYY-MM-DD.","examples":["2026-12-24"],"type":"string"},"isOpen":{"description":"Whether the branch is open or closed on the exception date.","type":"boolean"},"reason":{"description":"Reason for the exception (e.g. \"Christmas Eve\").","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","exceptionDate","isOpen"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"exceptionDate":{"description":"Exception date in ISO YYYY-MM-DD.","examples":["2026-12-24"],"type":"string"},"isOpen":{"description":"Whether the branch is open or closed on the exception date.","type":"boolean"},"reason":{"description":"Reason for the exception (e.g. \"Christmas Eve\").","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","exceptionDate","isOpen"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"exceptionDate":{"description":"Exception date in ISO YYYY-MM-DD.","examples":["2026-12-24"],"type":"string"},"isOpen":{"description":"Whether the branch is open or closed on the exception date.","type":"boolean"},"reason":{"description":"Reason for the exception (e.g. \"Christmas Eve\").","type":"string"}}}}}}}},"/bff/branch/delete-opening-hour-exception":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchDelete-opening-hour-exception","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Remove opening hour exception","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","exceptionId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"exceptionId":{"description":"Opening hour exception ID (from detail response).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","exceptionId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"exceptionId":{"description":"Opening hour exception ID (from detail response).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","exceptionId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"exceptionId":{"description":"Opening hour exception ID (from detail response).","type":"string"}}}}}}}},"/bff/branch/add-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchAdd-email","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Add branch email","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","email"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"email":{"format":"email","description":"Email address to attach.","type":"string"},"role":{"description":"Role label (e.g. \"Reception\").","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","email"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"email":{"format":"email","description":"Email address to attach.","type":"string"},"role":{"description":"Role label (e.g. \"Reception\").","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","email"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"email":{"format":"email","description":"Email address to attach.","type":"string"},"role":{"description":"Role label (e.g. \"Reception\").","type":"string"}}}}}}}},"/bff/branch/delete-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchDelete-email","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Remove branch email","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","emailId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"emailId":{"description":"Email ID from detail response.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","emailId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"emailId":{"description":"Email ID from detail response.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","emailId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"emailId":{"description":"Email ID from detail response.","type":"string"}}}}}}}},"/bff/branch/add-phone":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchAdd-phone","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Add branch phone","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","phone"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"phone":{"minLength":1,"description":"Phone number.","type":"string"},"role":{"description":"Role label (e.g. \"Main\", \"Fax\").","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","phone"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"phone":{"minLength":1,"description":"Phone number.","type":"string"},"role":{"description":"Role label (e.g. \"Main\", \"Fax\").","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","phone"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"phone":{"minLength":1,"description":"Phone number.","type":"string"},"role":{"description":"Role label (e.g. \"Main\", \"Fax\").","type":"string"}}}}}}}},"/bff/branch/delete-phone":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchDelete-phone","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Remove branch phone","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","phoneId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"phoneId":{"description":"Phone ID from detail response.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","phoneId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"phoneId":{"description":"Phone ID from detail response.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","phoneId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"phoneId":{"description":"Phone ID from detail response.","type":"string"}}}}}}}},"/bff/branch/gallery-list":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["blob","title","position","active","deleted","isLogo","isMainPhoto"],"properties":{"id":{"description":"Blob token (used as image identifier).","type":"string"},"blob":{"description":"Blob metadata (filename, URL, size)."},"title":{"description":"Image description / alt text.","type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"deleted":{"type":"boolean"},"isLogo":{"type":"boolean"},"isMainPhoto":{"type":"boolean"}}}},"mainImageId":{"description":"Blob token of the main image, if set.","type":"string"},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["blob","title","position","active","deleted","isLogo","isMainPhoto"],"properties":{"id":{"description":"Blob token (used as image identifier).","type":"string"},"blob":{"description":"Blob metadata (filename, URL, size)."},"title":{"description":"Image description / alt text.","type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"deleted":{"type":"boolean"},"isLogo":{"type":"boolean"},"isMainPhoto":{"type":"boolean"}}}},"mainImageId":{"description":"Blob token of the main image, if set.","type":"string"},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["blob","title","position","active","deleted","isLogo","isMainPhoto"],"properties":{"id":{"description":"Blob token (used as image identifier).","type":"string"},"blob":{"description":"Blob metadata (filename, URL, size)."},"title":{"description":"Image description / alt text.","type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"deleted":{"type":"boolean"},"isLogo":{"type":"boolean"},"isMainPhoto":{"type":"boolean"}}}},"mainImageId":{"description":"Blob token of the main image, if set.","type":"string"},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffBranchGallery-list","tags":["Branch"],"description":"Returns all non-deleted images of the branch gallery ordered by active first, then by position ascending. Includes blob metadata and the main image identifier.","summary":"List branch gallery images"}},"/bff/branch/gallery-link-blob":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Blob token from file upload.","schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffBranchGallery-link-blob","tags":["Branch"],"description":"Links an uploaded blob to the branch gallery. If the branch has no main photo yet, the new image becomes the main photo.","summary":"Add image to branch gallery"}},"/bff/branch/gallery-image-mark-main":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Blob token of the image to promote to main.","schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffBranchGallery-image-mark-main","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Set main branch photo"}},"/bff/branch/gallery-image-delete":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Blob token of the image to delete.","schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffBranchGallery-image-delete","tags":["Branch"],"description":"Soft-deletes an image (deleted_date set). If the deleted image was the main photo, the next active image becomes main.","summary":"Delete gallery image"}},"/bff/branch/gallery-image-toggle-active":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Blob token of the image to toggle.","schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffBranchGallery-image-toggle-active","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Toggle gallery image active status"}},"/bff/branch/gallery-reorder":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchGallery-reorder","tags":["Branch"],"description":"Sets the display order of the branch gallery (drag & drop in admin). Positions are rewritten 1..n.","summary":"Reorder branch gallery","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","imageIds"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","imageIds"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["slug","imageIds"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}}}}}},"/bff/branch/gallery-image-update-meta":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Blob token of the image.","schema":{"type":"string"},"in":"query","name":"blobToken","required":true},{"description":"New description / alt text. Empty to clear.","schema":{"type":"string"},"in":"query","name":"title","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffBranchGallery-image-update-meta","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Update gallery image description"}},"/bff/branch/gallery-image-set-logo":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true},{"description":"Blob token of the image.","schema":{"type":"string"},"in":"query","name":"blobToken","required":true},{"description":"Set to \"true\" to mark as logo, otherwise \"false\".","examples":["true"],"schema":{"type":"string"},"in":"query","name":"value","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffBranchGallery-image-set-logo","tags":["Branch"],"description":"Sets the is_logo flag for the image. When value is true, the flag is cleared from other images in the same branch first.","summary":"Mark image as logo"}},"/bff/branch/attachable-calendars":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","code"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"colorHex":{"type":"string"},"attachedToBranchId":{"type":"string"},"attachedToBranchName":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","code"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"colorHex":{"type":"string"},"attachedToBranchId":{"type":"string"},"attachedToBranchName":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","code"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"colorHex":{"type":"string"},"attachedToBranchId":{"type":"string"},"attachedToBranchName":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffBranchAttachable-calendars","tags":["Branch"],"description":"Returns calendars currently free (not attached to any branch) plus calendars already attached to this branch. Calendars attached to a different branch are excluded.","summary":"List attachable calendars for a branch"}},"/bff/branch/attach-calendar":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchAttach-calendar","tags":["Branch"],"description":"Sets core__calendar.branch_id = branchId. The calendar must belong to the same organisation. A calendar can only be attached to one branch at a time.","summary":"Attach calendar to branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","calendarId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"calendarId":{"description":"Calendar ID to attach.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","calendarId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"calendarId":{"description":"Calendar ID to attach.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","calendarId"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"calendarId":{"description":"Calendar ID to attach.","type":"string"}}}}}}}},"/bff/branch/detach-calendar":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchDetach-calendar","tags":["Branch"],"description":"Clears core__calendar.branch_id. The calendar becomes organisation-wide again.","summary":"Detach calendar from any branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["calendarId"],"properties":{"calendarId":{"description":"Calendar ID to detach (clears branch_id).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["calendarId"],"properties":{"calendarId":{"description":"Calendar ID to detach (clears branch_id).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["calendarId"],"properties":{"calendarId":{"description":"Calendar ID to detach (clears branch_id).","type":"string"}}}}}}}},"/bff/branch/product-options":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","slug","active"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","slug","active"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","slug","active"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"active":{"type":"boolean"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffBranchProduct-options","tags":["Branch"],"description":"Lightweight list (id, code, slug, active) of all non-deleted products in the organisation. Used as the option list of the branch product multi-select.","summary":"List products available to attach to a branch"}},"/bff/branch/save-products":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"added":{"type":"number"},"removed":{"type":"number"},"total":{"type":"number"}},"required":["success","added","removed","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"added":{"type":"number"},"removed":{"type":"number"},"total":{"type":"number"}},"required":["success","added","removed","total"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"added":{"type":"number"},"removed":{"type":"number"},"total":{"type":"number"}},"required":["success","added","removed","total"]}}}}},"operationId":"postBffBranchSave-products","tags":["Branch"],"description":"Replaces the full set of products assigned to a branch (M:N via shop__branch_product). Uses a diff strategy — only the rows that actually need to be added or removed are touched. All product IDs are validated against the organisation; passing a foreign or deleted product is rejected.","summary":"Save branch product assortment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","productIds"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"productIds":{"description":"Full desired list of product IDs for the branch. The assortment is replaced, not appended.","type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","productIds"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"productIds":{"description":"Full desired list of product IDs for the branch. The assortment is replaced, not appended.","type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["slug","productIds"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"productIds":{"description":"Full desired list of product IDs for the branch. The assortment is replaced, not appended.","type":"array","items":{"type":"string"}}}}}}}}},"/bff/branch/seo":{"get":{"parameters":[{"description":"Branch slug.","schema":{"type":"string"},"in":"query","name":"slug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["locale","metaTitle","metaDescription"],"properties":{"locale":{"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["locale","metaTitle","metaDescription"],"properties":{"locale":{"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["locale","metaTitle","metaDescription"],"properties":{"locale":{"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getBffBranchSeo","tags":["Branch"],"description":"Returns one item per locale enabled on the organisation (in the organisation locale order) with the custom SEO title and meta description of the public branch page. `null` = not filled in, the website uses its automatic title / description.","summary":"Get per-locale SEO overrides of a branch"}},"/bff/branch/save-seo":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}}}}},"operationId":"postBffBranchSave-seo","tags":["Branch"],"description":"Upserts the custom SEO title and meta description of the public branch page per locale. Values are trimmed; an empty value clears the override so the website falls back to its automatic title / description. No fallback between locales. E-shop frontends read the result via `GET /api/v1/branch/detail?locale=…` → `seo`.","summary":"Save per-locale SEO overrides of a branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","items"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["locale"],"properties":{"locale":{"description":"Locale code enabled on the organisation.","examples":["cs"],"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","items"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["locale"],"properties":{"locale":{"description":"Locale code enabled on the organisation.","examples":["cs"],"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["slug","items"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["locale"],"properties":{"locale":{"description":"Locale code enabled on the organisation.","examples":["cs"],"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}}}}}}},"/bff/branch/set-branch-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchSet-branch-contact","tags":["Branch"],"description":"Links a single `shop__contact` to a branch as its technical-contact identity. Pass `null` or omit `contactId` to unlink. This is independent of `shop__branch_person` (which carries real people).","summary":"Set or clear the branch technical contact","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"contactId":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact to link, or null to unlink.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"contactId":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact to link, or null to unlink.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["slug"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"contactId":{"nullable":true,"anyOf":[{"description":"CuRefNo of the contact to link, or null to unlink.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/branch/add-branch-person":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffBranchAdd-branch-person","tags":["Branch"],"description":"Creates a new `shop__branch_person` row linking a contact to the branch in a given role. Idempotent on (branchId, contactId, role) — if the link already exists the customLabel and position are updated instead of failing with a constraint violation.","summary":"Add (or upsert) a person on a branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","contactId","role"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"contactId":{"description":"CuRefNo of the contact to link to the branch.","type":"string"},"role":{"description":"Role enum. Allowed: branch_contact, owner, manager, custodian, cleaner, technician, accountant, security, support, other.","examples":["manager","owner","custodian"],"type":"string"},"customLabel":{"nullable":true,"anyOf":[{"maxLength":200,"description":"Free-text label (≤ 200 chars) shown next to / instead of the role. Optional.","type":"string"},{"type":"null"}]},"position":{"description":"Sort position; lower = earlier. Default 0.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","contactId","role"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"contactId":{"description":"CuRefNo of the contact to link to the branch.","type":"string"},"role":{"description":"Role enum. Allowed: branch_contact, owner, manager, custodian, cleaner, technician, accountant, security, support, other.","examples":["manager","owner","custodian"],"type":"string"},"customLabel":{"nullable":true,"anyOf":[{"maxLength":200,"description":"Free-text label (≤ 200 chars) shown next to / instead of the role. Optional.","type":"string"},{"type":"null"}]},"position":{"description":"Sort position; lower = earlier. Default 0.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["slug","contactId","role"],"properties":{"slug":{"description":"Branch slug.","type":"string"},"contactId":{"description":"CuRefNo of the contact to link to the branch.","type":"string"},"role":{"description":"Role enum. Allowed: branch_contact, owner, manager, custodian, cleaner, technician, accountant, security, support, other.","examples":["manager","owner","custodian"],"type":"string"},"customLabel":{"nullable":true,"anyOf":[{"maxLength":200,"description":"Free-text label (≤ 200 chars) shown next to / instead of the role. Optional.","type":"string"},{"type":"null"}]},"position":{"description":"Sort position; lower = earlier. Default 0.","type":"number"}}}}}}}},"/bff/branch/update-branch-person":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchUpdate-branch-person","tags":["Branch"],"description":"Updates the role / custom label / position on an existing branch_person row. Verifies the row belongs to the caller’s organisation.","summary":"Update a branch_person row","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["personId"],"properties":{"personId":{"description":"Internal id of the branch_person row (from the detail response).","type":"string"},"role":{"description":"New role; one of: branch_contact, owner, manager, custodian, cleaner, technician, accountant, security, support, other.","type":"string"},"customLabel":{"nullable":true,"anyOf":[{"maxLength":200,"description":"New free-text label; null to clear.","type":"string"},{"type":"null"}]},"position":{"description":"New sort position.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["personId"],"properties":{"personId":{"description":"Internal id of the branch_person row (from the detail response).","type":"string"},"role":{"description":"New role; one of: branch_contact, owner, manager, custodian, cleaner, technician, accountant, security, support, other.","type":"string"},"customLabel":{"nullable":true,"anyOf":[{"maxLength":200,"description":"New free-text label; null to clear.","type":"string"},{"type":"null"}]},"position":{"description":"New sort position.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["personId"],"properties":{"personId":{"description":"Internal id of the branch_person row (from the detail response).","type":"string"},"role":{"description":"New role; one of: branch_contact, owner, manager, custodian, cleaner, technician, accountant, security, support, other.","type":"string"},"customLabel":{"nullable":true,"anyOf":[{"maxLength":200,"description":"New free-text label; null to clear.","type":"string"},{"type":"null"}]},"position":{"description":"New sort position.","type":"number"}}}}}}}},"/bff/branch/remove-branch-person":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchRemove-branch-person","tags":["Branch"],"description":"Deletes a single branch_person row owned by the caller’s organisation.","summary":"Remove a branch_person row","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["personId"],"properties":{"personId":{"description":"Internal id of the branch_person row (from the detail response).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["personId"],"properties":{"personId":{"description":"Internal id of the branch_person row (from the detail response).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["personId"],"properties":{"personId":{"description":"Internal id of the branch_person row (from the detail response).","type":"string"}}}}}}}},"/bff/branch/tree":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["slug","name","parentSlug","branchType","active","childCount"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"parentSlug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"active":{"type":"boolean"},"childCount":{"type":"number"},"operatingCompany":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["slug","name","parentSlug","branchType","active","childCount"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"parentSlug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"active":{"type":"boolean"},"childCount":{"type":"number"},"operatingCompany":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["slug","name","parentSlug","branchType","active","childCount"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"parentSlug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"active":{"type":"boolean"},"childCount":{"type":"number"},"operatingCompany":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"}}}}}}},"required":["items"]}}}}},"operationId":"getBffBranchTree","tags":["Branch"],"description":"Flat list of all branches in the authenticated organisation with parent-slug, branch type, operating-company summary and direct-child count. The admin assembles the tree client-side so it can drive expand/collapse state without round-trips.","summary":"Branch operational tree"}},"/bff/branch/holding-tree":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"companies":{"type":"array","items":{"type":"object","required":["contactId","name","branchCount"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"},"branchCount":{"type":"number"}}}},"links":{"type":"array","items":{"type":"object","required":["id","parentContactId","childContactId","relationType"],"properties":{"id":{"type":"string"},"parentContactId":{"type":"string"},"childContactId":{"type":"string"},"relationType":{"anyOf":[{"const":"subsidiary","type":"string"},{"const":"franchisee","type":"string"},{"const":"sister","type":"string"},{"const":"joint_venture","type":"string"},{"const":"silent_partner","type":"string"}]},"ownershipPercent":{"type":"number"},"validFrom":{"type":"string"},"validTo":{"type":"string"},"notes":{"type":"string"}}}},"branchesByCompany":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["slug","name","branchType","active"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"active":{"type":"boolean"}}}}}}},"required":["companies","links","branchesByCompany"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"companies":{"type":"array","items":{"type":"object","required":["contactId","name","branchCount"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"},"branchCount":{"type":"number"}}}},"links":{"type":"array","items":{"type":"object","required":["id","parentContactId","childContactId","relationType"],"properties":{"id":{"type":"string"},"parentContactId":{"type":"string"},"childContactId":{"type":"string"},"relationType":{"anyOf":[{"const":"subsidiary","type":"string"},{"const":"franchisee","type":"string"},{"const":"sister","type":"string"},{"const":"joint_venture","type":"string"},{"const":"silent_partner","type":"string"}]},"ownershipPercent":{"type":"number"},"validFrom":{"type":"string"},"validTo":{"type":"string"},"notes":{"type":"string"}}}},"branchesByCompany":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["slug","name","branchType","active"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"active":{"type":"boolean"}}}}}}},"required":["companies","links","branchesByCompany"]}},"text/plain":{"schema":{"type":"object","properties":{"companies":{"type":"array","items":{"type":"object","required":["contactId","name","branchCount"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"},"branchCount":{"type":"number"}}}},"links":{"type":"array","items":{"type":"object","required":["id","parentContactId","childContactId","relationType"],"properties":{"id":{"type":"string"},"parentContactId":{"type":"string"},"childContactId":{"type":"string"},"relationType":{"anyOf":[{"const":"subsidiary","type":"string"},{"const":"franchisee","type":"string"},{"const":"sister","type":"string"},{"const":"joint_venture","type":"string"},{"const":"silent_partner","type":"string"}]},"ownershipPercent":{"type":"number"},"validFrom":{"type":"string"},"validTo":{"type":"string"},"notes":{"type":"string"}}}},"branchesByCompany":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["slug","name","branchType","active"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"branchType":{"anyOf":[{"const":"own","type":"string"},{"const":"franchise","type":"string"},{"const":"partner","type":"string"}]},"active":{"type":"boolean"}}}}}}},"required":["companies","links","branchesByCompany"]}}}}},"operationId":"getBffBranchHolding-tree","tags":["Branch"],"description":"Per-organisation DAG of company-to-company relationships plus the branches each company operates. Returned as flat lists (`companies`, `links`, `branchesByCompany`) so the admin renderer can walk the DAG safely (deduping nodes when the same company appears under multiple parents).","summary":"Holding (legal-entity) tree"}},"/bff/branch/operating-company-options":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["contactId","name"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["contactId","name"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["contactId","name"],"properties":{"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffBranchOperating-company-options","tags":["Branch"],"description":"Returns every contact in the organisation that already has an IČO — i.e. legal entities eligible to be picked as a branch operator. Capped at 500 rows.","summary":"List candidate operating companies"}},"/bff/branch/resolve-operating-company-by-ico":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"},"created":{"description":"True if a fresh contact was created in this call.","type":"boolean"}},"required":["success","contactId","name","created"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"},"created":{"description":"True if a fresh contact was created in this call.","type":"boolean"}},"required":["success","contactId","name","created"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"contactId":{"type":"string"},"name":{"type":"string"},"companyRegistrationNumber":{"type":"string"},"taxIdentificationNumber":{"type":"string"},"created":{"description":"True if a fresh contact was created in this call.","type":"boolean"}},"required":["success","contactId","name","created"]}}}}},"operationId":"postBffBranchResolve-operating-company-by-ico","tags":["Branch"],"description":"Returns an existing contact with this IČO in the org, or creates a new contact and runs the ARES sync to fill in name / DIČ / VAT status. The returned `contactId` (CuRefNo) is the value to pass as `operatingCompanyContactRef` in `/update`.","summary":"Resolve operating company by IČO","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["companyRegistrationNumber"],"properties":{"companyRegistrationNumber":{"minLength":1,"description":"IČO of the legal entity. Will be parsed/normalized server-side.","examples":["27082440"],"type":"string"},"countryCode":{"description":"ISO 3166-1 alpha-2 country code. Defaults to CZ.","examples":["CZ"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["companyRegistrationNumber"],"properties":{"companyRegistrationNumber":{"minLength":1,"description":"IČO of the legal entity. Will be parsed/normalized server-side.","examples":["27082440"],"type":"string"},"countryCode":{"description":"ISO 3166-1 alpha-2 country code. Defaults to CZ.","examples":["CZ"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["companyRegistrationNumber"],"properties":{"companyRegistrationNumber":{"minLength":1,"description":"IČO of the legal entity. Will be parsed/normalized server-side.","examples":["27082440"],"type":"string"},"countryCode":{"description":"ISO 3166-1 alpha-2 country code. Defaults to CZ.","examples":["CZ"],"type":"string"}}}}}}}},"/bff/branch/holding/link":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffBranchHoldingLink","tags":["Branch"],"description":"Creates a typed relationship between two company contacts. Duplicates per (org, parent, child, relationType) are rejected by a unique index. Self-loops are forbidden at the DB level.","summary":"Create a holding link","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["parentContactRef","childContactRef","relationType"],"properties":{"parentContactRef":{"description":"CuRefNo of the parent (owning) company contact.","type":"string"},"childContactRef":{"description":"CuRefNo of the child (owned) company contact.","type":"string"},"relationType":{"description":"Kind of relationship.","anyOf":[{"const":"subsidiary","type":"string"},{"const":"franchisee","type":"string"},{"const":"sister","type":"string"},{"const":"joint_venture","type":"string"},{"const":"silent_partner","type":"string"}]},"ownershipPercent":{"nullable":true,"anyOf":[{"minimum":0,"maximum":100,"description":"Ownership percent (0–100).","type":"number"},{"type":"null"}]},"validFrom":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD.","type":"string"},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD.","type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["parentContactRef","childContactRef","relationType"],"properties":{"parentContactRef":{"description":"CuRefNo of the parent (owning) company contact.","type":"string"},"childContactRef":{"description":"CuRefNo of the child (owned) company contact.","type":"string"},"relationType":{"description":"Kind of relationship.","anyOf":[{"const":"subsidiary","type":"string"},{"const":"franchisee","type":"string"},{"const":"sister","type":"string"},{"const":"joint_venture","type":"string"},{"const":"silent_partner","type":"string"}]},"ownershipPercent":{"nullable":true,"anyOf":[{"minimum":0,"maximum":100,"description":"Ownership percent (0–100).","type":"number"},{"type":"null"}]},"validFrom":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD.","type":"string"},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD.","type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["parentContactRef","childContactRef","relationType"],"properties":{"parentContactRef":{"description":"CuRefNo of the parent (owning) company contact.","type":"string"},"childContactRef":{"description":"CuRefNo of the child (owned) company contact.","type":"string"},"relationType":{"description":"Kind of relationship.","anyOf":[{"const":"subsidiary","type":"string"},{"const":"franchisee","type":"string"},{"const":"sister","type":"string"},{"const":"joint_venture","type":"string"},{"const":"silent_partner","type":"string"}]},"ownershipPercent":{"nullable":true,"anyOf":[{"minimum":0,"maximum":100,"description":"Ownership percent (0–100).","type":"number"},{"type":"null"}]},"validFrom":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD.","type":"string"},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD.","type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/branch/holding/unlink":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"type":"boolean"}},"required":["success","deleted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"type":"boolean"}},"required":["success","deleted"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"type":"boolean"}},"required":["success","deleted"]}}}}},"operationId":"postBffBranchHoldingUnlink","tags":["Branch"],"description":"Hard-deletes the holding-link row. Always scoped by organisation. Idempotent — deleting a missing row returns `{ deleted: false }` rather than throwing.","summary":"Delete a holding link","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["linkId"],"properties":{"linkId":{"description":"Internal id of the holding-link row (from /holding-tree).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["linkId"],"properties":{"linkId":{"description":"Internal id of the holding-link row (from /holding-tree).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["linkId"],"properties":{"linkId":{"description":"Internal id of the holding-link row (from /holding-tree).","type":"string"}}}}}}}},"/bff/branch/attachable-locks":{"get":{"parameters":[{"description":"Branch slug — locks already attached to this branch are flagged.","schema":{"type":"string"},"in":"query","name":"slug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","active","attached"],"properties":{"lockId":{"type":"number"},"alias":{"type":"string"},"electricQuantity":{"type":"number"},"hasGateway":{"type":"boolean"},"active":{"type":"boolean"},"attached":{"description":"True if already attached to this branch.","type":"boolean"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","active","attached"],"properties":{"lockId":{"type":"number"},"alias":{"type":"string"},"electricQuantity":{"type":"number"},"hasGateway":{"type":"boolean"},"active":{"type":"boolean"},"attached":{"description":"True if already attached to this branch.","type":"boolean"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","active","attached"],"properties":{"lockId":{"type":"number"},"alias":{"type":"string"},"electricQuantity":{"type":"number"},"hasGateway":{"type":"boolean"},"active":{"type":"boolean"},"attached":{"description":"True if already attached to this branch.","type":"boolean"}}}}},"required":["items"]}}}}},"operationId":"getBffBranchAttachable-locks","tags":["Branch"],"description":"Returns every lock in the organisation that is either unattached or already attached to THIS branch. Locks linked to a different branch are filtered out — the operator must detach them first.","summary":"List locks available to attach"}},"/bff/branch/attach-lock":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"lockId":{"type":"number"},"branchId":{"type":"number"},"branchSlug":{"type":"string"}},"required":["success","lockId","branchId","branchSlug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"lockId":{"type":"number"},"branchId":{"type":"number"},"branchSlug":{"type":"string"}},"required":["success","lockId","branchId","branchSlug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"lockId":{"type":"number"},"branchId":{"type":"number"},"branchSlug":{"type":"string"}},"required":["success","lockId","branchId","branchSlug"]}}}}},"operationId":"postBffBranchAttach-lock","tags":["Branch"],"description":"Sets iot__ttlock_lock.branch_id to the branch identified by `slug`. Overwrites any previous branch assignment on the lock — locks have at-most-one branch. The branch then becomes the operational technical contact for the lock.","summary":"Attach a lock to a branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","lockId"],"properties":{"slug":{"description":"Branch slug to attach the lock to.","type":"string"},"lockId":{"description":"External TTLock identifier (matches the lock detail URL).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","lockId"],"properties":{"slug":{"description":"Branch slug to attach the lock to.","type":"string"},"lockId":{"description":"External TTLock identifier (matches the lock detail URL).","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["slug","lockId"],"properties":{"slug":{"description":"Branch slug to attach the lock to.","type":"string"},"lockId":{"description":"External TTLock identifier (matches the lock detail URL).","type":"number"}}}}}}}},"/bff/branch/order-items-summary":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-plzen"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"Restrict the summary to a single calendar month, expressed as `YYYY-MM`. Uses the same revenue-date predicate as /order-items, so the headline turnover matches the filtered grid below. Malformed values are silently ignored.","examples":["2026-03"],"schema":{"type":"string"},"in":"query","name":"filterMonth","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"totalPriceMoney":{"type":"number"},"totalCreditAmount":{"type":"number"},"itemCount":{"type":"number"},"otherSubjectItemCount":{"description":"Rows attributed to this branch by `branch_id` but invoiced by a different legal entity (BIZKIT-57). Not included in `itemCount` / `totalPriceMoney`; reported here so the admin can render an informational \"Prodej jiných subjektů na pobočce\" line without inflating the branch turnover.","type":"number"},"otherSubjectTotalPriceMoney":{"description":"Turnover from rows invoiced by a different legal entity. Not included in `totalPriceMoney`; purely informational.","type":"number"},"franchiseFeePercentage":{"description":"Franchise fee skimmed off turnover, in percent. Omitted when not configured.","type":"number"},"franchiseFeeAmount":{"description":"totalPriceMoney × franchiseFeePercentage ÷ 100, rounded. Omitted when not configured.","type":"number"},"franchiseFeeRemainder":{"description":"totalPriceMoney − franchiseFeeAmount. Omitted when not configured.","type":"number"}},"required":["branchId","branchSlug","branchName","currency","totalPriceMoney","totalCreditAmount","itemCount","otherSubjectItemCount","otherSubjectTotalPriceMoney"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"totalPriceMoney":{"type":"number"},"totalCreditAmount":{"type":"number"},"itemCount":{"type":"number"},"otherSubjectItemCount":{"description":"Rows attributed to this branch by `branch_id` but invoiced by a different legal entity (BIZKIT-57). Not included in `itemCount` / `totalPriceMoney`; reported here so the admin can render an informational \"Prodej jiných subjektů na pobočce\" line without inflating the branch turnover.","type":"number"},"otherSubjectTotalPriceMoney":{"description":"Turnover from rows invoiced by a different legal entity. Not included in `totalPriceMoney`; purely informational.","type":"number"},"franchiseFeePercentage":{"description":"Franchise fee skimmed off turnover, in percent. Omitted when not configured.","type":"number"},"franchiseFeeAmount":{"description":"totalPriceMoney × franchiseFeePercentage ÷ 100, rounded. Omitted when not configured.","type":"number"},"franchiseFeeRemainder":{"description":"totalPriceMoney − franchiseFeeAmount. Omitted when not configured.","type":"number"}},"required":["branchId","branchSlug","branchName","currency","totalPriceMoney","totalCreditAmount","itemCount","otherSubjectItemCount","otherSubjectTotalPriceMoney"]}},"text/plain":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"totalPriceMoney":{"type":"number"},"totalCreditAmount":{"type":"number"},"itemCount":{"type":"number"},"otherSubjectItemCount":{"description":"Rows attributed to this branch by `branch_id` but invoiced by a different legal entity (BIZKIT-57). Not included in `itemCount` / `totalPriceMoney`; reported here so the admin can render an informational \"Prodej jiných subjektů na pobočce\" line without inflating the branch turnover.","type":"number"},"otherSubjectTotalPriceMoney":{"description":"Turnover from rows invoiced by a different legal entity. Not included in `totalPriceMoney`; purely informational.","type":"number"},"franchiseFeePercentage":{"description":"Franchise fee skimmed off turnover, in percent. Omitted when not configured.","type":"number"},"franchiseFeeAmount":{"description":"totalPriceMoney × franchiseFeePercentage ÷ 100, rounded. Omitted when not configured.","type":"number"},"franchiseFeeRemainder":{"description":"totalPriceMoney − franchiseFeeAmount. Omitted when not configured.","type":"number"}},"required":["branchId","branchSlug","branchName","currency","totalPriceMoney","totalCreditAmount","itemCount","otherSubjectItemCount","otherSubjectTotalPriceMoney"]}}}}},"operationId":"getBffBranchOrder-items-summary","tags":["Branch"],"description":"Returns the headline numbers (total turnover, total credit balance, total item count, currency, branch name) over `shop__order_item` rows invoiced by the branch own operating company. Rows attributed to the branch by branch_id but invoiced by a different legal entity (BIZKIT-57 \"other subject\" case — lednice / fridge sales) are reported as `otherSubjectItemCount` + `otherSubjectTotalPriceMoney` so the admin can surface them as an informational line WITHOUT inflating the branch turnover. Independent of pagination — drives the header above the paginated `/order-items` grid. Franchise economics use the rate effective on the LAST day of the filtered month (or today when no month filter is set), looked up from `shop__branch_franchise_fee`; when no rule covers that day the fee fields are omitted so the admin hides the franchise row.","summary":"Headline aggregates for the branch order-item ledger"}},"/bff/branch/monthly-breakdown":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-vinohrady"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"How many calendar months to return (default 24, clamped to [1, 60]). The window always ends with the current month.","examples":["12","24","36"],"schema":{"type":"string"},"in":"query","name":"monthCount","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"franchiseFeePercentage":{"description":"Branch franchise fee in percent. Omitted when not configured.","type":"number"},"monthCount":{"description":"Effective number of returned months (post-clamp).","type":"number"},"months":{"type":"array","items":{"type":"object","required":["month","revenue","cashInAmount","creditAmount","writeoff","writeoffPaidByBranch","writeoffSettlementCarryForward","writeoffSettlementCarryForwardSourceMonth","franchiseFeePercentage","franchiseFeeAmount","gatewayFeeAmount","costAmount","costAmountAgainstFranchisor","variableCost","net"],"properties":{"month":{"description":"Month identifier in \"YYYY-MM\" format.","type":"string"},"revenue":{"description":"Gross revenue (storno excluded).","type":"number"},"cashInAmount":{"description":"Real money actually received in this calendar month: successful gateway transactions (status PAID/COMPLETE) + auto-matched Fio bank wires + manually-recorded bank transfers, all paired to orders that have at least one item attributed to the branch. Dated by the day the money moved, NOT by the order's revenue date — cash-flow figure, not turnover. Cross-branch orders are pro-rated by each branch's share of the order's revenue, so summing this column across branches reproduces the gateway/bank totals (no double-counting). Cash receipts, manual_mark write-offs and credit/voucher redemptions are excluded; multiple gateway attempts collapse naturally (only PAID/COMPLETE rows contribute); manual price edits on the order do NOT change payment-row `price`, so this figure is free of operator distortion.","type":"number"},"creditAmount":{"description":"Net credit balance moved in the month.","type":"number"},"writeoff":{"description":"Sum of write-offs effective in the month.","type":"number"},"writeoffPaidByBranch":{"description":"Subset of `writeoff` whose PAYER (plátce) is the branch's own operating company (`shop__branch.operating_company_contact_id`). Since 2026-09 feeds the settlement / vyrovnání alongside `writeoffSettlementCarryForward` — rule: \"co platí franšízant vstupuje do vyrovnání, bez ohledu na příjemce\". Corrections funded by the org or by a third party (or with an unset payer) remain visible under `writeoff` for record-keeping but do NOT contribute to the branch↔org settlement price (they are settled outside the branch's responsibility). 0 when the branch has no operating-company contact configured — org-owned outlets fall here.","type":"number"},"writeoffSettlementCarryForward":{"description":"Automatic \"Vyrovnání z účetního období\" carry-forward writeoff booked on the 1st day of this month by issueBranchSettlementOrder when the previous period ended with \"org owes branch\". Payer is the organisation (not the branch), so it does NOT match `writeoffPaidByBranch`, but it still enters the current month's vyrovnání — otherwise the amount the org promised to carry forward disappears from the next report (BIZKIT-52). Identified by (source='writeoff' AND source_ref LIKE 'settlement-%'). Deleted / rejected rows are excluded.","type":"number"},"writeoffSettlementCarryForwardSourceMonth":{"description":"YYYY-MM of the source period that produced the carry-forward above (parsed back from source_ref). Null when `writeoffSettlementCarryForward` is 0. Semicolon-joined list when multiple source months contribute to the same bucket.","anyOf":[{"type":"string"},{"type":"null"}]},"franchiseFeePercentage":{"description":"Franchise-fee rate that fired in this month, picked from `shop__branch_franchise_fee` by the rule whose [fromDate, toDate] window covers the month's last day. 0 when no rule covers it. Equals the top-level `franchiseFeePercentage` for months in which the current rule has been in force; differs for older months whose rule has since been superseded — the whole point of the history table.","type":"number"},"franchiseFeeAmount":{"description":"revenue × franchiseFeePercentage ÷ 100 (rounded). Computed with the per-MONTH rate, not the live rate — a mid-year rate change is attributed to the months that actually experienced each rate.","type":"number"},"franchiseFeeNote":{"description":"Free-form description attached to the franchise-fee rule that fired for this month (services, agreement scope). Rendered into the finance-report PDF. null when no rule covers the month or the rule has no note.","anyOf":[{"type":"string"},{"type":"null"}]},"gatewayFeeAmount":{"description":"Money the payment gateway pocketed as commission on the gateway-routed slice of this month's cash-in. Only the gateway leg of `cashInAmount` is fee-bearing (bank wires and auto-matched Fio transfers contribute zero). The rate applied to each transaction is the commission period (configured on the gateway detail) whose [fromDate, toDate] window covers the payment date; latest fromDate wins when overlaps exist. Pro-rated across branches the same way as `cashInAmount`. Subtracted in `net`. Zero when no commission period is configured.","type":"number"},"costAmount":{"description":"Sum of recurring FIXED branch costs (rent, energy, …) that apply to this month, computed from `shop__branch_cost` + variable monthly entries. Displayed as \"Fixní náklady\" in the Finance grid.","type":"number"},"costAmountAgainstFranchisor":{"description":"Subset of `costAmount` whose supplier (`shop__branch_cost.contact_id`) matches the parent branch's branchContact (or the org internal contact for top-level branches). Flows into the settlement — the rest is paid to unrelated third parties (energy, cleaning, …) and settled outside this report.","type":"number"},"variableCost":{"description":"Variable cost — sum of `shop__order_item.cost × count` (snapshotted internal cost per unit at item-create time, FX-converted to the order currency) for every non-storno item attributed to this branch whose revenue date falls in the month. Positive magnitude; subtracted from `net` and displayed as a signed negative number in the Finance grid + PDF report (\"Variabilní náklady\" column).","type":"number"},"net":{"description":"revenue − franchiseFeeAmount + writeoff − costAmount − gatewayFeeAmount − variableCost (what the branch keeps).","type":"number"},"invoice":{"description":"Most recent settlement order for this month, including storno rows so the Finance grid can render \"storno\" as a distinct icon state. Omitted only when no order has ever been issued.","type":"object","required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"],"properties":{"orderId":{"description":"Internal shop__order.id.","type":"number"},"orderHash":{"description":"Hash used by the admin order detail URL (/order/{orderHash}).","type":"string"},"orderNumber":{"description":"Human-facing order number from the order group sequence.","type":"string"},"direction":{"description":"`org-to-branch` (default since 2026-07-03) = organisation invoices the branch. `branch-to-org` is kept for legacy orders issued before the direction was unified — never produced by new issue calls.","anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"description":"ISO timestamp when the settlement order was marked as paid (shop__order.order_pay_date). null while the order is still awaiting payment. Deferred statements (org owes branch, 0-Kč order + writeoff) stay null forever — the debt is cleared by an actual bank transfer that lands as `cashIn` in the settlement formula.","anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"description":"ISO date the order becomes overdue (`shop__order.due_date`). Drives the Finance-grid month icon: past-due unpaid orders render red, still-open unpaid ones render amber. null on legacy rows created before the field was set explicitly — treated as \"no overdue signal\".","anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"description":"True when the order is currently in a storno-typed status. Rendered as its own state in the Finance grid so the operator sees \"storno\" instead of \"no order\" when a settlement invoice is voided.","type":"boolean"}}}}}},"totals":{"type":"object","required":["revenue","cashInAmount","creditAmount","writeoff","writeoffPaidByBranch","writeoffSettlementCarryForward","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","monthlyAverageRevenue","monthlyMedianRevenue","monthlyAverageNet","monthlyMedianNet","bestMonth","worstMonth"],"properties":{"revenue":{"type":"number"},"cashInAmount":{"description":"Sum of `cashInAmount` over the window.","type":"number"},"creditAmount":{"type":"number"},"writeoff":{"type":"number"},"writeoffPaidByBranch":{"description":"Sum of `writeoffPaidByBranch` over the window.","type":"number"},"writeoffSettlementCarryForward":{"description":"Sum of `writeoffSettlementCarryForward` over the window.","type":"number"},"franchiseFeeAmount":{"type":"number"},"gatewayFeeAmount":{"type":"number"},"costAmount":{"type":"number"},"variableCost":{"description":"Sum of `variableCost` (internal item cost) over the window.","type":"number"},"net":{"type":"number"},"monthlyAverageRevenue":{"type":"number"},"monthlyMedianRevenue":{"type":"number"},"monthlyAverageNet":{"type":"number"},"monthlyMedianNet":{"type":"number"},"bestMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]},"worstMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]}}}},"required":["branchId","branchSlug","branchName","currency","monthCount","months","totals"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"franchiseFeePercentage":{"description":"Branch franchise fee in percent. Omitted when not configured.","type":"number"},"monthCount":{"description":"Effective number of returned months (post-clamp).","type":"number"},"months":{"type":"array","items":{"type":"object","required":["month","revenue","cashInAmount","creditAmount","writeoff","writeoffPaidByBranch","writeoffSettlementCarryForward","writeoffSettlementCarryForwardSourceMonth","franchiseFeePercentage","franchiseFeeAmount","gatewayFeeAmount","costAmount","costAmountAgainstFranchisor","variableCost","net"],"properties":{"month":{"description":"Month identifier in \"YYYY-MM\" format.","type":"string"},"revenue":{"description":"Gross revenue (storno excluded).","type":"number"},"cashInAmount":{"description":"Real money actually received in this calendar month: successful gateway transactions (status PAID/COMPLETE) + auto-matched Fio bank wires + manually-recorded bank transfers, all paired to orders that have at least one item attributed to the branch. Dated by the day the money moved, NOT by the order's revenue date — cash-flow figure, not turnover. Cross-branch orders are pro-rated by each branch's share of the order's revenue, so summing this column across branches reproduces the gateway/bank totals (no double-counting). Cash receipts, manual_mark write-offs and credit/voucher redemptions are excluded; multiple gateway attempts collapse naturally (only PAID/COMPLETE rows contribute); manual price edits on the order do NOT change payment-row `price`, so this figure is free of operator distortion.","type":"number"},"creditAmount":{"description":"Net credit balance moved in the month.","type":"number"},"writeoff":{"description":"Sum of write-offs effective in the month.","type":"number"},"writeoffPaidByBranch":{"description":"Subset of `writeoff` whose PAYER (plátce) is the branch's own operating company (`shop__branch.operating_company_contact_id`). Since 2026-09 feeds the settlement / vyrovnání alongside `writeoffSettlementCarryForward` — rule: \"co platí franšízant vstupuje do vyrovnání, bez ohledu na příjemce\". Corrections funded by the org or by a third party (or with an unset payer) remain visible under `writeoff` for record-keeping but do NOT contribute to the branch↔org settlement price (they are settled outside the branch's responsibility). 0 when the branch has no operating-company contact configured — org-owned outlets fall here.","type":"number"},"writeoffSettlementCarryForward":{"description":"Automatic \"Vyrovnání z účetního období\" carry-forward writeoff booked on the 1st day of this month by issueBranchSettlementOrder when the previous period ended with \"org owes branch\". Payer is the organisation (not the branch), so it does NOT match `writeoffPaidByBranch`, but it still enters the current month's vyrovnání — otherwise the amount the org promised to carry forward disappears from the next report (BIZKIT-52). Identified by (source='writeoff' AND source_ref LIKE 'settlement-%'). Deleted / rejected rows are excluded.","type":"number"},"writeoffSettlementCarryForwardSourceMonth":{"description":"YYYY-MM of the source period that produced the carry-forward above (parsed back from source_ref). Null when `writeoffSettlementCarryForward` is 0. Semicolon-joined list when multiple source months contribute to the same bucket.","anyOf":[{"type":"string"},{"type":"null"}]},"franchiseFeePercentage":{"description":"Franchise-fee rate that fired in this month, picked from `shop__branch_franchise_fee` by the rule whose [fromDate, toDate] window covers the month's last day. 0 when no rule covers it. Equals the top-level `franchiseFeePercentage` for months in which the current rule has been in force; differs for older months whose rule has since been superseded — the whole point of the history table.","type":"number"},"franchiseFeeAmount":{"description":"revenue × franchiseFeePercentage ÷ 100 (rounded). Computed with the per-MONTH rate, not the live rate — a mid-year rate change is attributed to the months that actually experienced each rate.","type":"number"},"franchiseFeeNote":{"description":"Free-form description attached to the franchise-fee rule that fired for this month (services, agreement scope). Rendered into the finance-report PDF. null when no rule covers the month or the rule has no note.","anyOf":[{"type":"string"},{"type":"null"}]},"gatewayFeeAmount":{"description":"Money the payment gateway pocketed as commission on the gateway-routed slice of this month's cash-in. Only the gateway leg of `cashInAmount` is fee-bearing (bank wires and auto-matched Fio transfers contribute zero). The rate applied to each transaction is the commission period (configured on the gateway detail) whose [fromDate, toDate] window covers the payment date; latest fromDate wins when overlaps exist. Pro-rated across branches the same way as `cashInAmount`. Subtracted in `net`. Zero when no commission period is configured.","type":"number"},"costAmount":{"description":"Sum of recurring FIXED branch costs (rent, energy, …) that apply to this month, computed from `shop__branch_cost` + variable monthly entries. Displayed as \"Fixní náklady\" in the Finance grid.","type":"number"},"costAmountAgainstFranchisor":{"description":"Subset of `costAmount` whose supplier (`shop__branch_cost.contact_id`) matches the parent branch's branchContact (or the org internal contact for top-level branches). Flows into the settlement — the rest is paid to unrelated third parties (energy, cleaning, …) and settled outside this report.","type":"number"},"variableCost":{"description":"Variable cost — sum of `shop__order_item.cost × count` (snapshotted internal cost per unit at item-create time, FX-converted to the order currency) for every non-storno item attributed to this branch whose revenue date falls in the month. Positive magnitude; subtracted from `net` and displayed as a signed negative number in the Finance grid + PDF report (\"Variabilní náklady\" column).","type":"number"},"net":{"description":"revenue − franchiseFeeAmount + writeoff − costAmount − gatewayFeeAmount − variableCost (what the branch keeps).","type":"number"},"invoice":{"description":"Most recent settlement order for this month, including storno rows so the Finance grid can render \"storno\" as a distinct icon state. Omitted only when no order has ever been issued.","type":"object","required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"],"properties":{"orderId":{"description":"Internal shop__order.id.","type":"number"},"orderHash":{"description":"Hash used by the admin order detail URL (/order/{orderHash}).","type":"string"},"orderNumber":{"description":"Human-facing order number from the order group sequence.","type":"string"},"direction":{"description":"`org-to-branch` (default since 2026-07-03) = organisation invoices the branch. `branch-to-org` is kept for legacy orders issued before the direction was unified — never produced by new issue calls.","anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"description":"ISO timestamp when the settlement order was marked as paid (shop__order.order_pay_date). null while the order is still awaiting payment. Deferred statements (org owes branch, 0-Kč order + writeoff) stay null forever — the debt is cleared by an actual bank transfer that lands as `cashIn` in the settlement formula.","anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"description":"ISO date the order becomes overdue (`shop__order.due_date`). Drives the Finance-grid month icon: past-due unpaid orders render red, still-open unpaid ones render amber. null on legacy rows created before the field was set explicitly — treated as \"no overdue signal\".","anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"description":"True when the order is currently in a storno-typed status. Rendered as its own state in the Finance grid so the operator sees \"storno\" instead of \"no order\" when a settlement invoice is voided.","type":"boolean"}}}}}},"totals":{"type":"object","required":["revenue","cashInAmount","creditAmount","writeoff","writeoffPaidByBranch","writeoffSettlementCarryForward","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","monthlyAverageRevenue","monthlyMedianRevenue","monthlyAverageNet","monthlyMedianNet","bestMonth","worstMonth"],"properties":{"revenue":{"type":"number"},"cashInAmount":{"description":"Sum of `cashInAmount` over the window.","type":"number"},"creditAmount":{"type":"number"},"writeoff":{"type":"number"},"writeoffPaidByBranch":{"description":"Sum of `writeoffPaidByBranch` over the window.","type":"number"},"writeoffSettlementCarryForward":{"description":"Sum of `writeoffSettlementCarryForward` over the window.","type":"number"},"franchiseFeeAmount":{"type":"number"},"gatewayFeeAmount":{"type":"number"},"costAmount":{"type":"number"},"variableCost":{"description":"Sum of `variableCost` (internal item cost) over the window.","type":"number"},"net":{"type":"number"},"monthlyAverageRevenue":{"type":"number"},"monthlyMedianRevenue":{"type":"number"},"monthlyAverageNet":{"type":"number"},"monthlyMedianNet":{"type":"number"},"bestMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]},"worstMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]}}}},"required":["branchId","branchSlug","branchName","currency","monthCount","months","totals"]}},"text/plain":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"franchiseFeePercentage":{"description":"Branch franchise fee in percent. Omitted when not configured.","type":"number"},"monthCount":{"description":"Effective number of returned months (post-clamp).","type":"number"},"months":{"type":"array","items":{"type":"object","required":["month","revenue","cashInAmount","creditAmount","writeoff","writeoffPaidByBranch","writeoffSettlementCarryForward","writeoffSettlementCarryForwardSourceMonth","franchiseFeePercentage","franchiseFeeAmount","gatewayFeeAmount","costAmount","costAmountAgainstFranchisor","variableCost","net"],"properties":{"month":{"description":"Month identifier in \"YYYY-MM\" format.","type":"string"},"revenue":{"description":"Gross revenue (storno excluded).","type":"number"},"cashInAmount":{"description":"Real money actually received in this calendar month: successful gateway transactions (status PAID/COMPLETE) + auto-matched Fio bank wires + manually-recorded bank transfers, all paired to orders that have at least one item attributed to the branch. Dated by the day the money moved, NOT by the order's revenue date — cash-flow figure, not turnover. Cross-branch orders are pro-rated by each branch's share of the order's revenue, so summing this column across branches reproduces the gateway/bank totals (no double-counting). Cash receipts, manual_mark write-offs and credit/voucher redemptions are excluded; multiple gateway attempts collapse naturally (only PAID/COMPLETE rows contribute); manual price edits on the order do NOT change payment-row `price`, so this figure is free of operator distortion.","type":"number"},"creditAmount":{"description":"Net credit balance moved in the month.","type":"number"},"writeoff":{"description":"Sum of write-offs effective in the month.","type":"number"},"writeoffPaidByBranch":{"description":"Subset of `writeoff` whose PAYER (plátce) is the branch's own operating company (`shop__branch.operating_company_contact_id`). Since 2026-09 feeds the settlement / vyrovnání alongside `writeoffSettlementCarryForward` — rule: \"co platí franšízant vstupuje do vyrovnání, bez ohledu na příjemce\". Corrections funded by the org or by a third party (or with an unset payer) remain visible under `writeoff` for record-keeping but do NOT contribute to the branch↔org settlement price (they are settled outside the branch's responsibility). 0 when the branch has no operating-company contact configured — org-owned outlets fall here.","type":"number"},"writeoffSettlementCarryForward":{"description":"Automatic \"Vyrovnání z účetního období\" carry-forward writeoff booked on the 1st day of this month by issueBranchSettlementOrder when the previous period ended with \"org owes branch\". Payer is the organisation (not the branch), so it does NOT match `writeoffPaidByBranch`, but it still enters the current month's vyrovnání — otherwise the amount the org promised to carry forward disappears from the next report (BIZKIT-52). Identified by (source='writeoff' AND source_ref LIKE 'settlement-%'). Deleted / rejected rows are excluded.","type":"number"},"writeoffSettlementCarryForwardSourceMonth":{"description":"YYYY-MM of the source period that produced the carry-forward above (parsed back from source_ref). Null when `writeoffSettlementCarryForward` is 0. Semicolon-joined list when multiple source months contribute to the same bucket.","anyOf":[{"type":"string"},{"type":"null"}]},"franchiseFeePercentage":{"description":"Franchise-fee rate that fired in this month, picked from `shop__branch_franchise_fee` by the rule whose [fromDate, toDate] window covers the month's last day. 0 when no rule covers it. Equals the top-level `franchiseFeePercentage` for months in which the current rule has been in force; differs for older months whose rule has since been superseded — the whole point of the history table.","type":"number"},"franchiseFeeAmount":{"description":"revenue × franchiseFeePercentage ÷ 100 (rounded). Computed with the per-MONTH rate, not the live rate — a mid-year rate change is attributed to the months that actually experienced each rate.","type":"number"},"franchiseFeeNote":{"description":"Free-form description attached to the franchise-fee rule that fired for this month (services, agreement scope). Rendered into the finance-report PDF. null when no rule covers the month or the rule has no note.","anyOf":[{"type":"string"},{"type":"null"}]},"gatewayFeeAmount":{"description":"Money the payment gateway pocketed as commission on the gateway-routed slice of this month's cash-in. Only the gateway leg of `cashInAmount` is fee-bearing (bank wires and auto-matched Fio transfers contribute zero). The rate applied to each transaction is the commission period (configured on the gateway detail) whose [fromDate, toDate] window covers the payment date; latest fromDate wins when overlaps exist. Pro-rated across branches the same way as `cashInAmount`. Subtracted in `net`. Zero when no commission period is configured.","type":"number"},"costAmount":{"description":"Sum of recurring FIXED branch costs (rent, energy, …) that apply to this month, computed from `shop__branch_cost` + variable monthly entries. Displayed as \"Fixní náklady\" in the Finance grid.","type":"number"},"costAmountAgainstFranchisor":{"description":"Subset of `costAmount` whose supplier (`shop__branch_cost.contact_id`) matches the parent branch's branchContact (or the org internal contact for top-level branches). Flows into the settlement — the rest is paid to unrelated third parties (energy, cleaning, …) and settled outside this report.","type":"number"},"variableCost":{"description":"Variable cost — sum of `shop__order_item.cost × count` (snapshotted internal cost per unit at item-create time, FX-converted to the order currency) for every non-storno item attributed to this branch whose revenue date falls in the month. Positive magnitude; subtracted from `net` and displayed as a signed negative number in the Finance grid + PDF report (\"Variabilní náklady\" column).","type":"number"},"net":{"description":"revenue − franchiseFeeAmount + writeoff − costAmount − gatewayFeeAmount − variableCost (what the branch keeps).","type":"number"},"invoice":{"description":"Most recent settlement order for this month, including storno rows so the Finance grid can render \"storno\" as a distinct icon state. Omitted only when no order has ever been issued.","type":"object","required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"],"properties":{"orderId":{"description":"Internal shop__order.id.","type":"number"},"orderHash":{"description":"Hash used by the admin order detail URL (/order/{orderHash}).","type":"string"},"orderNumber":{"description":"Human-facing order number from the order group sequence.","type":"string"},"direction":{"description":"`org-to-branch` (default since 2026-07-03) = organisation invoices the branch. `branch-to-org` is kept for legacy orders issued before the direction was unified — never produced by new issue calls.","anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"description":"ISO timestamp when the settlement order was marked as paid (shop__order.order_pay_date). null while the order is still awaiting payment. Deferred statements (org owes branch, 0-Kč order + writeoff) stay null forever — the debt is cleared by an actual bank transfer that lands as `cashIn` in the settlement formula.","anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"description":"ISO date the order becomes overdue (`shop__order.due_date`). Drives the Finance-grid month icon: past-due unpaid orders render red, still-open unpaid ones render amber. null on legacy rows created before the field was set explicitly — treated as \"no overdue signal\".","anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"description":"True when the order is currently in a storno-typed status. Rendered as its own state in the Finance grid so the operator sees \"storno\" instead of \"no order\" when a settlement invoice is voided.","type":"boolean"}}}}}},"totals":{"type":"object","required":["revenue","cashInAmount","creditAmount","writeoff","writeoffPaidByBranch","writeoffSettlementCarryForward","franchiseFeeAmount","gatewayFeeAmount","costAmount","variableCost","net","monthlyAverageRevenue","monthlyMedianRevenue","monthlyAverageNet","monthlyMedianNet","bestMonth","worstMonth"],"properties":{"revenue":{"type":"number"},"cashInAmount":{"description":"Sum of `cashInAmount` over the window.","type":"number"},"creditAmount":{"type":"number"},"writeoff":{"type":"number"},"writeoffPaidByBranch":{"description":"Sum of `writeoffPaidByBranch` over the window.","type":"number"},"writeoffSettlementCarryForward":{"description":"Sum of `writeoffSettlementCarryForward` over the window.","type":"number"},"franchiseFeeAmount":{"type":"number"},"gatewayFeeAmount":{"type":"number"},"costAmount":{"type":"number"},"variableCost":{"description":"Sum of `variableCost` (internal item cost) over the window.","type":"number"},"net":{"type":"number"},"monthlyAverageRevenue":{"type":"number"},"monthlyMedianRevenue":{"type":"number"},"monthlyAverageNet":{"type":"number"},"monthlyMedianNet":{"type":"number"},"bestMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]},"worstMonth":{"anyOf":[{"type":"null"},{"type":"object","required":["month","net"],"properties":{"month":{"type":"string"},"net":{"type":"number"}}}]}}}},"required":["branchId","branchSlug","branchName","currency","monthCount","months","totals"]}}}}},"operationId":"getBffBranchMonthly-breakdown","tags":["Branch"],"description":"Returns one row per calendar month over the requested window with: gross revenue (SUM(price × count − sale), storno items excluded), net credit balance, applied write-offs and the resulting \"net\" (revenue − franchise_fee + writeoff). On top of the rows the response carries window totals plus monthly average + monthly median + best-month + worst-month reference points the admin uses to colour-code each row relative to the branch's own baseline. Franchise fields are emitted as 0 when the branch has no `franchise_fee_percentage` configured. Revenue is bucketed by COALESCE(core__calendar_event.start_time, shop__order_item.inserted_date) — event-linked items (gym lessons, calendar appointments) land in the month they happened, non-event items in the month they were recorded.","summary":"Per-month financial roll-up for the branch detail \"Finance\" tab"}},"/bff/branch/inkaso-entries":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-vinohrady"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"Page number (1-based).","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Page number (1-based).","type":"number"}]},"in":"query","name":"page","required":false},{"description":"Items per page.","schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"description":"Items per page.","type":"number"}]},"in":"query","name":"limit","required":false},{"description":"Sort directive in `field:direction` form. Supported fields: receiptDate, allocatedAmount, signedAmount, grossAmount, branchShare, source, direction, status, orderNumber.","examples":["receiptDate:desc","allocatedAmount:desc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Window size in months (default 24, clamped to [1, 60]). Identical semantics to /monthly-breakdown.","examples":["24","60"],"schema":{"type":"string"},"in":"query","name":"monthCount","required":false},{"description":"Restrict to a single calendar month, expressed as `YYYY-MM`. Receipts are bucketed by `receipt_date` (when the money moved), the SAME dimension the Inkaso column on Finance uses, so `totalAllocated` here equals the Inkaso cell for that month exactly. Malformed values are ignored.","examples":["2026-06"],"schema":{"type":"string"},"in":"query","name":"filterMonth","required":false},{"description":"Restrict to one canonical receipt source.","schema":{"anyOf":[{"const":"gateway","type":"string"},{"const":"bank_transaction","type":"string"}]},"in":"query","name":"filterSource","required":false},{"description":"Restrict to incoming or outgoing (refund) receipts.","schema":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"in":"query","name":"filterDirection","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","source","sourceId","receiptDate","status","direction","grossAmount","signedAmount","branchShare","allocatedAmount","currency","gatewayTransactionId","order"],"properties":{"id":{"description":"Stable composite id (source-sourceId).","type":"string"},"source":{"anyOf":[{"const":"gateway","type":"string"},{"const":"bank_transaction","type":"string"}]},"sourceId":{"description":"Raw primary key in the source table.","type":"number"},"receiptDate":{"description":"When the money actually moved (ISO 8601). To the nearest second the source records.","type":"string"},"status":{"description":"Source status. Gateway: PAID / AUTHORIZED / COMPLETE. Bank wire: \"reconciled\".","type":"string"},"direction":{"description":"Incoming money vs. refund. Bank wires with negative price → \"out\".","anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"grossAmount":{"description":"Source row gross amount (positive, sign in `direction`).","type":"number"},"signedAmount":{"description":"signedAmount = direction-encoded gross. Negative = refund.","type":"number"},"branchShare":{"description":"Branch's pro-rate share of this order in [0, 1]. 1.0 = single-branch order. Denominator keeps storno (so storno reduces the share) and clamps negative discount lines so the share can't exceed 1.","type":"number"},"allocatedAmount":{"description":"Branch-allocated cash-in for this receipt = signedAmount × branchShare. SUM over the filtered set equals the Inkaso cell on Finance.","type":"number"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"gatewayTransactionId":{"description":"Top-level mirror of `gateway.transactionId`. Lifted so the admin DataGrid can address it as a sortable column field.","anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"description":"For deep-link to /order/<hash>.","type":"string"}}},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"gateway":{"type":"object","required":["providerName","instanceCode","transactionId"],"properties":{"providerName":{"description":"e.g. \"GoPay\", \"Stripe\".","type":"string"},"instanceCode":{"description":"Per-organisation instance code.","type":"string"},"transactionId":{"description":"Transaction id at the gateway provider (shop__order_payment.gateway_id). NULL on legacy rows.","anyOf":[{"type":"string"},{"type":"null"}]}}},"bank":{"type":"object","required":["bankExternalId","accountName"],"properties":{"bankExternalId":{"description":"Bank's transaction id (Fio bank_transaction_id).","type":"string"},"accountName":{"description":"Bank account display name or \"<prefix>-<num>/<code>\".","type":"string"},"counterpartyAccount":{"type":"string"},"counterpartyName":{"type":"string"},"message":{"description":"Joined message + user_notice + to_message.","type":"string"},"variableSymbol":{"type":"string"}}}}}},"itemCount":{"description":"Total rows matching filters (across all pages).","type":"number"},"totalAllocated":{"description":"Sum of allocatedAmount over the filtered set (NOT just the current page). Matches the Finance Inkaso cell for the same window + month.","type":"number"},"incomingCount":{"description":"How many receipts in the filtered set are direction='in'.","type":"number"},"outgoingCount":{"description":"How many receipts are direction='out' (refunds). They subtract from totalAllocated.","type":"number"}},"required":["items","itemCount","totalAllocated","incomingCount","outgoingCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","source","sourceId","receiptDate","status","direction","grossAmount","signedAmount","branchShare","allocatedAmount","currency","gatewayTransactionId","order"],"properties":{"id":{"description":"Stable composite id (source-sourceId).","type":"string"},"source":{"anyOf":[{"const":"gateway","type":"string"},{"const":"bank_transaction","type":"string"}]},"sourceId":{"description":"Raw primary key in the source table.","type":"number"},"receiptDate":{"description":"When the money actually moved (ISO 8601). To the nearest second the source records.","type":"string"},"status":{"description":"Source status. Gateway: PAID / AUTHORIZED / COMPLETE. Bank wire: \"reconciled\".","type":"string"},"direction":{"description":"Incoming money vs. refund. Bank wires with negative price → \"out\".","anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"grossAmount":{"description":"Source row gross amount (positive, sign in `direction`).","type":"number"},"signedAmount":{"description":"signedAmount = direction-encoded gross. Negative = refund.","type":"number"},"branchShare":{"description":"Branch's pro-rate share of this order in [0, 1]. 1.0 = single-branch order. Denominator keeps storno (so storno reduces the share) and clamps negative discount lines so the share can't exceed 1.","type":"number"},"allocatedAmount":{"description":"Branch-allocated cash-in for this receipt = signedAmount × branchShare. SUM over the filtered set equals the Inkaso cell on Finance.","type":"number"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"gatewayTransactionId":{"description":"Top-level mirror of `gateway.transactionId`. Lifted so the admin DataGrid can address it as a sortable column field.","anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"description":"For deep-link to /order/<hash>.","type":"string"}}},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"gateway":{"type":"object","required":["providerName","instanceCode","transactionId"],"properties":{"providerName":{"description":"e.g. \"GoPay\", \"Stripe\".","type":"string"},"instanceCode":{"description":"Per-organisation instance code.","type":"string"},"transactionId":{"description":"Transaction id at the gateway provider (shop__order_payment.gateway_id). NULL on legacy rows.","anyOf":[{"type":"string"},{"type":"null"}]}}},"bank":{"type":"object","required":["bankExternalId","accountName"],"properties":{"bankExternalId":{"description":"Bank's transaction id (Fio bank_transaction_id).","type":"string"},"accountName":{"description":"Bank account display name or \"<prefix>-<num>/<code>\".","type":"string"},"counterpartyAccount":{"type":"string"},"counterpartyName":{"type":"string"},"message":{"description":"Joined message + user_notice + to_message.","type":"string"},"variableSymbol":{"type":"string"}}}}}},"itemCount":{"description":"Total rows matching filters (across all pages).","type":"number"},"totalAllocated":{"description":"Sum of allocatedAmount over the filtered set (NOT just the current page). Matches the Finance Inkaso cell for the same window + month.","type":"number"},"incomingCount":{"description":"How many receipts in the filtered set are direction='in'.","type":"number"},"outgoingCount":{"description":"How many receipts are direction='out' (refunds). They subtract from totalAllocated.","type":"number"}},"required":["items","itemCount","totalAllocated","incomingCount","outgoingCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","source","sourceId","receiptDate","status","direction","grossAmount","signedAmount","branchShare","allocatedAmount","currency","gatewayTransactionId","order"],"properties":{"id":{"description":"Stable composite id (source-sourceId).","type":"string"},"source":{"anyOf":[{"const":"gateway","type":"string"},{"const":"bank_transaction","type":"string"}]},"sourceId":{"description":"Raw primary key in the source table.","type":"number"},"receiptDate":{"description":"When the money actually moved (ISO 8601). To the nearest second the source records.","type":"string"},"status":{"description":"Source status. Gateway: PAID / AUTHORIZED / COMPLETE. Bank wire: \"reconciled\".","type":"string"},"direction":{"description":"Incoming money vs. refund. Bank wires with negative price → \"out\".","anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"grossAmount":{"description":"Source row gross amount (positive, sign in `direction`).","type":"number"},"signedAmount":{"description":"signedAmount = direction-encoded gross. Negative = refund.","type":"number"},"branchShare":{"description":"Branch's pro-rate share of this order in [0, 1]. 1.0 = single-branch order. Denominator keeps storno (so storno reduces the share) and clamps negative discount lines so the share can't exceed 1.","type":"number"},"allocatedAmount":{"description":"Branch-allocated cash-in for this receipt = signedAmount × branchShare. SUM over the filtered set equals the Inkaso cell on Finance.","type":"number"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"gatewayTransactionId":{"description":"Top-level mirror of `gateway.transactionId`. Lifted so the admin DataGrid can address it as a sortable column field.","anyOf":[{"type":"string"},{"type":"null"}]},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"description":"For deep-link to /order/<hash>.","type":"string"}}},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"gateway":{"type":"object","required":["providerName","instanceCode","transactionId"],"properties":{"providerName":{"description":"e.g. \"GoPay\", \"Stripe\".","type":"string"},"instanceCode":{"description":"Per-organisation instance code.","type":"string"},"transactionId":{"description":"Transaction id at the gateway provider (shop__order_payment.gateway_id). NULL on legacy rows.","anyOf":[{"type":"string"},{"type":"null"}]}}},"bank":{"type":"object","required":["bankExternalId","accountName"],"properties":{"bankExternalId":{"description":"Bank's transaction id (Fio bank_transaction_id).","type":"string"},"accountName":{"description":"Bank account display name or \"<prefix>-<num>/<code>\".","type":"string"},"counterpartyAccount":{"type":"string"},"counterpartyName":{"type":"string"},"message":{"description":"Joined message + user_notice + to_message.","type":"string"},"variableSymbol":{"type":"string"}}}}}},"itemCount":{"description":"Total rows matching filters (across all pages).","type":"number"},"totalAllocated":{"description":"Sum of allocatedAmount over the filtered set (NOT just the current page). Matches the Finance Inkaso cell for the same window + month.","type":"number"},"incomingCount":{"description":"How many receipts in the filtered set are direction='in'.","type":"number"},"outgoingCount":{"description":"How many receipts are direction='out' (refunds). They subtract from totalAllocated.","type":"number"}},"required":["items","itemCount","totalAllocated","incomingCount","outgoingCount"]}}}}},"operationId":"getBffBranchInkaso-entries","tags":["Branch"],"description":"Returns one DataGrid page of pre-pro-rated real-money receipts that compose the \"Inkaso\" headline on the Finance tab. The same CTE drives both — by construction, `SUM(allocatedAmount)` over the filtered set equals the Inkaso cell on Finance for the same `branchSlug` + `filterMonth` to the cent.","summary":"Per-row audit list for the branch \"Inkaso\" tab"}},"/bff/branch/finance-report-pdf":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-vinohrady"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"Month identifier in YYYY-MM format.","examples":["2026-06"],"schema":{"type":"string"},"in":"query","name":"month","required":true}],"operationId":"getBffBranchFinance-report-pdf","tags":["Branch"],"description":"Returns a print-ready A4 PDF summarising the branch's finances for the requested calendar month: headline KPIs (Obrat, Inkaso, Franšíza, Oprávky, Náklady, Poplatek bráně, Net, Vyrovnání) plus two detail tables (Inkaso receipts and Oprávky entries). Same SQL CTEs that power the Finance tab feed this report, so the figures match to the cent. Not persisted — every request renders fresh.","summary":"On-demand monthly finance report PDF for a branch","responses":{"200":{}}}},"/bff/branch/settlement/issue-invoice":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"type":"number"},"orderHash":{"type":"string"},"orderNumber":{"type":"string"},"direction":{"anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"type":"boolean"}},"required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"orderId":{"type":"number"},"orderHash":{"type":"string"},"orderNumber":{"type":"string"},"direction":{"anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"type":"boolean"}},"required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"]}},"text/plain":{"schema":{"type":"object","properties":{"orderId":{"type":"number"},"orderHash":{"type":"string"},"orderNumber":{"type":"string"},"direction":{"anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"type":"boolean"}},"required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"]}}}},"409":{"content":{"application/json":{"schema":{"type":"object","properties":{"orderId":{"type":"number"},"orderHash":{"type":"string"},"orderNumber":{"type":"string"},"direction":{"anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"type":"boolean"}},"required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"orderId":{"type":"number"},"orderHash":{"type":"string"},"orderNumber":{"type":"string"},"direction":{"anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"type":"boolean"}},"required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"]}},"text/plain":{"schema":{"type":"object","properties":{"orderId":{"type":"number"},"orderHash":{"type":"string"},"orderNumber":{"type":"string"},"direction":{"anyOf":[{"const":"org-to-branch","type":"string"},{"const":"branch-to-org","type":"string"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"isStorno":{"type":"boolean"}},"required":["orderId","orderHash","orderNumber","direction","paidDate","dueDate","isStorno"]}}}},"422":{"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"description":"Machine-readable code: invalid-month | zero-amount | branch-not-found | missing-branch-operating-contact | missing-counterparty-contact | counterparty-no-identifier.","type":"string"},"message":{"type":"string"}},"required":["error","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"error":{"description":"Machine-readable code: invalid-month | zero-amount | branch-not-found | missing-branch-operating-contact | missing-counterparty-contact | counterparty-no-identifier.","type":"string"},"message":{"type":"string"}},"required":["error","message"]}},"text/plain":{"schema":{"type":"object","properties":{"error":{"description":"Machine-readable code: invalid-month | zero-amount | branch-not-found | missing-branch-operating-contact | missing-counterparty-contact | counterparty-no-identifier.","type":"string"},"message":{"type":"string"}},"required":["error","message"]}}}}},"operationId":"postBffBranchSettlementIssue-invoice","tags":["Branch"],"description":"Creates an internal \"vyrovnání\" order between the branch's operating company and the counterparty (parent branch operating company if `parent_branch_id` is set, otherwise the organisation's internal contact). Direction is driven by the sign of `settlementAmount`. Idempotent on `(branchSlug, settlementMonth)`: if an active (non-storno) settlement order already exists, returns it with HTTP 409 so the caller can navigate to it; a storno'd predecessor does not block re-issuing.","summary":"Issue a settlement order for a branch month","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["branchSlug","settlementMonth","settlementAmount","currency"],"properties":{"branchSlug":{"description":"Slug of the branch the settlement belongs to.","examples":["gymroom-vinohrady"],"type":"string"},"settlementMonth":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","description":"Month identifier in \"YYYY-MM\" format.","examples":["2026-05"],"type":"string"},"settlementAmount":{"description":"Signed settlement amount in the branch currency. Positive or zero = branch owes the organisation (branch-to-org): the branch is the invoice issuer and waits for payment. Negative = organisation owes the branch (org-to-branch): the order is issued with price = 0 (stays in \"new\" forever) and a matching writeoff expense is booked automatically so the difference settles cumulatively next month.","type":"number"},"currency":{"description":"ISO 4217 code of the order currency (typically the organisation default).","examples":["CZK"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["branchSlug","settlementMonth","settlementAmount","currency"],"properties":{"branchSlug":{"description":"Slug of the branch the settlement belongs to.","examples":["gymroom-vinohrady"],"type":"string"},"settlementMonth":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","description":"Month identifier in \"YYYY-MM\" format.","examples":["2026-05"],"type":"string"},"settlementAmount":{"description":"Signed settlement amount in the branch currency. Positive or zero = branch owes the organisation (branch-to-org): the branch is the invoice issuer and waits for payment. Negative = organisation owes the branch (org-to-branch): the order is issued with price = 0 (stays in \"new\" forever) and a matching writeoff expense is booked automatically so the difference settles cumulatively next month.","type":"number"},"currency":{"description":"ISO 4217 code of the order currency (typically the organisation default).","examples":["CZK"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["branchSlug","settlementMonth","settlementAmount","currency"],"properties":{"branchSlug":{"description":"Slug of the branch the settlement belongs to.","examples":["gymroom-vinohrady"],"type":"string"},"settlementMonth":{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","description":"Month identifier in \"YYYY-MM\" format.","examples":["2026-05"],"type":"string"},"settlementAmount":{"description":"Signed settlement amount in the branch currency. Positive or zero = branch owes the organisation (branch-to-org): the branch is the invoice issuer and waits for payment. Negative = organisation owes the branch (org-to-branch): the order is issued with price = 0 (stays in \"new\" forever) and a matching writeoff expense is booked automatically so the difference settles cumulatively next month.","type":"number"},"currency":{"description":"ISO 4217 code of the order currency (typically the organisation default).","examples":["CZK"],"type":"string"}}}}}}}},"/bff/branch/order-items":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-plzen"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"Page number (1-based).","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Page number (1-based).","type":"number"}]},"in":"query","name":"page","required":false},{"description":"Items per page.","schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"description":"Items per page.","type":"number"}]},"in":"query","name":"limit","required":false},{"description":"Sort directive in `field:direction` form. Supported fields: activityDate, insertedDate, label, count, price, sale, creditAmount, order, customer.","examples":["activityDate:desc","price:asc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Free-text search across label, order number and customer fields.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Restrict the result to a single calendar month, expressed as `YYYY-MM`. The cut-off uses the same date dimension as the revenue formula (event.start_time when present, otherwise i.inserted_date), so the filtered turnover matches the corresponding Finance-tab row to the cent. Malformed values are silently ignored.","examples":["2026-03"],"schema":{"type":"string"},"in":"query","name":"filterMonth","required":false},{"description":"When truthy (`1`, `true`), restrict the result to rows with a non-zero internal cost (`shop__order_item.cost > 0`). Same predicate that decides whether a row contributes to the Finance-tab \"Variabilní náklady\" total, so drilling from that column lands on exactly the rows summed.","examples":["1"],"schema":{"anyOf":[{"type":"string"},{"type":"boolean"}]},"in":"query","name":"filterHasCost","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","count","price","sale","creditAmount","cost","realMoneyPrice","isStorno","insertedDate","activityDate","order","issuedByOtherSubject","issuerDisplayName"],"properties":{"id":{"description":"External item id (\"hash_internalId\") for cross-references.","type":"string"},"label":{"type":"string"},"count":{"type":"number"},"price":{"description":"Unit price in the order currency.","type":"number"},"sale":{"description":"Per-line discount in the order currency.","type":"number"},"unit":{"type":"string"},"vat":{"type":"number"},"creditAmount":{"type":"number"},"cost":{"description":"Snapshotted per-unit internal cost in the order currency at the moment this line was created (variant.cost ?? product.cost, FX-converted from the org default). Informational on the branch grid — shows what the line cost the organisation at the time it was booked. Null means the cost was not resolvable at creation time (no variant/product cost on record or no FX rate available).","anyOf":[{"type":"number"},{"type":"null"}]},"realMoneyPrice":{"description":"Per-line MONEY the customer actually paid for this row after the order rule engine (vouchers + customer credits proportionally allocated). Null means the row is a virtual deduction line (no money attribution) OR the value has not been backfilled yet for this legacy row. Branch revenue is the SUM of this column over non-storno rows.","anyOf":[{"type":"number"},{"type":"null"}]},"isStorno":{"type":"boolean"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activityDate":{"description":"Date this row is bucketed on — event.start_time when the underlying shop__order_item references a calendar event (gym lesson, appointment), otherwise i.inserted_date. The grid sorts and the Finance tab buckets by this same value.","anyOf":[{"description":"Date this row is bucketed on — event.start_time when the underlying shop__order_item references a calendar event (gym lesson, appointment), otherwise i.inserted_date. The grid sorts and the Finance tab buckets by this same value.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"},"payDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"statusCode":{"type":"string"}}},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"issuedByOtherSubject":{"description":"True when the order this line belongs to is invoiced by a legal entity OTHER than the branch own operating company (BIZKIT-57 \"other subject\" case — lednice / fridge sales). The row is returned so the admin grid can grey it out, but it does NOT contribute to the branch turnover / inkaso / vyrovnání.","type":"boolean"},"issuerDisplayName":{"description":"Display name of the invoicing entity when `issuedByOtherSubject` is true (company name, falling back to personal name). `null` for matched rows.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total number of items matching the current filter — paginator denominator.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","count","price","sale","creditAmount","cost","realMoneyPrice","isStorno","insertedDate","activityDate","order","issuedByOtherSubject","issuerDisplayName"],"properties":{"id":{"description":"External item id (\"hash_internalId\") for cross-references.","type":"string"},"label":{"type":"string"},"count":{"type":"number"},"price":{"description":"Unit price in the order currency.","type":"number"},"sale":{"description":"Per-line discount in the order currency.","type":"number"},"unit":{"type":"string"},"vat":{"type":"number"},"creditAmount":{"type":"number"},"cost":{"description":"Snapshotted per-unit internal cost in the order currency at the moment this line was created (variant.cost ?? product.cost, FX-converted from the org default). Informational on the branch grid — shows what the line cost the organisation at the time it was booked. Null means the cost was not resolvable at creation time (no variant/product cost on record or no FX rate available).","anyOf":[{"type":"number"},{"type":"null"}]},"realMoneyPrice":{"description":"Per-line MONEY the customer actually paid for this row after the order rule engine (vouchers + customer credits proportionally allocated). Null means the row is a virtual deduction line (no money attribution) OR the value has not been backfilled yet for this legacy row. Branch revenue is the SUM of this column over non-storno rows.","anyOf":[{"type":"number"},{"type":"null"}]},"isStorno":{"type":"boolean"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activityDate":{"description":"Date this row is bucketed on — event.start_time when the underlying shop__order_item references a calendar event (gym lesson, appointment), otherwise i.inserted_date. The grid sorts and the Finance tab buckets by this same value.","anyOf":[{"description":"Date this row is bucketed on — event.start_time when the underlying shop__order_item references a calendar event (gym lesson, appointment), otherwise i.inserted_date. The grid sorts and the Finance tab buckets by this same value.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"},"payDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"statusCode":{"type":"string"}}},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"issuedByOtherSubject":{"description":"True when the order this line belongs to is invoiced by a legal entity OTHER than the branch own operating company (BIZKIT-57 \"other subject\" case — lednice / fridge sales). The row is returned so the admin grid can grey it out, but it does NOT contribute to the branch turnover / inkaso / vyrovnání.","type":"boolean"},"issuerDisplayName":{"description":"Display name of the invoicing entity when `issuedByOtherSubject` is true (company name, falling back to personal name). `null` for matched rows.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total number of items matching the current filter — paginator denominator.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","count","price","sale","creditAmount","cost","realMoneyPrice","isStorno","insertedDate","activityDate","order","issuedByOtherSubject","issuerDisplayName"],"properties":{"id":{"description":"External item id (\"hash_internalId\") for cross-references.","type":"string"},"label":{"type":"string"},"count":{"type":"number"},"price":{"description":"Unit price in the order currency.","type":"number"},"sale":{"description":"Per-line discount in the order currency.","type":"number"},"unit":{"type":"string"},"vat":{"type":"number"},"creditAmount":{"type":"number"},"cost":{"description":"Snapshotted per-unit internal cost in the order currency at the moment this line was created (variant.cost ?? product.cost, FX-converted from the org default). Informational on the branch grid — shows what the line cost the organisation at the time it was booked. Null means the cost was not resolvable at creation time (no variant/product cost on record or no FX rate available).","anyOf":[{"type":"number"},{"type":"null"}]},"realMoneyPrice":{"description":"Per-line MONEY the customer actually paid for this row after the order rule engine (vouchers + customer credits proportionally allocated). Null means the row is a virtual deduction line (no money attribution) OR the value has not been backfilled yet for this legacy row. Branch revenue is the SUM of this column over non-storno rows.","anyOf":[{"type":"number"},{"type":"null"}]},"isStorno":{"type":"boolean"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activityDate":{"description":"Date this row is bucketed on — event.start_time when the underlying shop__order_item references a calendar event (gym lesson, appointment), otherwise i.inserted_date. The grid sorts and the Finance tab buckets by this same value.","anyOf":[{"description":"Date this row is bucketed on — event.start_time when the underlying shop__order_item references a calendar event (gym lesson, appointment), otherwise i.inserted_date. The grid sorts and the Finance tab buckets by this same value.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"},"payDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"statusCode":{"type":"string"}}},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"issuedByOtherSubject":{"description":"True when the order this line belongs to is invoiced by a legal entity OTHER than the branch own operating company (BIZKIT-57 \"other subject\" case — lednice / fridge sales). The row is returned so the admin grid can grey it out, but it does NOT contribute to the branch turnover / inkaso / vyrovnání.","type":"boolean"},"issuerDisplayName":{"description":"Display name of the invoicing entity when `issuedByOtherSubject` is true (company name, falling back to personal name). `null` for matched rows.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total number of items matching the current filter — paginator denominator.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffBranchOrder-items","tags":["Branch"],"description":"Returns one DataGrid page of `shop__order_item` rows whose `branch_id` resolves to the requested branch. Drives the \"Order items\" tab grid in `apiUrl` mode — accepts `page`, `limit`, `orderBy`, `filterFulltextQuery` and returns `{ items, itemCount }` where `itemCount` is the count over the FILTERED set so the paginator math is correct. Use `/order-items-summary` for the header turnover / credit / total-item-count numbers.","summary":"Paginated list of order items attributed to a branch"}},"/bff/branch/customers-summary":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-plzen"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"itemCount":{"type":"number"}},"required":["branchId","branchSlug","branchName","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"itemCount":{"type":"number"}},"required":["branchId","branchSlug","branchName","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"branchId":{"type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"itemCount":{"type":"number"}},"required":["branchId","branchSlug","branchName","itemCount"]}}}}},"operationId":"getBffBranchCustomers-summary","tags":["Branch"],"description":"Returns the total count of distinct customers attached to the branch via `shop__order_item.branch_id`. Drives the header above the paginated `/customers` grid.","summary":"Headline aggregates for the branch customer ledger"}},"/bff/branch/customers":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-plzen"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"Page number (1-based).","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Page number (1-based).","type":"number"}]},"in":"query","name":"page","required":false},{"description":"Items per page.","schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"description":"Items per page.","type":"number"}]},"in":"query","name":"limit","required":false},{"description":"Sort directive in `field:direction` form. Supported fields: firstVisitDate, lastVisitDate, orderCount, itemCount, totalRevenue, name, email.","examples":["lastVisitDate:desc","totalRevenue:desc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Free-text search across name, email and phone.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","email","firstVisitDate","lastVisitDate","orderCount","itemCount","totalRevenue","lastOrder","score","trust","accountAgeDays","orderPaid","orderNotPaid","orderNew","orderProcessing","orderStorno","orderDone"],"properties":{"id":{"description":"Contact external id.","type":"string"},"name":{"description":"Pre-formatted display name: \"First Last (Company)\" if both, else whichever is available.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts — UI should fall back to `name` / `companyName` / `phone`.","type":"string"},{"type":"null"}]},"phone":{"type":"string"},"firstVisitDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastVisitDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderCount":{"type":"number"},"itemCount":{"type":"number"},"totalRevenue":{"description":"Sum of (price × count − sale) over every order item the customer has at this branch; storno items subtract.","type":"number"},"lastOrder":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"}}},"score":{"type":"number"},"trust":{"type":"number"},"accountAgeDays":{"type":"number"},"orderPaid":{"type":"number"},"orderNotPaid":{"type":"number"},"orderNew":{"type":"number"},"orderProcessing":{"type":"number"},"orderStorno":{"type":"number"},"orderDone":{"type":"number"}}}},"itemCount":{"description":"Total number of distinct customers matching the current filter — paginator denominator.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","email","firstVisitDate","lastVisitDate","orderCount","itemCount","totalRevenue","lastOrder","score","trust","accountAgeDays","orderPaid","orderNotPaid","orderNew","orderProcessing","orderStorno","orderDone"],"properties":{"id":{"description":"Contact external id.","type":"string"},"name":{"description":"Pre-formatted display name: \"First Last (Company)\" if both, else whichever is available.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts — UI should fall back to `name` / `companyName` / `phone`.","type":"string"},{"type":"null"}]},"phone":{"type":"string"},"firstVisitDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastVisitDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderCount":{"type":"number"},"itemCount":{"type":"number"},"totalRevenue":{"description":"Sum of (price × count − sale) over every order item the customer has at this branch; storno items subtract.","type":"number"},"lastOrder":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"}}},"score":{"type":"number"},"trust":{"type":"number"},"accountAgeDays":{"type":"number"},"orderPaid":{"type":"number"},"orderNotPaid":{"type":"number"},"orderNew":{"type":"number"},"orderProcessing":{"type":"number"},"orderStorno":{"type":"number"},"orderDone":{"type":"number"}}}},"itemCount":{"description":"Total number of distinct customers matching the current filter — paginator denominator.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","email","firstVisitDate","lastVisitDate","orderCount","itemCount","totalRevenue","lastOrder","score","trust","accountAgeDays","orderPaid","orderNotPaid","orderNew","orderProcessing","orderStorno","orderDone"],"properties":{"id":{"description":"Contact external id.","type":"string"},"name":{"description":"Pre-formatted display name: \"First Last (Company)\" if both, else whichever is available.","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts — UI should fall back to `name` / `companyName` / `phone`.","type":"string"},{"type":"null"}]},"phone":{"type":"string"},"firstVisitDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastVisitDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderCount":{"type":"number"},"itemCount":{"type":"number"},"totalRevenue":{"description":"Sum of (price × count − sale) over every order item the customer has at this branch; storno items subtract.","type":"number"},"lastOrder":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"}}},"score":{"type":"number"},"trust":{"type":"number"},"accountAgeDays":{"type":"number"},"orderPaid":{"type":"number"},"orderNotPaid":{"type":"number"},"orderNew":{"type":"number"},"orderProcessing":{"type":"number"},"orderStorno":{"type":"number"},"orderDone":{"type":"number"}}}},"itemCount":{"description":"Total number of distinct customers matching the current filter — paginator denominator.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffBranchCustomers","tags":["Branch"],"description":"Returns one DataGrid page of distinct customers (`shop__contact`) that have at least one `shop__order_item` attributed to the branch via `branch_id`. Drives the \"Customers\" tab grid in `apiUrl` mode — accepts `page`, `limit`, `orderBy`, `filterFulltextQuery`. `itemCount` is the count over the FILTERED set so paginator math is correct. Use `/customers-summary` for the header total.","summary":"Paginated list of customers who visited a branch"}},"/bff/branch/detach-lock":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"lockId":{"type":"number"},"branchSlug":{"type":"string"}},"required":["success","lockId","branchSlug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"lockId":{"type":"number"},"branchSlug":{"type":"string"}},"required":["success","lockId","branchSlug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"lockId":{"type":"number"},"branchSlug":{"type":"string"}},"required":["success","lockId","branchSlug"]}}}}},"operationId":"postBffBranchDetach-lock","tags":["Branch"],"description":"Sets iot__ttlock_lock.branch_id back to NULL. Rejects when the lock is attached to a different branch than `slug` — that protects against stale-UI races.","summary":"Detach a lock from a branch","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","lockId"],"properties":{"slug":{"description":"Branch slug the lock is currently attached to.","type":"string"},"lockId":{"description":"External TTLock identifier of the lock to detach.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","lockId"],"properties":{"slug":{"description":"Branch slug the lock is currently attached to.","type":"string"},"lockId":{"description":"External TTLock identifier of the lock to detach.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["slug","lockId"],"properties":{"slug":{"description":"Branch slug the lock is currently attached to.","type":"string"},"lockId":{"description":"External TTLock identifier of the lock to detach.","type":"number"}}}}}}}},"/bff/branch/closure-list":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-vinohrady"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","startDate","reason","insertedDate","updatedDate","status"],"properties":{"id":{"description":"External 24-char id of the closure.","type":"string"},"startDate":{"description":"ISO timestamp the closure begins.","type":"string"},"endDate":{"description":"ISO timestamp the closure ends. Omitted = open-ended (\"until further notice\").","type":"string"},"reason":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"scheduled","type":"string"},{"const":"past","type":"string"}]},"authorMemberName":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","startDate","reason","insertedDate","updatedDate","status"],"properties":{"id":{"description":"External 24-char id of the closure.","type":"string"},"startDate":{"description":"ISO timestamp the closure begins.","type":"string"},"endDate":{"description":"ISO timestamp the closure ends. Omitted = open-ended (\"until further notice\").","type":"string"},"reason":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"scheduled","type":"string"},{"const":"past","type":"string"}]},"authorMemberName":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","startDate","reason","insertedDate","updatedDate","status"],"properties":{"id":{"description":"External 24-char id of the closure.","type":"string"},"startDate":{"description":"ISO timestamp the closure begins.","type":"string"},"endDate":{"description":"ISO timestamp the closure ends. Omitted = open-ended (\"until further notice\").","type":"string"},"reason":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"scheduled","type":"string"},{"const":"past","type":"string"}]},"authorMemberName":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffBranchClosure-list","tags":["Branch"],"description":"Returns every closure (\"výluka\") for the branch in start-date-desc order. Each row carries a status flag (`active` | `scheduled` | `past`) derived from the current time so the admin can colour-code without redoing the math client-side. Soft-deleted rows are filtered out.","summary":"List all closures recorded for a branch"}},"/bff/branch/closure-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"closureId":{"type":"string"}},"required":["success","closureId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"closureId":{"type":"string"}},"required":["success","closureId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"closureId":{"type":"string"}},"required":["success","closureId"]}}}}},"operationId":"postBffBranchClosure-create","tags":["Branch"],"description":"Creates a closure row for the branch. End date is optional — leave it out for a closure that lasts \"until further notice\". The reason is required so the audit feed (and a future Finance report drill-down) always has a human-readable explanation.","summary":"Record a new branch closure","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["branchSlug","startDate","reason"],"properties":{"branchSlug":{"description":"Branch slug the closure applies to.","type":"string"},"startDate":{"minLength":1,"description":"ISO timestamp the closure begins.","type":"string"},"endDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp the closure ends. Null / omitted = open-ended (\"until further notice\"). Must be strictly after startDate.","type":"string"},{"type":"null"}]},"reason":{"minLength":1,"description":"Operator-supplied reason. Required.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["branchSlug","startDate","reason"],"properties":{"branchSlug":{"description":"Branch slug the closure applies to.","type":"string"},"startDate":{"minLength":1,"description":"ISO timestamp the closure begins.","type":"string"},"endDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp the closure ends. Null / omitted = open-ended (\"until further notice\"). Must be strictly after startDate.","type":"string"},{"type":"null"}]},"reason":{"minLength":1,"description":"Operator-supplied reason. Required.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["branchSlug","startDate","reason"],"properties":{"branchSlug":{"description":"Branch slug the closure applies to.","type":"string"},"startDate":{"minLength":1,"description":"ISO timestamp the closure begins.","type":"string"},"endDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp the closure ends. Null / omitted = open-ended (\"until further notice\"). Must be strictly after startDate.","type":"string"},{"type":"null"}]},"reason":{"minLength":1,"description":"Operator-supplied reason. Required.","type":"string"}}}}}}}},"/bff/branch/closure-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"closureId":{"type":"string"}},"required":["success","closureId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"closureId":{"type":"string"}},"required":["success","closureId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"closureId":{"type":"string"}},"required":["success","closureId"]}}}}},"operationId":"postBffBranchClosure-update","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Update an existing branch closure","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["closureId"],"properties":{"closureId":{"description":"External id of the closure to update.","type":"string"},"startDate":{"description":"New ISO start timestamp. Omit to keep.","type":"string"},"endDate":{"nullable":true,"anyOf":[{"description":"New ISO end timestamp; null clears (= open-ended). Omit to keep.","type":"string"},{"type":"null"}]},"reason":{"minLength":1,"description":"New reason. Omit to keep.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["closureId"],"properties":{"closureId":{"description":"External id of the closure to update.","type":"string"},"startDate":{"description":"New ISO start timestamp. Omit to keep.","type":"string"},"endDate":{"nullable":true,"anyOf":[{"description":"New ISO end timestamp; null clears (= open-ended). Omit to keep.","type":"string"},{"type":"null"}]},"reason":{"minLength":1,"description":"New reason. Omit to keep.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["closureId"],"properties":{"closureId":{"description":"External id of the closure to update.","type":"string"},"startDate":{"description":"New ISO start timestamp. Omit to keep.","type":"string"},"endDate":{"nullable":true,"anyOf":[{"description":"New ISO end timestamp; null clears (= open-ended). Omit to keep.","type":"string"},{"type":"null"}]},"reason":{"minLength":1,"description":"New reason. Omit to keep.","type":"string"}}}}}}}},"/bff/branch/closure-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchClosure-delete","tags":["Branch"],"description":"Sets `deleted_date` on the closure row. All read paths filter `deleted_date IS NULL` so the operator sees the row vanish. The row remains in the DB so the audit feed can still reference it.","summary":"Remove a branch closure (soft delete)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["closureId"],"properties":{"closureId":{"description":"External id of the closure to delete (soft-delete).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["closureId"],"properties":{"closureId":{"description":"External id of the closure to delete (soft-delete).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["closureId"],"properties":{"closureId":{"description":"External id of the closure to delete (soft-delete).","type":"string"}}}}}}}},"/bff/branch/franchise-fee-list":{"get":{"parameters":[{"description":"Branch slug.","examples":["nusle"],"schema":{"type":"string"},"in":"query","name":"slug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fromDate","toDate","percentage","note","insertedDate"],"properties":{"id":{"description":"Internal database ID of the validity period.","type":"string"},"fromDate":{"description":"Start of the period (inclusive), YYYY-MM-DD.","type":"string"},"toDate":{"description":"End of the period (inclusive). NULL = open-ended (still in force).","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Franchise fee in percent (e.g. 9 = 9 %). 0–100.","type":"number"},"note":{"description":"Optional human note (contract ref, reason for change, …).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the row was created.","anyOf":[{"description":"When the row was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fromDate","toDate","percentage","note","insertedDate"],"properties":{"id":{"description":"Internal database ID of the validity period.","type":"string"},"fromDate":{"description":"Start of the period (inclusive), YYYY-MM-DD.","type":"string"},"toDate":{"description":"End of the period (inclusive). NULL = open-ended (still in force).","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Franchise fee in percent (e.g. 9 = 9 %). 0–100.","type":"number"},"note":{"description":"Optional human note (contract ref, reason for change, …).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the row was created.","anyOf":[{"description":"When the row was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fromDate","toDate","percentage","note","insertedDate"],"properties":{"id":{"description":"Internal database ID of the validity period.","type":"string"},"fromDate":{"description":"Start of the period (inclusive), YYYY-MM-DD.","type":"string"},"toDate":{"description":"End of the period (inclusive). NULL = open-ended (still in force).","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Franchise fee in percent (e.g. 9 = 9 %). 0–100.","type":"number"},"note":{"description":"Optional human note (contract ref, reason for change, …).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the row was created.","anyOf":[{"description":"When the row was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffBranchFranchise-fee-list","tags":["Branch"],"description":"Returns the chronological list of franchise-fee percentages configured for the branch. Each row defines a percentage that applies between `fromDate` (inclusive) and `toDate` (inclusive, NULL = open-ended). The Branch Finance roll-up uses the row whose window covers each month's last day to compute the `franchiseFeeAmount` column.","summary":"List franchise-fee validity periods for a branch"}},"/bff/branch/franchise-fee-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffBranchFranchise-fee-add","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Add a franchise-fee validity period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","fromDate","percentage"],"properties":{"slug":{"description":"Branch slug the period belongs to.","examples":["nusle"],"type":"string"},"fromDate":{"description":"Start of the validity period (inclusive), YYYY-MM-DD.","examples":["2026-01-01"],"type":"string"},"toDate":{"description":"End of the validity period (inclusive). Omit or pass null for open-ended.","examples":["2026-12-31"],"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Franchise fee in percent (e.g. 9 for 9 %). Must be between 0 and 100.","examples":[9],"type":"number"},"note":{"description":"Free-form description of what the tariff covers (services, agreement scope). Max 5000 characters. Rendered into the branch finance-report PDF for the month this rule covers so the franchisee sees which services justify the percentage.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","fromDate","percentage"],"properties":{"slug":{"description":"Branch slug the period belongs to.","examples":["nusle"],"type":"string"},"fromDate":{"description":"Start of the validity period (inclusive), YYYY-MM-DD.","examples":["2026-01-01"],"type":"string"},"toDate":{"description":"End of the validity period (inclusive). Omit or pass null for open-ended.","examples":["2026-12-31"],"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Franchise fee in percent (e.g. 9 for 9 %). Must be between 0 and 100.","examples":[9],"type":"number"},"note":{"description":"Free-form description of what the tariff covers (services, agreement scope). Max 5000 characters. Rendered into the branch finance-report PDF for the month this rule covers so the franchisee sees which services justify the percentage.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["slug","fromDate","percentage"],"properties":{"slug":{"description":"Branch slug the period belongs to.","examples":["nusle"],"type":"string"},"fromDate":{"description":"Start of the validity period (inclusive), YYYY-MM-DD.","examples":["2026-01-01"],"type":"string"},"toDate":{"description":"End of the validity period (inclusive). Omit or pass null for open-ended.","examples":["2026-12-31"],"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Franchise fee in percent (e.g. 9 for 9 %). Must be between 0 and 100.","examples":[9],"type":"number"},"note":{"description":"Free-form description of what the tariff covers (services, agreement scope). Max 5000 characters. Rendered into the branch finance-report PDF for the month this rule covers so the franchisee sees which services justify the percentage.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/branch/franchise-fee-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchFranchise-fee-update","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Update a franchise-fee period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Franchise-fee period ID.","examples":["1"],"type":"string"},"fromDate":{"description":"New start (YYYY-MM-DD).","type":"string"},"toDate":{"description":"New end (YYYY-MM-DD) or null for open-ended.","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"New percentage. Must be between 0 and 100.","type":"number"},"note":{"description":"New free-form description of what the tariff covers (max 5000 chars). Also propagated into the finance-report PDF.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Franchise-fee period ID.","examples":["1"],"type":"string"},"fromDate":{"description":"New start (YYYY-MM-DD).","type":"string"},"toDate":{"description":"New end (YYYY-MM-DD) or null for open-ended.","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"New percentage. Must be between 0 and 100.","type":"number"},"note":{"description":"New free-form description of what the tariff covers (max 5000 chars). Also propagated into the finance-report PDF.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Franchise-fee period ID.","examples":["1"],"type":"string"},"fromDate":{"description":"New start (YYYY-MM-DD).","type":"string"},"toDate":{"description":"New end (YYYY-MM-DD) or null for open-ended.","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"New percentage. Must be between 0 and 100.","type":"number"},"note":{"description":"New free-form description of what the tariff covers (max 5000 chars). Also propagated into the finance-report PDF.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/branch/franchise-fee-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranchFranchise-fee-delete","tags":["Branch"],"description":"Organisation branches (pobočky) management. Each organisation can create any number of branches. A branch contains name, description, internal code, address, GPS coordinates, manager, opening hours (regular + exceptions), email/phone contacts and a photo gallery with a dedicated main photo.","summary":"Delete a franchise-fee period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Franchise-fee period ID.","examples":["1"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Franchise-fee period ID.","examples":["1"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Franchise-fee period ID.","examples":["1"],"type":"string"}}}}}}}},"/bff/branch-cost/list":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-vinohrady"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true}],"operationId":"getBffBranch-costList","tags":["Branch Cost"],"summary":"List recurring branch cost definitions","description":"Returns every active (not soft-deleted) cost line registered on the branch with its validity window, recurrence cadence, type (fixed/variable) and default amount. The monthly values for variable costs are emitted by `/monthly-breakdown` — this endpoint returns the definitions only.","responses":{"200":{}}}},"/bff/branch-cost/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"costId":{"type":"string"}},"required":["success","costId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"costId":{"type":"string"}},"required":["success","costId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"costId":{"type":"string"}},"required":["success","costId"]}}}}},"operationId":"postBffBranch-costCreate","tags":["Branch Cost"],"summary":"Create a recurring branch cost","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["branchSlug","name","category","type","defaultAmountMoney","appliesFrom"],"properties":{"branchSlug":{"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"category":{"anyOf":[{"const":"rent","type":"string"},{"const":"energy","type":"string"},{"const":"utilities","type":"string"},{"const":"cleaning","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"supplies","type":"string"},{"const":"insurance","type":"string"},{"const":"taxes","type":"string"},{"const":"services","type":"string"},{"const":"other","type":"string"}]},"type":{"anyOf":[{"const":"fixed","type":"string"},{"const":"variable","type":"string"}]},"defaultAmountMoney":{"description":"Amount in minor units (cents / haléře). Non-negative.","minimum":0,"type":"number"},"currency":{"description":"ISO 4217 — defaults to the organisation default currency.","type":"string"},"appliesFrom":{"description":"ISO YYYY-MM-DD.","type":"string"},"appliesTo":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD or null = open-ended.","type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"recurringIntervalMonths":{"minimum":1,"maximum":36,"type":"number"},"paymentDayOfMonth":{"nullable":true,"anyOf":[{"minimum":1,"maximum":28,"description":"Day of month due, 1..28.","type":"number"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the supplier (shop__contact.external_id) — the party this cost is paid to.","type":"string"},{"type":"null"}]},"payerContactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the \"PLÁTCE\" (shop__contact.external_id) — the party liable to pay. Omit to leave the branch itself as the implicit payer.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["branchSlug","name","category","type","defaultAmountMoney","appliesFrom"],"properties":{"branchSlug":{"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"category":{"anyOf":[{"const":"rent","type":"string"},{"const":"energy","type":"string"},{"const":"utilities","type":"string"},{"const":"cleaning","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"supplies","type":"string"},{"const":"insurance","type":"string"},{"const":"taxes","type":"string"},{"const":"services","type":"string"},{"const":"other","type":"string"}]},"type":{"anyOf":[{"const":"fixed","type":"string"},{"const":"variable","type":"string"}]},"defaultAmountMoney":{"description":"Amount in minor units (cents / haléře). Non-negative.","minimum":0,"type":"number"},"currency":{"description":"ISO 4217 — defaults to the organisation default currency.","type":"string"},"appliesFrom":{"description":"ISO YYYY-MM-DD.","type":"string"},"appliesTo":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD or null = open-ended.","type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"recurringIntervalMonths":{"minimum":1,"maximum":36,"type":"number"},"paymentDayOfMonth":{"nullable":true,"anyOf":[{"minimum":1,"maximum":28,"description":"Day of month due, 1..28.","type":"number"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the supplier (shop__contact.external_id) — the party this cost is paid to.","type":"string"},{"type":"null"}]},"payerContactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the \"PLÁTCE\" (shop__contact.external_id) — the party liable to pay. Omit to leave the branch itself as the implicit payer.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["branchSlug","name","category","type","defaultAmountMoney","appliesFrom"],"properties":{"branchSlug":{"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"category":{"anyOf":[{"const":"rent","type":"string"},{"const":"energy","type":"string"},{"const":"utilities","type":"string"},{"const":"cleaning","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"supplies","type":"string"},{"const":"insurance","type":"string"},{"const":"taxes","type":"string"},{"const":"services","type":"string"},{"const":"other","type":"string"}]},"type":{"anyOf":[{"const":"fixed","type":"string"},{"const":"variable","type":"string"}]},"defaultAmountMoney":{"description":"Amount in minor units (cents / haléře). Non-negative.","minimum":0,"type":"number"},"currency":{"description":"ISO 4217 — defaults to the organisation default currency.","type":"string"},"appliesFrom":{"description":"ISO YYYY-MM-DD.","type":"string"},"appliesTo":{"nullable":true,"anyOf":[{"description":"ISO YYYY-MM-DD or null = open-ended.","type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"recurringIntervalMonths":{"minimum":1,"maximum":36,"type":"number"},"paymentDayOfMonth":{"nullable":true,"anyOf":[{"minimum":1,"maximum":28,"description":"Day of month due, 1..28.","type":"number"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the supplier (shop__contact.external_id) — the party this cost is paid to.","type":"string"},{"type":"null"}]},"payerContactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the \"PLÁTCE\" (shop__contact.external_id) — the party liable to pay. Omit to leave the branch itself as the implicit payer.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/branch-cost/edit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"costId":{"type":"string"}},"required":["success","costId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"costId":{"type":"string"}},"required":["success","costId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"costId":{"type":"string"}},"required":["success","costId"]}}}}},"operationId":"postBffBranch-costEdit","tags":["Branch Cost"],"summary":"Edit an existing branch cost","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["costId"],"properties":{"costId":{"description":"External id of the cost to edit.","type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"category":{"anyOf":[{"const":"rent","type":"string"},{"const":"energy","type":"string"},{"const":"utilities","type":"string"},{"const":"cleaning","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"supplies","type":"string"},{"const":"insurance","type":"string"},{"const":"taxes","type":"string"},{"const":"services","type":"string"},{"const":"other","type":"string"}]},"type":{"anyOf":[{"const":"fixed","type":"string"},{"const":"variable","type":"string"}]},"defaultAmountMoney":{"minimum":0,"type":"number"},"appliesFrom":{"type":"string"},"appliesTo":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"recurringIntervalMonths":{"minimum":1,"maximum":36,"type":"number"},"paymentDayOfMonth":{"nullable":true,"anyOf":[{"minimum":1,"maximum":28,"type":"number"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the supplier (shop__contact.external_id). `null` clears the link.","type":"string"},{"type":"null"}]},"payerContactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the \"PLÁTCE\" (shop__contact.external_id). `null` clears the link, omit to keep the current value.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["costId"],"properties":{"costId":{"description":"External id of the cost to edit.","type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"category":{"anyOf":[{"const":"rent","type":"string"},{"const":"energy","type":"string"},{"const":"utilities","type":"string"},{"const":"cleaning","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"supplies","type":"string"},{"const":"insurance","type":"string"},{"const":"taxes","type":"string"},{"const":"services","type":"string"},{"const":"other","type":"string"}]},"type":{"anyOf":[{"const":"fixed","type":"string"},{"const":"variable","type":"string"}]},"defaultAmountMoney":{"minimum":0,"type":"number"},"appliesFrom":{"type":"string"},"appliesTo":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"recurringIntervalMonths":{"minimum":1,"maximum":36,"type":"number"},"paymentDayOfMonth":{"nullable":true,"anyOf":[{"minimum":1,"maximum":28,"type":"number"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the supplier (shop__contact.external_id). `null` clears the link.","type":"string"},{"type":"null"}]},"payerContactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the \"PLÁTCE\" (shop__contact.external_id). `null` clears the link, omit to keep the current value.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["costId"],"properties":{"costId":{"description":"External id of the cost to edit.","type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"category":{"anyOf":[{"const":"rent","type":"string"},{"const":"energy","type":"string"},{"const":"utilities","type":"string"},{"const":"cleaning","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"supplies","type":"string"},{"const":"insurance","type":"string"},{"const":"taxes","type":"string"},{"const":"services","type":"string"},{"const":"other","type":"string"}]},"type":{"anyOf":[{"const":"fixed","type":"string"},{"const":"variable","type":"string"}]},"defaultAmountMoney":{"minimum":0,"type":"number"},"appliesFrom":{"type":"string"},"appliesTo":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"recurringIntervalMonths":{"minimum":1,"maximum":36,"type":"number"},"paymentDayOfMonth":{"nullable":true,"anyOf":[{"minimum":1,"maximum":28,"type":"number"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the supplier (shop__contact.external_id). `null` clears the link.","type":"string"},{"type":"null"}]},"payerContactExternalId":{"nullable":true,"anyOf":[{"description":"External id of the \"PLÁTCE\" (shop__contact.external_id). `null` clears the link, omit to keep the current value.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/branch-cost/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffBranch-costDelete","tags":["Branch Cost"],"summary":"Soft-delete a branch cost","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["costId"],"properties":{"costId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["costId"],"properties":{"costId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["costId"],"properties":{"costId":{"type":"string"}}}}}}}},"/bff/branch-cost/entry-upsert":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"type":"string"}},"required":["success","entryId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"type":"string"}},"required":["success","entryId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"type":"string"}},"required":["success","entryId"]}}}}},"operationId":"postBffBranch-costEntry-upsert","tags":["Branch Cost"],"summary":"Set the monthly value for a variable cost (idempotent upsert)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["costId","yearMonth","amountMoney"],"properties":{"costId":{"description":"External id of the variable cost.","type":"string"},"yearMonth":{"description":"YYYY-MM.","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","type":"string"},"amountMoney":{"minimum":0,"type":"number"},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["costId","yearMonth","amountMoney"],"properties":{"costId":{"description":"External id of the variable cost.","type":"string"},"yearMonth":{"description":"YYYY-MM.","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","type":"string"},"amountMoney":{"minimum":0,"type":"number"},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["costId","yearMonth","amountMoney"],"properties":{"costId":{"description":"External id of the variable cost.","type":"string"},"yearMonth":{"description":"YYYY-MM.","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","type":"string"},"amountMoney":{"minimum":0,"type":"number"},"note":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/branch-cost/monthly-breakdown":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true},{"description":"Default 24, clamped to [1, 60].","schema":{"type":"string"},"in":"query","name":"monthCount","required":false}],"operationId":"getBffBranch-costMonthly-breakdown","tags":["Branch Cost"],"summary":"Per-month × per-cost matrix for the Costs tab","description":"Returns the cost matrix powering the Costs tab on the branch detail page: rows = months in the requested window, cells = computed amount per cost line (fixed → defaultAmount, variable → entry amount, 0 + flagged when missing). Also returns row totals (per month) and column totals (per cost), so the grid can show the \"Celkem\" column without recomputing.","responses":{"200":{}}}},"/bff/accounting-entity/list":{"get":{"operationId":"getBffAccounting-entityList","tags":["Accounting Entity"],"summary":"List accounting entities of the organisation","description":"Returns every accounting entity registered for the logged-in organisation, including the soft-deleted ones (UI dims them). Auto-bootstraps a default entity if none exists yet.","responses":{"200":{}}}},"/bff/accounting-entity/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"type":"string"}},"required":["success","externalId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"type":"string"}},"required":["success","externalId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"type":"string"}},"required":["success","externalId"]}}}}},"operationId":"postBffAccounting-entityCreate","tags":["Accounting Entity"],"summary":"Create accounting entity","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"contactExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"accountingYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"contactExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"accountingYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"contactExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"accountingYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/accounting-entity/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}}}}},"operationId":"postBffAccounting-entityUpdate","tags":["Accounting Entity"],"summary":"Update accounting entity","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"contactExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"accountingYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"contactExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"accountingYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"contactExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"accountingYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/accounting-entity/set-default":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"promoted":{"type":"boolean"}},"required":["success","promoted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"promoted":{"type":"boolean"}},"required":["success","promoted"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"promoted":{"type":"boolean"}},"required":["success","promoted"]}}}}},"operationId":"postBffAccounting-entitySet-default","tags":["Accounting Entity"],"summary":"Promote accounting entity to default","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}}}}}},"/bff/accounting-entity/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyDeleted":{"type":"boolean"}},"required":["success","alreadyDeleted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyDeleted":{"type":"boolean"}},"required":["success","alreadyDeleted"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyDeleted":{"type":"boolean"}},"required":["success","alreadyDeleted"]}}}}},"operationId":"postBffAccounting-entityDelete","tags":["Accounting Entity"],"summary":"Soft-delete accounting entity","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}}}}}},"/bff/expense/list":{"get":{"parameters":[{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"accountingEntityExternalId","required":false},{"schema":{"type":"string"},"in":"query","name":"branchSlug","required":false},{"schema":{"anyOf":[{"const":"fees","type":"string"},{"const":"shipping","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"utilities","type":"string"},{"const":"supplies","type":"string"},{"const":"services","type":"string"},{"const":"sw","type":"string"},{"const":"storage","type":"string"},{"const":"tax","type":"string"},{"const":"insurance","type":"string"},{"const":"travel","type":"string"},{"const":"writeoff","type":"string"},{"const":"refund","type":"string"},{"const":"other","type":"string"}]},"in":"query","name":"category","required":false},{"schema":{"anyOf":[{"const":"new","type":"string"},{"const":"approved","type":"string"},{"const":"in_progress","type":"string"},{"const":"review","type":"string"},{"const":"done","type":"string"},{"const":"rejected","type":"string"},{"const":"draft","type":"string"},{"const":"pending","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"const":"manual","type":"string"},{"const":"writeoff","type":"string"},{"const":"writeoff_legacy","type":"string"},{"const":"contact_credit","type":"string"},{"const":"payment_gateway_fee","type":"string"},{"const":"refund","type":"string"},{"const":"shipping_cost","type":"string"},{"const":"subscription_fee","type":"string"},{"const":"storage","type":"string"},{"const":"sms","type":"string"},{"const":"email","type":"string"},{"const":"bank_transaction","type":"string"},{"const":"cron","type":"string"},{"const":"api","type":"string"}]},"in":"query","name":"source","required":false},{"description":"YYYY-MM-DD inclusive lower bound on effective_date.","schema":{"type":"string"},"in":"query","name":"from","required":false},{"description":"YYYY-MM-DD inclusive upper bound on effective_date.","schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"boolean"},"in":"query","name":"includeDeleted","required":false},{"schema":{"minimum":1,"maximum":2000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":2000,"type":"integer"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffExpenseList","tags":["Expense"],"summary":"List expense ledger entries","description":"Returns the expense ledger of the logged-in organisation with optional filters. `total` is the signed sum of all non-deleted, non-rejected rows whose `totalMoney` is set; rejected and soft-deleted entries are still returned for the UI but excluded from the sum.","responses":{"200":{}}}},"/bff/expense/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"type":"string"},"attachmentCount":{"type":"number"}},"required":["success","externalId","attachmentCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"type":"string"},"attachmentCount":{"type":"number"}},"required":["success","externalId","attachmentCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"type":"string"},"attachmentCount":{"type":"number"}},"required":["success","externalId","attachmentCount"]}}}}},"operationId":"postBffExpenseCreate","tags":["Expense"],"summary":"Create expense","description":"Creates a new expense ledger entry. The `accountingEntityExternalId` is required only when multiple entities exist for the organisation — when omitted, the org default is used.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["category","effectiveDate","description"],"properties":{"accountingEntityExternalId":{"minLength":24,"maxLength":24,"type":"string"},"branchSlug":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierContactExternalId":{"description":"External id of the \"PŘÍJEMCE\" (payee) contact. Optional. When omitted or null, the expense is stored with supplier=NULL — the BFF does NOT invent a fallback (historically it auto-picked the org internal contact for write-offs, dropped 2026-07 so a genuinely unknown recipient stays unknown). Fill it in later via /update.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"invoiceExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"purchaseInvoiceSequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"const":"fees","type":"string"},{"const":"shipping","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"utilities","type":"string"},{"const":"supplies","type":"string"},{"const":"services","type":"string"},{"const":"sw","type":"string"},{"const":"storage","type":"string"},{"const":"tax","type":"string"},{"const":"insurance","type":"string"},{"const":"travel","type":"string"},{"const":"writeoff","type":"string"},{"const":"refund","type":"string"},{"const":"other","type":"string"}]},"accountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"vatRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"netMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"vatMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"minLength":3,"maxLength":3,"type":"string"},"effectiveDate":{"description":"YYYY-MM-DD","type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"type":"string"},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"payerContactExternalId":{"description":"External id of the \"PLÁTCE\" — the contact liable to pay the expense. Optional. When omitted or null, the expense is stored with payer=NULL — the BFF does NOT invent a fallback (operators sometimes don't know the counterparty at creation time; the admin fills the default at the UI layer). Fill it in later via /update.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"attachmentBlobTokens":{"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["category","effectiveDate","description"],"properties":{"accountingEntityExternalId":{"minLength":24,"maxLength":24,"type":"string"},"branchSlug":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierContactExternalId":{"description":"External id of the \"PŘÍJEMCE\" (payee) contact. Optional. When omitted or null, the expense is stored with supplier=NULL — the BFF does NOT invent a fallback (historically it auto-picked the org internal contact for write-offs, dropped 2026-07 so a genuinely unknown recipient stays unknown). Fill it in later via /update.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"invoiceExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"purchaseInvoiceSequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"const":"fees","type":"string"},{"const":"shipping","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"utilities","type":"string"},{"const":"supplies","type":"string"},{"const":"services","type":"string"},{"const":"sw","type":"string"},{"const":"storage","type":"string"},{"const":"tax","type":"string"},{"const":"insurance","type":"string"},{"const":"travel","type":"string"},{"const":"writeoff","type":"string"},{"const":"refund","type":"string"},{"const":"other","type":"string"}]},"accountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"vatRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"netMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"vatMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"minLength":3,"maxLength":3,"type":"string"},"effectiveDate":{"description":"YYYY-MM-DD","type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"type":"string"},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"payerContactExternalId":{"description":"External id of the \"PLÁTCE\" — the contact liable to pay the expense. Optional. When omitted or null, the expense is stored with payer=NULL — the BFF does NOT invent a fallback (operators sometimes don't know the counterparty at creation time; the admin fills the default at the UI layer). Fill it in later via /update.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"attachmentBlobTokens":{"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["category","effectiveDate","description"],"properties":{"accountingEntityExternalId":{"minLength":24,"maxLength":24,"type":"string"},"branchSlug":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierContactExternalId":{"description":"External id of the \"PŘÍJEMCE\" (payee) contact. Optional. When omitted or null, the expense is stored with supplier=NULL — the BFF does NOT invent a fallback (historically it auto-picked the org internal contact for write-offs, dropped 2026-07 so a genuinely unknown recipient stays unknown). Fill it in later via /update.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"invoiceExternalId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"purchaseInvoiceSequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderHash":{"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"const":"fees","type":"string"},{"const":"shipping","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"utilities","type":"string"},{"const":"supplies","type":"string"},{"const":"services","type":"string"},{"const":"sw","type":"string"},{"const":"storage","type":"string"},{"const":"tax","type":"string"},{"const":"insurance","type":"string"},{"const":"travel","type":"string"},{"const":"writeoff","type":"string"},{"const":"refund","type":"string"},{"const":"other","type":"string"}]},"accountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"vatRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"netMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"vatMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"minLength":3,"maxLength":3,"type":"string"},"effectiveDate":{"description":"YYYY-MM-DD","type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"type":"string"},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"payerContactExternalId":{"description":"External id of the \"PLÁTCE\" — the contact liable to pay the expense. Optional. When omitted or null, the expense is stored with payer=NULL — the BFF does NOT invent a fallback (operators sometimes don't know the counterparty at creation time; the admin fills the default at the UI layer). Fill it in later via /update.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"attachmentBlobTokens":{"type":"array","items":{"type":"string"}}}}}}}}},"/bff/expense/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}}}}},"operationId":"postBffExpenseUpdate","tags":["Expense"],"summary":"Update expense (payer + supplier swaps allowed on any status)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"description":{"minLength":1,"type":"string"},"category":{"anyOf":[{"const":"fees","type":"string"},{"const":"shipping","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"utilities","type":"string"},{"const":"supplies","type":"string"},{"const":"services","type":"string"},{"const":"sw","type":"string"},{"const":"storage","type":"string"},{"const":"tax","type":"string"},{"const":"insurance","type":"string"},{"const":"travel","type":"string"},{"const":"writeoff","type":"string"},{"const":"refund","type":"string"},{"const":"other","type":"string"}]},"accountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"vatRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"netMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"vatMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"effectiveDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"payerContactExternalId":{"description":"External id of the new \"PLÁTCE\" contact. `null` clears the link; omit to keep the current value. Editing the payer is allowed even on terminal rows because it does not move money — it just re-attributes who owes what.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"supplierContactExternalId":{"description":"External id of the new \"PŘÍJEMCE\" contact. Same tri-state as payer: `null` clears, omit keeps. Editing the supplier is allowed on terminal rows for the same reason.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"description":{"minLength":1,"type":"string"},"category":{"anyOf":[{"const":"fees","type":"string"},{"const":"shipping","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"utilities","type":"string"},{"const":"supplies","type":"string"},{"const":"services","type":"string"},{"const":"sw","type":"string"},{"const":"storage","type":"string"},{"const":"tax","type":"string"},{"const":"insurance","type":"string"},{"const":"travel","type":"string"},{"const":"writeoff","type":"string"},{"const":"refund","type":"string"},{"const":"other","type":"string"}]},"accountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"vatRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"netMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"vatMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"effectiveDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"payerContactExternalId":{"description":"External id of the new \"PLÁTCE\" contact. `null` clears the link; omit to keep the current value. Editing the payer is allowed even on terminal rows because it does not move money — it just re-attributes who owes what.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"supplierContactExternalId":{"description":"External id of the new \"PŘÍJEMCE\" contact. Same tri-state as payer: `null` clears, omit keeps. Editing the supplier is allowed on terminal rows for the same reason.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"description":{"minLength":1,"type":"string"},"category":{"anyOf":[{"const":"fees","type":"string"},{"const":"shipping","type":"string"},{"const":"marketing","type":"string"},{"const":"payroll","type":"string"},{"const":"utilities","type":"string"},{"const":"supplies","type":"string"},{"const":"services","type":"string"},{"const":"sw","type":"string"},{"const":"storage","type":"string"},{"const":"tax","type":"string"},{"const":"insurance","type":"string"},{"const":"travel","type":"string"},{"const":"writeoff","type":"string"},{"const":"refund","type":"string"},{"const":"other","type":"string"}]},"accountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"vatRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"netMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"vatMoney":{"anyOf":[{"type":"number"},{"type":"null"}]},"effectiveDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"payerContactExternalId":{"description":"External id of the new \"PLÁTCE\" contact. `null` clears the link; omit to keep the current value. Editing the payer is allowed even on terminal rows because it does not move money — it just re-attributes who owes what.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"supplierContactExternalId":{"description":"External id of the new \"PŘÍJEMCE\" contact. Same tri-state as payer: `null` clears, omit keeps. Editing the supplier is allowed on terminal rows for the same reason.","anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/expense/approve":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffExpenseApprove","tags":["Expense"],"summary":"Approve expense (records status=approved)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}}}}}},"/bff/expense/reject":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffExpenseReject","tags":["Expense"],"summary":"Reject expense (records status=rejected)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}}}}}},"/bff/expense/mark-paid":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyPaid":{"type":"boolean"}},"required":["success","alreadyPaid"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyPaid":{"type":"boolean"}},"required":["success","alreadyPaid"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyPaid":{"type":"boolean"}},"required":["success","alreadyPaid"]}}}}},"operationId":"postBffExpenseMark-paid","tags":["Expense"],"summary":"Mark expense paid","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","paidDate"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"paidDate":{"description":"YYYY-MM-DD","type":"string"},"paymentMethod":{"maxLength":32,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","paidDate"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"paidDate":{"description":"YYYY-MM-DD","type":"string"},"paymentMethod":{"maxLength":32,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId","paidDate"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"paidDate":{"description":"YYYY-MM-DD","type":"string"},"paymentMethod":{"maxLength":32,"type":"string"}}}}}}}},"/bff/expense/record-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"recordId":{"type":"number"}},"required":["success","recordId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"recordId":{"type":"number"}},"required":["success","recordId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"recordId":{"type":"number"}},"required":["success","recordId"]}}}}},"operationId":"postBffExpenseRecord-add","tags":["Expense"],"summary":"Append a record (state change / comment / attachment) to an expense","requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"The record must contribute something: at least one of (non-empty message, status change, attachment). A record with none of those is rejected with an application error before the DB CHECK fires.","type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"message":{"description":"Free-form comment. Empty allowed when the record carries a status change or an attachment.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"status":{"description":"New status. Omit or set null for pure comment / attachment records. Any of new / approved / in_progress / review / done / rejected.","anyOf":[{"anyOf":[{"const":"new","type":"string"},{"const":"approved","type":"string"},{"const":"in_progress","type":"string"},{"const":"review","type":"string"},{"const":"done","type":"string"},{"const":"rejected","type":"string"}]},{"type":"null"}]},"blobToken":{"description":"Blob token from a prior /file-upload. One attachment per record — attach many files by writing many records.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"description":"The record must contribute something: at least one of (non-empty message, status change, attachment). A record with none of those is rejected with an application error before the DB CHECK fires.","type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"message":{"description":"Free-form comment. Empty allowed when the record carries a status change or an attachment.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"status":{"description":"New status. Omit or set null for pure comment / attachment records. Any of new / approved / in_progress / review / done / rejected.","anyOf":[{"anyOf":[{"const":"new","type":"string"},{"const":"approved","type":"string"},{"const":"in_progress","type":"string"},{"const":"review","type":"string"},{"const":"done","type":"string"},{"const":"rejected","type":"string"}]},{"type":"null"}]},"blobToken":{"description":"Blob token from a prior /file-upload. One attachment per record — attach many files by writing many records.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"description":"The record must contribute something: at least one of (non-empty message, status change, attachment). A record with none of those is rejected with an application error before the DB CHECK fires.","type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"message":{"description":"Free-form comment. Empty allowed when the record carries a status change or an attachment.","anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"status":{"description":"New status. Omit or set null for pure comment / attachment records. Any of new / approved / in_progress / review / done / rejected.","anyOf":[{"anyOf":[{"const":"new","type":"string"},{"const":"approved","type":"string"},{"const":"in_progress","type":"string"},{"const":"review","type":"string"},{"const":"done","type":"string"},{"const":"rejected","type":"string"}]},{"type":"null"}]},"blobToken":{"description":"Blob token from a prior /file-upload. One attachment per record — attach many files by writing many records.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/expense/detail":{"get":{"parameters":[{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"externalId","required":true}],"operationId":"getBffExpenseDetail","tags":["Expense"],"summary":"Get expense detail — record timeline","description":"Returns the expense identity + the ordered record list. Records are the event-sourced state log; the newest record with a non-NULL status is the current status.","responses":{"200":{}}}},"/bff/expense/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deletedDate":{"type":"string"},"alreadyDeleted":{"type":"boolean"}},"required":["success","deletedDate","alreadyDeleted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deletedDate":{"type":"string"},"alreadyDeleted":{"type":"boolean"}},"required":["success","deletedDate","alreadyDeleted"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deletedDate":{"type":"string"},"alreadyDeleted":{"type":"boolean"}},"required":["success","deletedDate","alreadyDeleted"]}}}}},"operationId":"postBffExpenseDelete","tags":["Expense"],"summary":"Soft-delete expense","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}}}}}},"/bff/expense/attachment-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"attachmentId":{"type":"number"},"blobId":{"type":"number"}},"required":["success","attachmentId","blobId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"attachmentId":{"type":"number"},"blobId":{"type":"number"}},"required":["success","attachmentId","blobId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"attachmentId":{"type":"number"},"blobId":{"type":"number"}},"required":["success","attachmentId","blobId"]}}}}},"operationId":"postBffExpenseAttachment-add","tags":["Expense"],"summary":"Attach a blob to an expense","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","blobToken"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"blobToken":{"type":"string"},"kind":{"maxLength":16,"type":"string"},"label":{"maxLength":200,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","blobToken"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"blobToken":{"type":"string"},"kind":{"maxLength":16,"type":"string"},"label":{"maxLength":200,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId","blobToken"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"blobToken":{"type":"string"},"kind":{"maxLength":16,"type":"string"},"label":{"maxLength":200,"type":"string"}}}}}}}},"/bff/expense/attachment-remove":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"type":"boolean"}},"required":["success","removed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"type":"boolean"}},"required":["success","removed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"type":"boolean"}},"required":["success","removed"]}}}}},"operationId":"postBffExpenseAttachment-remove","tags":["Expense"],"summary":"Remove an expense attachment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","attachmentId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"attachmentId":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","attachmentId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"attachmentId":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["externalId","attachmentId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"attachmentId":{"type":"number"}}}}}}}},"/bff/calendar/calendar-list":{"get":{"parameters":[{"description":"`true` = include archived calendars (BIZKIT-109). Default hides them.","schema":{"type":"string"},"in":"query","name":"includeArchived","required":false},{"description":"Which slice of the directory to return. `'organisation'` (default) = team / booking / resource calendars plus the viewer's own personal calendar pinned first. `'personal'` = personal calendars (own + colleagues whose visibility is `'organisation'`).","schema":{"anyOf":[{"const":"organisation","type":"string"},{"const":"personal","type":"string"}]},"in":"query","name":"kind","required":false}],"responses":{"200":{"description":"List of calendars with live event status.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Calendar item with live status.","type":"object","required":["id","name","color","timezone","insertedDate","hasLock","kind","isOwn","totalEvents","upcomingEvents"],"properties":{"id":{"description":"External calendar code.","type":"string"},"name":{"description":"Calendar display name.","type":"string"},"internalDescription":{"description":"Internal note (not shown to customers).","type":"string"},"color":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"insertedDate":{"description":"Date when the calendar was created.","anyOf":[{"description":"Date when the calendar was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"hasLock":{"description":"Whether a smart lock device is connected.","type":"boolean"},"kind":{"description":"Calendar kind: 'organisation' (team/booking), 'personal' (owned by a member), 'resource', 'external_mirror'.","type":"string"},"isOwn":{"description":"True when this is the viewer's own personal calendar.","type":"boolean"},"archivedDate":{"description":"ISO timestamp when the calendar was archived; absent = active.","type":"string"},"totalEvents":{"description":"Total number of non-cancelled events.","type":"number"},"upcomingEvents":{"description":"Number of future events (start_time > now).","type":"number"},"currentEvent":{"description":"Event that is running right now (start <= now < end). Undefined if idle.","type":"object","required":["id","title","startTime","endTime"],"properties":{"id":{"description":"External event code.","type":"string"},"title":{"description":"Title of the currently running event.","type":"string"},"startTime":{"description":"Start time of the current event.","anyOf":[{"description":"Start time of the current event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"End time of the current event.","anyOf":[{"description":"End time of the current event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"nextEvent":{"description":"Nearest future event. Undefined if nothing is scheduled.","type":"object","required":["id","title","startTime"],"properties":{"id":{"description":"External event code.","type":"string"},"title":{"description":"Title of the next upcoming event.","type":"string"},"startTime":{"description":"Start time of the next event.","anyOf":[{"description":"Start time of the next event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"lastEventEnd":{"description":"End time of the most recent past event. Useful for \"last active\" display.","anyOf":[{"description":"End time of the most recent past event. Useful for \"last active\" display.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of calendars returned.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Calendar item with live status.","type":"object","required":["id","name","color","timezone","insertedDate","hasLock","kind","isOwn","totalEvents","upcomingEvents"],"properties":{"id":{"description":"External calendar code.","type":"string"},"name":{"description":"Calendar display name.","type":"string"},"internalDescription":{"description":"Internal note (not shown to customers).","type":"string"},"color":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"insertedDate":{"description":"Date when the calendar was created.","anyOf":[{"description":"Date when the calendar was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"hasLock":{"description":"Whether a smart lock device is connected.","type":"boolean"},"kind":{"description":"Calendar kind: 'organisation' (team/booking), 'personal' (owned by a member), 'resource', 'external_mirror'.","type":"string"},"isOwn":{"description":"True when this is the viewer's own personal calendar.","type":"boolean"},"archivedDate":{"description":"ISO timestamp when the calendar was archived; absent = active.","type":"string"},"totalEvents":{"description":"Total number of non-cancelled events.","type":"number"},"upcomingEvents":{"description":"Number of future events (start_time > now).","type":"number"},"currentEvent":{"description":"Event that is running right now (start <= now < end). Undefined if idle.","type":"object","required":["id","title","startTime","endTime"],"properties":{"id":{"description":"External event code.","type":"string"},"title":{"description":"Title of the currently running event.","type":"string"},"startTime":{"description":"Start time of the current event.","anyOf":[{"description":"Start time of the current event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"End time of the current event.","anyOf":[{"description":"End time of the current event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"nextEvent":{"description":"Nearest future event. Undefined if nothing is scheduled.","type":"object","required":["id","title","startTime"],"properties":{"id":{"description":"External event code.","type":"string"},"title":{"description":"Title of the next upcoming event.","type":"string"},"startTime":{"description":"Start time of the next event.","anyOf":[{"description":"Start time of the next event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"lastEventEnd":{"description":"End time of the most recent past event. Useful for \"last active\" display.","anyOf":[{"description":"End time of the most recent past event. Useful for \"last active\" display.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of calendars returned.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Calendar item with live status.","type":"object","required":["id","name","color","timezone","insertedDate","hasLock","kind","isOwn","totalEvents","upcomingEvents"],"properties":{"id":{"description":"External calendar code.","type":"string"},"name":{"description":"Calendar display name.","type":"string"},"internalDescription":{"description":"Internal note (not shown to customers).","type":"string"},"color":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"insertedDate":{"description":"Date when the calendar was created.","anyOf":[{"description":"Date when the calendar was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"hasLock":{"description":"Whether a smart lock device is connected.","type":"boolean"},"kind":{"description":"Calendar kind: 'organisation' (team/booking), 'personal' (owned by a member), 'resource', 'external_mirror'.","type":"string"},"isOwn":{"description":"True when this is the viewer's own personal calendar.","type":"boolean"},"archivedDate":{"description":"ISO timestamp when the calendar was archived; absent = active.","type":"string"},"totalEvents":{"description":"Total number of non-cancelled events.","type":"number"},"upcomingEvents":{"description":"Number of future events (start_time > now).","type":"number"},"currentEvent":{"description":"Event that is running right now (start <= now < end). Undefined if idle.","type":"object","required":["id","title","startTime","endTime"],"properties":{"id":{"description":"External event code.","type":"string"},"title":{"description":"Title of the currently running event.","type":"string"},"startTime":{"description":"Start time of the current event.","anyOf":[{"description":"Start time of the current event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"End time of the current event.","anyOf":[{"description":"End time of the current event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"nextEvent":{"description":"Nearest future event. Undefined if nothing is scheduled.","type":"object","required":["id","title","startTime"],"properties":{"id":{"description":"External event code.","type":"string"},"title":{"description":"Title of the next upcoming event.","type":"string"},"startTime":{"description":"Start time of the next event.","anyOf":[{"description":"Start time of the next event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"lastEventEnd":{"description":"End time of the most recent past event. Useful for \"last active\" display.","anyOf":[{"description":"End time of the most recent past event. Useful for \"last active\" display.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of calendars returned.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffCalendarCalendar-list","tags":["Calendar"],"summary":"List calendars","description":"Returns all calendars accessible to the authenticated member. Includes live status: currently running event, next upcoming event, and statistics. The viewer's own personal calendar is always pinned as the first row."}},"/bff/calendar/calendar-detail":{"get":{"parameters":[{"description":"External calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Calendar view mode (e.g., \"day\", \"week\", \"month\", \"report\").","schema":{"type":"string"},"in":"query","name":"view","required":true},{"description":"ISO date string to load events from. Defaults to now.","schema":{"type":"string"},"in":"query","name":"selectorFrom","required":false}],"operationId":"getBffCalendarCalendar-detail","tags":["Calendar"],"summary":"Get calendar detail","description":"Returns calendar metadata and events for the given view and date range. Requires the authenticated member to have permission on the calendar.","responses":{"200":{}}}},"/bff/calendar/overview":{"get":{"parameters":[{"description":"Calendar view mode (\"day\", \"week\", \"month\").","schema":{"type":"string"},"in":"query","name":"view","required":true},{"description":"ISO date string to load events from. Defaults to now.","schema":{"type":"string"},"in":"query","name":"selectorFrom","required":false}],"operationId":"getBffCalendarOverview","tags":["Calendar"],"summary":"All calendars overview","description":"BIZKIT-171: events of every calendar the member can see (team, booking and resource calendars plus the own personal one) in one range. Each event carries its calendar code, name and colour and the planned-date kinds of linked orders, so the UI can filter by calendar and by kind.","responses":{"200":{}}}},"/bff/calendar/calendar-settings":{"get":{"parameters":[{"description":"External calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"operationId":"getBffCalendarCalendar-settings","tags":["Calendar"],"summary":"Get calendar settings (admin shape)","description":"Returns the flat calendar configuration consumed by the admin \"Nastavení kalendáře\" dialog. Field names map one-to-one with the admin form: publicDescription / internalDescription refer to the calendar entity, settingsPublicDescription / settingsInternalDescription to the reservation-page \"important info\" block.","responses":{"200":{}}}},"/bff/calendar/calendar-archive":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"archived":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","archived","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"archived":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","archived","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"archived":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","archived","changed"]}}}}},"operationId":"postBffCalendarCalendar-archive","tags":["Calendar"],"summary":"Archive or restore a calendar (BIZKIT-109)","description":"Archived calendars keep all events, orders and statistics, are hidden from calendar lists and pickers (unless `includeArchived`), disappear from the public API and reject new events.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","archived"],"properties":{"code":{"description":"External calendar code.","type":"string"},"archived":{"description":"`true` = archive, `false` = restore.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","archived"],"properties":{"code":{"description":"External calendar code.","type":"string"},"archived":{"description":"`true` = archive, `false` = restore.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["code","archived"],"properties":{"code":{"description":"External calendar code.","type":"string"},"archived":{"description":"`true` = archive, `false` = restore.","type":"boolean"}}}}}}}},"/bff/calendar/calendar-settings-update":{"post":{"parameters":[],"operationId":"postBffCalendarCalendar-settings-update","tags":["Calendar"],"summary":"Update calendar settings","description":"Partially updates calendar settings. Only provided fields are changed. Requires the authenticated member to have permission on the calendar.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"External calendar code identifier.","type":"string"},"name":{"description":"Calendar display name.","type":"string"},"color":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"publicDescription":{"nullable":true,"anyOf":[{"description":"Public description shown to customers.","type":"string"},{"type":"null"}]},"internalDescription":{"nullable":true,"anyOf":[{"description":"Internal note (not shown to customers).","type":"string"},{"type":"null"}]},"emailDescription":{"nullable":true,"anyOf":[{"description":"Description included in email notifications.","type":"string"},{"type":"null"}]},"emailDescriptionTranslations":{"description":"Per-locale e-mail description keyed by locale code (e.g. {\"en\": \"...\", \"uk\": \"...\"}). `{{ calendarEmailDescription }}` returns the text in the recipient's locale; an empty value falls back to `emailDescription`. Only the listed locales change; each must be enabled for the organisation.","type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"defaultLocationTitle":{"nullable":true,"anyOf":[{"description":"Default location title for new events.","type":"string"},{"type":"null"}]},"productId":{"nullable":true,"anyOf":[{"description":"Linked product ID.","type":"number"},{"type":"null"}]},"variantId":{"nullable":true,"anyOf":[{"description":"Linked product variant ID.","type":"number"},{"type":"null"}]},"lockId":{"nullable":true,"anyOf":[{"description":"External TTLock identifier of the smart lock to bind to this calendar (matches `iot__ttlock_lock.lock_id` and the /iot-lock/[lockId] admin route). `null` unlinks the current lock. The lock must belong to the same organisation.","type":"number"},{"type":"null"}]},"settingsPublicDescription":{"nullable":true,"anyOf":[{"description":"Public description in settings context.","type":"string"},{"type":"null"}]},"settingsInternalDescription":{"nullable":true,"anyOf":[{"description":"Internal description in settings context.","type":"string"},{"type":"null"}]},"onlineChangeDeadline":{"description":"Deadline for online changes (ISO duration or similar).","type":"string"},"reserveFrom":{"description":"Earliest time customers can reserve.","type":"string"},"reserveUntil":{"description":"Latest time customers can reserve.","type":"string"},"timeSlotInterval":{"description":"Time slot interval for the booking grid.","type":"string"},"lateCancelEnabled":{"description":"Allow late cancellation without refund between onlineChangeDeadline and lateCancelMinBefore before the start.","type":"boolean"},"lateCancelMinBefore":{"description":"Latest point before the start when a late cancellation is still allowed (relative time, e.g. \"2h\").","type":"string"},"accessCodeNotifyBefore":{"nullable":true,"anyOf":[{"description":"How long before the start the reservation reminder (access-code e-mail) is sent, e.g. \"10m\". Overrides the notifyBefore sent by the website; null = use the website value.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"External calendar code identifier.","type":"string"},"name":{"description":"Calendar display name.","type":"string"},"color":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"publicDescription":{"nullable":true,"anyOf":[{"description":"Public description shown to customers.","type":"string"},{"type":"null"}]},"internalDescription":{"nullable":true,"anyOf":[{"description":"Internal note (not shown to customers).","type":"string"},{"type":"null"}]},"emailDescription":{"nullable":true,"anyOf":[{"description":"Description included in email notifications.","type":"string"},{"type":"null"}]},"emailDescriptionTranslations":{"description":"Per-locale e-mail description keyed by locale code (e.g. {\"en\": \"...\", \"uk\": \"...\"}). `{{ calendarEmailDescription }}` returns the text in the recipient's locale; an empty value falls back to `emailDescription`. Only the listed locales change; each must be enabled for the organisation.","type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"defaultLocationTitle":{"nullable":true,"anyOf":[{"description":"Default location title for new events.","type":"string"},{"type":"null"}]},"productId":{"nullable":true,"anyOf":[{"description":"Linked product ID.","type":"number"},{"type":"null"}]},"variantId":{"nullable":true,"anyOf":[{"description":"Linked product variant ID.","type":"number"},{"type":"null"}]},"lockId":{"nullable":true,"anyOf":[{"description":"External TTLock identifier of the smart lock to bind to this calendar (matches `iot__ttlock_lock.lock_id` and the /iot-lock/[lockId] admin route). `null` unlinks the current lock. The lock must belong to the same organisation.","type":"number"},{"type":"null"}]},"settingsPublicDescription":{"nullable":true,"anyOf":[{"description":"Public description in settings context.","type":"string"},{"type":"null"}]},"settingsInternalDescription":{"nullable":true,"anyOf":[{"description":"Internal description in settings context.","type":"string"},{"type":"null"}]},"onlineChangeDeadline":{"description":"Deadline for online changes (ISO duration or similar).","type":"string"},"reserveFrom":{"description":"Earliest time customers can reserve.","type":"string"},"reserveUntil":{"description":"Latest time customers can reserve.","type":"string"},"timeSlotInterval":{"description":"Time slot interval for the booking grid.","type":"string"},"lateCancelEnabled":{"description":"Allow late cancellation without refund between onlineChangeDeadline and lateCancelMinBefore before the start.","type":"boolean"},"lateCancelMinBefore":{"description":"Latest point before the start when a late cancellation is still allowed (relative time, e.g. \"2h\").","type":"string"},"accessCodeNotifyBefore":{"nullable":true,"anyOf":[{"description":"How long before the start the reservation reminder (access-code e-mail) is sent, e.g. \"10m\". Overrides the notifyBefore sent by the website; null = use the website value.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"External calendar code identifier.","type":"string"},"name":{"description":"Calendar display name.","type":"string"},"color":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"publicDescription":{"nullable":true,"anyOf":[{"description":"Public description shown to customers.","type":"string"},{"type":"null"}]},"internalDescription":{"nullable":true,"anyOf":[{"description":"Internal note (not shown to customers).","type":"string"},{"type":"null"}]},"emailDescription":{"nullable":true,"anyOf":[{"description":"Description included in email notifications.","type":"string"},{"type":"null"}]},"emailDescriptionTranslations":{"description":"Per-locale e-mail description keyed by locale code (e.g. {\"en\": \"...\", \"uk\": \"...\"}). `{{ calendarEmailDescription }}` returns the text in the recipient's locale; an empty value falls back to `emailDescription`. Only the listed locales change; each must be enabled for the organisation.","type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"defaultLocationTitle":{"nullable":true,"anyOf":[{"description":"Default location title for new events.","type":"string"},{"type":"null"}]},"productId":{"nullable":true,"anyOf":[{"description":"Linked product ID.","type":"number"},{"type":"null"}]},"variantId":{"nullable":true,"anyOf":[{"description":"Linked product variant ID.","type":"number"},{"type":"null"}]},"lockId":{"nullable":true,"anyOf":[{"description":"External TTLock identifier of the smart lock to bind to this calendar (matches `iot__ttlock_lock.lock_id` and the /iot-lock/[lockId] admin route). `null` unlinks the current lock. The lock must belong to the same organisation.","type":"number"},{"type":"null"}]},"settingsPublicDescription":{"nullable":true,"anyOf":[{"description":"Public description in settings context.","type":"string"},{"type":"null"}]},"settingsInternalDescription":{"nullable":true,"anyOf":[{"description":"Internal description in settings context.","type":"string"},{"type":"null"}]},"onlineChangeDeadline":{"description":"Deadline for online changes (ISO duration or similar).","type":"string"},"reserveFrom":{"description":"Earliest time customers can reserve.","type":"string"},"reserveUntil":{"description":"Latest time customers can reserve.","type":"string"},"timeSlotInterval":{"description":"Time slot interval for the booking grid.","type":"string"},"lateCancelEnabled":{"description":"Allow late cancellation without refund between onlineChangeDeadline and lateCancelMinBefore before the start.","type":"boolean"},"lateCancelMinBefore":{"description":"Latest point before the start when a late cancellation is still allowed (relative time, e.g. \"2h\").","type":"string"},"accessCodeNotifyBefore":{"nullable":true,"anyOf":[{"description":"How long before the start the reservation reminder (access-code e-mail) is sent, e.g. \"10m\". Overrides the notifyBefore sent by the website; null = use the website value.","type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/calendar/available-locks":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","active"],"properties":{"lockId":{"description":"External TTLock identifier (matches /iot-lock/[lockId] and the update body).","type":"number"},"alias":{"description":"Display name of the lock. Empty aliases are omitted; the UI shows \"Lock <lockId>\" as a fallback.","type":"string"},"active":{"description":"Whether the lock is currently active in the system.","type":"boolean"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway. Unknown for locks that never reported.","type":"boolean"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","active"],"properties":{"lockId":{"description":"External TTLock identifier (matches /iot-lock/[lockId] and the update body).","type":"number"},"alias":{"description":"Display name of the lock. Empty aliases are omitted; the UI shows \"Lock <lockId>\" as a fallback.","type":"string"},"active":{"description":"Whether the lock is currently active in the system.","type":"boolean"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway. Unknown for locks that never reported.","type":"boolean"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["lockId","active"],"properties":{"lockId":{"description":"External TTLock identifier (matches /iot-lock/[lockId] and the update body).","type":"number"},"alias":{"description":"Display name of the lock. Empty aliases are omitted; the UI shows \"Lock <lockId>\" as a fallback.","type":"string"},"active":{"description":"Whether the lock is currently active in the system.","type":"boolean"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway. Unknown for locks that never reported.","type":"boolean"}}}}},"required":["items"]}}}}},"operationId":"getBffCalendarAvailable-locks","tags":["Calendar"],"summary":"List locks available for calendar binding","description":"Lightweight lock listing (id + alias + status) intended for the calendar-settings smart-lock selector. Returns every non-deleted lock in the authenticated organisation regardless of current binding — a single lock can be bound to more than one calendar. Use `/bff/iot-lock/lock-list` when the full health / gateway detail is needed."}},"/bff/calendar/calendar-analytics-lost-revenue-capacity":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"soldOutEvents":{"description":"Number of events where product was sold out.","type":"number"},"totalEventsAnalyzed":{"description":"Total number of events analyzed.","type":"number"},"soldOutRate":{"description":"Percentage of events that were sold out (0-100).","type":"number"},"avgRevenuePerAttendee":{"description":"Average revenue per attendee.","type":"number"},"estimatedLostRevenue":{"description":"Estimated lost revenue due to capacity constraints.","type":"number"},"estimatedLostAttendees":{"description":"Estimated number of attendees who could not book.","type":"number"}},"required":["soldOutEvents","totalEventsAnalyzed","soldOutRate","avgRevenuePerAttendee","estimatedLostRevenue","estimatedLostAttendees"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"soldOutEvents":{"description":"Number of events where product was sold out.","type":"number"},"totalEventsAnalyzed":{"description":"Total number of events analyzed.","type":"number"},"soldOutRate":{"description":"Percentage of events that were sold out (0-100).","type":"number"},"avgRevenuePerAttendee":{"description":"Average revenue per attendee.","type":"number"},"estimatedLostRevenue":{"description":"Estimated lost revenue due to capacity constraints.","type":"number"},"estimatedLostAttendees":{"description":"Estimated number of attendees who could not book.","type":"number"}},"required":["soldOutEvents","totalEventsAnalyzed","soldOutRate","avgRevenuePerAttendee","estimatedLostRevenue","estimatedLostAttendees"]}},"text/plain":{"schema":{"type":"object","properties":{"soldOutEvents":{"description":"Number of events where product was sold out.","type":"number"},"totalEventsAnalyzed":{"description":"Total number of events analyzed.","type":"number"},"soldOutRate":{"description":"Percentage of events that were sold out (0-100).","type":"number"},"avgRevenuePerAttendee":{"description":"Average revenue per attendee.","type":"number"},"estimatedLostRevenue":{"description":"Estimated lost revenue due to capacity constraints.","type":"number"},"estimatedLostAttendees":{"description":"Estimated number of attendees who could not book.","type":"number"}},"required":["soldOutEvents","totalEventsAnalyzed","soldOutRate","avgRevenuePerAttendee","estimatedLostRevenue","estimatedLostAttendees"]}}}}},"operationId":"getBffCalendarCalendar-analytics-lost-revenue-capacity","tags":["Calendar Analytics"],"summary":"Lost revenue due to capacity","description":"Estimates how much money was potentially lost because events were sold out. Uses average revenue per attendee and assumes at least 1 additional person wanted to book for each sold-out event."}},"/bff/calendar/calendar-analytics-report":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"description":"Calendar timezone.","type":"string"},"hourUsages":{"description":"Event count aggregated by hour of day.","type":"array","items":{"type":"object","required":["hourOfDay","eventCount"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"eventCount":{"description":"Number of events in this hour.","type":"number"}}}},"hourDayUsages":{"description":"Event count aggregated by hour and day of week (heatmap data).","type":"array","items":{"type":"object","required":["hourOfDay","eventCount"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"dayOfWeek":{"description":"Day of week (0=Sunday, 6=Saturday).","type":"number"},"eventCount":{"description":"Number of events.","type":"number"}}}}},"required":["timezone","hourUsages","hourDayUsages"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"timezone":{"description":"Calendar timezone.","type":"string"},"hourUsages":{"description":"Event count aggregated by hour of day.","type":"array","items":{"type":"object","required":["hourOfDay","eventCount"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"eventCount":{"description":"Number of events in this hour.","type":"number"}}}},"hourDayUsages":{"description":"Event count aggregated by hour and day of week (heatmap data).","type":"array","items":{"type":"object","required":["hourOfDay","eventCount"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"dayOfWeek":{"description":"Day of week (0=Sunday, 6=Saturday).","type":"number"},"eventCount":{"description":"Number of events.","type":"number"}}}}},"required":["timezone","hourUsages","hourDayUsages"]}},"text/plain":{"schema":{"type":"object","properties":{"timezone":{"description":"Calendar timezone.","type":"string"},"hourUsages":{"description":"Event count aggregated by hour of day.","type":"array","items":{"type":"object","required":["hourOfDay","eventCount"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"eventCount":{"description":"Number of events in this hour.","type":"number"}}}},"hourDayUsages":{"description":"Event count aggregated by hour and day of week (heatmap data).","type":"array","items":{"type":"object","required":["hourOfDay","eventCount"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"dayOfWeek":{"description":"Day of week (0=Sunday, 6=Saturday).","type":"number"},"eventCount":{"description":"Number of events.","type":"number"}}}}},"required":["timezone","hourUsages","hourDayUsages"]}}}}},"operationId":"getBffCalendarCalendar-analytics-report","tags":["Calendar Analytics"],"summary":"Get calendar analytics report","description":"Returns the default calendar analytics report with hourly usage patterns. Use the specific analytics endpoints for detailed metrics."}},"/bff/calendar/calendar-analytics-peak-hours-heatmap":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["dayOfWeek","hourOfDay","eventCount"],"properties":{"dayOfWeek":{"description":"Day of week (0=Sunday, 6=Saturday).","type":"number"},"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"eventCount":{"description":"Number of events in this slot.","type":"number"}}}},"maxCount":{"description":"Maximum event count in any slot.","type":"number"}},"required":["data","maxCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["dayOfWeek","hourOfDay","eventCount"],"properties":{"dayOfWeek":{"description":"Day of week (0=Sunday, 6=Saturday).","type":"number"},"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"eventCount":{"description":"Number of events in this slot.","type":"number"}}}},"maxCount":{"description":"Maximum event count in any slot.","type":"number"}},"required":["data","maxCount"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["dayOfWeek","hourOfDay","eventCount"],"properties":{"dayOfWeek":{"description":"Day of week (0=Sunday, 6=Saturday).","type":"number"},"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"eventCount":{"description":"Number of events in this slot.","type":"number"}}}},"maxCount":{"description":"Maximum event count in any slot.","type":"number"}},"required":["data","maxCount"]}}}}},"operationId":"getBffCalendarCalendar-analytics-peak-hours-heatmap","tags":["Calendar Analytics"],"summary":"Peak hours heatmap","description":"Shows when the calendar is most busy by day and hour - critical for pricing, capacity planning, and staffing decisions. Returns a matrix of day×hour with event counts."}},"/bff/calendar/calendar-analytics-weekend-vs-weekday":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"weekdayEvents":{"description":"Total events on weekdays (Mon-Fri).","type":"number"},"weekendEvents":{"description":"Total events on weekends (Sat-Sun).","type":"number"},"weekdayAvgPerDay":{"description":"Average events per weekday.","type":"number"},"weekendAvgPerDay":{"description":"Average events per weekend day.","type":"number"},"weekendRatio":{"description":"Weekend events as % of weekday events.","type":"number"}},"required":["weekdayEvents","weekendEvents","weekdayAvgPerDay","weekendAvgPerDay","weekendRatio"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"weekdayEvents":{"description":"Total events on weekdays (Mon-Fri).","type":"number"},"weekendEvents":{"description":"Total events on weekends (Sat-Sun).","type":"number"},"weekdayAvgPerDay":{"description":"Average events per weekday.","type":"number"},"weekendAvgPerDay":{"description":"Average events per weekend day.","type":"number"},"weekendRatio":{"description":"Weekend events as % of weekday events.","type":"number"}},"required":["weekdayEvents","weekendEvents","weekdayAvgPerDay","weekendAvgPerDay","weekendRatio"]}},"text/plain":{"schema":{"type":"object","properties":{"weekdayEvents":{"description":"Total events on weekdays (Mon-Fri).","type":"number"},"weekendEvents":{"description":"Total events on weekends (Sat-Sun).","type":"number"},"weekdayAvgPerDay":{"description":"Average events per weekday.","type":"number"},"weekendAvgPerDay":{"description":"Average events per weekend day.","type":"number"},"weekendRatio":{"description":"Weekend events as % of weekday events.","type":"number"}},"required":["weekdayEvents","weekendEvents","weekdayAvgPerDay","weekendAvgPerDay","weekendRatio"]}}}}},"operationId":"getBffCalendarCalendar-analytics-weekend-vs-weekday","tags":["Calendar Analytics"],"summary":"Weekend vs weekday comparison","description":"Compares customer behavior between weekdays and weekends. Shows total events, daily averages, and weekend ratio. Critical for weekend pricing and staffing decisions."}},"/bff/calendar/calendar-analytics-monthly-trend":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["month","eventCount","year"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"eventCount":{"description":"Number of events in this month.","type":"number"},"year":{"description":"Year.","type":"number"}}}},"trend":{"description":"Overall trend direction.","anyOf":[{"const":"growing","type":"string"},{"const":"declining","type":"string"},{"const":"stable","type":"string"}]},"growthRate":{"description":"Growth rate percentage.","type":"number"}},"required":["data","trend","growthRate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["month","eventCount","year"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"eventCount":{"description":"Number of events in this month.","type":"number"},"year":{"description":"Year.","type":"number"}}}},"trend":{"description":"Overall trend direction.","anyOf":[{"const":"growing","type":"string"},{"const":"declining","type":"string"},{"const":"stable","type":"string"}]},"growthRate":{"description":"Growth rate percentage.","type":"number"}},"required":["data","trend","growthRate"]}},"text/plain":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","required":["month","eventCount","year"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"eventCount":{"description":"Number of events in this month.","type":"number"},"year":{"description":"Year.","type":"number"}}}},"trend":{"description":"Overall trend direction.","anyOf":[{"const":"growing","type":"string"},{"const":"declining","type":"string"},{"const":"stable","type":"string"}]},"growthRate":{"description":"Growth rate percentage.","type":"number"}},"required":["data","trend","growthRate"]}}}}},"operationId":"getBffCalendarCalendar-analytics-monthly-trend","tags":["Calendar Analytics"],"summary":"Monthly utilization trend","description":"Shows if calendar usage is growing, declining, or stable over the past 12 months. Product health indicator with growth rate calculation."}},"/bff/calendar/calendar-analytics-top-event-types":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","required":["typeId","typeName","eventCount","percentage"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"eventCount":{"description":"Number of events of this type.","type":"number"},"percentage":{"description":"Percentage of total events.","type":"number"}}}},"totalEvents":{"description":"Total number of events analyzed.","type":"number"}},"required":["types","totalEvents"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","required":["typeId","typeName","eventCount","percentage"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"eventCount":{"description":"Number of events of this type.","type":"number"},"percentage":{"description":"Percentage of total events.","type":"number"}}}},"totalEvents":{"description":"Total number of events analyzed.","type":"number"}},"required":["types","totalEvents"]}},"text/plain":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","required":["typeId","typeName","eventCount","percentage"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"eventCount":{"description":"Number of events of this type.","type":"number"},"percentage":{"description":"Percentage of total events.","type":"number"}}}},"totalEvents":{"description":"Total number of events analyzed.","type":"number"}},"required":["types","totalEvents"]}}}}},"operationId":"getBffCalendarCalendar-analytics-top-event-types","tags":["Calendar Analytics"],"summary":"Top event types","description":"Shows which event types dominate the calendar - critical for scaling and resource allocation decisions. Returns top 10 types with counts and percentages."}},"/bff/calendar/calendar-analytics-utilization-rate":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total number of events.","type":"number"},"totalAttendees":{"description":"Total number of attendees.","type":"number"},"avgAttendeesPerEvent":{"description":"Average attendees per event.","type":"number"}},"required":["totalEvents","totalAttendees","avgAttendeesPerEvent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total number of events.","type":"number"},"totalAttendees":{"description":"Total number of attendees.","type":"number"},"avgAttendeesPerEvent":{"description":"Average attendees per event.","type":"number"}},"required":["totalEvents","totalAttendees","avgAttendeesPerEvent"]}},"text/plain":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total number of events.","type":"number"},"totalAttendees":{"description":"Total number of attendees.","type":"number"},"avgAttendeesPerEvent":{"description":"Average attendees per event.","type":"number"}},"required":["totalEvents","totalAttendees","avgAttendeesPerEvent"]}}}}},"operationId":"getBffCalendarCalendar-analytics-utilization-rate","tags":["Calendar Analytics"],"summary":"Attendance utilization rate","description":"Shows average attendance per event - key metric for calendar usage. Analyzes events in 30-day window around current date."}},"/bff/calendar/calendar-analytics-sold-out-rate":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Number of events analyzed.","type":"number"},"topAttendedEvents":{"type":"array","items":{"type":"object","required":["eventId","title","attendeeCount"],"properties":{"eventId":{"description":"Event ID.","type":"number"},"title":{"description":"Event title.","type":"string"},"attendeeCount":{"description":"Number of attendees.","type":"number"}}}},"avgAttendeesPerEvent":{"description":"Average attendees per event.","type":"number"}},"required":["totalEvents","topAttendedEvents","avgAttendeesPerEvent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Number of events analyzed.","type":"number"},"topAttendedEvents":{"type":"array","items":{"type":"object","required":["eventId","title","attendeeCount"],"properties":{"eventId":{"description":"Event ID.","type":"number"},"title":{"description":"Event title.","type":"string"},"attendeeCount":{"description":"Number of attendees.","type":"number"}}}},"avgAttendeesPerEvent":{"description":"Average attendees per event.","type":"number"}},"required":["totalEvents","topAttendedEvents","avgAttendeesPerEvent"]}},"text/plain":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Number of events analyzed.","type":"number"},"topAttendedEvents":{"type":"array","items":{"type":"object","required":["eventId","title","attendeeCount"],"properties":{"eventId":{"description":"Event ID.","type":"number"},"title":{"description":"Event title.","type":"string"},"attendeeCount":{"description":"Number of attendees.","type":"number"}}}},"avgAttendeesPerEvent":{"description":"Average attendees per event.","type":"number"}},"required":["totalEvents","topAttendedEvents","avgAttendeesPerEvent"]}}}}},"operationId":"getBffCalendarCalendar-analytics-sold-out-rate","tags":["Calendar Analytics"],"summary":"Event attendance analysis","description":"Shows which events have the most attendees - helps identify popular events. Returns top 10 most attended events."}},"/bff/calendar/calendar-analytics-lead-time-booking":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"averageDays":{"description":"Average booking lead time in days.","type":"number"},"medianDays":{"description":"Median booking lead time in days.","type":"number"},"distribution":{"type":"array","items":{"type":"object","required":["range","count","percentage"],"properties":{"range":{"description":"Time range (e.g., \"0-1 days\", \"2-7 days\").","type":"string"},"count":{"description":"Number of bookings in this range.","type":"number"},"percentage":{"description":"Percentage of total bookings.","type":"number"}}}}},"required":["averageDays","medianDays","distribution"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"averageDays":{"description":"Average booking lead time in days.","type":"number"},"medianDays":{"description":"Median booking lead time in days.","type":"number"},"distribution":{"type":"array","items":{"type":"object","required":["range","count","percentage"],"properties":{"range":{"description":"Time range (e.g., \"0-1 days\", \"2-7 days\").","type":"string"},"count":{"description":"Number of bookings in this range.","type":"number"},"percentage":{"description":"Percentage of total bookings.","type":"number"}}}}},"required":["averageDays","medianDays","distribution"]}},"text/plain":{"schema":{"type":"object","properties":{"averageDays":{"description":"Average booking lead time in days.","type":"number"},"medianDays":{"description":"Median booking lead time in days.","type":"number"},"distribution":{"type":"array","items":{"type":"object","required":["range","count","percentage"],"properties":{"range":{"description":"Time range (e.g., \"0-1 days\", \"2-7 days\").","type":"string"},"count":{"description":"Number of bookings in this range.","type":"number"},"percentage":{"description":"Percentage of total bookings.","type":"number"}}}}},"required":["averageDays","medianDays","distribution"]}}}}},"operationId":"getBffCalendarCalendar-analytics-lead-time-booking","tags":["Calendar Analytics"],"summary":"Lead time booking analysis","description":"Shows how far in advance people book events - critical for reminder timing and campaign planning. Includes average, median, and distribution by time ranges."}},"/bff/calendar/calendar-analytics-last-minute-bookings":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"totalBookings":{"description":"Total number of bookings.","type":"number"},"lastMinuteBookings":{"description":"Bookings made within 24 hours of event.","type":"number"},"lastMinuteRate":{"description":"Last-minute booking percentage (0-100).","type":"number"}},"required":["totalBookings","lastMinuteBookings","lastMinuteRate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalBookings":{"description":"Total number of bookings.","type":"number"},"lastMinuteBookings":{"description":"Bookings made within 24 hours of event.","type":"number"},"lastMinuteRate":{"description":"Last-minute booking percentage (0-100).","type":"number"}},"required":["totalBookings","lastMinuteBookings","lastMinuteRate"]}},"text/plain":{"schema":{"type":"object","properties":{"totalBookings":{"description":"Total number of bookings.","type":"number"},"lastMinuteBookings":{"description":"Bookings made within 24 hours of event.","type":"number"},"lastMinuteRate":{"description":"Last-minute booking percentage (0-100).","type":"number"}},"required":["totalBookings","lastMinuteBookings","lastMinuteRate"]}}}}},"operationId":"getBffCalendarCalendar-analytics-last-minute-bookings","tags":["Calendar Analytics"],"summary":"Last-minute bookings (<24h)","description":"Shows how many people book within 24 hours of event start. Useful for dynamic pricing strategies and last-minute promotions."}},"/bff/calendar/calendar-analytics-event-completion-rate":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total events in period.","type":"number"},"completedEvents":{"description":"Events that completed successfully.","type":"number"},"cancelledEvents":{"description":"Events that were cancelled.","type":"number"},"completionRate":{"description":"Completion percentage (0-100).","type":"number"},"cancellationRate":{"description":"Cancellation percentage (0-100).","type":"number"}},"required":["totalEvents","completedEvents","cancelledEvents","completionRate","cancellationRate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total events in period.","type":"number"},"completedEvents":{"description":"Events that completed successfully.","type":"number"},"cancelledEvents":{"description":"Events that were cancelled.","type":"number"},"completionRate":{"description":"Completion percentage (0-100).","type":"number"},"cancellationRate":{"description":"Cancellation percentage (0-100).","type":"number"}},"required":["totalEvents","completedEvents","cancelledEvents","completionRate","cancellationRate"]}},"text/plain":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total events in period.","type":"number"},"completedEvents":{"description":"Events that completed successfully.","type":"number"},"cancelledEvents":{"description":"Events that were cancelled.","type":"number"},"completionRate":{"description":"Completion percentage (0-100).","type":"number"},"cancellationRate":{"description":"Cancellation percentage (0-100).","type":"number"}},"required":["totalEvents","completedEvents","cancelledEvents","completionRate","cancellationRate"]}}}}},"operationId":"getBffCalendarCalendar-analytics-event-completion-rate","tags":["Calendar Analytics"],"summary":"Event completion rate","description":"Shows how many events actually happen versus get cancelled - operational stability indicator. High completion rate indicates reliable operations."}},"/bff/calendar/calendar-analytics-cancellation-analysis":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total number of events.","type":"number"},"cancelledEvents":{"description":"Number of cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation percentage (0-100).","type":"number"}},"required":["totalEvents","cancelledEvents","cancellationRate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total number of events.","type":"number"},"cancelledEvents":{"description":"Number of cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation percentage (0-100).","type":"number"}},"required":["totalEvents","cancelledEvents","cancellationRate"]}},"text/plain":{"schema":{"type":"object","properties":{"totalEvents":{"description":"Total number of events.","type":"number"},"cancelledEvents":{"description":"Number of cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation percentage (0-100).","type":"number"}},"required":["totalEvents","cancelledEvents","cancellationRate"]}}}}},"operationId":"getBffCalendarCalendar-analytics-cancellation-analysis","tags":["Calendar Analytics"],"summary":"Cancellation analysis","description":"Shows how often events get cancelled - operational stability indicator. Analyzes events from the last 90 days."}},"/bff/calendar/calendar-analytics-average-event-duration":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"overallAvgMinutes":{"description":"Overall average duration across all events.","type":"number"},"byType":{"type":"array","items":{"type":"object","required":["typeId","typeName","avgMinutes","eventCount"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"avgMinutes":{"description":"Average duration in minutes.","type":"number"},"eventCount":{"description":"Number of events of this type.","type":"number"}}}}},"required":["overallAvgMinutes","byType"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"overallAvgMinutes":{"description":"Overall average duration across all events.","type":"number"},"byType":{"type":"array","items":{"type":"object","required":["typeId","typeName","avgMinutes","eventCount"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"avgMinutes":{"description":"Average duration in minutes.","type":"number"},"eventCount":{"description":"Number of events of this type.","type":"number"}}}}},"required":["overallAvgMinutes","byType"]}},"text/plain":{"schema":{"type":"object","properties":{"overallAvgMinutes":{"description":"Overall average duration across all events.","type":"number"},"byType":{"type":"array","items":{"type":"object","required":["typeId","typeName","avgMinutes","eventCount"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"avgMinutes":{"description":"Average duration in minutes.","type":"number"},"eventCount":{"description":"Number of events of this type.","type":"number"}}}}},"required":["overallAvgMinutes","byType"]}}}}},"operationId":"getBffCalendarCalendar-analytics-average-event-duration","tags":["Calendar Analytics"],"summary":"Average event duration","description":"Shows how long events actually are, broken down by event type. Critical for realistic slot planning and capacity estimation."}},"/bff/calendar/calendar-analytics-simultaneous-events":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"maxSimultaneous":{"description":"Maximum concurrent events ever.","type":"number"},"avgSimultaneous":{"description":"Average concurrent events.","type":"number"},"currentSimultaneous":{"description":"Currently running events right now.","type":"number"}},"required":["maxSimultaneous","avgSimultaneous","currentSimultaneous"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"maxSimultaneous":{"description":"Maximum concurrent events ever.","type":"number"},"avgSimultaneous":{"description":"Average concurrent events.","type":"number"},"currentSimultaneous":{"description":"Currently running events right now.","type":"number"}},"required":["maxSimultaneous","avgSimultaneous","currentSimultaneous"]}},"text/plain":{"schema":{"type":"object","properties":{"maxSimultaneous":{"description":"Maximum concurrent events ever.","type":"number"},"avgSimultaneous":{"description":"Average concurrent events.","type":"number"},"currentSimultaneous":{"description":"Currently running events right now.","type":"number"}},"required":["maxSimultaneous","avgSimultaneous","currentSimultaneous"]}}}}},"operationId":"getBffCalendarCalendar-analytics-simultaneous-events","tags":["Calendar Analytics"],"summary":"Simultaneous events analysis","description":"Shows how many events run concurrently (max and average). Critical for understanding capacity and staffing limits."}},"/bff/calendar/calendar-analytics-revenue-per-event-type":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","required":["typeId","typeName","totalRevenue","eventCount","avgRevenuePerEvent","percentage"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"totalRevenue":{"description":"Total revenue from this type.","type":"number"},"eventCount":{"description":"Number of events.","type":"number"},"avgRevenuePerEvent":{"description":"Average revenue per event.","type":"number"},"percentage":{"description":"Percentage of total revenue.","type":"number"}}}},"totalRevenue":{"description":"Total revenue across all types.","type":"number"}},"required":["types","totalRevenue"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","required":["typeId","typeName","totalRevenue","eventCount","avgRevenuePerEvent","percentage"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"totalRevenue":{"description":"Total revenue from this type.","type":"number"},"eventCount":{"description":"Number of events.","type":"number"},"avgRevenuePerEvent":{"description":"Average revenue per event.","type":"number"},"percentage":{"description":"Percentage of total revenue.","type":"number"}}}},"totalRevenue":{"description":"Total revenue across all types.","type":"number"}},"required":["types","totalRevenue"]}},"text/plain":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"object","required":["typeId","typeName","totalRevenue","eventCount","avgRevenuePerEvent","percentage"],"properties":{"typeId":{"description":"Event type ID.","type":"number"},"typeName":{"description":"Event type name.","type":"string"},"totalRevenue":{"description":"Total revenue from this type.","type":"number"},"eventCount":{"description":"Number of events.","type":"number"},"avgRevenuePerEvent":{"description":"Average revenue per event.","type":"number"},"percentage":{"description":"Percentage of total revenue.","type":"number"}}}},"totalRevenue":{"description":"Total revenue across all types.","type":"number"}},"required":["types","totalRevenue"]}}}}},"operationId":"getBffCalendarCalendar-analytics-revenue-per-event-type","tags":["Calendar Analytics"],"summary":"Revenue per event type","description":"Shows which event types generate the most revenue - critical insight to avoid confusing utilization with profitability. Returns total revenue, event count, and average per event for each type."}},"/bff/calendar/calendar-analytics-revenue-per-hour":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"hourly":{"type":"array","items":{"type":"object","required":["hourOfDay","revenue","eventCount","avgRevenuePerEvent"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"revenue":{"description":"Total revenue in this hour.","type":"number"},"eventCount":{"description":"Number of events.","type":"number"},"avgRevenuePerEvent":{"description":"Average revenue per event.","type":"number"}}}},"peakHour":{"description":"Hour with highest revenue.","type":"number"},"peakRevenue":{"description":"Revenue in peak hour.","type":"number"},"totalRevenue":{"description":"Total revenue across all hours.","type":"number"}},"required":["hourly","peakHour","peakRevenue","totalRevenue"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"hourly":{"type":"array","items":{"type":"object","required":["hourOfDay","revenue","eventCount","avgRevenuePerEvent"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"revenue":{"description":"Total revenue in this hour.","type":"number"},"eventCount":{"description":"Number of events.","type":"number"},"avgRevenuePerEvent":{"description":"Average revenue per event.","type":"number"}}}},"peakHour":{"description":"Hour with highest revenue.","type":"number"},"peakRevenue":{"description":"Revenue in peak hour.","type":"number"},"totalRevenue":{"description":"Total revenue across all hours.","type":"number"}},"required":["hourly","peakHour","peakRevenue","totalRevenue"]}},"text/plain":{"schema":{"type":"object","properties":{"hourly":{"type":"array","items":{"type":"object","required":["hourOfDay","revenue","eventCount","avgRevenuePerEvent"],"properties":{"hourOfDay":{"description":"Hour of day (0-23).","type":"number"},"revenue":{"description":"Total revenue in this hour.","type":"number"},"eventCount":{"description":"Number of events.","type":"number"},"avgRevenuePerEvent":{"description":"Average revenue per event.","type":"number"}}}},"peakHour":{"description":"Hour with highest revenue.","type":"number"},"peakRevenue":{"description":"Revenue in peak hour.","type":"number"},"totalRevenue":{"description":"Total revenue across all hours.","type":"number"}},"required":["hourly","peakHour","peakRevenue","totalRevenue"]}}}}},"operationId":"getBffCalendarCalendar-analytics-revenue-per-hour","tags":["Calendar Analytics"],"summary":"Revenue per hour of day","description":"Shows how much each hour of the calendar day earns - brutally powerful metric for pricing optimization. Identifies peak revenue hours and opportunities for dynamic pricing."}},"/bff/calendar/calendar-analytics-time-to-fill":{"get":{"parameters":[{"description":"Calendar code identifier.","schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"averageHours":{"description":"Average hours to fill capacity.","type":"number"},"medianHours":{"description":"Median hours to fill capacity.","type":"number"},"fastestHours":{"description":"Fastest fill time ever recorded.","type":"number"},"distribution":{"type":"array","items":{"type":"object","required":["range","count","percentage"],"properties":{"range":{"description":"Time range (e.g., \"0-1 hours\").","type":"string"},"count":{"description":"Events that filled in this range.","type":"number"},"percentage":{"description":"Percentage of total filled events.","type":"number"}}}}},"required":["averageHours","medianHours","fastestHours","distribution"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"averageHours":{"description":"Average hours to fill capacity.","type":"number"},"medianHours":{"description":"Median hours to fill capacity.","type":"number"},"fastestHours":{"description":"Fastest fill time ever recorded.","type":"number"},"distribution":{"type":"array","items":{"type":"object","required":["range","count","percentage"],"properties":{"range":{"description":"Time range (e.g., \"0-1 hours\").","type":"string"},"count":{"description":"Events that filled in this range.","type":"number"},"percentage":{"description":"Percentage of total filled events.","type":"number"}}}}},"required":["averageHours","medianHours","fastestHours","distribution"]}},"text/plain":{"schema":{"type":"object","properties":{"averageHours":{"description":"Average hours to fill capacity.","type":"number"},"medianHours":{"description":"Median hours to fill capacity.","type":"number"},"fastestHours":{"description":"Fastest fill time ever recorded.","type":"number"},"distribution":{"type":"array","items":{"type":"object","required":["range","count","percentage"],"properties":{"range":{"description":"Time range (e.g., \"0-1 hours\").","type":"string"},"count":{"description":"Events that filled in this range.","type":"number"},"percentage":{"description":"Percentage of total filled events.","type":"number"}}}}},"required":["averageHours","medianHours","fastestHours","distribution"]}}}}},"operationId":"getBffCalendarCalendar-analytics-time-to-fill","tags":["Calendar Analytics"],"summary":"Time-to-fill analysis","description":"Shows how fast events fill to capacity - ideal metric for pricing optimization and demand prediction. Fast fill times indicate high demand and pricing power."}},"/bff/calendar/calendar-add":{"post":{"operationId":"postBffCalendarCalendar-add","tags":["Calendar"],"summary":"Create a new calendar","description":"Creates a new calendar for the authenticated organisation. Body is validated via createCalendarSchema.","responses":{"200":{}}}},"/bff/calendar/detail-reservations":{"get":{"parameters":[{"description":"Customer reference number to filter reservations by.","schema":{"type":"string"},"in":"query","name":"customerId","required":false},{"description":"Calendar code to filter reservations by.","schema":{"type":"string"},"in":"query","name":"calendarId","required":false},{"description":"Page number for pagination (default 1).","schema":{"type":"number"},"in":"query","name":"page","required":false},{"description":"Number of items per page (default 100).","schema":{"type":"number"},"in":"query","name":"limit","required":false}],"operationId":"getBffCalendarDetail-reservations","tags":["Calendar"],"summary":"List reservations","description":"Returns a paginated list of calendar event reservations. Can be filtered by customer and/or calendar.","responses":{"200":{}}}},"/bff/calendar/me":{"get":{"operationId":"getBffCalendarMe","tags":["Calendar"],"summary":"Get the viewer's personal calendar in the current organisation","description":"Returns the code of the personal calendar of the currently authenticated member in their active organisation. Auto-provisions one on first call if it does not exist yet (idempotent — backed by the partial unique index `(organisation_id, owner_member_id) WHERE kind='personal'`).","responses":{"200":{}}}},"/bff/calendar/my-overlay":{"get":{"parameters":[{"description":"ISO-8601 lower bound (inclusive).","examples":["2026-06-01T00:00:00Z"],"schema":{"type":"string"},"in":"query","name":"from","required":true},{"description":"ISO-8601 upper bound (inclusive).","examples":["2026-06-30T23:59:59Z"],"schema":{"type":"string"},"in":"query","name":"to","required":true}],"operationId":"getBffCalendarMy-overlay","tags":["Calendar"],"summary":"Unified cross-org overlay of the viewer events","description":"Returns all events the viewer is involved in — their per-org personal calendars plus events they're an attendee of — across every active membership of the viewer (`cas__organisation_member.user_id`). Events whose `organisation_id` differs from the current session org, or whose effective visibility is `private`, are returned with `title`, `calendar_name` and `calendar_color` set to `null` and `mask_reason` set to `'cross_org'` or `'private'`. The UI is expected to render a generic Busy placeholder for those.","responses":{"200":{}}}},"/bff/calendar/conflicts":{"get":{"parameters":[{"description":"ISO-8601 lower bound.","examples":["2026-06-01T00:00:00Z"],"schema":{"type":"string"},"in":"query","name":"from","required":true},{"description":"ISO-8601 upper bound.","examples":["2026-06-30T23:59:59Z"],"schema":{"type":"string"},"in":"query","name":"to","required":true}],"operationId":"getBffCalendarConflicts","tags":["Calendar"],"summary":"List cross-org calendar conflicts for the viewer","description":"Returns every pair of blocking (non-all-day) events from `my-overlay` whose time windows overlap. Cross-org events keep the privacy mask (title/calendar fields are NULL with `maskReason` set).","responses":{"200":{}}}},"/bff/calendar/colleague-overlay":{"get":{"parameters":[{"description":"Wire-id of the colleague (the `shop__contact.external_id` returned by `/bff/member/detail` as `id`).","schema":{"type":"string"},"in":"query","name":"memberId","required":true},{"description":"ISO-8601 lower bound.","schema":{"type":"string"},"in":"query","name":"from","required":true},{"description":"ISO-8601 upper bound.","schema":{"type":"string"},"in":"query","name":"to","required":true}],"operationId":"getBffCalendarColleague-overlay","tags":["Calendar"],"summary":"See a colleague calendar (their cross-org events shown as Busy)","description":"Returns the same overlay shape as `/my-overlay`, but computed for a colleague that lives in the same organisation as the viewer. The colleague external events keep the cross-org privacy mask.","responses":{"200":{}}}},"/bff/calendar/event-detail":{"get":{"parameters":[{"description":"External event code identifier.","schema":{"type":"string"},"in":"query","name":"eventId","required":true}],"responses":{"200":{"description":"Full event detail with all associated data.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"External event code identifier.","type":"string"},"calendarId":{"description":"External calendar code.","type":"string"},"calendarName":{"description":"Calendar display name.","type":"string"},"calendarColor":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"startTime":{"description":"Event start time (UTC).","anyOf":[{"description":"Event start time (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time (UTC).","anyOf":[{"description":"Event end time (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"durationMinutes":{"description":"Computed event duration in minutes.","type":"number"},"reservedBlockingTo":{"description":"Time until which the event blocks the calendar slot.","anyOf":[{"description":"Time until which the event blocks the calendar slot.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"description":"Event title.","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks conflicting reservations.","type":"boolean"},"isStorno":{"description":"Whether the event has been cancelled.","type":"boolean"},"visibility":{"nullable":true,"anyOf":[{"description":"Per-event visibility override. NULL = inherit from calendar. \"private\" makes the event invisible to everyone but the owner across all orgs.","anyOf":[{"const":"organisation","type":"string"},{"const":"shared","type":"string"},{"const":"private","type":"string"}]},{"type":"null"}]},"isOpenButtonAvailable":{"description":"Whether a smart lock unlock button should be shown.","type":"boolean"},"lockOnline":{"description":"Smart lock gateway connectivity. Populated only when the calendar has a lock. true = gateway reachable, false = currently in an outage.","type":"boolean"},"typeCode":{"description":"Event type code (e.g., \"workshop\").","type":"string"},"typeLabel":{"description":"Event type display label.","type":"string"},"color":{"description":"Event type hex color.","type":"string"},"description":{"description":"Event description (rich text).","type":"string"},"agenda":{"description":"Event agenda / schedule.","type":"string"},"url":{"description":"External URL associated with the event.","type":"string"},"insertedDate":{"description":"Date when the event was created.","anyOf":[{"description":"Date when the event was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locationTitle":{"description":"Location name / label.","type":"string"},"location":{"description":"Full location address resolved from the address registry.","type":"object","properties":{"title":{"description":"Location name.","type":"string"},"streetAddress":{"description":"Street and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"postalCode":{"description":"Postal / ZIP code.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"cityPart":{"description":"City district / part.","type":"string"},"latitude":{"description":"GPS latitude.","type":"string"},"longitude":{"description":"GPS longitude.","type":"string"}}},"eventTypeProduct":{"description":"Product linked to the event type (for pricing / inventory).","type":"object","required":["code","name","price"],"properties":{"code":{"description":"Product code.","type":"string"},"name":{"description":"Product name.","type":"string"},"price":{"description":"Product price.","type":"string"}}},"reminderList":{"description":"Active reminders for this event.","type":"array","items":{"type":"object","required":["date","relativeTime"],"properties":{"date":{"description":"Absolute reminder trigger time.","anyOf":[{"description":"Absolute reminder trigger time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"relativeTime":{"description":"Relative time before event (e.g., \"30m\", \"1h\", \"1d\").","type":"string"}}}},"orderList":{"description":"Orders / reservations linked to this event.","type":"array","items":{"type":"object","required":["orderNumber","hash","paid","isStorno"],"properties":{"orderNumber":{"description":"Order number.","type":"string"},"hash":{"description":"Order hash for URL identification.","type":"string"},"paid":{"description":"Whether the order has been paid.","type":"boolean"},"isStorno":{"description":"Whether the order item is cancelled.","type":"boolean"},"customerId":{"description":"Customer external ID.","type":"string"},"customerName":{"description":"Customer full name.","type":"string"},"email":{"description":"Customer email.","type":"string"},"phone":{"description":"Customer phone.","type":"string"}}}},"workOrders":{"description":"Work orders scheduled as this event (BIZKIT-159).","type":"array","items":{"type":"object","required":["hash","orderNumber","groupName","statusLabel","statusColor","customerName","email","phone","address","internalNotice","publicNotice","items"],"properties":{"hash":{"description":"Order hash for URL identification.","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"groupName":{"description":"Order group name.","anyOf":[{"type":"string"},{"type":"null"}]},"statusLabel":{"description":"Current order status label.","anyOf":[{"type":"string"},{"type":"null"}]},"statusColor":{"description":"Current order status color.","anyOf":[{"type":"string"},{"type":"null"}]},"customerName":{"description":"Customer (company or person) name.","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Customer e-mail.","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Customer phone.","anyOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Delivery (else billing) address on one line.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"description":"Internal order notice, including field notes.","anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"description":"Customer note on the order.","anyOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Active order lines.","type":"array","items":{"type":"object","required":["label","count","unit"],"properties":{"label":{"type":"string"},"count":{"type":"number"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"canOpenOrders":{"description":"The member may open order detail (module-order).","type":"boolean"},"attendeeList":{"description":"Event attendees / participants sorted by organizer status and date.","type":"array","items":{"type":"object","required":["organizer","required","accepted","insertedDate"],"properties":{"contactId":{"description":"Contact external id of the attendee.","type":"string"},"name":{"description":"Attendee name.","type":"string"},"email":{"description":"Attendee email.","type":"string"},"phone":{"description":"Attendee phone.","type":"string"},"organizer":{"description":"Whether this attendee is the event organizer.","type":"boolean"},"required":{"description":"Whether attendance is required.","type":"boolean"},"accepted":{"description":"Whether the attendee has accepted the invitation.","type":"boolean"},"insertedDate":{"description":"Date when the attendee was added.","anyOf":[{"description":"Date when the attendee was added.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"passwordList":{"description":"Smart lock passwords generated for this event.","type":"array","items":{"type":"object","required":["password","state"],"properties":{"password":{"description":"Smart lock temporary password.","type":"string"},"state":{"description":"Password lifecycle: \"pending\" = uploaded, waiting for start_date; \"active\" = currently valid; \"expired\" = past end_date; \"deleted\" = removed from the physical lock.","anyOf":[{"const":"pending","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"deleted","type":"string"}]}}}},"lockAccess":{"description":"Lock access log — present only when the event's calendar is bound to a smart lock. Combines provisioning status with the physical lock's recorded activity in the event window.","type":"object","required":["status","unlockCount","failedAttemptCount","timeline"],"properties":{"status":{"nullable":true,"anyOf":[{"description":"Provisioning outcome for the event's access code: \"pending\" = queued, \"ready\" = uploaded and active on the lock, \"fallback_backup\" = degraded, reverted to the shared backup passcode, \"failed\" = could not provision, \"manual_override\" = operator bypassed automation, \"not_required\" = event does not need a code. NULL = never evaluated.","anyOf":[{"const":"pending","type":"string"},{"const":"ready","type":"string"},{"const":"fallback_backup","type":"string"},{"const":"failed","type":"string"},{"const":"manual_override","type":"string"},{"const":"not_required","type":"string"}]},{"type":"null"}]},"lastAttemptAt":{"description":"Last time the provisioner touched this event.","anyOf":[{"description":"Last time the provisioner touched this event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"failureReason":{"description":"Short human-readable reason for a failed provisioning.","type":"string"},"firstUnlockAt":{"description":"First successful unlock observed in the event window.","anyOf":[{"description":"First successful unlock observed in the event window.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityAt":{"description":"Timestamp of the last lock/unlock record observed in the window. Proxy signal for \"customer left\" — not a hard check-out.","anyOf":[{"description":"Timestamp of the last lock/unlock record observed in the window. Proxy signal for \"customer left\" — not a hard check-out.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"unlockCount":{"description":"Number of successful lock/unlock records in the event window.","type":"number"},"failedAttemptCount":{"description":"Number of failed attempts (bad passcode, etc.) in the event window.","type":"number"},"usedBackupCode":{"description":"When any successful passcode unlock happened: true = only a non-event code (backup / other) was used, false = this event's issued code was used at least once. Absent when there was no passcode activity.","type":"boolean"},"timeline":{"description":"Chronological unlock/lock records in the event window (capped at 50).","type":"array","items":{"type":"object","required":["at","success","recordType","matchedEventCode"],"properties":{"at":{"description":"When the lock/unlock happened (UTC).","anyOf":[{"description":"When the lock/unlock happened (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"success":{"description":"Whether the attempt succeeded.","type":"boolean"},"recordType":{"description":"Opaque TTLock record_type enum — pass-through for the UI.","type":"number"},"matchedEventCode":{"description":"true = entered passcode is exactly the one issued for this event.","type":"boolean"}}}}}},"reservation":{"description":"Reservation status when event type is linked to a product.","type":"object","required":["confirmed","limit"],"properties":{"confirmed":{"description":"Number of confirmed reservations.","type":"number"},"limit":{"description":"Maximum capacity from product warehouse limit.","type":"number"}}},"recurrence":{"description":"Recurrence series information with all related events.","type":"object","required":["isRecurrence","items"],"properties":{"isRecurrence":{"description":"Whether this event is part of a recurring series.","type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["id","title","startTime","endTime","isStorno"],"properties":{"id":{"description":"External event code.","type":"string"},"isParent":{"description":"Whether this is the root/parent event.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"startTime":{"description":"Event start time.","anyOf":[{"description":"Event start time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time.","anyOf":[{"description":"Event end time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isStorno":{"description":"Whether this occurrence is cancelled.","type":"boolean"}}}}}},"recurrenceRule":{"description":"iCalendar RRULE string (e.g., \"FREQ=WEEKLY;BYDAY=MO,WE,FR\").","type":"string"}},"required":["id","calendarId","calendarName","calendarColor","timezone","startTime","endTime","durationMinutes","title","isAllDay","isBlocking","isStorno","visibility","insertedDate","reminderList","orderList","attendeeList","passwordList","recurrence"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"External event code identifier.","type":"string"},"calendarId":{"description":"External calendar code.","type":"string"},"calendarName":{"description":"Calendar display name.","type":"string"},"calendarColor":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"startTime":{"description":"Event start time (UTC).","anyOf":[{"description":"Event start time (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time (UTC).","anyOf":[{"description":"Event end time (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"durationMinutes":{"description":"Computed event duration in minutes.","type":"number"},"reservedBlockingTo":{"description":"Time until which the event blocks the calendar slot.","anyOf":[{"description":"Time until which the event blocks the calendar slot.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"description":"Event title.","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks conflicting reservations.","type":"boolean"},"isStorno":{"description":"Whether the event has been cancelled.","type":"boolean"},"visibility":{"nullable":true,"anyOf":[{"description":"Per-event visibility override. NULL = inherit from calendar. \"private\" makes the event invisible to everyone but the owner across all orgs.","anyOf":[{"const":"organisation","type":"string"},{"const":"shared","type":"string"},{"const":"private","type":"string"}]},{"type":"null"}]},"isOpenButtonAvailable":{"description":"Whether a smart lock unlock button should be shown.","type":"boolean"},"lockOnline":{"description":"Smart lock gateway connectivity. Populated only when the calendar has a lock. true = gateway reachable, false = currently in an outage.","type":"boolean"},"typeCode":{"description":"Event type code (e.g., \"workshop\").","type":"string"},"typeLabel":{"description":"Event type display label.","type":"string"},"color":{"description":"Event type hex color.","type":"string"},"description":{"description":"Event description (rich text).","type":"string"},"agenda":{"description":"Event agenda / schedule.","type":"string"},"url":{"description":"External URL associated with the event.","type":"string"},"insertedDate":{"description":"Date when the event was created.","anyOf":[{"description":"Date when the event was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locationTitle":{"description":"Location name / label.","type":"string"},"location":{"description":"Full location address resolved from the address registry.","type":"object","properties":{"title":{"description":"Location name.","type":"string"},"streetAddress":{"description":"Street and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"postalCode":{"description":"Postal / ZIP code.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"cityPart":{"description":"City district / part.","type":"string"},"latitude":{"description":"GPS latitude.","type":"string"},"longitude":{"description":"GPS longitude.","type":"string"}}},"eventTypeProduct":{"description":"Product linked to the event type (for pricing / inventory).","type":"object","required":["code","name","price"],"properties":{"code":{"description":"Product code.","type":"string"},"name":{"description":"Product name.","type":"string"},"price":{"description":"Product price.","type":"string"}}},"reminderList":{"description":"Active reminders for this event.","type":"array","items":{"type":"object","required":["date","relativeTime"],"properties":{"date":{"description":"Absolute reminder trigger time.","anyOf":[{"description":"Absolute reminder trigger time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"relativeTime":{"description":"Relative time before event (e.g., \"30m\", \"1h\", \"1d\").","type":"string"}}}},"orderList":{"description":"Orders / reservations linked to this event.","type":"array","items":{"type":"object","required":["orderNumber","hash","paid","isStorno"],"properties":{"orderNumber":{"description":"Order number.","type":"string"},"hash":{"description":"Order hash for URL identification.","type":"string"},"paid":{"description":"Whether the order has been paid.","type":"boolean"},"isStorno":{"description":"Whether the order item is cancelled.","type":"boolean"},"customerId":{"description":"Customer external ID.","type":"string"},"customerName":{"description":"Customer full name.","type":"string"},"email":{"description":"Customer email.","type":"string"},"phone":{"description":"Customer phone.","type":"string"}}}},"workOrders":{"description":"Work orders scheduled as this event (BIZKIT-159).","type":"array","items":{"type":"object","required":["hash","orderNumber","groupName","statusLabel","statusColor","customerName","email","phone","address","internalNotice","publicNotice","items"],"properties":{"hash":{"description":"Order hash for URL identification.","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"groupName":{"description":"Order group name.","anyOf":[{"type":"string"},{"type":"null"}]},"statusLabel":{"description":"Current order status label.","anyOf":[{"type":"string"},{"type":"null"}]},"statusColor":{"description":"Current order status color.","anyOf":[{"type":"string"},{"type":"null"}]},"customerName":{"description":"Customer (company or person) name.","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Customer e-mail.","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Customer phone.","anyOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Delivery (else billing) address on one line.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"description":"Internal order notice, including field notes.","anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"description":"Customer note on the order.","anyOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Active order lines.","type":"array","items":{"type":"object","required":["label","count","unit"],"properties":{"label":{"type":"string"},"count":{"type":"number"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"canOpenOrders":{"description":"The member may open order detail (module-order).","type":"boolean"},"attendeeList":{"description":"Event attendees / participants sorted by organizer status and date.","type":"array","items":{"type":"object","required":["organizer","required","accepted","insertedDate"],"properties":{"contactId":{"description":"Contact external id of the attendee.","type":"string"},"name":{"description":"Attendee name.","type":"string"},"email":{"description":"Attendee email.","type":"string"},"phone":{"description":"Attendee phone.","type":"string"},"organizer":{"description":"Whether this attendee is the event organizer.","type":"boolean"},"required":{"description":"Whether attendance is required.","type":"boolean"},"accepted":{"description":"Whether the attendee has accepted the invitation.","type":"boolean"},"insertedDate":{"description":"Date when the attendee was added.","anyOf":[{"description":"Date when the attendee was added.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"passwordList":{"description":"Smart lock passwords generated for this event.","type":"array","items":{"type":"object","required":["password","state"],"properties":{"password":{"description":"Smart lock temporary password.","type":"string"},"state":{"description":"Password lifecycle: \"pending\" = uploaded, waiting for start_date; \"active\" = currently valid; \"expired\" = past end_date; \"deleted\" = removed from the physical lock.","anyOf":[{"const":"pending","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"deleted","type":"string"}]}}}},"lockAccess":{"description":"Lock access log — present only when the event's calendar is bound to a smart lock. Combines provisioning status with the physical lock's recorded activity in the event window.","type":"object","required":["status","unlockCount","failedAttemptCount","timeline"],"properties":{"status":{"nullable":true,"anyOf":[{"description":"Provisioning outcome for the event's access code: \"pending\" = queued, \"ready\" = uploaded and active on the lock, \"fallback_backup\" = degraded, reverted to the shared backup passcode, \"failed\" = could not provision, \"manual_override\" = operator bypassed automation, \"not_required\" = event does not need a code. NULL = never evaluated.","anyOf":[{"const":"pending","type":"string"},{"const":"ready","type":"string"},{"const":"fallback_backup","type":"string"},{"const":"failed","type":"string"},{"const":"manual_override","type":"string"},{"const":"not_required","type":"string"}]},{"type":"null"}]},"lastAttemptAt":{"description":"Last time the provisioner touched this event.","anyOf":[{"description":"Last time the provisioner touched this event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"failureReason":{"description":"Short human-readable reason for a failed provisioning.","type":"string"},"firstUnlockAt":{"description":"First successful unlock observed in the event window.","anyOf":[{"description":"First successful unlock observed in the event window.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityAt":{"description":"Timestamp of the last lock/unlock record observed in the window. Proxy signal for \"customer left\" — not a hard check-out.","anyOf":[{"description":"Timestamp of the last lock/unlock record observed in the window. Proxy signal for \"customer left\" — not a hard check-out.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"unlockCount":{"description":"Number of successful lock/unlock records in the event window.","type":"number"},"failedAttemptCount":{"description":"Number of failed attempts (bad passcode, etc.) in the event window.","type":"number"},"usedBackupCode":{"description":"When any successful passcode unlock happened: true = only a non-event code (backup / other) was used, false = this event's issued code was used at least once. Absent when there was no passcode activity.","type":"boolean"},"timeline":{"description":"Chronological unlock/lock records in the event window (capped at 50).","type":"array","items":{"type":"object","required":["at","success","recordType","matchedEventCode"],"properties":{"at":{"description":"When the lock/unlock happened (UTC).","anyOf":[{"description":"When the lock/unlock happened (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"success":{"description":"Whether the attempt succeeded.","type":"boolean"},"recordType":{"description":"Opaque TTLock record_type enum — pass-through for the UI.","type":"number"},"matchedEventCode":{"description":"true = entered passcode is exactly the one issued for this event.","type":"boolean"}}}}}},"reservation":{"description":"Reservation status when event type is linked to a product.","type":"object","required":["confirmed","limit"],"properties":{"confirmed":{"description":"Number of confirmed reservations.","type":"number"},"limit":{"description":"Maximum capacity from product warehouse limit.","type":"number"}}},"recurrence":{"description":"Recurrence series information with all related events.","type":"object","required":["isRecurrence","items"],"properties":{"isRecurrence":{"description":"Whether this event is part of a recurring series.","type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["id","title","startTime","endTime","isStorno"],"properties":{"id":{"description":"External event code.","type":"string"},"isParent":{"description":"Whether this is the root/parent event.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"startTime":{"description":"Event start time.","anyOf":[{"description":"Event start time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time.","anyOf":[{"description":"Event end time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isStorno":{"description":"Whether this occurrence is cancelled.","type":"boolean"}}}}}},"recurrenceRule":{"description":"iCalendar RRULE string (e.g., \"FREQ=WEEKLY;BYDAY=MO,WE,FR\").","type":"string"}},"required":["id","calendarId","calendarName","calendarColor","timezone","startTime","endTime","durationMinutes","title","isAllDay","isBlocking","isStorno","visibility","insertedDate","reminderList","orderList","attendeeList","passwordList","recurrence"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"External event code identifier.","type":"string"},"calendarId":{"description":"External calendar code.","type":"string"},"calendarName":{"description":"Calendar display name.","type":"string"},"calendarColor":{"description":"Calendar hex color (e.g., \"#FF5733\").","type":"string"},"timezone":{"description":"Calendar timezone (e.g., \"Europe/Prague\").","type":"string"},"startTime":{"description":"Event start time (UTC).","anyOf":[{"description":"Event start time (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time (UTC).","anyOf":[{"description":"Event end time (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"durationMinutes":{"description":"Computed event duration in minutes.","type":"number"},"reservedBlockingTo":{"description":"Time until which the event blocks the calendar slot.","anyOf":[{"description":"Time until which the event blocks the calendar slot.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"description":"Event title.","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks conflicting reservations.","type":"boolean"},"isStorno":{"description":"Whether the event has been cancelled.","type":"boolean"},"visibility":{"nullable":true,"anyOf":[{"description":"Per-event visibility override. NULL = inherit from calendar. \"private\" makes the event invisible to everyone but the owner across all orgs.","anyOf":[{"const":"organisation","type":"string"},{"const":"shared","type":"string"},{"const":"private","type":"string"}]},{"type":"null"}]},"isOpenButtonAvailable":{"description":"Whether a smart lock unlock button should be shown.","type":"boolean"},"lockOnline":{"description":"Smart lock gateway connectivity. Populated only when the calendar has a lock. true = gateway reachable, false = currently in an outage.","type":"boolean"},"typeCode":{"description":"Event type code (e.g., \"workshop\").","type":"string"},"typeLabel":{"description":"Event type display label.","type":"string"},"color":{"description":"Event type hex color.","type":"string"},"description":{"description":"Event description (rich text).","type":"string"},"agenda":{"description":"Event agenda / schedule.","type":"string"},"url":{"description":"External URL associated with the event.","type":"string"},"insertedDate":{"description":"Date when the event was created.","anyOf":[{"description":"Date when the event was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locationTitle":{"description":"Location name / label.","type":"string"},"location":{"description":"Full location address resolved from the address registry.","type":"object","properties":{"title":{"description":"Location name.","type":"string"},"streetAddress":{"description":"Street and house number.","type":"string"},"city":{"description":"City name.","type":"string"},"postalCode":{"description":"Postal / ZIP code.","type":"string"},"stateRegion":{"description":"State or region.","type":"string"},"cityPart":{"description":"City district / part.","type":"string"},"latitude":{"description":"GPS latitude.","type":"string"},"longitude":{"description":"GPS longitude.","type":"string"}}},"eventTypeProduct":{"description":"Product linked to the event type (for pricing / inventory).","type":"object","required":["code","name","price"],"properties":{"code":{"description":"Product code.","type":"string"},"name":{"description":"Product name.","type":"string"},"price":{"description":"Product price.","type":"string"}}},"reminderList":{"description":"Active reminders for this event.","type":"array","items":{"type":"object","required":["date","relativeTime"],"properties":{"date":{"description":"Absolute reminder trigger time.","anyOf":[{"description":"Absolute reminder trigger time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"relativeTime":{"description":"Relative time before event (e.g., \"30m\", \"1h\", \"1d\").","type":"string"}}}},"orderList":{"description":"Orders / reservations linked to this event.","type":"array","items":{"type":"object","required":["orderNumber","hash","paid","isStorno"],"properties":{"orderNumber":{"description":"Order number.","type":"string"},"hash":{"description":"Order hash for URL identification.","type":"string"},"paid":{"description":"Whether the order has been paid.","type":"boolean"},"isStorno":{"description":"Whether the order item is cancelled.","type":"boolean"},"customerId":{"description":"Customer external ID.","type":"string"},"customerName":{"description":"Customer full name.","type":"string"},"email":{"description":"Customer email.","type":"string"},"phone":{"description":"Customer phone.","type":"string"}}}},"workOrders":{"description":"Work orders scheduled as this event (BIZKIT-159).","type":"array","items":{"type":"object","required":["hash","orderNumber","groupName","statusLabel","statusColor","customerName","email","phone","address","internalNotice","publicNotice","items"],"properties":{"hash":{"description":"Order hash for URL identification.","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"groupName":{"description":"Order group name.","anyOf":[{"type":"string"},{"type":"null"}]},"statusLabel":{"description":"Current order status label.","anyOf":[{"type":"string"},{"type":"null"}]},"statusColor":{"description":"Current order status color.","anyOf":[{"type":"string"},{"type":"null"}]},"customerName":{"description":"Customer (company or person) name.","anyOf":[{"type":"string"},{"type":"null"}]},"email":{"description":"Customer e-mail.","anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"description":"Customer phone.","anyOf":[{"type":"string"},{"type":"null"}]},"address":{"description":"Delivery (else billing) address on one line.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"description":"Internal order notice, including field notes.","anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"description":"Customer note on the order.","anyOf":[{"type":"string"},{"type":"null"}]},"items":{"description":"Active order lines.","type":"array","items":{"type":"object","required":["label","count","unit"],"properties":{"label":{"type":"string"},"count":{"type":"number"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"canOpenOrders":{"description":"The member may open order detail (module-order).","type":"boolean"},"attendeeList":{"description":"Event attendees / participants sorted by organizer status and date.","type":"array","items":{"type":"object","required":["organizer","required","accepted","insertedDate"],"properties":{"contactId":{"description":"Contact external id of the attendee.","type":"string"},"name":{"description":"Attendee name.","type":"string"},"email":{"description":"Attendee email.","type":"string"},"phone":{"description":"Attendee phone.","type":"string"},"organizer":{"description":"Whether this attendee is the event organizer.","type":"boolean"},"required":{"description":"Whether attendance is required.","type":"boolean"},"accepted":{"description":"Whether the attendee has accepted the invitation.","type":"boolean"},"insertedDate":{"description":"Date when the attendee was added.","anyOf":[{"description":"Date when the attendee was added.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"passwordList":{"description":"Smart lock passwords generated for this event.","type":"array","items":{"type":"object","required":["password","state"],"properties":{"password":{"description":"Smart lock temporary password.","type":"string"},"state":{"description":"Password lifecycle: \"pending\" = uploaded, waiting for start_date; \"active\" = currently valid; \"expired\" = past end_date; \"deleted\" = removed from the physical lock.","anyOf":[{"const":"pending","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"deleted","type":"string"}]}}}},"lockAccess":{"description":"Lock access log — present only when the event's calendar is bound to a smart lock. Combines provisioning status with the physical lock's recorded activity in the event window.","type":"object","required":["status","unlockCount","failedAttemptCount","timeline"],"properties":{"status":{"nullable":true,"anyOf":[{"description":"Provisioning outcome for the event's access code: \"pending\" = queued, \"ready\" = uploaded and active on the lock, \"fallback_backup\" = degraded, reverted to the shared backup passcode, \"failed\" = could not provision, \"manual_override\" = operator bypassed automation, \"not_required\" = event does not need a code. NULL = never evaluated.","anyOf":[{"const":"pending","type":"string"},{"const":"ready","type":"string"},{"const":"fallback_backup","type":"string"},{"const":"failed","type":"string"},{"const":"manual_override","type":"string"},{"const":"not_required","type":"string"}]},{"type":"null"}]},"lastAttemptAt":{"description":"Last time the provisioner touched this event.","anyOf":[{"description":"Last time the provisioner touched this event.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"failureReason":{"description":"Short human-readable reason for a failed provisioning.","type":"string"},"firstUnlockAt":{"description":"First successful unlock observed in the event window.","anyOf":[{"description":"First successful unlock observed in the event window.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityAt":{"description":"Timestamp of the last lock/unlock record observed in the window. Proxy signal for \"customer left\" — not a hard check-out.","anyOf":[{"description":"Timestamp of the last lock/unlock record observed in the window. Proxy signal for \"customer left\" — not a hard check-out.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"unlockCount":{"description":"Number of successful lock/unlock records in the event window.","type":"number"},"failedAttemptCount":{"description":"Number of failed attempts (bad passcode, etc.) in the event window.","type":"number"},"usedBackupCode":{"description":"When any successful passcode unlock happened: true = only a non-event code (backup / other) was used, false = this event's issued code was used at least once. Absent when there was no passcode activity.","type":"boolean"},"timeline":{"description":"Chronological unlock/lock records in the event window (capped at 50).","type":"array","items":{"type":"object","required":["at","success","recordType","matchedEventCode"],"properties":{"at":{"description":"When the lock/unlock happened (UTC).","anyOf":[{"description":"When the lock/unlock happened (UTC).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"success":{"description":"Whether the attempt succeeded.","type":"boolean"},"recordType":{"description":"Opaque TTLock record_type enum — pass-through for the UI.","type":"number"},"matchedEventCode":{"description":"true = entered passcode is exactly the one issued for this event.","type":"boolean"}}}}}},"reservation":{"description":"Reservation status when event type is linked to a product.","type":"object","required":["confirmed","limit"],"properties":{"confirmed":{"description":"Number of confirmed reservations.","type":"number"},"limit":{"description":"Maximum capacity from product warehouse limit.","type":"number"}}},"recurrence":{"description":"Recurrence series information with all related events.","type":"object","required":["isRecurrence","items"],"properties":{"isRecurrence":{"description":"Whether this event is part of a recurring series.","type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["id","title","startTime","endTime","isStorno"],"properties":{"id":{"description":"External event code.","type":"string"},"isParent":{"description":"Whether this is the root/parent event.","type":"boolean"},"title":{"description":"Event title.","type":"string"},"startTime":{"description":"Event start time.","anyOf":[{"description":"Event start time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time.","anyOf":[{"description":"Event end time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isStorno":{"description":"Whether this occurrence is cancelled.","type":"boolean"}}}}}},"recurrenceRule":{"description":"iCalendar RRULE string (e.g., \"FREQ=WEEKLY;BYDAY=MO,WE,FR\").","type":"string"}},"required":["id","calendarId","calendarName","calendarColor","timezone","startTime","endTime","durationMinutes","title","isAllDay","isBlocking","isStorno","visibility","insertedDate","reminderList","orderList","attendeeList","passwordList","recurrence"]}}}}},"operationId":"getBffCalendarEvent-detail","tags":["Calendar Event"],"summary":"Get full event detail","description":"Returns comprehensive event information including calendar context, event type, attendees, orders, reminders, location address, passwords, reservation status, and recurrence data."}},"/bff/calendar/event-find-conflict":{"post":{"parameters":[],"operationId":"postBffCalendarEvent-find-conflict","tags":["Calendar Event"],"summary":"Find calendar event conflicts","description":"Checks whether proposed events conflict with existing events on the given calendar. Returns a list of conflicting time slots.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["calendarId","eventList"],"properties":{"calendarId":{"description":"External calendar code.","type":"string"},"eventList":{"description":"List of proposed events to check for conflicts.","type":"array","items":{"type":"object","required":["startTime","endTime"],"properties":{"startTime":{"description":"Proposed start time (ISO 8601).","type":"string"},"endTime":{"description":"Proposed end time (ISO 8601).","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks the calendar slot.","type":"boolean"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["calendarId","eventList"],"properties":{"calendarId":{"description":"External calendar code.","type":"string"},"eventList":{"description":"List of proposed events to check for conflicts.","type":"array","items":{"type":"object","required":["startTime","endTime"],"properties":{"startTime":{"description":"Proposed start time (ISO 8601).","type":"string"},"endTime":{"description":"Proposed end time (ISO 8601).","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks the calendar slot.","type":"boolean"}}}}}}},"text/plain":{"schema":{"type":"object","required":["calendarId","eventList"],"properties":{"calendarId":{"description":"External calendar code.","type":"string"},"eventList":{"description":"List of proposed events to check for conflicts.","type":"array","items":{"type":"object","required":["startTime","endTime"],"properties":{"startTime":{"description":"Proposed start time (ISO 8601).","type":"string"},"endTime":{"description":"Proposed end time (ISO 8601).","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks the calendar slot.","type":"boolean"}}}}}}}}},"responses":{"200":{}}}},"/bff/calendar/event-add":{"post":{"operationId":"postBffCalendarEvent-add","tags":["Calendar Event"],"summary":"Create calendar event","description":"Creates a new calendar event. The request body is validated against the calendar event server schema.","responses":{"200":{}}}},"/bff/calendar/event-order-link":{"post":{"parameters":[],"operationId":"postBffCalendarEvent-order-link","tags":["Calendar Event"],"summary":"Link a work order to an event","description":"Links an order to a calendar event as a scheduled work order (BIZKIT-159). Idempotent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId","orderNumber"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderNumber":{"minLength":1,"description":"Order number of the work order to link.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId","orderNumber"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderNumber":{"minLength":1,"description":"Order number of the work order to link.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["eventId","orderNumber"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderNumber":{"minLength":1,"description":"Order number of the work order to link.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/calendar/event-order-unlink":{"post":{"parameters":[],"operationId":"postBffCalendarEvent-order-unlink","tags":["Calendar Event"],"summary":"Unlink a work order from an event","description":"Removes the link between a calendar event and an order. Neither is deleted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId","orderHash"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderHash":{"description":"Order hash.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId","orderHash"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderHash":{"description":"Order hash.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["eventId","orderHash"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderHash":{"description":"Order hash.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/calendar/event-order-note":{"post":{"parameters":[],"operationId":"postBffCalendarEvent-order-note","tags":["Calendar Event"],"summary":"Add a field note to a work order","description":"Appends a signed, dated note to the internal notice of an order linked to the event, so the office sees it on the order (BIZKIT-159).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId","orderHash","note"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderHash":{"description":"Hash of an order linked to the event.","type":"string"},"note":{"minLength":1,"maxLength":4000,"description":"Field note; appended to the internal order notice.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId","orderHash","note"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderHash":{"description":"Hash of an order linked to the event.","type":"string"},"note":{"minLength":1,"maxLength":4000,"description":"Field note; appended to the internal order notice.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["eventId","orderHash","note"],"properties":{"eventId":{"description":"External event code.","type":"string"},"orderHash":{"description":"Hash of an order linked to the event.","type":"string"},"note":{"minLength":1,"maxLength":4000,"description":"Field note; appended to the internal order notice.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/calendar/event-type-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["label","code","color"],"properties":{"label":{"description":"Event type display label.","type":"string"},"code":{"description":"Unique event type code.","type":"string"},"color":{"description":"Hex color for the event type.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["label","code","color"],"properties":{"label":{"description":"Event type display label.","type":"string"},"code":{"description":"Unique event type code.","type":"string"},"color":{"description":"Hex color for the event type.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["label","code","color"],"properties":{"label":{"description":"Event type display label.","type":"string"},"code":{"description":"Unique event type code.","type":"string"},"color":{"description":"Hex color for the event type.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffCalendarEvent-type-list","tags":["Calendar Event"],"summary":"List event types","description":"Returns all event types available for the organisation."}},"/bff/calendar/event-type-grid":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","label","color","position"],"properties":{"code":{"description":"Unique event type code.","type":"string"},"label":{"description":"Display label.","type":"string"},"color":{"description":"Hex color (e.g., \"#FF5733\").","type":"string"},"position":{"description":"Sort position within the organisation.","type":"number"},"productCode":{"description":"Linked product code (admin URL slug). Omitted if not linked.","type":"string"},"productName":{"description":"Linked product display name (first translation). Omitted if not linked.","type":"string"}}}},"itemCount":{"description":"Total number of event types for the organisation.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","label","color","position"],"properties":{"code":{"description":"Unique event type code.","type":"string"},"label":{"description":"Display label.","type":"string"},"color":{"description":"Hex color (e.g., \"#FF5733\").","type":"string"},"position":{"description":"Sort position within the organisation.","type":"number"},"productCode":{"description":"Linked product code (admin URL slug). Omitted if not linked.","type":"string"},"productName":{"description":"Linked product display name (first translation). Omitted if not linked.","type":"string"}}}},"itemCount":{"description":"Total number of event types for the organisation.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","label","color","position"],"properties":{"code":{"description":"Unique event type code.","type":"string"},"label":{"description":"Display label.","type":"string"},"color":{"description":"Hex color (e.g., \"#FF5733\").","type":"string"},"position":{"description":"Sort position within the organisation.","type":"number"},"productCode":{"description":"Linked product code (admin URL slug). Omitted if not linked.","type":"string"},"productName":{"description":"Linked product display name (first translation). Omitted if not linked.","type":"string"}}}},"itemCount":{"description":"Total number of event types for the organisation.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffCalendarEvent-type-grid","tags":["Calendar Event"],"summary":"List event types for settings grid","description":"Returns all event types of the organisation enriched with `position` and the linked product (code + display name). Ordered by `position` ASC. Consumed by the admin \"Calendar event types\" settings tab."}},"/bff/calendar/event-type-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"description":"Code of the created event type.","type":"string"}},"required":["code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"code":{"description":"Code of the created event type.","type":"string"}},"required":["code"]}},"text/plain":{"schema":{"type":"object","properties":{"code":{"description":"Code of the created event type.","type":"string"}},"required":["code"]}}}}},"operationId":"postBffCalendarEvent-type-add","tags":["Calendar Event"],"summary":"Add event type","description":"Creates a new event type for the organisation. Code must be unique within the organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","label","color"],"properties":{"code":{"description":"Unique event type code (e.g., \"workshop\", \"meeting\").","type":"string"},"label":{"description":"Display label (e.g., \"Workshop\", \"Meeting\").","type":"string"},"color":{"description":"Hex color (e.g., \"#FF5733\" or \"FF5733\").","type":"string"},"productId":{"nullable":true,"anyOf":[{"description":"Product ID to link for pricing / inventory. Null if none.","type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","label","color"],"properties":{"code":{"description":"Unique event type code (e.g., \"workshop\", \"meeting\").","type":"string"},"label":{"description":"Display label (e.g., \"Workshop\", \"Meeting\").","type":"string"},"color":{"description":"Hex color (e.g., \"#FF5733\" or \"FF5733\").","type":"string"},"productId":{"nullable":true,"anyOf":[{"description":"Product ID to link for pricing / inventory. Null if none.","type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code","label","color"],"properties":{"code":{"description":"Unique event type code (e.g., \"workshop\", \"meeting\").","type":"string"},"label":{"description":"Display label (e.g., \"Workshop\", \"Meeting\").","type":"string"},"color":{"description":"Hex color (e.g., \"#FF5733\" or \"FF5733\").","type":"string"},"productId":{"nullable":true,"anyOf":[{"description":"Product ID to link for pricing / inventory. Null if none.","type":"number"},{"type":"null"}]}}}}}}}},"/bff/calendar/event-edit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}}}},"422":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"description":"Why the event cannot be moved.","type":"string"}},"required":["success","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"description":"Why the event cannot be moved.","type":"string"}},"required":["success","error"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"description":"Why the event cannot be moved.","type":"string"}},"required":["success","error"]}}}}},"operationId":"postBffCalendarEvent-edit","tags":["Calendar Event"],"summary":"Edit calendar event","description":"Updates an existing calendar event. All fields are optional - only provided fields are changed. Nullable fields can be set to null to clear the value. When start time changes, existing reminders are automatically recalculated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId"],"properties":{"calendarId":{"description":"BIZKIT-160: code of the calendar to move the event to. Attendees, reminders, attachments and linked orders are kept; the event code stays the same.","type":"string"},"eventId":{"description":"External event code identifier.","type":"string"},"title":{"description":"Event title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Event description (rich text). Set null to clear.","type":"string"},{"type":"null"}]},"agenda":{"nullable":true,"anyOf":[{"description":"Event agenda / schedule. Set null to clear.","type":"string"},{"type":"null"}]},"url":{"nullable":true,"anyOf":[{"description":"External URL associated with the event. Set null to clear.","type":"string"},{"type":"null"}]},"startTime":{"description":"New start time (ISO 8601).","type":"string"},"endTime":{"description":"New end time (ISO 8601).","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks conflicting reservations in the same slot.","type":"boolean"},"locationTitle":{"nullable":true,"anyOf":[{"description":"Location name / label. Set null to clear.","type":"string"},{"type":"null"}]},"reservedBlockingTo":{"nullable":true,"anyOf":[{"description":"Time until which the calendar slot is blocked (ISO 8601). Set null to clear.","type":"string"},{"type":"null"}]},"type":{"nullable":true,"anyOf":[{"description":"Event type code (e.g., \"workshop\"). Set null to remove type assignment.","type":"string"},{"type":"null"}]},"notifyBefore":{"nullable":true,"anyOf":[{"description":"Reminder relative time before event start (e.g., \"30m\", \"1h\", \"1d\"). Replaces existing reminder. Set null to remove all reminders.","type":"string"},{"type":"null"}]},"visibility":{"nullable":true,"anyOf":[{"description":"Per-event visibility override. NULL inherits from the calendar default. \"private\" hides the title and calendar from anyone but the owner — across all orgs.","anyOf":[{"const":"organisation","type":"string"},{"const":"shared","type":"string"},{"const":"private","type":"string"}]},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId"],"properties":{"calendarId":{"description":"BIZKIT-160: code of the calendar to move the event to. Attendees, reminders, attachments and linked orders are kept; the event code stays the same.","type":"string"},"eventId":{"description":"External event code identifier.","type":"string"},"title":{"description":"Event title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Event description (rich text). Set null to clear.","type":"string"},{"type":"null"}]},"agenda":{"nullable":true,"anyOf":[{"description":"Event agenda / schedule. Set null to clear.","type":"string"},{"type":"null"}]},"url":{"nullable":true,"anyOf":[{"description":"External URL associated with the event. Set null to clear.","type":"string"},{"type":"null"}]},"startTime":{"description":"New start time (ISO 8601).","type":"string"},"endTime":{"description":"New end time (ISO 8601).","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks conflicting reservations in the same slot.","type":"boolean"},"locationTitle":{"nullable":true,"anyOf":[{"description":"Location name / label. Set null to clear.","type":"string"},{"type":"null"}]},"reservedBlockingTo":{"nullable":true,"anyOf":[{"description":"Time until which the calendar slot is blocked (ISO 8601). Set null to clear.","type":"string"},{"type":"null"}]},"type":{"nullable":true,"anyOf":[{"description":"Event type code (e.g., \"workshop\"). Set null to remove type assignment.","type":"string"},{"type":"null"}]},"notifyBefore":{"nullable":true,"anyOf":[{"description":"Reminder relative time before event start (e.g., \"30m\", \"1h\", \"1d\"). Replaces existing reminder. Set null to remove all reminders.","type":"string"},{"type":"null"}]},"visibility":{"nullable":true,"anyOf":[{"description":"Per-event visibility override. NULL inherits from the calendar default. \"private\" hides the title and calendar from anyone but the owner — across all orgs.","anyOf":[{"const":"organisation","type":"string"},{"const":"shared","type":"string"},{"const":"private","type":"string"}]},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["eventId"],"properties":{"calendarId":{"description":"BIZKIT-160: code of the calendar to move the event to. Attendees, reminders, attachments and linked orders are kept; the event code stays the same.","type":"string"},"eventId":{"description":"External event code identifier.","type":"string"},"title":{"description":"Event title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Event description (rich text). Set null to clear.","type":"string"},{"type":"null"}]},"agenda":{"nullable":true,"anyOf":[{"description":"Event agenda / schedule. Set null to clear.","type":"string"},{"type":"null"}]},"url":{"nullable":true,"anyOf":[{"description":"External URL associated with the event. Set null to clear.","type":"string"},{"type":"null"}]},"startTime":{"description":"New start time (ISO 8601).","type":"string"},"endTime":{"description":"New end time (ISO 8601).","type":"string"},"isAllDay":{"description":"Whether the event spans the entire day.","type":"boolean"},"isBlocking":{"description":"Whether the event blocks conflicting reservations in the same slot.","type":"boolean"},"locationTitle":{"nullable":true,"anyOf":[{"description":"Location name / label. Set null to clear.","type":"string"},{"type":"null"}]},"reservedBlockingTo":{"nullable":true,"anyOf":[{"description":"Time until which the calendar slot is blocked (ISO 8601). Set null to clear.","type":"string"},{"type":"null"}]},"type":{"nullable":true,"anyOf":[{"description":"Event type code (e.g., \"workshop\"). Set null to remove type assignment.","type":"string"},{"type":"null"}]},"notifyBefore":{"nullable":true,"anyOf":[{"description":"Reminder relative time before event start (e.g., \"30m\", \"1h\", \"1d\"). Replaces existing reminder. Set null to remove all reminders.","type":"string"},{"type":"null"}]},"visibility":{"nullable":true,"anyOf":[{"description":"Per-event visibility override. NULL inherits from the calendar default. \"private\" hides the title and calendar from anyone but the owner — across all orgs.","anyOf":[{"const":"organisation","type":"string"},{"const":"shared","type":"string"},{"const":"private","type":"string"}]},{"type":"null"}]}}}}}}}},"/bff/calendar/event-make-recurring":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the conversion was successful.","type":"boolean"},"addedCount":{"description":"Number of sibling occurrences created.","type":"number"}},"required":["success","addedCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the conversion was successful.","type":"boolean"},"addedCount":{"description":"Number of sibling occurrences created.","type":"number"}},"required":["success","addedCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the conversion was successful.","type":"boolean"},"addedCount":{"description":"Number of sibling occurrences created.","type":"number"}},"required":["success","addedCount"]}}}}},"operationId":"postBffCalendarEvent-make-recurring","tags":["Calendar Event"],"summary":"Convert a single event into a recurring series","description":"Turns a standalone event into a recurring template (\"vzor\") by creating sibling events that point to it via parent_event_id. Fields (title, description, agenda, url, location, type, blocking flag, all-day flag, reservedBlockingTo) are copied from the parent. Refuses if the event is already part of a recurring series.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId","periodDates"],"properties":{"eventId":{"description":"External event code of the (currently non-recurring) event that should become the series parent.","type":"string"},"periodDates":{"description":"List of occurrences for the new recurring series. The occurrence whose start/end exactly matches the parent event is skipped automatically.","type":"array","items":{"type":"object","required":["dateFrom","dateTo"],"properties":{"dateFrom":{"description":"Occurrence start time (ISO 8601).","type":"string"},"dateTo":{"description":"Occurrence end time (ISO 8601).","type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId","periodDates"],"properties":{"eventId":{"description":"External event code of the (currently non-recurring) event that should become the series parent.","type":"string"},"periodDates":{"description":"List of occurrences for the new recurring series. The occurrence whose start/end exactly matches the parent event is skipped automatically.","type":"array","items":{"type":"object","required":["dateFrom","dateTo"],"properties":{"dateFrom":{"description":"Occurrence start time (ISO 8601).","type":"string"},"dateTo":{"description":"Occurrence end time (ISO 8601).","type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","required":["eventId","periodDates"],"properties":{"eventId":{"description":"External event code of the (currently non-recurring) event that should become the series parent.","type":"string"},"periodDates":{"description":"List of occurrences for the new recurring series. The occurrence whose start/end exactly matches the parent event is skipped automatically.","type":"array","items":{"type":"object","required":["dateFrom","dateTo"],"properties":{"dateFrom":{"description":"Occurrence start time (ISO 8601).","type":"string"},"dateTo":{"description":"Occurrence end time (ISO 8601).","type":"string"}}}}}}}}}}},"/bff/calendar/event-attendee-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"added":{"description":"Number of people actually added.","type":"number"},"skipped":{"description":"Already present or not resolvable to a contact.","type":"number"}},"required":["success","added","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"added":{"description":"Number of people actually added.","type":"number"},"skipped":{"description":"Already present or not resolvable to a contact.","type":"number"}},"required":["success","added","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"added":{"description":"Number of people actually added.","type":"number"},"skipped":{"description":"Already present or not resolvable to a contact.","type":"number"}},"required":["success","added","skipped"]}}}}},"operationId":"postBffCalendarEvent-attendee-add","tags":["Calendar Event"],"summary":"Add attendees to a calendar event","description":"Adds people to an existing event using the same contact resolution as event creation. People already on the event are skipped. Newly added people receive the invitation e-mail.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId","attendees"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"},"attendees":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["name"],"properties":{"memberId":{"description":"Organisation member id.","type":"number"},"customerId":{"description":"Contact id.","type":"number"},"name":{"description":"Display name.","type":"string"},"email":{"description":"E-mail (creates the contact when unknown).","type":"string"},"phone":{"description":"Phone.","type":"string"}}}},"sendInvite":{"description":"Send the invitation e-mail to added people (default true).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId","attendees"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"},"attendees":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["name"],"properties":{"memberId":{"description":"Organisation member id.","type":"number"},"customerId":{"description":"Contact id.","type":"number"},"name":{"description":"Display name.","type":"string"},"email":{"description":"E-mail (creates the contact when unknown).","type":"string"},"phone":{"description":"Phone.","type":"string"}}}},"sendInvite":{"description":"Send the invitation e-mail to added people (default true).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["eventId","attendees"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"},"attendees":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["name"],"properties":{"memberId":{"description":"Organisation member id.","type":"number"},"customerId":{"description":"Contact id.","type":"number"},"name":{"description":"Display name.","type":"string"},"email":{"description":"E-mail (creates the contact when unknown).","type":"string"},"phone":{"description":"Phone.","type":"string"}}}},"sendInvite":{"description":"Send the invitation e-mail to added people (default true).","type":"boolean"}}}}}}}},"/bff/calendar/event-attendee-remove":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether an attendee row was removed.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether an attendee row was removed.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether an attendee row was removed.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffCalendarEvent-attendee-remove","tags":["Calendar Event"],"summary":"Remove an attendee from a calendar event","description":"Removes a non-organiser attendee. Order customers are cancelled via storno instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId","contactId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"},"contactId":{"description":"Contact external id of the attendee to remove.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId","contactId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"},"contactId":{"description":"Contact external id of the attendee to remove.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["eventId","contactId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"},"contactId":{"description":"Contact external id of the attendee to remove.","type":"string"}}}}}}}},"/bff/calendar/event-storno":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was found and updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was found and updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was found and updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffCalendarEvent-storno","tags":["Calendar Event"],"summary":"Storno single calendar event","description":"Cancels or restores a single calendar event. Sends storno notification emails to all attendees and logs the action.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["calendarId","eventId","isStorno"],"properties":{"calendarId":{"description":"Calendar code.","type":"string"},"eventId":{"description":"External event code identifier.","type":"string"},"isStorno":{"description":"true = cancel, false = restore.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["calendarId","eventId","isStorno"],"properties":{"calendarId":{"description":"Calendar code.","type":"string"},"eventId":{"description":"External event code identifier.","type":"string"},"isStorno":{"description":"true = cancel, false = restore.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["calendarId","eventId","isStorno"],"properties":{"calendarId":{"description":"Calendar code.","type":"string"},"eventId":{"description":"External event code identifier.","type":"string"},"isStorno":{"description":"true = cancel, false = restore.","type":"boolean"}}}}}}}},"/bff/calendar/event-late-cancel":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["status","cancelledAt","lockCodeDeleted"],"properties":{"status":{"const":"cancelled","type":"string"},"cancelledAt":{"type":"string"},"lockCodeDeleted":{"type":"boolean"}}},{"type":"object","required":["status","cancelledAt"],"properties":{"status":{"const":"already_cancelled","type":"string"},"cancelledAt":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["status","cancelledAt","lockCodeDeleted"],"properties":{"status":{"const":"cancelled","type":"string"},"cancelledAt":{"type":"string"},"lockCodeDeleted":{"type":"boolean"}}},{"type":"object","required":["status","cancelledAt"],"properties":{"status":{"const":"already_cancelled","type":"string"},"cancelledAt":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["status","cancelledAt","lockCodeDeleted"],"properties":{"status":{"const":"cancelled","type":"string"},"cancelledAt":{"type":"string"},"lockCodeDeleted":{"type":"boolean"}}},{"type":"object","required":["status","cancelledAt"],"properties":{"status":{"const":"already_cancelled","type":"string"},"cancelledAt":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["status","cancelledAt","lockCodeDeleted"],"properties":{"status":{"const":"cancelled","type":"string"},"cancelledAt":{"type":"string"},"lockCodeDeleted":{"type":"boolean"}}},{"type":"object","required":["status","cancelledAt"],"properties":{"status":{"const":"already_cancelled","type":"string"},"cancelledAt":{"type":"string"}}}]}}}}},"operationId":"postBffCalendarEvent-late-cancel","tags":["Calendar Event"],"summary":"Late cancellation without refund (admin)","description":"Releases the slot of a reservation: the event is cancelled, the order stays paid and unchanged, nothing is refunded and no e-mail is sent. No time limits for administrators. Deletes the lock passcode.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["eventId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"}}}}}}}},"/bff/calendar/event-storno-series":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation completed.","type":"boolean"},"affectedCount":{"description":"Number of events that were actually updated (excludes already-stornoed events).","type":"number"}},"required":["success","affectedCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation completed.","type":"boolean"},"affectedCount":{"description":"Number of events that were actually updated (excludes already-stornoed events).","type":"number"}},"required":["success","affectedCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation completed.","type":"boolean"},"affectedCount":{"description":"Number of events that were actually updated (excludes already-stornoed events).","type":"number"}},"required":["success","affectedCount"]}}}}},"operationId":"postBffCalendarEvent-storno-series","tags":["Calendar Event"],"summary":"Storno entire recurring event series","description":"Cancels or restores all events in a recurring series at once. Pass any event code from the series (parent or child) and all related events will be updated. Each event is processed individually — storno notifications are sent per event and each action is logged. Events that already have the desired storno status are skipped. For non-recurring events this behaves like a single storno.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["calendarId","eventId","isStorno"],"properties":{"calendarId":{"description":"Calendar code.","type":"string"},"eventId":{"description":"Any event code from the recurring series (parent or child). The system automatically finds all events in the series.","type":"string"},"isStorno":{"description":"true = cancel all events in series, false = restore all.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["calendarId","eventId","isStorno"],"properties":{"calendarId":{"description":"Calendar code.","type":"string"},"eventId":{"description":"Any event code from the recurring series (parent or child). The system automatically finds all events in the series.","type":"string"},"isStorno":{"description":"true = cancel all events in series, false = restore all.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["calendarId","eventId","isStorno"],"properties":{"calendarId":{"description":"Calendar code.","type":"string"},"eventId":{"description":"Any event code from the recurring series (parent or child). The system automatically finds all events in the series.","type":"string"},"isStorno":{"description":"true = cancel all events in series, false = restore all.","type":"boolean"}}}}}}}},"/bff/calendar/event-download-ics":{"get":{"parameters":[{"description":"External event code identifier.","schema":{"type":"string"},"in":"query","name":"eventId","required":true}],"operationId":"getBffCalendarEvent-download-ics","tags":["Calendar Event"],"summary":"Download event as ICS file","description":"Generates and downloads an iCalendar (.ics) file for the given event.","responses":{"200":{}}}},"/bff/calendar/event-unlock-now":{"get":{"parameters":[{"description":"External event code identifier.","schema":{"type":"string"},"in":"query","name":"eventId","required":true}],"operationId":"getBffCalendarEvent-unlock-now","tags":["Calendar Event"],"summary":"Unlock smart lock now","description":"Triggers an immediate smart lock unlock for the lock associated with the given event.","responses":{"200":{}}}},"/bff/calendar/event-retry-access":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"description":"Final lock_access_status after this attempt: one of ready, fallback_backup, failed, manual_override, pending.","type":"string"},"failureReason":{"description":"Underlying error message when status=failed.","type":"string"},"passcodeId":{"description":"Internal id of the linked passcode (when present).","type":"number"}},"required":["status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"description":"Final lock_access_status after this attempt: one of ready, fallback_backup, failed, manual_override, pending.","type":"string"},"failureReason":{"description":"Underlying error message when status=failed.","type":"string"},"passcodeId":{"description":"Internal id of the linked passcode (when present).","type":"number"}},"required":["status"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"description":"Final lock_access_status after this attempt: one of ready, fallback_backup, failed, manual_override, pending.","type":"string"},"failureReason":{"description":"Underlying error message when status=failed.","type":"string"},"passcodeId":{"description":"Internal id of the linked passcode (when present).","type":"number"}},"required":["status"]}}}}},"operationId":"postBffCalendarEvent-retry-access","tags":["Calendar Event"],"summary":"Retry lock access code generation for an event","description":"Runs the same passcode-generation pipeline that the cron uses (`connectPasscodeWithCalendarEvent`). Returns the resulting lifecycle status: `ready` (primary code created), `fallback_backup` (gateway still offline, the lock's backup code is now linked), or `failed` (primary failed and no usable backup). Idempotent — safe to retry from the UI as a \"fix it\" button.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["eventId"],"properties":{"eventId":{"description":"External event code identifier.","type":"string"}}}}}}}},"/bff/calendar/event-resend-access":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"sent":{"type":"number"}},"required":["success","sent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"sent":{"type":"number"}},"required":["success","sent"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"sent":{"type":"number"}},"required":["success","sent"]}}}}},"operationId":"postBffCalendarEvent-resend-access","tags":["Calendar Event"],"summary":"Resend the access e-mail of an event","description":"Sends the `calendar-event-ping` e-mail (access code and practical info) again, using the same template, layout and language as the reminder cron. The recipient is the attendee contact's current e-mail unless `email` overrides it. Refused for cancelled events and for lock events without an access code yet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["eventCode"],"properties":{"eventCode":{"description":"External event code identifier.","type":"string"},"contactId":{"description":"External ID of the attendee contact to send to. Defaults to every attendee.","type":"string"},"email":{"description":"Deliver to this address instead of the attendee e-mail. Requires a single attendee (the event has one, or contactId selects one).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["eventCode"],"properties":{"eventCode":{"description":"External event code identifier.","type":"string"},"contactId":{"description":"External ID of the attendee contact to send to. Defaults to every attendee.","type":"string"},"email":{"description":"Deliver to this address instead of the attendee e-mail. Requires a single attendee (the event has one, or contactId selects one).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["eventCode"],"properties":{"eventCode":{"description":"External event code identifier.","type":"string"},"contactId":{"description":"External ID of the attendee contact to send to. Defaults to every attendee.","type":"string"},"email":{"description":"Deliver to this address instead of the attendee e-mail. Requires a single attendee (the event has one, or contactId selects one).","type":"string"}}}}}}}},"/bff/calendar/event-search":{"get":{"parameters":[{"description":"Title / location fragment or exact event code. Empty = next upcoming events.","schema":{"type":"string"},"in":"query","name":"query","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","title","startTime","endTime","isAllDay","calendarName","calendarColor","locationTitle","reserved","capacity","productPrice"],"properties":{"code":{"type":"string"},"title":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"isAllDay":{"type":"boolean"},"calendarName":{"type":"string"},"calendarColor":{"type":"string"},"locationTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"reserved":{"type":"number"},"capacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"productPrice":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","title","startTime","endTime","isAllDay","calendarName","calendarColor","locationTitle","reserved","capacity","productPrice"],"properties":{"code":{"type":"string"},"title":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"isAllDay":{"type":"boolean"},"calendarName":{"type":"string"},"calendarColor":{"type":"string"},"locationTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"reserved":{"type":"number"},"capacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"productPrice":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["code","title","startTime","endTime","isAllDay","calendarName","calendarColor","locationTitle","reserved","capacity","productPrice"],"properties":{"code":{"type":"string"},"title":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"isAllDay":{"type":"boolean"},"calendarName":{"type":"string"},"calendarColor":{"type":"string"},"locationTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"reserved":{"type":"number"},"capacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"productPrice":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getBffCalendarEvent-search","tags":["Calendar Event"],"summary":"Search calendar events (picker)","description":"Upcoming events for pickers such as \"attach event to order\": title / location / code match, soonest first, with reservation count and capacity. Skips storno events, archived calendars and colleagues' personal calendars."}},"/bff/calendar/upcoming-without-access":{"get":{"operationId":"getBffCalendarUpcoming-without-access","tags":["Calendar Event"],"summary":"Upcoming events without working customer access","description":"Events scheduled in the next 24h where either the calendar has a lock attached and `lock_access_status` is anything other than `ready` (or `manual_override` / `not_required`), or the customer booking e-mail (access code or order e-mail) failed (`accessDeliveryFailure`). Drives the \"Events at risk\" dashboard tile.","responses":{"200":{}}}},"/bff/cart/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Max items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Free-text search across cart identifier and customer email / first / last name.","examples":["jan@example.com","a1b2c3"],"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"\"true\" = only carts with at least one item, \"false\" = only empty carts.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"hasItems","required":false},{"description":"\"true\" = only carts linked to a contact, \"false\" = only anonymous carts.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"hasCustomer","required":false},{"description":"Inclusive lower bound on `updated_date` (ISO date or datetime).","schema":{"type":"string"},"in":"query","name":"updatedFrom","required":false},{"description":"Inclusive upper bound on `updated_date` (ISO date or datetime).","schema":{"type":"string"},"in":"query","name":"updatedTo","required":false}],"operationId":"getBffCartList","tags":["Cart"],"summary":"List shopping carts","description":"Returns a paginated list of carts for the authenticated organisation, sorted by `updated_date` descending. Each row includes a precomputed item count and a total price (in cart currency). Filters cover full-text search, empty / non-empty carts, anonymous vs identified, and a date range on `updated_date`.","responses":{"200":{}}}},"/bff/cart/detail":{"get":{"parameters":[{"description":"Cart identifier (32-char `shop__cart.identifier`).","examples":["a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffCartDetail","tags":["Cart"],"summary":"Get cart detail","description":"Full detail of a single cart — items (with main image preview URL), associated vouchers, customer (when known), delivery and payment method, free-text public notice, and the GeoIP record of the visitor who created the cart. Returns `{ exist: false }` when the cart does not exist or belongs to another organisation.","responses":{"200":{}}}},"/bff/cart/stats":{"get":{"operationId":"getBffCartStats","tags":["Cart"],"summary":"Cart statistics","description":"Aggregated cart metrics: total carts, carts with items, identified carts, recently active (24h / 7d), abandoned carts (with items, untouched 14+ days), potential pipeline revenue, and the dominant currency.","responses":{"200":{}}}},"/bff/cart/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deleted":{"type":"boolean"},"itemCount":{"description":"Number of cart items removed alongside the cart.","type":"number"},"voucherCount":{"description":"Number of cart-voucher rows removed alongside the cart.","type":"number"}},"required":["success","deleted","itemCount","voucherCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deleted":{"type":"boolean"},"itemCount":{"description":"Number of cart items removed alongside the cart.","type":"number"},"voucherCount":{"description":"Number of cart-voucher rows removed alongside the cart.","type":"number"}},"required":["success","deleted","itemCount","voucherCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deleted":{"type":"boolean"},"itemCount":{"description":"Number of cart items removed alongside the cart.","type":"number"},"voucherCount":{"description":"Number of cart-voucher rows removed alongside the cart.","type":"number"}},"required":["success","deleted","itemCount","voucherCount"]}}}}},"operationId":"postBffCartDelete","tags":["Cart"],"summary":"Delete cart","description":"Hard-deletes a cart together with its line items and applied vouchers. Multi-tenant safe — only carts of the calling organisation can be removed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Cart identifier (32-char `shop__cart.identifier`) to delete.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Cart identifier (32-char `shop__cart.identifier`) to delete.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Cart identifier (32-char `shop__cart.identifier`) to delete.","type":"string"}}}}}}}},"/bff/chat/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string","maxLength":200},"in":"query","name":"filterFulltextQuery","required":false},{"schema":{"type":"string","maxLength":16},"in":"query","name":"kind","required":false},{"schema":{"type":"string","maxLength":32},"in":"query","name":"source","required":false},{"schema":{"type":"string"},"in":"query","name":"ownerMemberId","required":false},{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"contactExternalId","required":false},{"schema":{"type":"string","maxLength":64},"in":"query","name":"externalUserRef","required":false},{"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string"},"in":"query","name":"dateTo","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","kind","title","source","model","ownerMemberId","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"hasProblematicMessage":{"type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","kind","title","source","model","ownerMemberId","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"hasProblematicMessage":{"type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","kind","title","source","model","ownerMemberId","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"hasProblematicMessage":{"type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}}}}},"operationId":"getBffChatList","tags":["Chat"],"summary":"List chat rooms for the admin grid"}},"/bff/chat/contact-options":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","name","count"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","name","count"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","name","count"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}},"required":["items"]}}}}},"operationId":"getBffChatContact-options","tags":["Chat"],"summary":"Contact dropdown options for the conversation grid filter","description":"Returns only shop__contact rows that own at least one non-deleted chat room, with a per-contact `count` of those rooms, sorted desc."}},"/bff/chat/detail":{"get":{"parameters":[{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","kind","title","source","model","ownerMemberId","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"hasProblematicMessage":{"type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"messages":{"type":"array","items":{"type":"object","required":["id","position","role","memberId","content","model","inputTokens","outputTokens","toolCalls","isMarkedProblematic","insertedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"memberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"content":{"type":"string"},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"outputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"toolCalls":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"insertedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","kind","title","source","model","ownerMemberId","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"hasProblematicMessage":{"type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"messages":{"type":"array","items":{"type":"object","required":["id","position","role","memberId","content","model","inputTokens","outputTokens","toolCalls","isMarkedProblematic","insertedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"memberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"content":{"type":"string"},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"outputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"toolCalls":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"insertedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","kind","title","source","model","ownerMemberId","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"hasProblematicMessage":{"type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"messages":{"type":"array","items":{"type":"object","required":["id","position","role","memberId","content","model","inputTokens","outputTokens","toolCalls","isMarkedProblematic","insertedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"memberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"content":{"type":"string"},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"outputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"toolCalls":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"insertedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","kind","title","source","model","ownerMemberId","ownerContactExternalId","ownerContactName","externalUserRef","messageCount","totalTokens","lastMessageDate","isMarkedProblematic","hasProblematicMessage","insertedDate","updatedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"internal","type":"string"},{"const":"external","type":"string"}]},"title":{"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"ownerContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"ownerContactName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"externalUserRef":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"totalTokens":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"hasProblematicMessage":{"type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}},"messages":{"type":"array","items":{"type":"object","required":["id","position","role","memberId","content","model","inputTokens","outputTokens","toolCalls","isMarkedProblematic","insertedDate","metadata"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"memberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"content":{"type":"string"},"model":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"outputTokens":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"toolCalls":{"nullable":true,"anyOf":[{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},{"type":"null"}]},"isMarkedProblematic":{"type":"boolean"},"insertedDate":{"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"getBffChatDetail","tags":["Chat"],"summary":"Chat room detail with all messages"}},"/bff/chat/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"minLength":24,"maxLength":24,"type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"minLength":24,"maxLength":24,"type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"minLength":24,"maxLength":24,"type":"string"}},"required":["id"]}}}}},"operationId":"postBffChatCreate","tags":["Chat"],"summary":"Create a chat room (admin / internal use)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"external","type":"string"}]},"title":{"maxLength":200,"type":"string"},"source":{"maxLength":32,"type":"string"},"model":{"maxLength":100,"type":"string"},"participantMemberIds":{"type":"array","items":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"external","type":"string"}]},"title":{"maxLength":200,"type":"string"},"source":{"maxLength":32,"type":"string"},"model":{"maxLength":100,"type":"string"},"participantMemberIds":{"type":"array","items":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"text/plain":{"schema":{"type":"object","properties":{"kind":{"anyOf":[{"const":"ai","type":"string"},{"const":"external","type":"string"}]},"title":{"maxLength":200,"type":"string"},"source":{"maxLength":32,"type":"string"},"model":{"maxLength":100,"type":"string"},"participantMemberIds":{"type":"array","items":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}}}},"/bff/chat/message":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state","id","position"],"properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","id","position"],"properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","id","position"],"properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","id","position"],"properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"postBffChatMessage","tags":["Chat"],"summary":"Append a message to a chat room","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","content"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"content":{"minLength":1,"type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"toolCalls":{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"markProblematic":{"type":"boolean"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","content"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"content":{"minLength":1,"type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"toolCalls":{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"markProblematic":{"type":"boolean"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"text/plain":{"schema":{"type":"object","required":["roomId","content"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"content":{"minLength":1,"type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"},{"const":"system","type":"string"},{"const":"tool","type":"string"},{"const":"member","type":"string"}]},"toolCalls":{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"markProblematic":{"type":"boolean"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}}}},"/bff/chat/title":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"postBffChatTitle","tags":["Chat"],"summary":"Rename a chat room","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","title"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","title"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","title"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"}}}}}}}},"/bff/chat/problem":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"postBffChatProblem","tags":["Chat"],"summary":"Toggle the conversation-level problem flag","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","state"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"state":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","state"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"state":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","state"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"state":{"type":"boolean"}}}}}}}},"/bff/chat/delete":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"postBffChatDelete","tags":["Chat"],"summary":"Soft-delete a chat room","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}}}}}},"/bff/chat/ai-question":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"userMessageId":{"minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"minLength":24,"maxLength":24,"type":"string"},"answer":{"type":"string"}},"required":["roomId","userMessageId","assistantMessageId","answer"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"userMessageId":{"minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"minLength":24,"maxLength":24,"type":"string"},"answer":{"type":"string"}},"required":["roomId","userMessageId","assistantMessageId","answer"]}},"text/plain":{"schema":{"type":"object","properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"userMessageId":{"minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"minLength":24,"maxLength":24,"type":"string"},"answer":{"type":"string"}},"required":["roomId","userMessageId","assistantMessageId","answer"]}}}}},"operationId":"postBffChatAi-question","tags":["Chat"],"summary":"Persistent AI turn (admin AiChatApp / dashboards)","description":"Wrapper that creates a cas__chat_room (kind=ai) on first call and appends both the user prompt and the assistant answer as cas__chat_message rows.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"type":"string"},"roomId":{"minLength":24,"maxLength":24,"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"type":"string"},"roomId":{"minLength":24,"maxLength":24,"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"text/plain":{"schema":{"type":"object","required":["question"],"properties":{"question":{"minLength":1,"type":"string"},"roomId":{"minLength":24,"maxLength":24,"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}}}},"/bff/chat/persist-turn":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"userMessageId":{"minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"minLength":24,"maxLength":24,"type":"string"}},"required":["roomId","userMessageId","assistantMessageId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"userMessageId":{"minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"minLength":24,"maxLength":24,"type":"string"}},"required":["roomId","userMessageId","assistantMessageId"]}},"text/plain":{"schema":{"type":"object","properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"userMessageId":{"minLength":24,"maxLength":24,"type":"string"},"assistantMessageId":{"minLength":24,"maxLength":24,"type":"string"}},"required":["roomId","userMessageId","assistantMessageId"]}}}}},"operationId":"postBffChatPersist-turn","tags":["Chat"],"summary":"Persist a finished user/assistant turn into a chat room","description":"Use this when the AI answer was generated client-side (e.g. via SSE streaming) and you only need to write the audit trail without re-calling the model.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question","answer"],"properties":{"question":{"minLength":1,"type":"string"},"answer":{"minLength":1,"type":"string"},"roomId":{"minLength":24,"maxLength":24,"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"inputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"outputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"toolCalls":{"description":"Optional tool-call trace to attach to the assistant message. Each item is a flexible object; the `/conversation` UI expects at least `{toolCallId, toolName, args?, result?, state?}` shape.","type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["question","answer"],"properties":{"question":{"minLength":1,"type":"string"},"answer":{"minLength":1,"type":"string"},"roomId":{"minLength":24,"maxLength":24,"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"inputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"outputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"toolCalls":{"description":"Optional tool-call trace to attach to the assistant message. Each item is a flexible object; the `/conversation` UI expects at least `{toolCallId, toolName, args?, result?, state?}` shape.","type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}},"text/plain":{"schema":{"type":"object","required":["question","answer"],"properties":{"question":{"minLength":1,"type":"string"},"answer":{"minLength":1,"type":"string"},"roomId":{"minLength":24,"maxLength":24,"type":"string"},"model":{"maxLength":100,"type":"string"},"source":{"maxLength":32,"type":"string"},"externalUserRef":{"maxLength":64,"type":"string"},"inputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"outputTokens":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"toolCalls":{"description":"Optional tool-call trace to attach to the assistant message. Each item is a flexible object; the `/conversation` UI expects at least `{toolCallId, toolName, args?, result?, state?}` shape.","type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"metadata":{"type":"object","patternProperties":{"^(.*)$":{}}}}}}}}}},"/bff/chat/feedback":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"postBffChatFeedback","tags":["Chat"],"summary":"Record thumbs-up/down on an assistant message","description":"Merges `{feedback: \"up\"|\"down\"}` into cas__chat_message.metadata via jsonb_set — no read/modify/write race across tabs. Tenant-scoped by organisationId, only assistant-role messages accepted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messageId","feedback"],"properties":{"messageId":{"minLength":24,"maxLength":24,"type":"string"},"feedback":{"description":"Set thumb up/down, or null to clear.","anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["messageId","feedback"],"properties":{"messageId":{"minLength":24,"maxLength":24,"type":"string"},"feedback":{"description":"Set thumb up/down, or null to clear.","anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["messageId","feedback"],"properties":{"messageId":{"minLength":24,"maxLength":24,"type":"string"},"feedback":{"description":"Set thumb up/down, or null to clear.","anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"type":"null"}]}}}}}}}},"/bff/chat/kit-rooms":{"get":{"parameters":[{"schema":{"type":"string","maxLength":200},"in":"query","name":"query","required":false},{"schema":{"minimum":1,"maximum":100,"default":50,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":100,"default":50,"type":"number"}]},"in":"query","name":"limit","required":false},{"schema":{"minimum":0,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":0,"type":"number"}]},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","createdDate","updatedDate","messageCount","preview"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"title":{"type":"string"},"createdDate":{"type":"string"},"updatedDate":{"description":"Last activity (last message, else creation) as ISO string.","type":"string"},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"preview":{"description":"First user question, whitespace-collapsed, max 160 chars.","type":"string"}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","createdDate","updatedDate","messageCount","preview"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"title":{"type":"string"},"createdDate":{"type":"string"},"updatedDate":{"description":"Last activity (last message, else creation) as ISO string.","type":"string"},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"preview":{"description":"First user question, whitespace-collapsed, max 160 chars.","type":"string"}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","createdDate","updatedDate","messageCount","preview"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"title":{"type":"string"},"createdDate":{"type":"string"},"updatedDate":{"description":"Last activity (last message, else creation) as ISO string.","type":"string"},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"preview":{"description":"First user question, whitespace-collapsed, max 160 chars.","type":"string"}}}},"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","total"]}}}}},"operationId":"getBffChatKit-rooms","tags":["Chat"],"summary":"List the caller's own Kit conversations","description":"Kit sidebar: rooms owned by the calling member (kind=ai, source=admin), most recently active first. `query` matches the title or the first user question."}},"/bff/chat/kit-room":{"get":{"parameters":[{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","title","createdDate","updatedDate"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"title":{"type":"string"},"createdDate":{"type":"string"},"updatedDate":{"type":"string"}}},"messages":{"type":"array","items":{"type":"object","required":["id","role","content","createdDate"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"type":"string"},"createdDate":{"type":"string"},"toolCalls":{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"feedback":{"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"}]},"model":{"type":"string"}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","title","createdDate","updatedDate"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"title":{"type":"string"},"createdDate":{"type":"string"},"updatedDate":{"type":"string"}}},"messages":{"type":"array","items":{"type":"object","required":["id","role","content","createdDate"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"type":"string"},"createdDate":{"type":"string"},"toolCalls":{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"feedback":{"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"}]},"model":{"type":"string"}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","title","createdDate","updatedDate"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"title":{"type":"string"},"createdDate":{"type":"string"},"updatedDate":{"type":"string"}}},"messages":{"type":"array","items":{"type":"object","required":["id","role","content","createdDate"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"type":"string"},"createdDate":{"type":"string"},"toolCalls":{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"feedback":{"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"}]},"model":{"type":"string"}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","room","messages"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","title","createdDate","updatedDate"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"title":{"type":"string"},"createdDate":{"type":"string"},"updatedDate":{"type":"string"}}},"messages":{"type":"array","items":{"type":"object","required":["id","role","content","createdDate"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"role":{"anyOf":[{"const":"user","type":"string"},{"const":"assistant","type":"string"}]},"content":{"type":"string"},"createdDate":{"type":"string"},"toolCalls":{"type":"array","items":{"type":"object","patternProperties":{"^(.*)$":{}}}},"feedback":{"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"}]},"model":{"type":"string"}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"getBffChatKit-room","tags":["Chat"],"summary":"One of the caller's Kit conversations with its messages","description":"Returns the last 200 user/assistant messages in chronological order. `not-found` also when the room belongs to another member or is not a Kit room."}},"/bff/chat/kit-room-delete":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"postBffChatKit-room-delete","tags":["Chat"],"summary":"Soft-delete one of the caller's Kit conversations","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"}}}}}}}},"/bff/chat/kit-room-rename":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"ok","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"postBffChatKit-room-rename","tags":["Chat"],"summary":"Rename one of the caller's Kit conversations","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","title"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"title":{"minLength":1,"maxLength":120,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","title"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"title":{"minLength":1,"maxLength":120,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","title"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"title":{"minLength":1,"maxLength":120,"type":"string"}}}}}}}},"/bff/chat/create-ticket-from-turn":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success","issueKey","url"],"properties":{"success":{"const":true,"type":"boolean"},"issueKey":{"minLength":1,"type":"string"},"url":{"minLength":1,"type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"member_required","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","issueKey","url"],"properties":{"success":{"const":true,"type":"boolean"},"issueKey":{"minLength":1,"type":"string"},"url":{"minLength":1,"type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"member_required","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","issueKey","url"],"properties":{"success":{"const":true,"type":"boolean"},"issueKey":{"minLength":1,"type":"string"},"url":{"minLength":1,"type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"member_required","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","issueKey","url"],"properties":{"success":{"const":true,"type":"boolean"},"issueKey":{"minLength":1,"type":"string"},"url":{"minLength":1,"type":"string"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"member_required","type":"string"}}}]}}}}},"operationId":"postBffChatCreate-ticket-from-turn","tags":["Chat"],"summary":"Create a ticket from a chat room Kit proposed one for","description":"Kit (the AI agent) emits a `\\`\\`\\`propose-ticket` fenced block in its answer when it cannot resolve the operator's request. On confirmation, the client posts this endpoint with { roomId, kind }; the server reads the full chat transcript, composes title/description/priority via askAIJson, and creates either a BizKitHub support ticket or an internal issue in the operator's own default project. Returns the new issueKey and its admin URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","kind"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"support","type":"string"},{"const":"internal","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","kind"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"support","type":"string"},{"const":"internal","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["roomId","kind"],"properties":{"roomId":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"support","type":"string"},{"const":"internal","type":"string"}]}}}}}}}},"/bff/cms/menu":{"get":{"operationId":"getBffCmsMenu","tags":["CMS"],"summary":"Get navigation menu","description":"Returns the hierarchical navigation menu for the authenticated user. Menu items are filtered based on user permissions and organisation settings. Returns an empty array if user is not authenticated. Each item contains: id, module (ApplicationModule), uri, and optional subLinks (recursive children).","responses":{"200":{}}}},"/bff/cms/menu/pins":{"get":{"responses":{"200":{"description":"List of pinned menu items for the current user and organisation.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["uri","position","pinnedAt"],"properties":{"uri":{"description":"Pinned menu URI.","examples":["/order"],"type":"string"},"position":{"description":"0-based display order.","examples":[0],"type":"number"},"pinnedAt":{"description":"ISO-8601 timestamp of when the pin was first created.","examples":["2026-04-12T10:34:11Z"],"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["uri","position","pinnedAt"],"properties":{"uri":{"description":"Pinned menu URI.","examples":["/order"],"type":"string"},"position":{"description":"0-based display order.","examples":[0],"type":"number"},"pinnedAt":{"description":"ISO-8601 timestamp of when the pin was first created.","examples":["2026-04-12T10:34:11Z"],"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["uri","position","pinnedAt"],"properties":{"uri":{"description":"Pinned menu URI.","examples":["/order"],"type":"string"},"position":{"description":"0-based display order.","examples":[0],"type":"number"},"pinnedAt":{"description":"ISO-8601 timestamp of when the pin was first created.","examples":["2026-04-12T10:34:11Z"],"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffCmsMenuPins","tags":["CMS"],"summary":"List pinned menu items","description":"Returns the pinned menu items of the authenticated user inside the active organisation, ordered by their stored position (0-based, ascending). Pin identity is the menu URI; menu node ids are not stable across releases. If the URI no longer resolves in the current menu the client filters it out at render time. Returns 401 when no session is present and 403 when the user has no active organisation."},"put":{"parameters":[],"operationId":"putBffCmsMenuPins","tags":["CMS"],"summary":"Replace pinned menu items","description":"Atomically replaces the entire pin collection of the authenticated user inside the active organisation. The order of URIs in the request becomes the display order (position 0..N-1). Used for pin / unpin / reorder in a single round-trip — the client always sends the full set. Validation errors return 422 with `{ error: \"validation\", fields }`. Duplicate URIs, malformed URIs, and counts above 30 are rejected. On success, returns the updated list so the client can replace its cache directly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["uris"],"properties":{"uris":{"maxItems":30,"description":"Full ordered set of pinned URIs. Position in the array becomes the display position. Sending an empty array clears all pins for the current (user, organisation).","type":"array","items":{"minLength":1,"maxLength":200,"description":"Menu URI to pin. Must start with \"/\" and contain URL-safe characters only.","examples":["/order"],"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["uris"],"properties":{"uris":{"maxItems":30,"description":"Full ordered set of pinned URIs. Position in the array becomes the display position. Sending an empty array clears all pins for the current (user, organisation).","type":"array","items":{"minLength":1,"maxLength":200,"description":"Menu URI to pin. Must start with \"/\" and contain URL-safe characters only.","examples":["/order"],"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["uris"],"properties":{"uris":{"maxItems":30,"description":"Full ordered set of pinned URIs. Position in the array becomes the display position. Sending an empty array clears all pins for the current (user, organisation).","type":"array","items":{"minLength":1,"maxLength":200,"description":"Menu URI to pin. Must start with \"/\" and contain URL-safe characters only.","examples":["/order"],"type":"string"}}}}}}},"responses":{"200":{}}}},"/bff/cms/menu/custom-links":{"get":{"responses":{"200":{"description":"List of personal custom links for the current user and organisation.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","url","position","createdAt"],"properties":{"id":{"description":"16-char external id used to address the link.","type":"string"},"label":{"description":"Human-readable label shown in the sidebar.","type":"string"},"url":{"description":"Absolute http(s) URL. Opens in a new tab.","type":"string"},"position":{"description":"0-based display order.","type":"number"},"createdAt":{"description":"ISO-8601 timestamp of when the link was added.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","url","position","createdAt"],"properties":{"id":{"description":"16-char external id used to address the link.","type":"string"},"label":{"description":"Human-readable label shown in the sidebar.","type":"string"},"url":{"description":"Absolute http(s) URL. Opens in a new tab.","type":"string"},"position":{"description":"0-based display order.","type":"number"},"createdAt":{"description":"ISO-8601 timestamp of when the link was added.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","url","position","createdAt"],"properties":{"id":{"description":"16-char external id used to address the link.","type":"string"},"label":{"description":"Human-readable label shown in the sidebar.","type":"string"},"url":{"description":"Absolute http(s) URL. Opens in a new tab.","type":"string"},"position":{"description":"0-based display order.","type":"number"},"createdAt":{"description":"ISO-8601 timestamp of when the link was added.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffCmsMenuCustom-links","tags":["CMS"],"summary":"List custom favourite links","description":"Returns the personal custom links (label + external URL) the authenticated user has saved inside the active organisation. Rendered in the sidebar next to pinned menu items. Ordered by stored position, then insertion time. Returns 401 when no session is present and 403 when the user has no active organisation."},"post":{"parameters":[],"operationId":"postBffCmsMenuCustom-links","tags":["CMS"],"summary":"Add custom favourite link","description":"Adds a personal custom link for the authenticated user inside the active organisation. Label is trimmed and required (min 1 char). URL must be absolute http(s). Validation errors return 422 with `{ error: \"validation\", fields }`. Max 50 links per (user, organisation) — hitting the cap returns 409 `{ error: \"limit-reached\" }`. On success, returns the full updated list so the client can replace its cache directly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label","url"],"properties":{"label":{"minLength":1,"maxLength":120,"description":"Human-readable label. Trimmed server-side.","examples":["GitHub org"],"type":"string"},"url":{"minLength":1,"maxLength":2048,"description":"Absolute http(s) URL. Other schemes (javascript:, data:, mailto:, custom) are rejected.","examples":["https://github.com/BizKitHub"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["label","url"],"properties":{"label":{"minLength":1,"maxLength":120,"description":"Human-readable label. Trimmed server-side.","examples":["GitHub org"],"type":"string"},"url":{"minLength":1,"maxLength":2048,"description":"Absolute http(s) URL. Other schemes (javascript:, data:, mailto:, custom) are rejected.","examples":["https://github.com/BizKitHub"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["label","url"],"properties":{"label":{"minLength":1,"maxLength":120,"description":"Human-readable label. Trimmed server-side.","examples":["GitHub org"],"type":"string"},"url":{"minLength":1,"maxLength":2048,"description":"Absolute http(s) URL. Other schemes (javascript:, data:, mailto:, custom) are rejected.","examples":["https://github.com/BizKitHub"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/cms/menu/custom-links/{id}":{"delete":{"parameters":[{"description":"16-char external id of the link.","schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"id","required":true}],"operationId":"deleteBffCmsMenuCustom-linksById","tags":["CMS"],"summary":"Delete custom favourite link","description":"Removes a personal custom link identified by its external id. Silently succeeds if the id no longer resolves (idempotent). Returns the full updated list so the client can replace its cache directly.","responses":{"200":{}}}},"/bff/cms/switch-organisation":{"post":{"parameters":[],"responses":{"200":{"description":"Organisation switch result.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"},"identityId":{"description":"New identity ID for the switched organisation session.","examples":["xyz789-new-identity"],"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"},"identityId":{"description":"New identity ID for the switched organisation session.","examples":["xyz789-new-identity"],"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"},"identityId":{"description":"New identity ID for the switched organisation session.","examples":["xyz789-new-identity"],"type":"string"}},"required":["success"]}}}}},"operationId":"postBffCmsSwitch-organisation","tags":["CMS"],"summary":"Switch organisation context","description":"Switches the user session to a different organisation. Creates a new identity session for the target organisation. User must be a member of the target organisation. Updates the organisation order in the user menu (most recently accessed first).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityCookies","organisation"],"properties":{"identityCookies":{"description":"Current user identity cookie value.","examples":["abc123-identity-token"],"type":"string"},"organisation":{"description":"Slug of the organisation to switch to.","examples":["acme-corp"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityCookies","organisation"],"properties":{"identityCookies":{"description":"Current user identity cookie value.","examples":["abc123-identity-token"],"type":"string"},"organisation":{"description":"Slug of the organisation to switch to.","examples":["acme-corp"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityCookies","organisation"],"properties":{"identityCookies":{"description":"Current user identity cookie value.","examples":["abc123-identity-token"],"type":"string"},"organisation":{"description":"Slug of the organisation to switch to.","examples":["acme-corp"],"type":"string"}}}}}}}},"/bff/cms/switch-locale":{"post":{"parameters":[],"responses":{"200":{"description":"Locale changed successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffCmsSwitch-locale","tags":["CMS"],"summary":"Switch user locale","description":"Changes the preferred locale/language for the authenticated user. This affects the UI language and date/number formatting across all sessions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["identityCookies","locale"],"properties":{"identityCookies":{"description":"Current user identity cookie value.","examples":["abc123-identity-token"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["identityCookies","locale"],"properties":{"identityCookies":{"description":"Current user identity cookie value.","examples":["abc123-identity-token"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["identityCookies","locale"],"properties":{"identityCookies":{"description":"Current user identity cookie value.","examples":["abc123-identity-token"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}}}},"/bff/complaint/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Filter by complaint variant code defined by organisation.","examples":["complaint","return"],"schema":{"type":"string"},"in":"query","name":"variantCode","required":false},{"description":"Filter by complaint status.","examples":["new","open","wait","resolve","reject","closed"],"schema":{"type":"string"},"in":"query","name":"status","required":false},{"description":"Filter by resolution state. \"true\" = resolved only, \"false\" = open only.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"isResolved","required":false},{"description":"Full-text search across customer name, email, order number, and description.","examples":["jan@example.com","Novák"],"schema":{"type":"string"},"in":"query","name":"search","required":false},{"description":"Filter complaints created on or after this date (inclusive).","examples":["2026-01-01"],"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"Filter complaints created on or before this date (inclusive).","examples":["2026-01-31"],"schema":{"type":"string"},"in":"query","name":"dateTo","required":false}],"operationId":"getBffComplaintList","tags":["Complaint"],"summary":"List complaints","description":"Returns a paginated list of complaints with variant, status, and customer info. Supports filtering by variant, status, resolution state, date range, and full-text search.","responses":{"200":{}}}},"/bff/complaint/detail":{"get":{"parameters":[{"description":"Complaint ID.","examples":["42"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffComplaintDetail","tags":["Complaint"],"summary":"Complaint detail","description":"Returns full complaint detail including items, events timeline, refund info, and satisfaction feedback.","responses":{"200":{}}}},"/bff/complaint/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"number":{"description":"Human-readable complaint number from the organisation number series.","examples":["REK260001"],"type":"string"}},"required":["success","id","number"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"number":{"description":"Human-readable complaint number from the organisation number series.","examples":["REK260001"],"type":"string"}},"required":["success","id","number"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"number":{"description":"Human-readable complaint number from the organisation number series.","examples":["REK260001"],"type":"string"}},"required":["success","id","number"]}}}}},"operationId":"postBffComplaintCreate","tags":["Complaint"],"summary":"Create complaint","description":"Creates a new complaint case. Optionally links to an existing order and its items. An initial event is automatically created in the complaint timeline.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["variantCode","description","customerName"],"properties":{"variantCode":{"description":"Organisation-defined complaint variant code.","examples":["complaint","return","exchange"],"type":"string"},"orderId":{"description":"Internal order ID to link the complaint to an existing order.","examples":[1024],"type":"number"},"orderNumber":{"description":"Human-readable order number. Use when order is external or unavailable by ID.","examples":["25000087"],"type":"string"},"description":{"description":"Customer-provided description and reason for the complaint.","examples":["Product arrived damaged, visible scratch on the surface."],"type":"string"},"customerName":{"description":"Full name of the customer filing the complaint.","examples":["Jan Novák"],"type":"string"},"email":{"description":"Customer e-mail for complaint communication.","examples":["jan@example.com"],"type":"string"},"phone":{"description":"Customer phone number.","examples":["+420 777 123 456"],"type":"string"},"price":{"description":"Total claimed amount in the order-defined currency.","examples":[1500],"type":"number"},"currencyId":{"description":"Currency ID for the claimed amount.","examples":[1],"type":"number"},"refundCountry":{"description":"ISO 3166-1 alpha-2 country code for refund bank account.","examples":["CZ","SK"],"type":"string"},"refundBankAccount":{"description":"Bank account number for refund transfer.","examples":["123456789/0100"],"type":"string"},"refundVariableSymbol":{"description":"Variable symbol for refund bank transfer.","examples":["25000087"],"type":"string"},"branchId":{"description":"Branch ID where the product should be sent for inspection.","examples":[1],"type":"number"},"serviceId":{"description":"External service provider ID handling the complaint.","examples":[1],"type":"number"},"resolutionMethodCode":{"description":"Preferred resolution method code defined by organisation.","examples":["repair","exchange","refund"],"type":"string"},"dueDate":{"description":"Deadline for complaint resolution.","format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"type":"string"},"items":{"description":"List of complained items from the original order.","type":"array","items":{"type":"object","required":["label"],"properties":{"orderItemId":{"description":"Link to original order item being complained about.","examples":[501],"type":"number"},"label":{"description":"Item description as displayed in the complaint.","examples":["Cheese burger"],"type":"string"},"quantity":{"description":"Number of items being complained about. Defaults to 1.","examples":[1],"type":"number"},"price":{"description":"Claimed unit price of the item.","examples":[250],"type":"number"},"currencyId":{"description":"Currency ID for the item price.","examples":[1],"type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["variantCode","description","customerName"],"properties":{"variantCode":{"description":"Organisation-defined complaint variant code.","examples":["complaint","return","exchange"],"type":"string"},"orderId":{"description":"Internal order ID to link the complaint to an existing order.","examples":[1024],"type":"number"},"orderNumber":{"description":"Human-readable order number. Use when order is external or unavailable by ID.","examples":["25000087"],"type":"string"},"description":{"description":"Customer-provided description and reason for the complaint.","examples":["Product arrived damaged, visible scratch on the surface."],"type":"string"},"customerName":{"description":"Full name of the customer filing the complaint.","examples":["Jan Novák"],"type":"string"},"email":{"description":"Customer e-mail for complaint communication.","examples":["jan@example.com"],"type":"string"},"phone":{"description":"Customer phone number.","examples":["+420 777 123 456"],"type":"string"},"price":{"description":"Total claimed amount in the order-defined currency.","examples":[1500],"type":"number"},"currencyId":{"description":"Currency ID for the claimed amount.","examples":[1],"type":"number"},"refundCountry":{"description":"ISO 3166-1 alpha-2 country code for refund bank account.","examples":["CZ","SK"],"type":"string"},"refundBankAccount":{"description":"Bank account number for refund transfer.","examples":["123456789/0100"],"type":"string"},"refundVariableSymbol":{"description":"Variable symbol for refund bank transfer.","examples":["25000087"],"type":"string"},"branchId":{"description":"Branch ID where the product should be sent for inspection.","examples":[1],"type":"number"},"serviceId":{"description":"External service provider ID handling the complaint.","examples":[1],"type":"number"},"resolutionMethodCode":{"description":"Preferred resolution method code defined by organisation.","examples":["repair","exchange","refund"],"type":"string"},"dueDate":{"description":"Deadline for complaint resolution.","format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"type":"string"},"items":{"description":"List of complained items from the original order.","type":"array","items":{"type":"object","required":["label"],"properties":{"orderItemId":{"description":"Link to original order item being complained about.","examples":[501],"type":"number"},"label":{"description":"Item description as displayed in the complaint.","examples":["Cheese burger"],"type":"string"},"quantity":{"description":"Number of items being complained about. Defaults to 1.","examples":[1],"type":"number"},"price":{"description":"Claimed unit price of the item.","examples":[250],"type":"number"},"currencyId":{"description":"Currency ID for the item price.","examples":[1],"type":"number"}}}}}}},"text/plain":{"schema":{"type":"object","required":["variantCode","description","customerName"],"properties":{"variantCode":{"description":"Organisation-defined complaint variant code.","examples":["complaint","return","exchange"],"type":"string"},"orderId":{"description":"Internal order ID to link the complaint to an existing order.","examples":[1024],"type":"number"},"orderNumber":{"description":"Human-readable order number. Use when order is external or unavailable by ID.","examples":["25000087"],"type":"string"},"description":{"description":"Customer-provided description and reason for the complaint.","examples":["Product arrived damaged, visible scratch on the surface."],"type":"string"},"customerName":{"description":"Full name of the customer filing the complaint.","examples":["Jan Novák"],"type":"string"},"email":{"description":"Customer e-mail for complaint communication.","examples":["jan@example.com"],"type":"string"},"phone":{"description":"Customer phone number.","examples":["+420 777 123 456"],"type":"string"},"price":{"description":"Total claimed amount in the order-defined currency.","examples":[1500],"type":"number"},"currencyId":{"description":"Currency ID for the claimed amount.","examples":[1],"type":"number"},"refundCountry":{"description":"ISO 3166-1 alpha-2 country code for refund bank account.","examples":["CZ","SK"],"type":"string"},"refundBankAccount":{"description":"Bank account number for refund transfer.","examples":["123456789/0100"],"type":"string"},"refundVariableSymbol":{"description":"Variable symbol for refund bank transfer.","examples":["25000087"],"type":"string"},"branchId":{"description":"Branch ID where the product should be sent for inspection.","examples":[1],"type":"number"},"serviceId":{"description":"External service provider ID handling the complaint.","examples":[1],"type":"number"},"resolutionMethodCode":{"description":"Preferred resolution method code defined by organisation.","examples":["repair","exchange","refund"],"type":"string"},"dueDate":{"description":"Deadline for complaint resolution.","format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"type":"string"},"items":{"description":"List of complained items from the original order.","type":"array","items":{"type":"object","required":["label"],"properties":{"orderItemId":{"description":"Link to original order item being complained about.","examples":[501],"type":"number"},"label":{"description":"Item description as displayed in the complaint.","examples":["Cheese burger"],"type":"string"},"quantity":{"description":"Number of items being complained about. Defaults to 1.","examples":[1],"type":"number"},"price":{"description":"Claimed unit price of the item.","examples":[250],"type":"number"},"currencyId":{"description":"Currency ID for the item price.","examples":[1],"type":"number"}}}}}}}}}}},"/bff/complaint/set-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintSet-status","tags":["Complaint"],"summary":"Set complaint status","description":"Changes complaint status and records the transition in the event timeline. Statuses \"resolve\" and \"closed\" automatically set is_resolved flag and resolved_date.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintId","status"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"status":{"description":"New status code. Setting \"resolve\" or \"closed\" automatically marks the complaint as resolved.","examples":["new","open","wait","resolve","reject","closed"],"type":"string"},"message":{"description":"Optional note explaining the status change. Visible in the complaint timeline.","examples":["Awaiting customer response."],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintId","status"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"status":{"description":"New status code. Setting \"resolve\" or \"closed\" automatically marks the complaint as resolved.","examples":["new","open","wait","resolve","reject","closed"],"type":"string"},"message":{"description":"Optional note explaining the status change. Visible in the complaint timeline.","examples":["Awaiting customer response."],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["complaintId","status"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"status":{"description":"New status code. Setting \"resolve\" or \"closed\" automatically marks the complaint as resolved.","examples":["new","open","wait","resolve","reject","closed"],"type":"string"},"message":{"description":"Optional note explaining the status change. Visible in the complaint timeline.","examples":["Awaiting customer response."],"type":"string"}}}}}}}},"/bff/complaint/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintUpdate","tags":["Complaint"],"summary":"Update complaint","description":"Updates complaint fields. Only provided fields are modified; omitted fields remain unchanged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"description":{"description":"Updated complaint description and reason.","examples":["Product arrived with a cracked screen."],"type":"string"},"customerName":{"description":"Updated customer full name.","examples":["Jan Novák"],"type":"string"},"email":{"description":"Updated customer e-mail.","examples":["jan@example.com"],"type":"string"},"phone":{"description":"Updated customer phone number.","examples":["+420 777 123 456"],"type":"string"},"refundCountry":{"description":"ISO 3166-1 alpha-2 country code for refund.","examples":["CZ"],"type":"string"},"refundBankAccount":{"description":"Updated bank account number for refund.","examples":["123456789/0100"],"type":"string"},"refundVariableSymbol":{"description":"Updated variable symbol for refund transfer.","examples":["25000087"],"type":"string"},"branchId":{"description":"Updated branch ID for inspection delivery.","examples":[1],"type":"number"},"serviceId":{"description":"Updated external service provider ID.","examples":[1],"type":"number"},"dueDate":{"description":"Updated deadline for complaint resolution.","format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"description":{"description":"Updated complaint description and reason.","examples":["Product arrived with a cracked screen."],"type":"string"},"customerName":{"description":"Updated customer full name.","examples":["Jan Novák"],"type":"string"},"email":{"description":"Updated customer e-mail.","examples":["jan@example.com"],"type":"string"},"phone":{"description":"Updated customer phone number.","examples":["+420 777 123 456"],"type":"string"},"refundCountry":{"description":"ISO 3166-1 alpha-2 country code for refund.","examples":["CZ"],"type":"string"},"refundBankAccount":{"description":"Updated bank account number for refund.","examples":["123456789/0100"],"type":"string"},"refundVariableSymbol":{"description":"Updated variable symbol for refund transfer.","examples":["25000087"],"type":"string"},"branchId":{"description":"Updated branch ID for inspection delivery.","examples":[1],"type":"number"},"serviceId":{"description":"Updated external service provider ID.","examples":[1],"type":"number"},"dueDate":{"description":"Updated deadline for complaint resolution.","format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["complaintId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"description":{"description":"Updated complaint description and reason.","examples":["Product arrived with a cracked screen."],"type":"string"},"customerName":{"description":"Updated customer full name.","examples":["Jan Novák"],"type":"string"},"email":{"description":"Updated customer e-mail.","examples":["jan@example.com"],"type":"string"},"phone":{"description":"Updated customer phone number.","examples":["+420 777 123 456"],"type":"string"},"refundCountry":{"description":"ISO 3166-1 alpha-2 country code for refund.","examples":["CZ"],"type":"string"},"refundBankAccount":{"description":"Updated bank account number for refund.","examples":["123456789/0100"],"type":"string"},"refundVariableSymbol":{"description":"Updated variable symbol for refund transfer.","examples":["25000087"],"type":"string"},"branchId":{"description":"Updated branch ID for inspection delivery.","examples":[1],"type":"number"},"serviceId":{"description":"Updated external service provider ID.","examples":[1],"type":"number"},"dueDate":{"description":"Updated deadline for complaint resolution.","format":"date-time","examples":["2026-02-15T00:00:00.000Z"],"type":"string"}}}}}}}},"/bff/complaint/add-event":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintAdd-event","tags":["Complaint"],"summary":"Add complaint event","description":"Adds a new event to the complaint timeline. Use for internal notes or customer-facing messages. Set shareWithCustomer=true to make the event visible to the customer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"shareWithCustomer":{"description":"Indicator of whether this event should be visible to the customer. Defaults to false (internal only).","default":false,"type":"boolean"},"subject":{"description":"Event subject line.","examples":["Inspection result"],"type":"string"},"message":{"description":"Event message body. Supports internal notes or customer-facing communication.","examples":["Product defect confirmed. Replacement will be shipped."],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"shareWithCustomer":{"description":"Indicator of whether this event should be visible to the customer. Defaults to false (internal only).","default":false,"type":"boolean"},"subject":{"description":"Event subject line.","examples":["Inspection result"],"type":"string"},"message":{"description":"Event message body. Supports internal notes or customer-facing communication.","examples":["Product defect confirmed. Replacement will be shipped."],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["complaintId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"shareWithCustomer":{"description":"Indicator of whether this event should be visible to the customer. Defaults to false (internal only).","default":false,"type":"boolean"},"subject":{"description":"Event subject line.","examples":["Inspection result"],"type":"string"},"message":{"description":"Event message body. Supports internal notes or customer-facing communication.","examples":["Product defect confirmed. Replacement will be shipped."],"type":"string"}}}}}}}},"/bff/complaint/add-item":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintAdd-item","tags":["Complaint"],"summary":"Add complaint item","description":"Adds a new item to an existing complaint. Optionally links to an original order item.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintId","label"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"orderItemId":{"description":"Link to original order item being complained about.","examples":[501],"type":"number"},"label":{"description":"Item description as displayed in the complaint.","examples":["Wireless headphones"],"type":"string"},"quantity":{"description":"Number of items. Defaults to 1.","examples":[1],"type":"number"},"price":{"description":"Claimed unit price of the item.","examples":[2490],"type":"number"},"currencyId":{"description":"Currency ID for the item price.","examples":[1],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintId","label"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"orderItemId":{"description":"Link to original order item being complained about.","examples":[501],"type":"number"},"label":{"description":"Item description as displayed in the complaint.","examples":["Wireless headphones"],"type":"string"},"quantity":{"description":"Number of items. Defaults to 1.","examples":[1],"type":"number"},"price":{"description":"Claimed unit price of the item.","examples":[2490],"type":"number"},"currencyId":{"description":"Currency ID for the item price.","examples":[1],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["complaintId","label"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"orderItemId":{"description":"Link to original order item being complained about.","examples":[501],"type":"number"},"label":{"description":"Item description as displayed in the complaint.","examples":["Wireless headphones"],"type":"string"},"quantity":{"description":"Number of items. Defaults to 1.","examples":[1],"type":"number"},"price":{"description":"Claimed unit price of the item.","examples":[2490],"type":"number"},"currencyId":{"description":"Currency ID for the item price.","examples":[1],"type":"number"}}}}}}}},"/bff/complaint/remove-item":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintRemove-item","tags":["Complaint"],"summary":"Remove complaint item","description":"Removes an item from the complaint.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintId","itemId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"itemId":{"description":"Complaint item ID to remove.","examples":[12],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintId","itemId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"itemId":{"description":"Complaint item ID to remove.","examples":[12],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["complaintId","itemId"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"itemId":{"description":"Complaint item ID to remove.","examples":[12],"type":"number"}}}}}}}},"/bff/complaint/link-blob":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintLink-blob","tags":["Complaint"],"summary":"Attach file to complaint","description":"Links an already-uploaded blob to a complaint. The file must be uploaded via blob storage first. An event is automatically recorded in the complaint timeline.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintId","blobToken"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"blobToken":{"description":"Blob storage token of the previously uploaded file.","examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"label":{"description":"Human-readable file label.","examples":["Photo of damaged product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintId","blobToken"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"blobToken":{"description":"Blob storage token of the previously uploaded file.","examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"label":{"description":"Human-readable file label.","examples":["Photo of damaged product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["complaintId","blobToken"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"blobToken":{"description":"Blob storage token of the previously uploaded file.","examples":["b411056d304d9y6mHe2SoMFBL2Apxfnb"],"type":"string"},"label":{"description":"Human-readable file label.","examples":["Photo of damaged product"],"type":"string"}}}}}}}},"/bff/complaint/satisfaction":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintSatisfaction","tags":["Complaint"],"summary":"Submit satisfaction feedback","description":"Records customer satisfaction feedback for a complaint. Typically called after the complaint has been resolved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintId","score"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"score":{"minimum":1,"maximum":10,"description":"Customer satisfaction score from 1 (worst) to 10 (best).","examples":[8],"type":"number"},"message":{"description":"Optional free-text feedback from the customer about the complaint resolution.","examples":["Quick and professional resolution, thank you."],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintId","score"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"score":{"minimum":1,"maximum":10,"description":"Customer satisfaction score from 1 (worst) to 10 (best).","examples":[8],"type":"number"},"message":{"description":"Optional free-text feedback from the customer about the complaint resolution.","examples":["Quick and professional resolution, thank you."],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["complaintId","score"],"properties":{"complaintId":{"description":"Complaint external ID.","examples":["a1b2c3d4"],"type":"string"},"score":{"minimum":1,"maximum":10,"description":"Customer satisfaction score from 1 (worst) to 10 (best).","examples":[8],"type":"number"},"message":{"description":"Optional free-text feedback from the customer about the complaint resolution.","examples":["Quick and professional resolution, thank you."],"type":"string"}}}}}}}},"/bff/complaint/variant-list":{"get":{"parameters":[{"examples":["en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"operationId":"getBffComplaintVariant-list","tags":["Complaint"],"summary":"List complaint variants","description":"Returns all complaint variant types defined by the organisation (e.g. complaint, return, exchange). Labels honour the optional `locale` query param and fall back to the DB label for org-defined codes.","responses":{"200":{}}}},"/bff/complaint/variant-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created variant ID.","examples":[1],"type":"number"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created variant ID.","examples":[1],"type":"number"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created variant ID.","examples":[1],"type":"number"}},"required":["success","id"]}}}}},"operationId":"postBffComplaintVariant-create","tags":["Complaint"],"summary":"Create complaint variant","description":"Creates a new complaint variant type for the organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","label"],"properties":{"code":{"description":"Unique variant code within the organisation. Used as identifier in API calls.","examples":["complaint","return","exchange"],"type":"string"},"label":{"description":"Human-readable variant label displayed in UI.","examples":["Complaint","Return of goods","Exchange"],"type":"string"},"policyId":{"description":"Default complaint policy ID applied to this variant.","examples":[1],"type":"number"},"position":{"description":"Display order position. Lower values appear first.","examples":[0],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","label"],"properties":{"code":{"description":"Unique variant code within the organisation. Used as identifier in API calls.","examples":["complaint","return","exchange"],"type":"string"},"label":{"description":"Human-readable variant label displayed in UI.","examples":["Complaint","Return of goods","Exchange"],"type":"string"},"policyId":{"description":"Default complaint policy ID applied to this variant.","examples":[1],"type":"number"},"position":{"description":"Display order position. Lower values appear first.","examples":[0],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["code","label"],"properties":{"code":{"description":"Unique variant code within the organisation. Used as identifier in API calls.","examples":["complaint","return","exchange"],"type":"string"},"label":{"description":"Human-readable variant label displayed in UI.","examples":["Complaint","Return of goods","Exchange"],"type":"string"},"policyId":{"description":"Default complaint policy ID applied to this variant.","examples":[1],"type":"number"},"position":{"description":"Display order position. Lower values appear first.","examples":[0],"type":"number"}}}}}}}},"/bff/complaint/variant-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintVariant-update","tags":["Complaint"],"summary":"Update complaint variant","description":"Updates an existing complaint variant. Only provided fields are modified.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Variant ID to update.","examples":[1],"type":"number"},"label":{"description":"Updated human-readable variant label.","examples":["Reklamace"],"type":"string"},"policyId":{"description":"Updated default complaint policy ID.","examples":[1],"type":"number"},"position":{"description":"Updated display order position.","examples":[0],"type":"number"},"isActive":{"description":"Indicator of whether the variant is active and selectable.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Variant ID to update.","examples":[1],"type":"number"},"label":{"description":"Updated human-readable variant label.","examples":["Reklamace"],"type":"string"},"policyId":{"description":"Updated default complaint policy ID.","examples":[1],"type":"number"},"position":{"description":"Updated display order position.","examples":[0],"type":"number"},"isActive":{"description":"Indicator of whether the variant is active and selectable.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Variant ID to update.","examples":[1],"type":"number"},"label":{"description":"Updated human-readable variant label.","examples":["Reklamace"],"type":"string"},"policyId":{"description":"Updated default complaint policy ID.","examples":[1],"type":"number"},"position":{"description":"Updated display order position.","examples":[0],"type":"number"},"isActive":{"description":"Indicator of whether the variant is active and selectable.","type":"boolean"}}}}}}}},"/bff/complaint/resolution-method-list":{"get":{"parameters":[{"examples":["en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"operationId":"getBffComplaintResolution-method-list","tags":["Complaint"],"summary":"List resolution methods","description":"Returns all complaint resolution methods defined by the organisation (e.g. repair, exchange, refund). Labels honour the optional `locale` query param and fall back to the DB label for org-defined codes.","responses":{"200":{}}}},"/bff/complaint/resolution-method-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created resolution method ID.","examples":[1],"type":"number"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created resolution method ID.","examples":[1],"type":"number"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created resolution method ID.","examples":[1],"type":"number"}},"required":["success","id"]}}}}},"operationId":"postBffComplaintResolution-method-create","tags":["Complaint"],"summary":"Create resolution method","description":"Creates a new complaint resolution method for the organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","label"],"properties":{"code":{"description":"Unique resolution method code within the organisation.","examples":["repair","exchange","refund","credit"],"type":"string"},"label":{"description":"Human-readable resolution method label displayed in UI.","examples":["Oprava","Výměna","Vrácení peněz","Dobropis"],"type":"string"},"position":{"description":"Display order position. Lower values appear first.","examples":[0],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","label"],"properties":{"code":{"description":"Unique resolution method code within the organisation.","examples":["repair","exchange","refund","credit"],"type":"string"},"label":{"description":"Human-readable resolution method label displayed in UI.","examples":["Oprava","Výměna","Vrácení peněz","Dobropis"],"type":"string"},"position":{"description":"Display order position. Lower values appear first.","examples":[0],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["code","label"],"properties":{"code":{"description":"Unique resolution method code within the organisation.","examples":["repair","exchange","refund","credit"],"type":"string"},"label":{"description":"Human-readable resolution method label displayed in UI.","examples":["Oprava","Výměna","Vrácení peněz","Dobropis"],"type":"string"},"position":{"description":"Display order position. Lower values appear first.","examples":[0],"type":"number"}}}}}}}},"/bff/complaint/resolution-method-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintResolution-method-update","tags":["Complaint"],"summary":"Update resolution method","description":"Updates an existing resolution method. Only provided fields are modified.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Resolution method ID to update.","examples":[1],"type":"number"},"label":{"description":"Updated human-readable label.","examples":["Oprava"],"type":"string"},"position":{"description":"Updated display order position.","examples":[0],"type":"number"},"isActive":{"description":"Indicator of whether the resolution method is active and selectable.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Resolution method ID to update.","examples":[1],"type":"number"},"label":{"description":"Updated human-readable label.","examples":["Oprava"],"type":"string"},"position":{"description":"Updated display order position.","examples":[0],"type":"number"},"isActive":{"description":"Indicator of whether the resolution method is active and selectable.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Resolution method ID to update.","examples":[1],"type":"number"},"label":{"description":"Updated human-readable label.","examples":["Oprava"],"type":"string"},"position":{"description":"Updated display order position.","examples":[0],"type":"number"},"isActive":{"description":"Indicator of whether the resolution method is active and selectable.","type":"boolean"}}}}}}}},"/bff/complaint/policy-list":{"get":{"operationId":"getBffComplaintPolicy-list","tags":["Complaint"],"summary":"List complaint policies","description":"Returns all complaint policies for the organisation. Policies define cancellation rules, free storno windows, and fee percentages per product or category.","responses":{"200":{}}}},"/bff/complaint/policy-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created policy ID.","examples":[1],"type":"number"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created policy ID.","examples":[1],"type":"number"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"},"id":{"description":"Newly created policy ID.","examples":[1],"type":"number"}},"required":["success","id"]}}}}},"operationId":"postBffComplaintPolicy-create","tags":["Complaint"],"summary":"Create complaint policy","description":"Creates a versioned complaint policy with cancellation/storno rules. Assign to a product or category. Multiple versions can coexist with different validity periods.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","body","validFrom"],"properties":{"productId":{"description":"Apply this policy to a specific product.","examples":[42],"type":"number"},"categoryId":{"description":"Apply this policy to all products in a category.","examples":[5],"type":"number"},"title":{"description":"Policy title displayed to staff and optionally to customer.","examples":["Standard return policy"],"type":"string"},"body":{"description":"Full policy text in HTML or plain text. Defines terms and conditions for complaints.","examples":["Items may be returned within 14 days of delivery."],"type":"string"},"validFrom":{"description":"Date from which this policy version is effective.","format":"date-time","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"Date until which this policy is effective. Null means open-ended.","format":"date-time","examples":["2026-12-31T23:59:59.000Z"],"type":"string"},"allowStorno":{"description":"Indicator of whether free cancellation/storno is allowed under this policy.","default":false,"type":"boolean"},"stornoFreeHours":{"description":"Number of hours before the reservation/event during which storno is free of charge.","examples":[48],"type":"number"},"stornoFeePercent":{"description":"Storno fee as a percentage of the order price when cancelled within the fee window.","examples":[50],"type":"number"},"stornoFeeDeadlineHours":{"description":"Number of hours before the reservation/event within which the storno fee applies. Cancellations before this window use stornoFreeHours rules.","examples":[24],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["title","body","validFrom"],"properties":{"productId":{"description":"Apply this policy to a specific product.","examples":[42],"type":"number"},"categoryId":{"description":"Apply this policy to all products in a category.","examples":[5],"type":"number"},"title":{"description":"Policy title displayed to staff and optionally to customer.","examples":["Standard return policy"],"type":"string"},"body":{"description":"Full policy text in HTML or plain text. Defines terms and conditions for complaints.","examples":["Items may be returned within 14 days of delivery."],"type":"string"},"validFrom":{"description":"Date from which this policy version is effective.","format":"date-time","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"Date until which this policy is effective. Null means open-ended.","format":"date-time","examples":["2026-12-31T23:59:59.000Z"],"type":"string"},"allowStorno":{"description":"Indicator of whether free cancellation/storno is allowed under this policy.","default":false,"type":"boolean"},"stornoFreeHours":{"description":"Number of hours before the reservation/event during which storno is free of charge.","examples":[48],"type":"number"},"stornoFeePercent":{"description":"Storno fee as a percentage of the order price when cancelled within the fee window.","examples":[50],"type":"number"},"stornoFeeDeadlineHours":{"description":"Number of hours before the reservation/event within which the storno fee applies. Cancellations before this window use stornoFreeHours rules.","examples":[24],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["title","body","validFrom"],"properties":{"productId":{"description":"Apply this policy to a specific product.","examples":[42],"type":"number"},"categoryId":{"description":"Apply this policy to all products in a category.","examples":[5],"type":"number"},"title":{"description":"Policy title displayed to staff and optionally to customer.","examples":["Standard return policy"],"type":"string"},"body":{"description":"Full policy text in HTML or plain text. Defines terms and conditions for complaints.","examples":["Items may be returned within 14 days of delivery."],"type":"string"},"validFrom":{"description":"Date from which this policy version is effective.","format":"date-time","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"Date until which this policy is effective. Null means open-ended.","format":"date-time","examples":["2026-12-31T23:59:59.000Z"],"type":"string"},"allowStorno":{"description":"Indicator of whether free cancellation/storno is allowed under this policy.","default":false,"type":"boolean"},"stornoFreeHours":{"description":"Number of hours before the reservation/event during which storno is free of charge.","examples":[48],"type":"number"},"stornoFeePercent":{"description":"Storno fee as a percentage of the order price when cancelled within the fee window.","examples":[50],"type":"number"},"stornoFeeDeadlineHours":{"description":"Number of hours before the reservation/event within which the storno fee applies. Cancellations before this window use stornoFreeHours rules.","examples":[24],"type":"number"}}}}}}}},"/bff/complaint/policy-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Indicates whether the operation completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffComplaintPolicy-update","tags":["Complaint"],"summary":"Update complaint policy","description":"Updates an existing complaint policy. Only provided fields are modified.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Policy ID to update.","examples":[1],"type":"number"},"title":{"description":"Updated policy title.","examples":["Standard return policy"],"type":"string"},"body":{"description":"Updated policy text.","examples":["Items may be returned within 14 days of delivery."],"type":"string"},"validTo":{"description":"Updated expiration date.","format":"date-time","examples":["2026-12-31T23:59:59.000Z"],"type":"string"},"allowStorno":{"description":"Updated storno permission flag.","type":"boolean"},"stornoFreeHours":{"description":"Updated free storno hours window.","examples":[48],"type":"number"},"stornoFeePercent":{"description":"Updated storno fee percentage.","examples":[50],"type":"number"},"stornoFeeDeadlineHours":{"description":"Updated storno fee deadline hours.","examples":[24],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Policy ID to update.","examples":[1],"type":"number"},"title":{"description":"Updated policy title.","examples":["Standard return policy"],"type":"string"},"body":{"description":"Updated policy text.","examples":["Items may be returned within 14 days of delivery."],"type":"string"},"validTo":{"description":"Updated expiration date.","format":"date-time","examples":["2026-12-31T23:59:59.000Z"],"type":"string"},"allowStorno":{"description":"Updated storno permission flag.","type":"boolean"},"stornoFreeHours":{"description":"Updated free storno hours window.","examples":[48],"type":"number"},"stornoFeePercent":{"description":"Updated storno fee percentage.","examples":[50],"type":"number"},"stornoFeeDeadlineHours":{"description":"Updated storno fee deadline hours.","examples":[24],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Policy ID to update.","examples":[1],"type":"number"},"title":{"description":"Updated policy title.","examples":["Standard return policy"],"type":"string"},"body":{"description":"Updated policy text.","examples":["Items may be returned within 14 days of delivery."],"type":"string"},"validTo":{"description":"Updated expiration date.","format":"date-time","examples":["2026-12-31T23:59:59.000Z"],"type":"string"},"allowStorno":{"description":"Updated storno permission flag.","type":"boolean"},"stornoFreeHours":{"description":"Updated free storno hours window.","examples":[48],"type":"number"},"stornoFeePercent":{"description":"Updated storno fee percentage.","examples":[50],"type":"number"},"stornoFeeDeadlineHours":{"description":"Updated storno fee deadline hours.","examples":[24],"type":"number"}}}}}}}},"/bff/review/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"`shop` or `product`; empty = both.","schema":{"type":"string"},"in":"query","name":"kind","required":false},{"description":"`visible`, `hidden` or `unanswered`; empty = all.","schema":{"type":"string"},"in":"query","name":"visibility","required":false},{"description":"Stars 1–5.","schema":{"type":"string"},"in":"query","name":"rating","required":false},{"description":"Author, text, order number, e-mail or product name.","schema":{"type":"string"},"in":"query","name":"search","required":false}],"operationId":"getBffReviewList","tags":["Review"],"summary":"List reviews","description":"Shop and product reviews of the organisation for moderation, newest first.","responses":{"200":{}}}},"/bff/review/set-hidden":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffReviewSet-hidden","tags":["Review"],"summary":"Hide or show a review","description":"Hidden reviews disappear from the public API and summaries.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","hidden"],"properties":{"id":{"description":"Review id.","type":"string"},"hidden":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","hidden"],"properties":{"id":{"description":"Review id.","type":"string"},"hidden":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","hidden"],"properties":{"id":{"description":"Review id.","type":"string"},"hidden":{"type":"boolean"}}}}}}}},"/bff/review/reply":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffReviewReply","tags":["Review"],"summary":"Reply to a review","description":"The reply is shown under the review on the website.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","reply"],"properties":{"id":{"description":"Review id.","type":"string"},"reply":{"maxLength":2000,"description":"Public reply of the shop; empty removes it.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","reply"],"properties":{"id":{"description":"Review id.","type":"string"},"reply":{"maxLength":2000,"description":"Public reply of the shop; empty removes it.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","reply"],"properties":{"id":{"description":"Review id.","type":"string"},"reply":{"maxLength":2000,"description":"Public reply of the shop; empty removes it.","type":"string"}}}}}}}},"/bff/review/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffReviewDelete","tags":["Review"],"summary":"Delete a review","description":"Soft delete. The order becomes available for a new review; prefer hiding for unwanted reviews.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Review id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Review id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Review id.","type":"string"}}}}}}}},"/bff/contact/list":{"get":{"parameters":[{"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"schema":{"type":"number"},"in":"query","name":"page","required":false},{"description":"Full-text search across name, email, phone, and company name.","examples":["jan@example.com","Novák","+420"],"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Comma-separated customer group slugs. Use \"#-no-tags-#\" for untagged contacts.","examples":["vip,wholesale","#-no-tags-#"],"schema":{"type":"string"},"in":"query","name":"tagFilter","required":false},{"description":"Sort field and direction. Format: \"field:asc\" or \"field:desc\".","examples":["credit:desc","last_activity_date:asc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Filter VIP/premium customers.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"isPremium","required":false},{"description":"Filter blocked/banned customers.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"isBanned","required":false},{"description":"Filter by registration status (has password = registered account).","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"isRegistered","required":false},{"description":"Filter test accounts. Use \"false\" to exclude them from reports.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"isTestAccount","required":false},{"description":"Filter customers with positive credit balance (\"true\") or zero credit (\"false\").","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"hasCredit","required":false},{"description":"Filter by customer locale.","examples":["cs","en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"description":"Filter customers registered on or after this date (inclusive).","examples":["2026-01-01"],"schema":{"type":"string"},"in":"query","name":"registeredFrom","required":false},{"description":"Filter customers registered on or before this date (inclusive).","examples":["2026-01-31"],"schema":{"type":"string"},"in":"query","name":"registeredTo","required":false},{"description":"Filter customers active on or after this date. Use to find recently active or inactive users.","examples":["2026-01-01"],"schema":{"type":"string"},"in":"query","name":"lastActivityFrom","required":false},{"description":"Filter by bulk email opt-out status. \"true\" = opted out, \"false\" = subscribed.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"ignoreBulkMail","required":false},{"description":"Filter contacts flagged by the automated cleanup routine as suspicious / non-functional.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"isSuspicious","required":false},{"description":"Lifecycle bucket from the /contact statistics panel: active7 (seen in 7 days), active30 (8 to 30 days), dormant (30 to 90 days), lost (90+ days), neverSeen (no own activity since creation).","examples":["active7","dormant"],"schema":{"type":"string"},"in":"query","name":"lifecycle","required":false},{"description":"Data-health bucket from the /contact statistics panel: undeliverable (bounced e-mail), suspicious (other suspicious flag), noContactInfo (no e-mail and no phone), duplicatePhone (phone shared with another live contact).","examples":["undeliverable","duplicatePhone"],"schema":{"type":"string"},"in":"query","name":"dataHealth","required":false},{"description":"Bucket of a reachability pivot dimension as \"<dimension>:<bucket>\" (activity, customer, newsletter, domain, created). Same SQL as GET /bff/contact/reachability/pivot, so a cell count equals the rows.","examples":["activity:active30","domain:seznam.cz","created:2019"],"schema":{"type":"string"},"in":"query","name":"reachBucket","required":false},{"description":"Bulk e-mail reachability from the /contact \"Dosažitelnost\" tab: reachable (a bulk send reaches the contact) or the exclusion reason (noEmail, banned, unsubscribed, manualOptOut, badAddress, legacyOptOut, spamComplaint, hardBounce, suspicious). Same rule as newsletter dispatch.","examples":["reachable","legacyOptOut"],"schema":{"type":"string"},"in":"query","name":"bulkReach","required":false},{"description":"Transactional e-mail reachability (Dosažitelnost tab, channel \"Transakční e-maily\"): reachable, noEmail, blocked (address bounced or complained in the last 24 h, not attempted now) or atRisk (address hard-bounced in 30 days, still attempted). Same rule as the send-time gate.","examples":["reachable","atRisk"],"schema":{"type":"string"},"in":"query","name":"transactionalReach","required":false},{"description":"\"true\" lists soft-deleted contacts (the Deleted view, restorable) instead of live ones.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"deleted","required":false},{"description":"\"true\" lists the spam-review queue (\"Ke kontrole\"): live, not dismissed contacts with a spam signal or a suspicious flag, excluding members, the organisation own contact and real customers.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"review","required":false}],"responses":{"200":{"description":"Paginated contact list with CRM analytics.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","email","locale","ignoreBulkMail","registered","credit","creditMoney","defaultOrderSale","groupList","insertedDate","updatedDate","lastActivityDate","accountAgeDays","monthLimitMaxCreditSpendHard","monthLimitMaxCreditSpendSoft","orderTotal","orderPaid","orderNotPaid","orderNew","orderProcessing","orderStorno","orderDone","score","trust","totalRevenue","paidOrderCount","refundTotal","stornoOrderCount","voucherOrderCount","activeSubscriptionCount","badges"],"properties":{"id":{"description":"Contact external ID (16-char).","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Primary e-mail. `null` for phone-only contacts (imported by phone with no e-mail) and for contacts anonymised via GDPR right-to-erasure. Use `phone`, `name`, or the external ID for display when null.","type":"string"},{"type":"null"}]},"name":{"description":"Full display name (first + last).","type":"string"},"firstName":{"description":"First name.","type":"string"},"lastName":{"description":"Last name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"isCompany":{"description":"True if the contact has company registration data attached.","type":"boolean"},"companyRegistrationNumber":{"description":"IČO / company registration number.","type":"string"},"taxIdentificationNumber":{"description":"DIČ / VAT / tax identification number.","type":"string"},"isVatPayer":{"description":"Whether the contact is currently a VAT payer (from registry).","type":"boolean"},"isUnreliableVatPayer":{"description":"Flagged as unreliable VAT payer by the tax authority.","type":"boolean"},"phone":{"description":"Phone number.","type":"string"},"locale":{"description":"Customer locale code (cs, en, de...).","type":"string"},"newsletter":{"nullable":true,"anyOf":[{"description":"Newsletter subscription status.","anyOf":[{"const":"registered","type":"string"},{"const":"authorized","type":"string"},{"const":"canceled","type":"string"},{"const":"ignored","type":"string"}]},{"type":"null"}]},"ignoreBulkMail":{"description":"Opted out of bulk emails.","type":"boolean"},"testAccount":{"description":"Is a test account.","type":"boolean"},"premium":{"description":"VIP/premium customer flag.","type":"boolean"},"ban":{"description":"Blocked/banned customer flag.","type":"boolean"},"registered":{"description":"Has a password (registered account).","type":"boolean"},"credit":{"description":"Current store credit balance.","type":"number"},"creditMoney":{"description":"Current store credit balance in default currency (CZK).","type":"number"},"defaultOrderSale":{"description":"Default order discount for this customer.","type":"number"},"subscriptionActiveCount":{"description":"Number of active subscriptions (computed from subscription table).","type":"number"},"groupList":{"description":"Customer group memberships.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"description":"Group slug identifier.","type":"string"},"name":{"description":"Group display name.","type":"string"},"color":{"description":"Group color hex code.","type":"string"},"count":{"description":"Number of contacts in this group.","type":"number"}}}},"avatarUrl":{"description":"Gravatar URL.","type":"string"},"internalNote":{"description":"Internal admin note.","type":"string"},"insertedDate":{"description":"Registration date.","anyOf":[{"description":"Registration date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last profile update date.","anyOf":[{"description":"Last profile update date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"description":"Last activity timestamp.","anyOf":[{"description":"Last activity timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"accountAgeDays":{"description":"Days since registration.","type":"number"},"monthLimitMaxCreditSpendHard":{"description":"Hard monthly credit spend limit.","type":"number"},"monthLimitMaxCreditSpendSoft":{"description":"Soft monthly credit spend limit (warning threshold).","type":"number"},"orderTotal":{"description":"Total number of orders regardless of status (paid, unpaid, storno). Includes historical orders.","type":"number"},"orderPaid":{"description":"Number of paid orders.","type":"number"},"orderNotPaid":{"description":"Number of unpaid orders.","type":"number"},"orderNew":{"description":"Orders in \"new\" status.","type":"number"},"orderProcessing":{"description":"Orders in \"processing\" status.","type":"number"},"orderStorno":{"description":"Orders in \"storno\" status (from vitals).","type":"number"},"orderDone":{"description":"Orders in \"done\" status.","type":"number"},"score":{"description":"CRM quality score (0–100, −1 for blocked). Higher = better customer.","type":"number"},"trust":{"description":"Identity trust score (0–100). Higher = stronger evidence the contact represents a verified real person. Materialized in DB, recomputed by updateContactReadModel on every relevant write.","type":"number"},"totalRevenue":{"description":"Lifetime revenue from paid orders.","type":"number"},"paidOrderCount":{"description":"Total number of paid orders (materialized).","type":"number"},"refundTotal":{"description":"Total value of refunded/storno items.","type":"number"},"firstOrderDate":{"description":"Date of first order (ISO timestamp).","type":"string"},"lastOrderDate":{"description":"Date of most recent order (ISO timestamp).","type":"string"},"lastPaidOrderDate":{"description":"Date of most recent paid order (ISO timestamp).","type":"string"},"stornoOrderCount":{"description":"Number of cancelled/storno orders.","type":"number"},"voucherOrderCount":{"description":"Number of orders placed with a voucher.","type":"number"},"activeSubscriptionCount":{"description":"Number of active subscriptions (materialized).","type":"number"},"badges":{"description":"Display-ready badge list (operator, ban, premium, company, VAT flags, reverse charge, tax exempt, test account, subscription, suspicious) plus user-defined group tags. Same order and contents as the contact detail and hover popover — use directly in the UI.","type":"array","items":{"anyOf":[{"type":"object","required":["kind","slug"],"properties":{"kind":{"const":"system","type":"string"},"slug":{"anyOf":[{"const":"operator","type":"string"},{"const":"ban","type":"string"},{"const":"premium","type":"string"},{"const":"company","type":"string"},{"const":"vatPayer","type":"string"},{"const":"unreliableVatPayer","type":"string"},{"const":"reverseCharge","type":"string"},{"const":"taxExempt","type":"string"},{"const":"testAccount","type":"string"},{"const":"subscription","type":"string"},{"const":"suspicious","type":"string"}]}}},{"type":"object","required":["kind","slug","name","color"],"properties":{"kind":{"const":"group","type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}}]}},"suspicious":{"description":"Present when the contact is currently flagged by the automated cleanup routine. Absent otherwise.","type":"object","required":["reasonCode","reasonLabel","severity","flaggedDate"],"properties":{"reasonCode":{"description":"Machine-readable reason slug (translated by admin).","type":"string"},"reasonLabel":{"description":"English fallback label from the reason registry.","type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},"flaggedDate":{"description":"ISO timestamp when the flag was set.","type":"string"}}},"registeredStatus":{"description":"Three-state registration status: \"none\" — no account, \"active\" — has account and is not banned / suspicious, \"inactive\" — has account but is banned or suspicious.","anyOf":[{"const":"none","type":"string"},{"const":"active","type":"string"},{"const":"inactive","type":"string"}]},"deletedDate":{"description":"ISO soft-delete timestamp (only with `deleted=true`).","type":"string"},"deletedReason":{"description":"Reason recorded at soft-delete (only with `deleted=true`).","type":"string"},"spamSignals":{"description":"Spam-review signals (BIZKIT-141). Empty when none or not evaluated yet.","type":"array","items":{"anyOf":[{"const":"gibberishName","type":"string"},{"const":"gmailDotAlias","type":"string"},{"const":"spamTicketsOnly","type":"string"},{"const":"hostingContactForm","type":"string"}]}}}}},"itemCount":{"description":"Total number of contacts matching the filter (before pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","email","locale","ignoreBulkMail","registered","credit","creditMoney","defaultOrderSale","groupList","insertedDate","updatedDate","lastActivityDate","accountAgeDays","monthLimitMaxCreditSpendHard","monthLimitMaxCreditSpendSoft","orderTotal","orderPaid","orderNotPaid","orderNew","orderProcessing","orderStorno","orderDone","score","trust","totalRevenue","paidOrderCount","refundTotal","stornoOrderCount","voucherOrderCount","activeSubscriptionCount","badges"],"properties":{"id":{"description":"Contact external ID (16-char).","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Primary e-mail. `null` for phone-only contacts (imported by phone with no e-mail) and for contacts anonymised via GDPR right-to-erasure. Use `phone`, `name`, or the external ID for display when null.","type":"string"},{"type":"null"}]},"name":{"description":"Full display name (first + last).","type":"string"},"firstName":{"description":"First name.","type":"string"},"lastName":{"description":"Last name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"isCompany":{"description":"True if the contact has company registration data attached.","type":"boolean"},"companyRegistrationNumber":{"description":"IČO / company registration number.","type":"string"},"taxIdentificationNumber":{"description":"DIČ / VAT / tax identification number.","type":"string"},"isVatPayer":{"description":"Whether the contact is currently a VAT payer (from registry).","type":"boolean"},"isUnreliableVatPayer":{"description":"Flagged as unreliable VAT payer by the tax authority.","type":"boolean"},"phone":{"description":"Phone number.","type":"string"},"locale":{"description":"Customer locale code (cs, en, de...).","type":"string"},"newsletter":{"nullable":true,"anyOf":[{"description":"Newsletter subscription status.","anyOf":[{"const":"registered","type":"string"},{"const":"authorized","type":"string"},{"const":"canceled","type":"string"},{"const":"ignored","type":"string"}]},{"type":"null"}]},"ignoreBulkMail":{"description":"Opted out of bulk emails.","type":"boolean"},"testAccount":{"description":"Is a test account.","type":"boolean"},"premium":{"description":"VIP/premium customer flag.","type":"boolean"},"ban":{"description":"Blocked/banned customer flag.","type":"boolean"},"registered":{"description":"Has a password (registered account).","type":"boolean"},"credit":{"description":"Current store credit balance.","type":"number"},"creditMoney":{"description":"Current store credit balance in default currency (CZK).","type":"number"},"defaultOrderSale":{"description":"Default order discount for this customer.","type":"number"},"subscriptionActiveCount":{"description":"Number of active subscriptions (computed from subscription table).","type":"number"},"groupList":{"description":"Customer group memberships.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"description":"Group slug identifier.","type":"string"},"name":{"description":"Group display name.","type":"string"},"color":{"description":"Group color hex code.","type":"string"},"count":{"description":"Number of contacts in this group.","type":"number"}}}},"avatarUrl":{"description":"Gravatar URL.","type":"string"},"internalNote":{"description":"Internal admin note.","type":"string"},"insertedDate":{"description":"Registration date.","anyOf":[{"description":"Registration date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last profile update date.","anyOf":[{"description":"Last profile update date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"description":"Last activity timestamp.","anyOf":[{"description":"Last activity timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"accountAgeDays":{"description":"Days since registration.","type":"number"},"monthLimitMaxCreditSpendHard":{"description":"Hard monthly credit spend limit.","type":"number"},"monthLimitMaxCreditSpendSoft":{"description":"Soft monthly credit spend limit (warning threshold).","type":"number"},"orderTotal":{"description":"Total number of orders regardless of status (paid, unpaid, storno). Includes historical orders.","type":"number"},"orderPaid":{"description":"Number of paid orders.","type":"number"},"orderNotPaid":{"description":"Number of unpaid orders.","type":"number"},"orderNew":{"description":"Orders in \"new\" status.","type":"number"},"orderProcessing":{"description":"Orders in \"processing\" status.","type":"number"},"orderStorno":{"description":"Orders in \"storno\" status (from vitals).","type":"number"},"orderDone":{"description":"Orders in \"done\" status.","type":"number"},"score":{"description":"CRM quality score (0–100, −1 for blocked). Higher = better customer.","type":"number"},"trust":{"description":"Identity trust score (0–100). Higher = stronger evidence the contact represents a verified real person. Materialized in DB, recomputed by updateContactReadModel on every relevant write.","type":"number"},"totalRevenue":{"description":"Lifetime revenue from paid orders.","type":"number"},"paidOrderCount":{"description":"Total number of paid orders (materialized).","type":"number"},"refundTotal":{"description":"Total value of refunded/storno items.","type":"number"},"firstOrderDate":{"description":"Date of first order (ISO timestamp).","type":"string"},"lastOrderDate":{"description":"Date of most recent order (ISO timestamp).","type":"string"},"lastPaidOrderDate":{"description":"Date of most recent paid order (ISO timestamp).","type":"string"},"stornoOrderCount":{"description":"Number of cancelled/storno orders.","type":"number"},"voucherOrderCount":{"description":"Number of orders placed with a voucher.","type":"number"},"activeSubscriptionCount":{"description":"Number of active subscriptions (materialized).","type":"number"},"badges":{"description":"Display-ready badge list (operator, ban, premium, company, VAT flags, reverse charge, tax exempt, test account, subscription, suspicious) plus user-defined group tags. Same order and contents as the contact detail and hover popover — use directly in the UI.","type":"array","items":{"anyOf":[{"type":"object","required":["kind","slug"],"properties":{"kind":{"const":"system","type":"string"},"slug":{"anyOf":[{"const":"operator","type":"string"},{"const":"ban","type":"string"},{"const":"premium","type":"string"},{"const":"company","type":"string"},{"const":"vatPayer","type":"string"},{"const":"unreliableVatPayer","type":"string"},{"const":"reverseCharge","type":"string"},{"const":"taxExempt","type":"string"},{"const":"testAccount","type":"string"},{"const":"subscription","type":"string"},{"const":"suspicious","type":"string"}]}}},{"type":"object","required":["kind","slug","name","color"],"properties":{"kind":{"const":"group","type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}}]}},"suspicious":{"description":"Present when the contact is currently flagged by the automated cleanup routine. Absent otherwise.","type":"object","required":["reasonCode","reasonLabel","severity","flaggedDate"],"properties":{"reasonCode":{"description":"Machine-readable reason slug (translated by admin).","type":"string"},"reasonLabel":{"description":"English fallback label from the reason registry.","type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},"flaggedDate":{"description":"ISO timestamp when the flag was set.","type":"string"}}},"registeredStatus":{"description":"Three-state registration status: \"none\" — no account, \"active\" — has account and is not banned / suspicious, \"inactive\" — has account but is banned or suspicious.","anyOf":[{"const":"none","type":"string"},{"const":"active","type":"string"},{"const":"inactive","type":"string"}]},"deletedDate":{"description":"ISO soft-delete timestamp (only with `deleted=true`).","type":"string"},"deletedReason":{"description":"Reason recorded at soft-delete (only with `deleted=true`).","type":"string"},"spamSignals":{"description":"Spam-review signals (BIZKIT-141). Empty when none or not evaluated yet.","type":"array","items":{"anyOf":[{"const":"gibberishName","type":"string"},{"const":"gmailDotAlias","type":"string"},{"const":"spamTicketsOnly","type":"string"},{"const":"hostingContactForm","type":"string"}]}}}}},"itemCount":{"description":"Total number of contacts matching the filter (before pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","email","locale","ignoreBulkMail","registered","credit","creditMoney","defaultOrderSale","groupList","insertedDate","updatedDate","lastActivityDate","accountAgeDays","monthLimitMaxCreditSpendHard","monthLimitMaxCreditSpendSoft","orderTotal","orderPaid","orderNotPaid","orderNew","orderProcessing","orderStorno","orderDone","score","trust","totalRevenue","paidOrderCount","refundTotal","stornoOrderCount","voucherOrderCount","activeSubscriptionCount","badges"],"properties":{"id":{"description":"Contact external ID (16-char).","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Primary e-mail. `null` for phone-only contacts (imported by phone with no e-mail) and for contacts anonymised via GDPR right-to-erasure. Use `phone`, `name`, or the external ID for display when null.","type":"string"},{"type":"null"}]},"name":{"description":"Full display name (first + last).","type":"string"},"firstName":{"description":"First name.","type":"string"},"lastName":{"description":"Last name.","type":"string"},"companyName":{"description":"Company name.","type":"string"},"isCompany":{"description":"True if the contact has company registration data attached.","type":"boolean"},"companyRegistrationNumber":{"description":"IČO / company registration number.","type":"string"},"taxIdentificationNumber":{"description":"DIČ / VAT / tax identification number.","type":"string"},"isVatPayer":{"description":"Whether the contact is currently a VAT payer (from registry).","type":"boolean"},"isUnreliableVatPayer":{"description":"Flagged as unreliable VAT payer by the tax authority.","type":"boolean"},"phone":{"description":"Phone number.","type":"string"},"locale":{"description":"Customer locale code (cs, en, de...).","type":"string"},"newsletter":{"nullable":true,"anyOf":[{"description":"Newsletter subscription status.","anyOf":[{"const":"registered","type":"string"},{"const":"authorized","type":"string"},{"const":"canceled","type":"string"},{"const":"ignored","type":"string"}]},{"type":"null"}]},"ignoreBulkMail":{"description":"Opted out of bulk emails.","type":"boolean"},"testAccount":{"description":"Is a test account.","type":"boolean"},"premium":{"description":"VIP/premium customer flag.","type":"boolean"},"ban":{"description":"Blocked/banned customer flag.","type":"boolean"},"registered":{"description":"Has a password (registered account).","type":"boolean"},"credit":{"description":"Current store credit balance.","type":"number"},"creditMoney":{"description":"Current store credit balance in default currency (CZK).","type":"number"},"defaultOrderSale":{"description":"Default order discount for this customer.","type":"number"},"subscriptionActiveCount":{"description":"Number of active subscriptions (computed from subscription table).","type":"number"},"groupList":{"description":"Customer group memberships.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"description":"Group slug identifier.","type":"string"},"name":{"description":"Group display name.","type":"string"},"color":{"description":"Group color hex code.","type":"string"},"count":{"description":"Number of contacts in this group.","type":"number"}}}},"avatarUrl":{"description":"Gravatar URL.","type":"string"},"internalNote":{"description":"Internal admin note.","type":"string"},"insertedDate":{"description":"Registration date.","anyOf":[{"description":"Registration date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last profile update date.","anyOf":[{"description":"Last profile update date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastActivityDate":{"description":"Last activity timestamp.","anyOf":[{"description":"Last activity timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"accountAgeDays":{"description":"Days since registration.","type":"number"},"monthLimitMaxCreditSpendHard":{"description":"Hard monthly credit spend limit.","type":"number"},"monthLimitMaxCreditSpendSoft":{"description":"Soft monthly credit spend limit (warning threshold).","type":"number"},"orderTotal":{"description":"Total number of orders regardless of status (paid, unpaid, storno). Includes historical orders.","type":"number"},"orderPaid":{"description":"Number of paid orders.","type":"number"},"orderNotPaid":{"description":"Number of unpaid orders.","type":"number"},"orderNew":{"description":"Orders in \"new\" status.","type":"number"},"orderProcessing":{"description":"Orders in \"processing\" status.","type":"number"},"orderStorno":{"description":"Orders in \"storno\" status (from vitals).","type":"number"},"orderDone":{"description":"Orders in \"done\" status.","type":"number"},"score":{"description":"CRM quality score (0–100, −1 for blocked). Higher = better customer.","type":"number"},"trust":{"description":"Identity trust score (0–100). Higher = stronger evidence the contact represents a verified real person. Materialized in DB, recomputed by updateContactReadModel on every relevant write.","type":"number"},"totalRevenue":{"description":"Lifetime revenue from paid orders.","type":"number"},"paidOrderCount":{"description":"Total number of paid orders (materialized).","type":"number"},"refundTotal":{"description":"Total value of refunded/storno items.","type":"number"},"firstOrderDate":{"description":"Date of first order (ISO timestamp).","type":"string"},"lastOrderDate":{"description":"Date of most recent order (ISO timestamp).","type":"string"},"lastPaidOrderDate":{"description":"Date of most recent paid order (ISO timestamp).","type":"string"},"stornoOrderCount":{"description":"Number of cancelled/storno orders.","type":"number"},"voucherOrderCount":{"description":"Number of orders placed with a voucher.","type":"number"},"activeSubscriptionCount":{"description":"Number of active subscriptions (materialized).","type":"number"},"badges":{"description":"Display-ready badge list (operator, ban, premium, company, VAT flags, reverse charge, tax exempt, test account, subscription, suspicious) plus user-defined group tags. Same order and contents as the contact detail and hover popover — use directly in the UI.","type":"array","items":{"anyOf":[{"type":"object","required":["kind","slug"],"properties":{"kind":{"const":"system","type":"string"},"slug":{"anyOf":[{"const":"operator","type":"string"},{"const":"ban","type":"string"},{"const":"premium","type":"string"},{"const":"company","type":"string"},{"const":"vatPayer","type":"string"},{"const":"unreliableVatPayer","type":"string"},{"const":"reverseCharge","type":"string"},{"const":"taxExempt","type":"string"},{"const":"testAccount","type":"string"},{"const":"subscription","type":"string"},{"const":"suspicious","type":"string"}]}}},{"type":"object","required":["kind","slug","name","color"],"properties":{"kind":{"const":"group","type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}}]}},"suspicious":{"description":"Present when the contact is currently flagged by the automated cleanup routine. Absent otherwise.","type":"object","required":["reasonCode","reasonLabel","severity","flaggedDate"],"properties":{"reasonCode":{"description":"Machine-readable reason slug (translated by admin).","type":"string"},"reasonLabel":{"description":"English fallback label from the reason registry.","type":"string"},"severity":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"critical","type":"string"}]},"flaggedDate":{"description":"ISO timestamp when the flag was set.","type":"string"}}},"registeredStatus":{"description":"Three-state registration status: \"none\" — no account, \"active\" — has account and is not banned / suspicious, \"inactive\" — has account but is banned or suspicious.","anyOf":[{"const":"none","type":"string"},{"const":"active","type":"string"},{"const":"inactive","type":"string"}]},"deletedDate":{"description":"ISO soft-delete timestamp (only with `deleted=true`).","type":"string"},"deletedReason":{"description":"Reason recorded at soft-delete (only with `deleted=true`).","type":"string"},"spamSignals":{"description":"Spam-review signals (BIZKIT-141). Empty when none or not evaluated yet.","type":"array","items":{"anyOf":[{"const":"gibberishName","type":"string"},{"const":"gmailDotAlias","type":"string"},{"const":"spamTicketsOnly","type":"string"},{"const":"hostingContactForm","type":"string"}]}}}}},"itemCount":{"description":"Total number of contacts matching the filter (before pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffContactList","tags":["Contact"],"summary":"List contacts","description":"Returns a paginated list of contacts/customers with vitals, group membership, newsletter status, and CRM analytics. Supports full-text search, group filtering, and 10 attribute filters. All boolean filters use string values (\"true\"/\"false\"). Pagination via limit/page query params."}},"/bff/contact/detail":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactDetail","tags":["Contact"],"summary":"Get contact detail","description":"Returns full detail of a single contact by external ID, including profile data and CRM info. Vitals include both `credit` (count) and `creditMoney` (monetary value); the response also includes `currency` (ISO 4217 code of the organisation default currency) used for all *Money fields. Values are guaranteed consistent with `/bff/contact/detail-credit` for the same customer.","responses":{"200":{}}}},"/bff/contact/detail-edit":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactDetail-edit","tags":["Contact"],"summary":"Edit contact detail","description":"Updates profile fields, group memberships, and account flags for a contact. Body is validated via Zod schema."}},"/bff/contact/update-invoice-footer-html":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactUpdate-invoice-footer-html","tags":["Contact"],"summary":"Update invoice footer HTML","description":"Sets per-issuer free-text invoice footer. Rendered under the auto-generated commercial-register notice. Each issuer contact can carry its own — supports franchise branches with distinct legal additions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","invoiceFooterHtml"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"invoiceFooterHtml":{"description":"Free-text HTML snippet appended to the invoice footer when this contact issues an invoice. Empty string clears the field.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","invoiceFooterHtml"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"invoiceFooterHtml":{"description":"Free-text HTML snippet appended to the invoice footer when this contact issues an invoice. Empty string clears the field.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","invoiceFooterHtml"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"invoiceFooterHtml":{"description":"Free-text HTML snippet appended to the invoice footer when this contact issues an invoice. Empty string clears the field.","type":"string"}}}}}}}},"/bff/contact/update-internal-notice":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactUpdate-internal-notice","tags":["Contact"],"summary":"Update contact internal notice","description":"Single-field update of the internal notice on a contact — used by the inline-edit affordance on the contact detail. Endpoint /detail-edit still updates the full profile.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","internalNotice"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","internalNotice"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","internalNotice"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"}}}}}}}},"/bff/contact/company-refresh":{"post":{"parameters":[],"operationId":"postBffContactCompany-refresh","tags":["Contact"],"summary":"Force-refresh company registry record","description":"Forces a fresh fetch from the company registry (ARES for CZ) for a contact and updates the cached company record, including VAT-payer status and the unreliable-VAT-payer cross-check.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/contact/vat-registration-type":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactVat-registration-type","tags":["Contact"],"summary":"Set contact VAT registration type (manual override)","description":"Pin the contact to PAYER / IDENTIFIED_PERSON / NON_PAYER. ARES cannot distinguish §6i identified persons from full payers (both are AKTIVNI), so this endpoint is the only way to correct that. Setting a mode always sets source=MANUAL and freezes vat_registration_type_locked_date; the ARES sync then leaves the field alone. To hand control back to ARES, call the endpoint with releaseLock=true.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"mode":{"description":"Manually pinned VAT registration mode. PAYER = full VAT payer (21 %). IDENTIFIED_PERSON = §6i ZDPH: holds a DIČ for EU intra-community input VAT but does NOT charge output VAT. NON_PAYER = not registered for VAT. Setting this always sets source=MANUAL, which blocks the ARES cron from overwriting it.","anyOf":[{"const":"PAYER","type":"string"},{"const":"IDENTIFIED_PERSON","type":"string"},{"const":"NON_PAYER","type":"string"}]},"releaseLock":{"description":"Drop the MANUAL lock and clear the pinned mode so the next ARES sync (within 4 hours) fills it back in.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"mode":{"description":"Manually pinned VAT registration mode. PAYER = full VAT payer (21 %). IDENTIFIED_PERSON = §6i ZDPH: holds a DIČ for EU intra-community input VAT but does NOT charge output VAT. NON_PAYER = not registered for VAT. Setting this always sets source=MANUAL, which blocks the ARES cron from overwriting it.","anyOf":[{"const":"PAYER","type":"string"},{"const":"IDENTIFIED_PERSON","type":"string"},{"const":"NON_PAYER","type":"string"}]},"releaseLock":{"description":"Drop the MANUAL lock and clear the pinned mode so the next ARES sync (within 4 hours) fills it back in.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"mode":{"description":"Manually pinned VAT registration mode. PAYER = full VAT payer (21 %). IDENTIFIED_PERSON = §6i ZDPH: holds a DIČ for EU intra-community input VAT but does NOT charge output VAT. NON_PAYER = not registered for VAT. Setting this always sets source=MANUAL, which blocks the ARES cron from overwriting it.","anyOf":[{"const":"PAYER","type":"string"},{"const":"IDENTIFIED_PERSON","type":"string"},{"const":"NON_PAYER","type":"string"}]},"releaseLock":{"description":"Drop the MANUAL lock and clear the pinned mode so the next ARES sync (within 4 hours) fills it back in.","type":"boolean"}}}}}}}},"/bff/contact/detail-change-email-preview":{"post":{"parameters":[],"operationId":"postBffContactDetail-change-email-preview","tags":["Contact"],"summary":"Preview the effect of changing a contact e-mail","description":"Returns whether submitting the given e-mail would be a no-op, a plain rename, or a merge with an existing contact. Designed for live ajax feedback as the operator types into the change-email form.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","newEmail"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"newEmail":{"description":"Candidate new e-mail address (may be unnormalized).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","newEmail"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"newEmail":{"description":"Candidate new e-mail address (may be unnormalized).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","newEmail"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"newEmail":{"description":"Candidate new e-mail address (may be unnormalized).","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/contact/detail-change-email":{"post":{"parameters":[],"operationId":"postBffContactDetail-change-email","tags":["Contact"],"summary":"Change contact email","description":"Changes the primary email address of a contact. Requires the current email for verification. When the target e-mail is already taken by another contact in the same organisation, the call fails unless `confirmMerge: true` is provided, in which case the duplicate is merged into the current contact first. Address-bound suspicious flags (bounced-emails, bounced-emails-soft, disposable-domain, no-mx-record) are cleared, so mail to the corrected address is no longer short-circuited as undeliverable. Other flags can be cleared explicitly via POST /bff/contact/suspicious-clear.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","currentEmail","newEmail","reason"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"currentEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"newEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"reason":{"description":"Reason for the email change.","type":"string"},"confirmMerge":{"description":"Set to true to acknowledge that another contact already owns the target e-mail; that contact will be merged into the current one before the rename.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","currentEmail","newEmail","reason"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"currentEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"newEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"reason":{"description":"Reason for the email change.","type":"string"},"confirmMerge":{"description":"Set to true to acknowledge that another contact already owns the target e-mail; that contact will be merged into the current one before the rename.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","currentEmail","newEmail","reason"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"currentEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"newEmail":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"reason":{"description":"Reason for the email change.","type":"string"},"confirmMerge":{"description":"Set to true to acknowledge that another contact already owns the target e-mail; that contact will be merged into the current one before the rename.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/contact/detail-sessions":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactDetail-sessions","tags":["Contact"],"summary":"List contact sessions","description":"Returns active and recent sessions for a contact.","responses":{"200":{}}}},"/bff/contact/detail-login-attempts":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of login attempts.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","committed","riskScore","insertedDate","relativeDate","ip","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Masked attempt identifier.","type":"string"},"committed":{"description":"True if the attempt succeeded and issued a session.","type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"description":"Risk score computed at the moment of the attempt (0 = clean, 100 = maximum).","type":"number"},"insertedDate":{"description":"Absolute date the attempt was made.","type":"string"},"relativeDate":{"description":"Human-relative date (e.g. \"3 hours ago\").","type":"string"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP, if resolved.","type":"string"},"city":{"description":"City resolved from GeoIP.","type":"string"},"country":{"description":"ISO country code resolved from GeoIP.","type":"string"},"countryRegion":{"description":"Region/state code resolved from GeoIP.","type":"string"},"asn":{"description":"Autonomous System Number of the network owning the IP.","type":"string"},"asnOrganization":{"description":"Organisation owning the ASN (e.g. Cloudflare).","type":"string"},"isp":{"description":"ISP name from the GeoIP database.","type":"string"},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["itemCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of login attempts.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","committed","riskScore","insertedDate","relativeDate","ip","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Masked attempt identifier.","type":"string"},"committed":{"description":"True if the attempt succeeded and issued a session.","type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"description":"Risk score computed at the moment of the attempt (0 = clean, 100 = maximum).","type":"number"},"insertedDate":{"description":"Absolute date the attempt was made.","type":"string"},"relativeDate":{"description":"Human-relative date (e.g. \"3 hours ago\").","type":"string"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP, if resolved.","type":"string"},"city":{"description":"City resolved from GeoIP.","type":"string"},"country":{"description":"ISO country code resolved from GeoIP.","type":"string"},"countryRegion":{"description":"Region/state code resolved from GeoIP.","type":"string"},"asn":{"description":"Autonomous System Number of the network owning the IP.","type":"string"},"asnOrganization":{"description":"Organisation owning the ASN (e.g. Cloudflare).","type":"string"},"isp":{"description":"ISP name from the GeoIP database.","type":"string"},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["itemCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of login attempts.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","committed","riskScore","insertedDate","relativeDate","ip","mobile","proxy","hosting","tor"],"properties":{"id":{"description":"Masked attempt identifier.","type":"string"},"committed":{"description":"True if the attempt succeeded and issued a session.","type":"boolean"},"riskScore":{"minimum":0,"maximum":100,"description":"Risk score computed at the moment of the attempt (0 = clean, 100 = maximum).","type":"number"},"insertedDate":{"description":"Absolute date the attempt was made.","type":"string"},"relativeDate":{"description":"Human-relative date (e.g. \"3 hours ago\").","type":"string"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"description":"Reverse-DNS hostname of the IP, if resolved.","type":"string"},"city":{"description":"City resolved from GeoIP.","type":"string"},"country":{"description":"ISO country code resolved from GeoIP.","type":"string"},"countryRegion":{"description":"Region/state code resolved from GeoIP.","type":"string"},"asn":{"description":"Autonomous System Number of the network owning the IP.","type":"string"},"asnOrganization":{"description":"Organisation owning the ASN (e.g. Cloudflare).","type":"string"},"isp":{"description":"ISP name from the GeoIP database.","type":"string"},"mobile":{"description":"True if the IP belongs to a mobile carrier.","type":"boolean"},"proxy":{"description":"True if the IP is a known anonymising proxy.","type":"boolean"},"hosting":{"description":"True if the IP belongs to a hosting/cloud provider.","type":"boolean"},"tor":{"description":"True if the IP is a known Tor exit node.","type":"boolean"}}}}},"required":["itemCount","items"]}}}}},"operationId":"getBffContactDetail-login-attempts","tags":["Contact"],"summary":"List contact login attempts","description":"Returns every recorded sign-in attempt for the contact, including successful and blocked ones, with the risk score computed at the time of the attempt and full GeoIP/threat context (IP, hostname, city, country, ASN, ISP, mobile/proxy/hosting/tor flags). Same shape as `/bff/account/audit-login-attempts` so the admin can render both with a single grid component."}},"/bff/contact/detail-ip-report":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactDetail-ip-report","tags":["Contact"],"summary":"IP address report for a contact","description":"Returns one row per IP address that is or was linked to the contact across all data sources (orders, carts, sessions/logins, registration, consents, email & newsletter opens, blog comments, CRM leads, and the shop__contact_geo tracking aggregate) — including per-source counts, first/last seen timestamps and GeoIP metadata (city, country, hostname, ASN, mobile/proxy/hosting/tor flags).","responses":{"200":{}}}},"/bff/contact/detail-password-log":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactDetail-password-log","tags":["Contact"],"summary":"Get contact password log","description":"Returns a list of password change events for a contact.","responses":{"200":{}}}},"/bff/contact/detail-security-info":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactDetail-security-info","tags":["Contact"],"summary":"Get contact security info","description":"Returns security-related information for a contact, including last password change date.","responses":{"200":{}}}},"/bff/contact/detail-section-counts":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"credit":{"description":"Credit transactions.","type":"number"},"address":{"description":"Addresses.","type":"number"},"subscription":{"description":"Running subscriptions.","type":"number"},"reservation":{"description":"Reservations (last 12 months and upcoming).","type":"number"},"emailSent":{"description":"Outbound e-mails sent to the contact.","type":"number"},"emailReceived":{"description":"Inbound e-mails with the contact as participant.","type":"number"},"issue":{"description":"Tickets the contact participated in (any status).","type":"number"},"session":{"description":"Sessions and API keys.","type":"number"},"loginAttempt":{"description":"Login attempts.","type":"number"},"activity":{"description":"Activity entries where the contact is actor or target.","type":"number"},"log":{"description":"Log groups linked to the contact. Omitted without module-log permission.","type":"number"}},"required":["credit","address","subscription","reservation","emailSent","emailReceived","issue","session","loginAttempt","activity"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"credit":{"description":"Credit transactions.","type":"number"},"address":{"description":"Addresses.","type":"number"},"subscription":{"description":"Running subscriptions.","type":"number"},"reservation":{"description":"Reservations (last 12 months and upcoming).","type":"number"},"emailSent":{"description":"Outbound e-mails sent to the contact.","type":"number"},"emailReceived":{"description":"Inbound e-mails with the contact as participant.","type":"number"},"issue":{"description":"Tickets the contact participated in (any status).","type":"number"},"session":{"description":"Sessions and API keys.","type":"number"},"loginAttempt":{"description":"Login attempts.","type":"number"},"activity":{"description":"Activity entries where the contact is actor or target.","type":"number"},"log":{"description":"Log groups linked to the contact. Omitted without module-log permission.","type":"number"}},"required":["credit","address","subscription","reservation","emailSent","emailReceived","issue","session","loginAttempt","activity"]}},"text/plain":{"schema":{"type":"object","properties":{"credit":{"description":"Credit transactions.","type":"number"},"address":{"description":"Addresses.","type":"number"},"subscription":{"description":"Running subscriptions.","type":"number"},"reservation":{"description":"Reservations (last 12 months and upcoming).","type":"number"},"emailSent":{"description":"Outbound e-mails sent to the contact.","type":"number"},"emailReceived":{"description":"Inbound e-mails with the contact as participant.","type":"number"},"issue":{"description":"Tickets the contact participated in (any status).","type":"number"},"session":{"description":"Sessions and API keys.","type":"number"},"loginAttempt":{"description":"Login attempts.","type":"number"},"activity":{"description":"Activity entries where the contact is actor or target.","type":"number"},"log":{"description":"Log groups linked to the contact. Omitted without module-log permission.","type":"number"}},"required":["credit","address","subscription","reservation","emailSent","emailReceived","issue","session","loginAttempt","activity"]}}}}},"operationId":"getBffContactDetail-section-counts","tags":["Contact"],"summary":"Get contact detail section counts","description":"Returns the number of records in each section of the admin contact detail (credit transactions, addresses, subscriptions, reservations, e-mails, tickets, sessions, login attempts, activity, logs). Each count uses the same filters as the grid shown in that section."}},"/bff/contact/detail-address":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactDetail-address","tags":["Contact"],"summary":"Get contact addresses","description":"Returns a list of addresses associated with a contact.","responses":{"200":{}}}},"/bff/contact/set-primary-address":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyPrimary":{"default":false,"type":"boolean"}},"required":["success","alreadyPrimary"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyPrimary":{"default":false,"type":"boolean"}},"required":["success","alreadyPrimary"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyPrimary":{"default":false,"type":"boolean"}},"required":["success","alreadyPrimary"]}}}}},"operationId":"postBffContactSet-primary-address","tags":["Contact"],"summary":"Set primary address","description":"Sets which of the contact's addresses is the default (primary) address used to pre-fill new orders and invoices. The addressId must reference an address that belongs to this contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","addressId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"addressId":{"description":"Address external ID that should become the contact's primary address. Must belong to this contact.","examples":["addr_abc123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","addressId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"addressId":{"description":"Address external ID that should become the contact's primary address. Must belong to this contact.","examples":["addr_abc123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","addressId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"addressId":{"description":"Address external ID that should become the contact's primary address. Must belong to this contact.","examples":["addr_abc123"],"type":"string"}}}}}}}},"/bff/contact/statistics":{"get":{"parameters":[{"description":"Chart window: 30d, 90d (default) or 365d.","examples":["90d"],"schema":{"type":"string"},"in":"query","name":"period","required":false}],"operationId":"getBffContactStatistics","tags":["Contact"],"summary":"Contact statistics for the /contact panel","description":"Online snapshot (1 h / 24 h / 3 d / 7 d from last_activity_date) with day-aligned trends from shop__contact_activity_day, a zero-filled daily series (active contacts, new contacts, new customers) with medians and best days, KPI trends and lifecycle buckets. Excludes deleted, test and staff contacts. Cached 60 s per organisation and period.","responses":{"200":{}}}},"/bff/contact/statistics/interactions":{"get":{"parameters":[{"description":"Chart window: 30d, 90d (default) or 365d.","examples":["90d"],"schema":{"type":"string"},"in":"query","name":"period","required":false}],"operationId":"getBffContactStatisticsInteractions","tags":["Contact"],"summary":"Contact interactions by channel + customer funnel","description":"Zero-filled daily interaction counts per channel (orders, inbound e-mails, outbound e-mails, tickets, calendar bookings, other own actions), period totals, 7-day trends, and the funnel contacts → customers → repeat → loyal with a 30-day new-contact conversion rate. Same contact base as /statistics. Cached 5 min.","responses":{"200":{}}}},"/bff/contact/statistics/heatmap":{"get":{"operationId":"getBffContactStatisticsHeatmap","tags":["Contact"],"summary":"Weekday × hour heatmap of contact activity","description":"Own actions of contacts over the last 90 days grouped by ISO weekday and hour in the organisation's timezone (UTC fallback). Cached 15 min.","responses":{"200":{}}}},"/bff/contact/statistics/insights":{"get":{"operationId":"getBffContactStatisticsInsights","tags":["Contact"],"summary":"Contact correlations + data health","description":"Pearson correlations over the last 90 days (new contacts vs orders, sent e-mails vs orders, sent vs inbound e-mails, active contacts vs orders) with scatter points, and data-health counts (undeliverable, suspicious, no contact info, duplicate phone). Cached 10 min.","responses":{"200":{}}}},"/bff/contact/reachability":{"get":{"parameters":[{"description":"\"true\" bypasses the 5 min cache.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"fresh","required":false},{"description":"email-bulk (default: newsletters, campaigns) or email-transactional (orders, invoices).","examples":["email-transactional"],"schema":{"type":"string"},"in":"query","name":"channel","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"total":{"description":"Live (not deleted) contacts.","type":"number"},"reachable":{"description":"Contacts a bulk e-mail reaches right now.","type":"number"},"excluded":{"description":"Contacts left out by the first matching reason (BULK_EXCLUSION_REASONS).","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"computedAt":{"description":"ISO time the numbers were computed (cached 5 min).","type":"string"}},"required":["total","reachable","excluded","computedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"total":{"description":"Live (not deleted) contacts.","type":"number"},"reachable":{"description":"Contacts a bulk e-mail reaches right now.","type":"number"},"excluded":{"description":"Contacts left out by the first matching reason (BULK_EXCLUSION_REASONS).","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"computedAt":{"description":"ISO time the numbers were computed (cached 5 min).","type":"string"}},"required":["total","reachable","excluded","computedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"total":{"description":"Live (not deleted) contacts.","type":"number"},"reachable":{"description":"Contacts a bulk e-mail reaches right now.","type":"number"},"excluded":{"description":"Contacts left out by the first matching reason (BULK_EXCLUSION_REASONS).","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"computedAt":{"description":"ISO time the numbers were computed (cached 5 min).","type":"string"}},"required":["total","reachable","excluded","computedAt"]}}}}},"operationId":"getBffContactReachability","tags":["Contact"],"summary":"Bulk e-mail reachability of the contact base","description":"How many live contacts a bulk e-mail (newsletter, campaign) can reach and why the rest are left out. Same rule as dispatch and the compose preview. Each reason is also a /bff/contact/list?bulkReach= filter."}},"/bff/contact/reachability/history":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"days":{"description":"ISO days, oldest first, ending today (UTC).","type":"array","items":{"type":"string"}},"series":{"description":"Reachability key → count per day; null = no snapshot that day.","type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"weekDelta":{"description":"Live count minus the snapshot 7 days ago; null without one.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"weekBaseDay":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["days","series","weekDelta","weekBaseDay"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"days":{"description":"ISO days, oldest first, ending today (UTC).","type":"array","items":{"type":"string"}},"series":{"description":"Reachability key → count per day; null = no snapshot that day.","type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"weekDelta":{"description":"Live count minus the snapshot 7 days ago; null without one.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"weekBaseDay":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["days","series","weekDelta","weekBaseDay"]}},"text/plain":{"schema":{"type":"object","properties":{"days":{"description":"ISO days, oldest first, ending today (UTC).","type":"array","items":{"type":"string"}},"series":{"description":"Reachability key → count per day; null = no snapshot that day.","type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"weekDelta":{"description":"Live count minus the snapshot 7 days ago; null without one.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"weekBaseDay":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["days","series","weekDelta","weekBaseDay"]}}}}},"operationId":"getBffContactReachabilityHistory","tags":["Contact"],"summary":"Bulk e-mail reachability over the last 30 days","description":"Daily snapshots per reachability value plus the change against last week, for the Dosažitelnost tab."}},"/bff/contact/reachability/pivot":{"get":{"parameters":[{"description":"activity | customer | newsletter | domain | created","examples":["activity"],"schema":{"type":"string"},"in":"query","name":"dimension","required":true},{"description":"\"true\" bypasses the 5 min cache.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"fresh","required":false},{"description":"email-bulk (default) or email-transactional.","schema":{"type":"string"},"in":"query","name":"channel","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"dimension":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","required":["key","total","filterable"],"properties":{"key":{"description":"Bucket key; folded tails are \"_other\" / \"_older\", no e-mail is \"_none\".","type":"string"},"total":{"type":"number"},"filterable":{"description":"False for folded tails: no reachBucket grid filter for them.","type":"boolean"}}}},"cells":{"description":"reach key (reachable or exclusion reason) → bucket key → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}},"computedAt":{"type":"string"}},"required":["dimension","buckets","cells","computedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"dimension":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","required":["key","total","filterable"],"properties":{"key":{"description":"Bucket key; folded tails are \"_other\" / \"_older\", no e-mail is \"_none\".","type":"string"},"total":{"type":"number"},"filterable":{"description":"False for folded tails: no reachBucket grid filter for them.","type":"boolean"}}}},"cells":{"description":"reach key (reachable or exclusion reason) → bucket key → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}},"computedAt":{"type":"string"}},"required":["dimension","buckets","cells","computedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"dimension":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","required":["key","total","filterable"],"properties":{"key":{"description":"Bucket key; folded tails are \"_other\" / \"_older\", no e-mail is \"_none\".","type":"string"},"total":{"type":"number"},"filterable":{"description":"False for folded tails: no reachBucket grid filter for them.","type":"boolean"}}}},"cells":{"description":"reach key (reachable or exclusion reason) → bucket key → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}},"computedAt":{"type":"string"}},"required":["dimension","buckets","cells","computedAt"]}}}}},"operationId":"getBffContactReachabilityPivot","tags":["Contact"],"summary":"Bulk e-mail reachability × one dimension","description":"Pivot of the live contact base: reachability (same rule as dispatch) against one dimension (activity, customer, newsletter state, e-mail domain top 10, creation year). Each filterable cell is also /bff/contact/list?bulkReach=&reachBucket=. Cached 5 min per dimension."}},"/bff/contact/statistics/retention":{"get":{"operationId":"getBffContactStatisticsRetention","tags":["Contact"],"summary":"Weekly retention cohorts of new contacts","description":"Last 12 weekly cohorts of new contacts with the share active in each of the following 0 to 8 weeks, from shop__contact_activity_day. Weeks before activity tracking or in the future are null. Cached 1 h.","responses":{"200":{}}}},"/bff/contact/online":{"get":{"operationId":"getBffContactOnline","tags":["Contact"],"summary":"Contacts online right now","description":"Count of contacts with own activity in the last 5 minutes plus the 8 most recent of them (name, avatar). Uncached, meant for a 30 s poll.","responses":{"200":{}}}},"/bff/contact/group-list":{"get":{"operationId":"getBffContactGroup-list","tags":["Contact"],"summary":"List contact groups","description":"Returns all contact groups (tags) defined for the organisation, including groups with no contacts yet.","responses":{"200":{}}}},"/bff/contact/group-edit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["success","slug","name","color"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["success","slug","name","color"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}},"required":["success","slug","name","color"]}}}}},"operationId":"postBffContactGroup-edit","tags":["Contact"],"summary":"Edit contact group (tag)","description":"Renames and/or recolours a contact group addressed by slug. The slug never changes, so API integrations (`/api/v1/customer/add-groups`) and segment filters keep working.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["slug","name"],"properties":{"slug":{"minLength":1,"description":"Slug of the group to edit. The slug itself is immutable (API clients assign and filter by it).","examples":["poptavka-web"],"type":"string"},"name":{"minLength":1,"maxLength":128,"description":"New display name.","examples":["Poptávka z webu"],"type":"string"},"color":{"description":"Optional new hex colour (`#rrggbb` or `#rgb`).","examples":["#2563eb"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["slug","name"],"properties":{"slug":{"minLength":1,"description":"Slug of the group to edit. The slug itself is immutable (API clients assign and filter by it).","examples":["poptavka-web"],"type":"string"},"name":{"minLength":1,"maxLength":128,"description":"New display name.","examples":["Poptávka z webu"],"type":"string"},"color":{"description":"Optional new hex colour (`#rrggbb` or `#rgb`).","examples":["#2563eb"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["slug","name"],"properties":{"slug":{"minLength":1,"description":"Slug of the group to edit. The slug itself is immutable (API clients assign and filter by it).","examples":["poptavka-web"],"type":"string"},"name":{"minLength":1,"maxLength":128,"description":"New display name.","examples":["Poptávka z webu"],"type":"string"},"color":{"description":"Optional new hex colour (`#rrggbb` or `#rgb`).","examples":["#2563eb"],"type":"string"}}}}}}}},"/bff/contact/add-groups":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactAdd-groups","tags":["Contact"],"summary":"Add groups (tags) to a contact","description":"Adds one or more groups to a contact identified by `email` or `cuRefNo` (at least one is required; `cuRefNo` takes precedence when both are supplied). Idempotent — groups already assigned to the contact are silently skipped, and groups that do not exist yet in the organisation are auto-created.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"groups":{"minItems":1,"description":"List of group slugs to assign. Non-slug input is normalised via `toSlug`. Groups that do not exist yet in the organisation are auto-created.","type":"array","items":{"examples":["personal-training"],"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"groups":{"minItems":1,"description":"List of group slugs to assign. Non-slug input is normalised via `toSlug`. Groups that do not exist yet in the organisation are auto-created.","type":"array","items":{"examples":["personal-training"],"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"groups":{"minItems":1,"description":"List of group slugs to assign. Non-slug input is normalised via `toSlug`. Groups that do not exist yet in the organisation are auto-created.","type":"array","items":{"examples":["personal-training"],"type":"string"}}}}}}}}},"/bff/contact/remove-groups":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"removed":{"description":"Group slugs the contact really had and that were removed (empty when nothing changed).","type":"array","items":{"type":"string"}}},"required":["success","removed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"removed":{"description":"Group slugs the contact really had and that were removed (empty when nothing changed).","type":"array","items":{"type":"string"}}},"required":["success","removed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"removed":{"description":"Group slugs the contact really had and that were removed (empty when nothing changed).","type":"array","items":{"type":"string"}}},"required":["success","removed"]}}}}},"operationId":"postBffContactRemove-groups","tags":["Contact"],"summary":"Remove groups (tags) from a contact","description":"Counterpart of `/add-groups`. Removes the listed groups from a contact identified by `email` or `cuRefNo` (at least one is required; `cuRefNo` takes precedence). Every other group and every other contact field stays unchanged. Idempotent: groups the contact does not have are skipped. The groups themselves are never deleted, even when no contact is left in them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"groups":{"minItems":1,"maxItems":20,"description":"List of group slugs to remove (1 to 20). Non-slug input is normalised via `toSlug`. Slugs the contact does not have, or that do not exist in the organisation, are skipped.","type":"array","items":{"examples":["trainer"],"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"groups":{"minItems":1,"maxItems":20,"description":"List of group slugs to remove (1 to 20). Non-slug input is normalised via `toSlug`. Slugs the contact does not have, or that do not exist in the organisation, are skipped.","type":"array","items":{"examples":["trainer"],"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["groups"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"cuRefNo":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"groups":{"minItems":1,"maxItems":20,"description":"List of group slugs to remove (1 to 20). Non-slug input is normalised via `toSlug`. Slugs the contact does not have, or that do not exist in the organisation, are skipped.","type":"array","items":{"examples":["trainer"],"type":"string"}}}}}}}}},"/bff/contact/find-or-create-by-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Numeric contact id (customerId).","type":"number"},"name":{"description":"Human display name — from first/last name, beautified e-mail local-part, or the raw address.","type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"created":{"description":"`true` when a new contact was inserted; `false` when an existing one was returned.","type":"boolean"}},"required":["id","name","email","created"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Numeric contact id (customerId).","type":"number"},"name":{"description":"Human display name — from first/last name, beautified e-mail local-part, or the raw address.","type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"created":{"description":"`true` when a new contact was inserted; `false` when an existing one was returned.","type":"boolean"}},"required":["id","name","email","created"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Numeric contact id (customerId).","type":"number"},"name":{"description":"Human display name — from first/last name, beautified e-mail local-part, or the raw address.","type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"created":{"description":"`true` when a new contact was inserted; `false` when an existing one was returned.","type":"boolean"}},"required":["id","name","email","created"]}}}}},"operationId":"postBffContactFind-or-create-by-email","tags":["Contact"],"summary":"Find contact by e-mail, creating a minimal one if none exists","description":"Normalizes the e-mail via the canonical `normalizeContactEmail` helper (same rules as unique-index enforcement), looks the contact up within the current organisation, and returns it if found. Otherwise creates a minimal contact with just the e-mail and returns the new row. Used by the issue-reporter quick-add flow so an e-mail typed into the picker becomes a real `shop__contact` in one click without opening the full contact-registration modal.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}}}}}},"/bff/contact/set-password":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactSet-password","tags":["Contact"],"summary":"Set contact password","description":"Sets a new password for a contact account by direct operator action (no reset-token flow). Hashes with bcrypt, writes a shop__contact_password_log entry, and records a contact.set_password activity.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","newPassword"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"newPassword":{"description":"New password to set.","minLength":1,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","newPassword"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"newPassword":{"description":"New password to set.","minLength":1,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","newPassword"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"newPassword":{"description":"New password to set.","minLength":1,"type":"string"}}}}}}}},"/bff/contact/merge-customers":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactMerge-customers","tags":["Contact"],"summary":"Merge two contacts","description":"Merges the legacy contact into the final contact, transferring all related data.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["finalCustomerId","legacyCustomerId"],"properties":{"finalCustomerId":{"description":"External ID of the contact to keep.","type":"string"},"legacyCustomerId":{"description":"External ID of the contact to merge and remove.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["finalCustomerId","legacyCustomerId"],"properties":{"finalCustomerId":{"description":"External ID of the contact to keep.","type":"string"},"legacyCustomerId":{"description":"External ID of the contact to merge and remove.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["finalCustomerId","legacyCustomerId"],"properties":{"finalCustomerId":{"description":"External ID of the contact to keep.","type":"string"},"legacyCustomerId":{"description":"External ID of the contact to merge and remove.","type":"string"}}}}}}}},"/bff/contact/invalidate-sessions":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactInvalidate-sessions","tags":["Contact"],"summary":"Invalidate contact sessions","description":"Invalidates all active sessions for a contact, forcing re-authentication.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"}}}}}}}},"/bff/contact/reset-password":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactReset-password","tags":["Contact"],"summary":"Request password reset","description":"Create a new reset password request and send verification mail to customer automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}}}}}},"/bff/contact/process-set-password":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006"],"type":"string"},"message":{"examples":["Change password failed.","You have entered a previously used password. For security reasons, please enter a new and unique password.","Reset password request does not exist.","Reset password request has been expired.","Customer account has no e-mail address.","The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit)."],"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006"],"type":"string"},"message":{"examples":["Change password failed.","You have entered a previously used password. For security reasons, please enter a new and unique password.","Reset password request does not exist.","Reset password request has been expired.","Customer account has no e-mail address.","The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit)."],"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006"],"type":"string"},"message":{"examples":["Change password failed.","You have entered a previously used password. For security reasons, please enter a new and unique password.","Reset password request does not exist.","Reset password request has been expired.","Customer account has no e-mail address.","The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit)."],"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","errorCode","message"],"properties":{"success":{"const":false,"type":"boolean"},"errorCode":{"examples":["E001","E002","E003","E004","E005","E006"],"type":"string"},"message":{"examples":["Change password failed.","You have entered a previously used password. For security reasons, please enter a new and unique password.","Reset password request does not exist.","Reset password request has been expired.","Customer account has no e-mail address.","The password does not meet the minimum security requirements (at least 8 characters, an uppercase letter, a lowercase letter and a digit)."],"type":"string"}}}]}}}}},"operationId":"postBffContactProcess-set-password","tags":["Contact"],"summary":"Process password reset","description":"Validates the reset token and sets the new password for the contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","password"],"properties":{"token":{"description":"Password reset token from the verification email.","type":"string"},"password":{"description":"New password to set.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","password"],"properties":{"token":{"description":"Password reset token from the verification email.","type":"string"},"password":{"description":"New password to set.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token","password"],"properties":{"token":{"description":"Password reset token from the verification email.","type":"string"},"password":{"description":"New password to set.","type":"string"}}}}}}}},"/bff/contact/generate-api-key":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"apiKey":{"type":"string"}},"required":["success","apiKey"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"apiKey":{"type":"string"}},"required":["success","apiKey"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"apiKey":{"type":"string"}},"required":["success","apiKey"]}}}}},"operationId":"postBffContactGenerate-api-key","tags":["Contact"],"summary":"Generate API key","description":"Generates a new API key for a contact, bound to a specific workspace.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","name","workspace"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"name":{"description":"Display name for the API key.","type":"string"},"workspace":{"description":"Workspace code to associate with the key.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","name","workspace"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"name":{"description":"Display name for the API key.","type":"string"},"workspace":{"description":"Workspace code to associate with the key.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","name","workspace"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"name":{"description":"Display name for the API key.","type":"string"},"workspace":{"description":"Workspace code to associate with the key.","type":"string"}}}}}}}},"/bff/contact/workspace-list":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactWorkspace-list","tags":["Contact"],"summary":"List contact workspaces","description":"Returns all workspaces assigned to a contact.","responses":{"200":{}}}},"/bff/contact/add-workspace":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactAdd-workspace","tags":["Contact"],"summary":"Add workspace to contact","description":"Creates a new workspace for a contact with the given name and color.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","name","color"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"name":{"description":"Workspace display name.","type":"string"},"color":{"description":"Workspace color (hex code).","examples":["#ff0000"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","name","color"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"name":{"description":"Workspace display name.","type":"string"},"color":{"description":"Workspace color (hex code).","examples":["#ff0000"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","name","color"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"name":{"description":"Workspace display name.","type":"string"},"color":{"description":"Workspace color (hex code).","examples":["#ff0000"],"type":"string"}}}}}}}},"/bff/contact/block-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactBlock-contact","tags":["Contact"],"summary":"Block or unblock contact","description":"Toggles the block/ban status of a contact. If currently blocked, unblocks; if unblocked, blocks.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"description":"Reason for blocking or unblocking.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"description":"Reason for blocking or unblocking.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"description":"Reason for blocking or unblocking.","type":"string"}}}}}}}},"/bff/contact/suspicious-clear":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"cleared","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"notFlagged","type":"string"}}},{"type":"object","required":["state","reasonCode"],"properties":{"state":{"const":"refusedCritical","type":"string"},"reasonCode":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"cleared","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"notFlagged","type":"string"}}},{"type":"object","required":["state","reasonCode"],"properties":{"state":{"const":"refusedCritical","type":"string"},"reasonCode":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"cleared","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"notFlagged","type":"string"}}},{"type":"object","required":["state","reasonCode"],"properties":{"state":{"const":"refusedCritical","type":"string"},"reasonCode":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state"],"properties":{"state":{"const":"cleared","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"notFlagged","type":"string"}}},{"type":"object","required":["state","reasonCode"],"properties":{"state":{"const":"refusedCritical","type":"string"},"reasonCode":{"type":"string"}}}]}}}}},"operationId":"postBffContactSuspicious-clear","tags":["Contact"],"summary":"Clear automatic suspicious flag","description":"Removes the automated cleanup flag from a contact. Refuses when the flagged reason has \"critical\" severity — those represent permanent-ban decisions (fraud, blacklisted domain) and can only be reversed by an operator with direct DB access. All state changes are recorded in core__activity.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"}}}}}}}},"/bff/contact/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactDelete","tags":["Contact"],"summary":"Soft-delete contact","description":"Marks a contact as deleted (soft delete). The contact cannot already be deleted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"description":"Reason for deletion.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"description":"Reason for deletion.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"description":"Reason for deletion.","type":"string"}}}}}}}},"/bff/contact/anonymize":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error","pendingOrders"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"pending_orders","type":"string"},"pendingOrders":{"type":"array","items":{"type":"object","required":["orderNumber","hash","statusCode","statusTypeCode"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"},"statusCode":{"type":"string"},"statusTypeCode":{"anyOf":[{"const":"new","type":"string"},{"const":"processing","type":"string"}]}}}}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error","pendingOrders"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"pending_orders","type":"string"},"pendingOrders":{"type":"array","items":{"type":"object","required":["orderNumber","hash","statusCode","statusTypeCode"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"},"statusCode":{"type":"string"},"statusTypeCode":{"anyOf":[{"const":"new","type":"string"},{"const":"processing","type":"string"}]}}}}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error","pendingOrders"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"pending_orders","type":"string"},"pendingOrders":{"type":"array","items":{"type":"object","required":["orderNumber","hash","statusCode","statusTypeCode"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"},"statusCode":{"type":"string"},"statusTypeCode":{"anyOf":[{"const":"new","type":"string"},{"const":"processing","type":"string"}]}}}}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error","pendingOrders"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"pending_orders","type":"string"},"pendingOrders":{"type":"array","items":{"type":"object","required":["orderNumber","hash","statusCode","statusTypeCode"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"},"statusCode":{"type":"string"},"statusTypeCode":{"anyOf":[{"const":"new","type":"string"},{"const":"processing","type":"string"}]}}}}}}]}}}}},"operationId":"postBffContactAnonymize","tags":["Contact"],"summary":"Anonymise contact (GDPR right-to-erasure)","description":"Irreversibly nulls every identifying field on a contact while keeping the row (and its FKs from invoices, orders, etc.) intact. Blocks with HTTP 409 if the contact still has any order in a non-terminal status (`new` / `processing`) — the operator must finalise or storno them first so fulfilment is not left without a delivery address. Deletes secondary e-mails, addresses, bank accounts, custom fields, attributes, meta, ARES company records, and password history. Invalidates active sessions. Preserves accounting data: invoices carry an immutable `customerSnapshot` so historical bookkeeping survives the wipe.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"minLength":10,"maxLength":1000,"description":"Free-text reason for the anonymisation. Recorded into shop__contact.deleted_reason and the operator audit feed; minimum 10 chars to discourage empty placeholders.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"minLength":10,"maxLength":1000,"description":"Free-text reason for the anonymisation. Recorded into shop__contact.deleted_reason and the operator audit feed; minimum 10 chars to discourage empty placeholders.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"reason":{"minLength":10,"maxLength":1000,"description":"Free-text reason for the anonymisation. Recorded into shop__contact.deleted_reason and the operator audit feed; minimum 10 chars to discourage empty placeholders.","type":"string"}}}}}}}},"/bff/contact/bulk-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}}}}},"operationId":"postBffContactBulk-delete","tags":["Contact"],"summary":"Bulk soft-delete contacts","description":"Soft-deletes up to 500 contacts (explicit ids or all contacts matching the list filter). Skips, never fails on, contacts that look like real customers or belong to the organisation: organisation members, the organisation own contact, contacts with paid orders, positive credit or an active subscription. Skipped rows come back with a reason. Sessions of deleted contacts are revoked. Restorable via `/bulk-restore`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reasonCode"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"reasonCode":{"description":"Standard delete reason. A data-subject erasure request belongs to `/anonymize` instead.","anyOf":[{"const":"spam","type":"string"},{"const":"fraud","type":"string"},{"const":"duplicate","type":"string"},{"const":"test","type":"string"},{"const":"other","type":"string"}]},"note":{"maxLength":500,"description":"Optional free-text note appended to the reason.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["reasonCode"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"reasonCode":{"description":"Standard delete reason. A data-subject erasure request belongs to `/anonymize` instead.","anyOf":[{"const":"spam","type":"string"},{"const":"fraud","type":"string"},{"const":"duplicate","type":"string"},{"const":"test","type":"string"},{"const":"other","type":"string"}]},"note":{"maxLength":500,"description":"Optional free-text note appended to the reason.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["reasonCode"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"reasonCode":{"description":"Standard delete reason. A data-subject erasure request belongs to `/anonymize` instead.","anyOf":[{"const":"spam","type":"string"},{"const":"fraud","type":"string"},{"const":"duplicate","type":"string"},{"const":"test","type":"string"},{"const":"other","type":"string"}]},"note":{"maxLength":500,"description":"Optional free-text note appended to the reason.","type":"string"}}}}}}}},"/bff/contact/bulk-restore":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}}}}},"operationId":"postBffContactBulk-restore","tags":["Contact"],"summary":"Bulk restore soft-deleted contacts","description":"Clears the soft delete of the given contacts. Contacts that are not deleted come back as skipped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"text/plain":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"/bff/contact/bulk-groups":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}}}}},"operationId":"postBffContactBulk-groups","tags":["Contact"],"summary":"Bulk add or remove contact groups (tags)","description":"Adds or removes groups on many contacts. Contacts whose groups did not change come back as skipped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groups","mode"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"groups":{"minItems":1,"maxItems":20,"description":"Group slugs. On `add`, groups that do not exist yet are created.","type":"array","items":{"examples":["vip"],"type":"string"}},"mode":{"anyOf":[{"const":"add","type":"string"},{"const":"remove","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["groups","mode"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"groups":{"minItems":1,"maxItems":20,"description":"Group slugs. On `add`, groups that do not exist yet are created.","type":"array","items":{"examples":["vip"],"type":"string"}},"mode":{"anyOf":[{"const":"add","type":"string"},{"const":"remove","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["groups","mode"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"groups":{"minItems":1,"maxItems":20,"description":"Group slugs. On `add`, groups that do not exist yet are created.","type":"array","items":{"examples":["vip"],"type":"string"}},"mode":{"anyOf":[{"const":"add","type":"string"},{"const":"remove","type":"string"}]}}}}}}}},"/bff/contact/bulk-suspicious":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}}}}},"operationId":"postBffContactBulk-suspicious","tags":["Contact"],"summary":"Bulk set or clear the suspicious flag","description":"Sets the `manual` suspicious flag (never downgrades a stronger existing flag) or clears the flag. Critical flags (fraud, blacklisted domain) are never cleared and come back as skipped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["flagged"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"flagged":{"description":"true = set the manual suspicious flag, false = clear the flag.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["flagged"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"flagged":{"description":"true = set the manual suspicious flag, false = clear the flag.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["flagged"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"flagged":{"description":"true = set the manual suspicious flag, false = clear the flag.","type":"boolean"}}}}}}}},"/bff/contact/bulk-not-spam":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}}}}},"operationId":"postBffContactBulk-not-spam","tags":["Contact"],"summary":"Bulk mark contacts as not spam","description":"Removes the contacts from the spam-review list (`review=true`) for good. Signals and suspicious flags are kept.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"text/plain":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"/bff/contact/bulk-block":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}}}}},"operationId":"postBffContactBulk-block","tags":["Contact"],"summary":"Bulk block or unblock contacts","description":"Blocks (bans) or unblocks contacts. Blocking revokes login sessions and pending password resets. Organisation members and the organisation own contact are never blocked in bulk and come back as skipped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["blocked"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"blocked":{"description":"true = block (ban, revoke sessions), false = unblock.","type":"boolean"},"reason":{"maxLength":200,"description":"Ban reason stored as a contact tag.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["blocked"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"blocked":{"description":"true = block (ban, revoke sessions), false = unblock.","type":"boolean"},"reason":{"maxLength":200,"description":"Ban reason stored as a contact tag.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["blocked"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"blocked":{"description":"true = block (ban, revoke sessions), false = unblock.","type":"boolean"},"reason":{"maxLength":200,"description":"Ban reason stored as a contact tag.","type":"string"}}}}}}}},"/bff/contact/bulk-mail-opt-out":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}}},"required":["requested","done","skipped"]}}}}},"operationId":"postBffContactBulk-mail-opt-out","tags":["Contact"],"summary":"Bulk opt contacts out of bulk e-mail","description":"Sets `ignore_bulk_mail` with reason `manual`. One-way on purpose: opting back in stays a per-contact action.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"text/plain":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"/bff/contact/bulk-mail-reenable-preview":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"reenable":{"description":"Contacts that would get bulk e-mail back.","type":"number"},"reenableByClass":{"type":"object","required":["legacyOptOut","badAddress","manualOptOut"],"properties":{"legacyOptOut":{"type":"number"},"badAddress":{"type":"number"},"manualOptOut":{"type":"number"}}},"inactiveIncluded":{"type":"number"},"skipped":{"description":"Skip reason → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"warmupDays":{"description":"Days the first newsletter to them is spread over.","type":"number"},"warmupDailyCap":{"type":"number"}},"required":["total","reenable","reenableByClass","inactiveIncluded","skipped","warmupDays","warmupDailyCap"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"total":{"type":"number"},"reenable":{"description":"Contacts that would get bulk e-mail back.","type":"number"},"reenableByClass":{"type":"object","required":["legacyOptOut","badAddress","manualOptOut"],"properties":{"legacyOptOut":{"type":"number"},"badAddress":{"type":"number"},"manualOptOut":{"type":"number"}}},"inactiveIncluded":{"type":"number"},"skipped":{"description":"Skip reason → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"warmupDays":{"description":"Days the first newsletter to them is spread over.","type":"number"},"warmupDailyCap":{"type":"number"}},"required":["total","reenable","reenableByClass","inactiveIncluded","skipped","warmupDays","warmupDailyCap"]}},"text/plain":{"schema":{"type":"object","properties":{"total":{"type":"number"},"reenable":{"description":"Contacts that would get bulk e-mail back.","type":"number"},"reenableByClass":{"type":"object","required":["legacyOptOut","badAddress","manualOptOut"],"properties":{"legacyOptOut":{"type":"number"},"badAddress":{"type":"number"},"manualOptOut":{"type":"number"}}},"inactiveIncluded":{"type":"number"},"skipped":{"description":"Skip reason → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"warmupDays":{"description":"Days the first newsletter to them is spread over.","type":"number"},"warmupDailyCap":{"type":"number"}},"required":["total","reenable","reenableByClass","inactiveIncluded","skipped","warmupDays","warmupDailyCap"]}}}}},"operationId":"postBffContactBulk-mail-reenable-preview","tags":["Contact"],"summary":"Preview: turn bulk e-mail back on","description":"Read-only. How many contacts of the selection would get bulk e-mail back and why the rest are skipped. Only operator, automatic and unexplained opt-outs are reversible; unsubscribed, spam complaints and blocked contacts never. Unexplained opt-outs need activity in 90 days unless `allowInactive`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"allowInactive":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"allowInactive":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"allowInactive":{"type":"boolean"}}}}}}}},"/bff/contact/bulk-mail-reenable":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}},"runId":{"description":"Run id for /bulk-mail-reenable-undo.","type":"string"}},"required":["requested","done","skipped","runId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}},"runId":{"description":"Run id for /bulk-mail-reenable-undo.","type":"string"}},"required":["requested","done","skipped","runId"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}},"runId":{"description":"Run id for /bulk-mail-reenable-undo.","type":"string"}},"required":["requested","done","skipped","runId"]}}}}},"operationId":"postBffContactBulk-mail-reenable","tags":["Contact"],"summary":"Turn bulk e-mail back on (synchronous, up to 500)","description":"Same rules as the preview. Every flip is logged with the run id and the previous reason; the first newsletters to these contacts are spread over days (warm-up). Larger selections: /bulk-job-create with action `mail-reenable`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"allowInactive":{"type":"boolean"},"note":{"maxLength":500,"description":"Required (min. 10 chars) with `allowInactive`.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"allowInactive":{"type":"boolean"},"note":{"maxLength":500,"description":"Required (min. 10 chars) with `allowInactive`.","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"allowInactive":{"type":"boolean"},"note":{"maxLength":500,"description":"Required (min. 10 chars) with `allowInactive`.","type":"string"}}}}}}}},"/bff/contact/bulk-mail-reenable-runs":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["runId","count","startedAt","finishedAt","memberId","undoneAt","undoneCount"],"properties":{"runId":{"type":"string"},"count":{"type":"number"},"startedAt":{"type":"string"},"finishedAt":{"type":"string"},"memberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"undoneAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"undoneCount":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["runId","count","startedAt","finishedAt","memberId","undoneAt","undoneCount"],"properties":{"runId":{"type":"string"},"count":{"type":"number"},"startedAt":{"type":"string"},"finishedAt":{"type":"string"},"memberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"undoneAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"undoneCount":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["runId","count","startedAt","finishedAt","memberId","undoneAt","undoneCount"],"properties":{"runId":{"type":"string"},"count":{"type":"number"},"startedAt":{"type":"string"},"finishedAt":{"type":"string"},"memberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"undoneAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"undoneCount":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getBffContactBulk-mail-reenable-runs","tags":["Contact"],"summary":"Recent \"turn bulk e-mail back on\" runs","description":"Runs of the last 30 days from the activity log, newest first, with their undo state."}},"/bff/contact/bulk-mail-reenable-undo":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"restored":{"type":"number"},"unchanged":{"type":"number"},"cancelledDeliveries":{"type":"number"}},"required":["runId","restored","unchanged","cancelledDeliveries"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"restored":{"type":"number"},"unchanged":{"type":"number"},"cancelledDeliveries":{"type":"number"}},"required":["runId","restored","unchanged","cancelledDeliveries"]}},"text/plain":{"schema":{"type":"object","properties":{"runId":{"type":"string"},"restored":{"type":"number"},"unchanged":{"type":"number"},"cancelledDeliveries":{"type":"number"}},"required":["runId","restored","unchanged","cancelledDeliveries"]}}}}},"operationId":"postBffContactBulk-mail-reenable-undo","tags":["Contact"],"summary":"Undo a \"turn bulk e-mail back on\" run","description":"Opts the run's contacts out again with their previous reason (contacts opted out again in the meantime stay as they are) and cancels their pending newsletter deliveries (marked failed, never deleted).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["runId"],"properties":{"runId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["runId"],"properties":{"runId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["runId"],"properties":{"runId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/contact/bulk-mail-repermission-preview":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"eligible":{"description":"Contacts that would be asked (before the daily cap).","type":"number"},"sendableToday":{"description":"Of `eligible`, how many fit into today's cap.","type":"number"},"dailyCap":{"type":"number"},"askedToday":{"type":"number"},"skipped":{"description":"Skip reason → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}},"required":["total","eligible","sendableToday","dailyCap","askedToday","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"total":{"type":"number"},"eligible":{"description":"Contacts that would be asked (before the daily cap).","type":"number"},"sendableToday":{"description":"Of `eligible`, how many fit into today's cap.","type":"number"},"dailyCap":{"type":"number"},"askedToday":{"type":"number"},"skipped":{"description":"Skip reason → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}},"required":["total","eligible","sendableToday","dailyCap","askedToday","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"total":{"type":"number"},"eligible":{"description":"Contacts that would be asked (before the daily cap).","type":"number"},"sendableToday":{"description":"Of `eligible`, how many fit into today's cap.","type":"number"},"dailyCap":{"type":"number"},"askedToday":{"type":"number"},"skipped":{"description":"Skip reason → contacts.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}},"required":["total","eligible","sendableToday","dailyCap","askedToday","skipped"]}}}}},"operationId":"postBffContactBulk-mail-repermission-preview","tags":["Contact"],"summary":"Preview: one-time re-permission request","description":"Read-only. Who of the selection would get the \"do you still want to hear from us?\" e-mail: unexplained opt-outs with activity in 90 days, never asked before, nothing else refusing them. Capped per day.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"text/plain":{"schema":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"/bff/contact/bulk-mail-repermission":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}},"runId":{"type":"string"}},"required":["requested","done","skipped","runId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}},"runId":{"type":"string"}},"required":["requested","done","skipped","runId"]}},"text/plain":{"schema":{"type":"object","properties":{"requested":{"type":"number"},"done":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","required":["id","reason"],"properties":{"id":{"description":"Contact external id.","type":"string"},"reason":{"anyOf":[{"const":"notFound","type":"string"},{"const":"alreadyDeleted","type":"string"},{"const":"notDeleted","type":"string"},{"const":"member","type":"string"},{"const":"ownContact","type":"string"},{"const":"paidOrders","type":"string"},{"const":"credit","type":"string"},{"const":"subscription","type":"string"},{"const":"criticalFlag","type":"string"},{"const":"notFlagged","type":"string"},{"const":"unchanged","type":"string"},{"const":"alreadyAnonymized","type":"string"},{"const":"pendingOrders","type":"string"},{"const":"notOptedOut","type":"string"},{"const":"unsubscribed","type":"string"},{"const":"spamComplaint","type":"string"},{"const":"banned","type":"string"},{"const":"hardBounce","type":"string"},{"const":"suspicious","type":"string"},{"const":"noRecentActivity","type":"string"},{"const":"noEmail","type":"string"},{"const":"alreadyAsked","type":"string"},{"const":"notLegacyOptOut","type":"string"},{"const":"dailyCap","type":"string"}]}}}},"runId":{"type":"string"}},"required":["requested","done","skipped","runId"]}}}}},"operationId":"postBffContactBulk-mail-repermission","tags":["Contact"],"summary":"Send the one-time re-permission request (synchronous, up to 500)","description":"Sends `newsletter-repermission-contact` with the double opt-in confirm link. Each contact is asked at most once; at most 300 per organisation and day. Larger selections: /bulk-job-create with action `mail-repermission`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["legalConfirmed","note"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"legalConfirmed":{"description":"Must be true: the legal basis for the request was assessed.","type":"boolean"},"note":{"minLength":10,"maxLength":500,"description":"Who assessed the legal basis and when.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["legalConfirmed","note"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"legalConfirmed":{"description":"Must be true: the legal basis for the request was assessed.","type":"boolean"},"note":{"minLength":10,"maxLength":500,"description":"Who assessed the legal basis and when.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["legalConfirmed","note"],"properties":{"ids":{"maxItems":500,"description":"Contact external ids (explicit selection).","type":"array","items":{"type":"string"}},"allMatching":{"description":"Act on every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query (filters, fulltext) for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"legalConfirmed":{"description":"Must be true: the legal basis for the request was assessed.","type":"boolean"},"note":{"minLength":10,"maxLength":500,"description":"Who assessed the legal basis and when.","type":"string"}}}}}}}},"/bff/contact/repermission-stats":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"asked":{"type":"number"},"confirmed":{"type":"number"},"declined":{"type":"number"},"pending":{"type":"number"},"askedToday":{"type":"number"},"dailyCap":{"type":"number"}},"required":["asked","confirmed","declined","pending","askedToday","dailyCap"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"asked":{"type":"number"},"confirmed":{"type":"number"},"declined":{"type":"number"},"pending":{"type":"number"},"askedToday":{"type":"number"},"dailyCap":{"type":"number"}},"required":["asked","confirmed","declined","pending","askedToday","dailyCap"]}},"text/plain":{"schema":{"type":"object","properties":{"asked":{"type":"number"},"confirmed":{"type":"number"},"declined":{"type":"number"},"pending":{"type":"number"},"askedToday":{"type":"number"},"dailyCap":{"type":"number"}},"required":["asked","confirmed","declined","pending","askedToday","dailyCap"]}}}}},"operationId":"getBffContactRepermission-stats","tags":["Contact"],"summary":"Re-permission request results","description":"Contacts asked so far and how many confirmed, unsubscribed or did not answer."}},"/bff/contact/bulk-job-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Bulk job id for `/bff/bulk-job/detail`.","type":"string"},"total":{"type":"number"}},"required":["id","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Bulk job id for `/bff/bulk-job/detail`.","type":"string"},"total":{"type":"number"}},"required":["id","total"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Bulk job id for `/bff/bulk-job/detail`.","type":"string"},"total":{"type":"number"}},"required":["id","total"]}}}}},"operationId":"postBffContactBulk-job-create","tags":["Contact"],"summary":"Start a contact bulk action as a background job","description":"Runs any contact bulk action (same rules and skip reasons as the synchronous `/bulk-*` endpoints) as a background job for up to 20 000 contacts. GDPR anonymisation (`anonymize`) always runs this way; it skips members, the own contact, real customers, already anonymised contacts and contacts with orders in progress.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection","action"],"properties":{"selection":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"action":{"anyOf":[{"const":"delete","type":"string"},{"const":"restore","type":"string"},{"const":"groups","type":"string"},{"const":"suspicious","type":"string"},{"const":"not-spam","type":"string"},{"const":"block","type":"string"},{"const":"mail-opt-out","type":"string"},{"const":"mail-reenable","type":"string"},{"const":"mail-repermission","type":"string"},{"const":"anonymize","type":"string"}]},"reasonCode":{"anyOf":[{"const":"spam","type":"string"},{"const":"fraud","type":"string"},{"const":"duplicate","type":"string"},{"const":"test","type":"string"},{"const":"other","type":"string"}]},"note":{"maxLength":500,"type":"string"},"groups":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}},"mode":{"anyOf":[{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"flagged":{"type":"boolean"},"blocked":{"type":"boolean"},"reason":{"maxLength":1000,"description":"Block reason, or the GDPR anonymisation reason (min. 10 chars).","type":"string"},"allowInactive":{"description":"`mail-reenable`: include unexplained opt-outs without activity in 90 days (needs `note`).","type":"boolean"},"runId":{"description":"`mail-reenable`: reuse a run id (retry of a job) so the undo covers both. Generated when absent.","type":"string"},"legalConfirmed":{"description":"`mail-repermission`: the legal basis was assessed (required, with `note`).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection","action"],"properties":{"selection":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"action":{"anyOf":[{"const":"delete","type":"string"},{"const":"restore","type":"string"},{"const":"groups","type":"string"},{"const":"suspicious","type":"string"},{"const":"not-spam","type":"string"},{"const":"block","type":"string"},{"const":"mail-opt-out","type":"string"},{"const":"mail-reenable","type":"string"},{"const":"mail-repermission","type":"string"},{"const":"anonymize","type":"string"}]},"reasonCode":{"anyOf":[{"const":"spam","type":"string"},{"const":"fraud","type":"string"},{"const":"duplicate","type":"string"},{"const":"test","type":"string"},{"const":"other","type":"string"}]},"note":{"maxLength":500,"type":"string"},"groups":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}},"mode":{"anyOf":[{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"flagged":{"type":"boolean"},"blocked":{"type":"boolean"},"reason":{"maxLength":1000,"description":"Block reason, or the GDPR anonymisation reason (min. 10 chars).","type":"string"},"allowInactive":{"description":"`mail-reenable`: include unexplained opt-outs without activity in 90 days (needs `note`).","type":"boolean"},"runId":{"description":"`mail-reenable`: reuse a run id (retry of a job) so the undo covers both. Generated when absent.","type":"string"},"legalConfirmed":{"description":"`mail-repermission`: the legal basis was assessed (required, with `note`).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["selection","action"],"properties":{"selection":{"type":"object","properties":{"ids":{"maxItems":20000,"description":"Contact external ids.","type":"array","items":{"type":"string"}},"allMatching":{"description":"Every contact matching `filter` instead of `ids`.","type":"boolean"},"filter":{"description":"The `/list` query for `allMatching`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"action":{"anyOf":[{"const":"delete","type":"string"},{"const":"restore","type":"string"},{"const":"groups","type":"string"},{"const":"suspicious","type":"string"},{"const":"not-spam","type":"string"},{"const":"block","type":"string"},{"const":"mail-opt-out","type":"string"},{"const":"mail-reenable","type":"string"},{"const":"mail-repermission","type":"string"},{"const":"anonymize","type":"string"}]},"reasonCode":{"anyOf":[{"const":"spam","type":"string"},{"const":"fraud","type":"string"},{"const":"duplicate","type":"string"},{"const":"test","type":"string"},{"const":"other","type":"string"}]},"note":{"maxLength":500,"type":"string"},"groups":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}},"mode":{"anyOf":[{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"flagged":{"type":"boolean"},"blocked":{"type":"boolean"},"reason":{"maxLength":1000,"description":"Block reason, or the GDPR anonymisation reason (min. 10 chars).","type":"string"},"allowInactive":{"description":"`mail-reenable`: include unexplained opt-outs without activity in 90 days (needs `note`).","type":"boolean"},"runId":{"description":"`mail-reenable`: reuse a run id (retry of a job) so the undo covers both. Generated when absent.","type":"string"},"legalConfirmed":{"description":"`mail-repermission`: the legal basis was assessed (required, with `note`).","type":"boolean"}}}}}}}},"/bff/contact/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"customerId":{"description":"External ID of the newly created contact.","type":"string"}},"required":["success","customerId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"customerId":{"description":"External ID of the newly created contact.","type":"string"}},"required":["success","customerId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"customerId":{"description":"External ID of the newly created contact.","type":"string"}},"required":["success","customerId"]}}}}},"operationId":"postBffContactCreate","tags":["Contact"],"summary":"Quick-create contact","description":"Creates a single contact from a minimal form. **Either `email` OR `phone` is required** (both are allowed). First name, last name and IČO are optional. When IČO is provided, the company name and address are auto-filled from ARES. Optionally triggers the registration workflow with the standard confirmation e-mail (requires `email`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Contact first name.","type":"string"},"lastName":{"description":"Contact last name.","type":"string"},"phone":{"description":"Contact phone number. Normalised to international format using the organisation default country prefix. Required when `email` is omitted (phone-only contact).","type":"string"},"companyRegistrationNumber":{"description":"IČO (Czech company registration number). When provided, the company name and invoice address are auto-filled from ARES.","type":"string"},"sendRegistrationInvite":{"description":"When true, also triggers the standard registration workflow and sends the registration confirmation e-mail to the contact. Requires `email` to be present.","type":"boolean"},"ignoreBulkMail":{"description":"When true, the contact is opted out of bulk / newsletter e-mails from creation.","type":"boolean"},"groupList":{"description":"Customer group tags to attach on creation. Free-solo slugs are created lazily; existing slugs are looked up and reused.","type":"array","items":{"type":"object","required":["slug"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Contact first name.","type":"string"},"lastName":{"description":"Contact last name.","type":"string"},"phone":{"description":"Contact phone number. Normalised to international format using the organisation default country prefix. Required when `email` is omitted (phone-only contact).","type":"string"},"companyRegistrationNumber":{"description":"IČO (Czech company registration number). When provided, the company name and invoice address are auto-filled from ARES.","type":"string"},"sendRegistrationInvite":{"description":"When true, also triggers the standard registration workflow and sends the registration confirmation e-mail to the contact. Requires `email` to be present.","type":"boolean"},"ignoreBulkMail":{"description":"When true, the contact is opted out of bulk / newsletter e-mails from creation.","type":"boolean"},"groupList":{"description":"Customer group tags to attach on creation. Free-solo slugs are created lazily; existing slugs are looked up and reused.","type":"array","items":{"type":"object","required":["slug"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Contact first name.","type":"string"},"lastName":{"description":"Contact last name.","type":"string"},"phone":{"description":"Contact phone number. Normalised to international format using the organisation default country prefix. Required when `email` is omitted (phone-only contact).","type":"string"},"companyRegistrationNumber":{"description":"IČO (Czech company registration number). When provided, the company name and invoice address are auto-filled from ARES.","type":"string"},"sendRegistrationInvite":{"description":"When true, also triggers the standard registration workflow and sends the registration confirmation e-mail to the contact. Requires `email` to be present.","type":"boolean"},"ignoreBulkMail":{"description":"When true, the contact is opted out of bulk / newsletter e-mails from creation.","type":"boolean"},"groupList":{"description":"Customer group tags to attach on creation. Free-solo slugs are created lazily; existing slugs are looked up and reused.","type":"array","items":{"type":"object","required":["slug"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"}}}}}}}}}}},"/bff/contact/check-email-availability":{"post":{"parameters":[],"operationId":"postBffContactCheck-email-availability","tags":["Contact"],"summary":"Check whether an e-mail can be used for a new contact","description":"Normalizes the candidate e-mail via fixEmail() and reports whether it is empty, invalid, available, or already taken by another contact in the organisation. Designed for live ajax feedback as the operator types into the create-contact form.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"description":"Candidate e-mail address (may be unnormalized).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"description":"Candidate e-mail address (may be unnormalized).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"description":"Candidate e-mail address (may be unnormalized).","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/contact/bulk-import":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"inserted":{"description":"Brand-new contact rows created.","type":"number"},"updated":{"description":"Existing contacts touched (fill-if-blank metadata or ≥1 new tag attached).","type":"number"},"unchanged":{"description":"Existing contacts left untouched — every requested tag already attached and no field needed filling.","type":"number"},"skipped":{"description":"Rows dropped because no identifier could be resolved (empty e-mail + unparseable phone).","type":"number"}},"required":["success","inserted","updated","unchanged","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"inserted":{"description":"Brand-new contact rows created.","type":"number"},"updated":{"description":"Existing contacts touched (fill-if-blank metadata or ≥1 new tag attached).","type":"number"},"unchanged":{"description":"Existing contacts left untouched — every requested tag already attached and no field needed filling.","type":"number"},"skipped":{"description":"Rows dropped because no identifier could be resolved (empty e-mail + unparseable phone).","type":"number"}},"required":["success","inserted","updated","unchanged","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"inserted":{"description":"Brand-new contact rows created.","type":"number"},"updated":{"description":"Existing contacts touched (fill-if-blank metadata or ≥1 new tag attached).","type":"number"},"unchanged":{"description":"Existing contacts left untouched — every requested tag already attached and no field needed filling.","type":"number"},"skipped":{"description":"Rows dropped because no identifier could be resolved (empty e-mail + unparseable phone).","type":"number"}},"required":["success","inserted","updated","unchanged","skipped"]}}}}},"operationId":"postBffContactBulk-import","tags":["Contact"],"summary":"Bulk import contacts (upsert with additive tags)","description":"Imports multiple contacts at once. Existing contacts are matched by e-mail (or phone for phone-only entries); their `first_name`, `last_name` and `internal_note` are filled ONLY if currently empty, and any requested tags are additively attached. `updated_date` is bumped only when at least one field is filled or at least one new tag join is created — otherwise the row is left completely alone.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contactList","internalNote"],"properties":{"contactList":{"description":"List of contacts to import.","type":"array","items":{"type":"object","required":["email","name"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"description":"Contact display name.","type":"string"}}}},"internalNote":{"description":"Internal note attached to newly-created contacts only. Existing contacts keep their current note.","type":"string"},"groupList":{"description":"Groups (tags) to additively attach to every imported contact. Never removes existing group joins.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["contactList","internalNote"],"properties":{"contactList":{"description":"List of contacts to import.","type":"array","items":{"type":"object","required":["email","name"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"description":"Contact display name.","type":"string"}}}},"internalNote":{"description":"Internal note attached to newly-created contacts only. Existing contacts keep their current note.","type":"string"},"groupList":{"description":"Groups (tags) to additively attach to every imported contact. Never removes existing group joins.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}}}},"text/plain":{"schema":{"type":"object","required":["contactList","internalNote"],"properties":{"contactList":{"description":"List of contacts to import.","type":"array","items":{"type":"object","required":["email","name"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"name":{"description":"Contact display name.","type":"string"}}}},"internalNote":{"description":"Internal note attached to newly-created contacts only. Existing contacts keep their current note.","type":"string"},"groupList":{"description":"Groups (tags) to additively attach to every imported contact. Never removes existing group joins.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}}}}}}}},"/bff/contact/consent/grant":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactConsentGrant","tags":["Contact"],"summary":"Grant consent","description":"Grants a specific consent type for a contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"type":{"description":"Consent type.","examples":["newsletter","marketing","gdpr"],"type":"string"},"source":{"description":"Source of the consent grant.","examples":["admin","web"],"type":"string"},"note":{"description":"Optional note about the consent.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","type"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"type":{"description":"Consent type.","examples":["newsletter","marketing","gdpr"],"type":"string"},"source":{"description":"Source of the consent grant.","examples":["admin","web"],"type":"string"},"note":{"description":"Optional note about the consent.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","type"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"type":{"description":"Consent type.","examples":["newsletter","marketing","gdpr"],"type":"string"},"source":{"description":"Source of the consent grant.","examples":["admin","web"],"type":"string"},"note":{"description":"Optional note about the consent.","type":"string"}}}}}}}},"/bff/contact/consent/revoke":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactConsentRevoke","tags":["Contact"],"summary":"Revoke consent","description":"Revokes a specific consent type for a contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"type":{"description":"Consent type.","examples":["newsletter","marketing","gdpr"],"type":"string"},"source":{"description":"Source of the consent revocation.","examples":["admin","web"],"type":"string"},"note":{"description":"Optional note about the revocation.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","type"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"type":{"description":"Consent type.","examples":["newsletter","marketing","gdpr"],"type":"string"},"source":{"description":"Source of the consent revocation.","examples":["admin","web"],"type":"string"},"note":{"description":"Optional note about the revocation.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","type"],"properties":{"id":{"description":"Contact external ID.","type":"string"},"type":{"description":"Consent type.","examples":["newsletter","marketing","gdpr"],"type":"string"},"source":{"description":"Source of the consent revocation.","examples":["admin","web"],"type":"string"},"note":{"description":"Optional note about the revocation.","type":"string"}}}}}}}},"/bff/contact/custom-field/definition-list":{"get":{"operationId":"getBffContactCustom-fieldDefinition-list","tags":["Contact"],"summary":"List custom field definitions","description":"Returns all custom field definitions configured for the organisation.","responses":{"200":{}}}},"/bff/contact/custom-field/definition-save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactCustom-fieldDefinition-save","tags":["Contact"],"summary":"Save custom field definition","description":"Creates or updates a custom field definition. Uses upsert on key + organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key","type","label","required","active","position"],"properties":{"key":{"description":"Unique field key identifier.","examples":["company_size"],"type":"string"},"type":{"description":"Field data type: text, textarea, number, boolean, select, date.","examples":["text","number","select"],"type":"string"},"label":{"description":"Display label for the field.","type":"string"},"helperText":{"description":"Help text shown below the field.","type":"string"},"placeholder":{"description":"Placeholder text for the input.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"active":{"description":"Whether the field is active and visible.","type":"boolean"},"validationPattern":{"description":"Regex validation pattern.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"options":{"description":"Allowed values of a select field (BIZKIT-133). Ignored for other types.","type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"string"},"label":{"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["key","type","label","required","active","position"],"properties":{"key":{"description":"Unique field key identifier.","examples":["company_size"],"type":"string"},"type":{"description":"Field data type: text, textarea, number, boolean, select, date.","examples":["text","number","select"],"type":"string"},"label":{"description":"Display label for the field.","type":"string"},"helperText":{"description":"Help text shown below the field.","type":"string"},"placeholder":{"description":"Placeholder text for the input.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"active":{"description":"Whether the field is active and visible.","type":"boolean"},"validationPattern":{"description":"Regex validation pattern.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"options":{"description":"Allowed values of a select field (BIZKIT-133). Ignored for other types.","type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"string"},"label":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","required":["key","type","label","required","active","position"],"properties":{"key":{"description":"Unique field key identifier.","examples":["company_size"],"type":"string"},"type":{"description":"Field data type: text, textarea, number, boolean, select, date.","examples":["text","number","select"],"type":"string"},"label":{"description":"Display label for the field.","type":"string"},"helperText":{"description":"Help text shown below the field.","type":"string"},"placeholder":{"description":"Placeholder text for the input.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"active":{"description":"Whether the field is active and visible.","type":"boolean"},"validationPattern":{"description":"Regex validation pattern.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"options":{"description":"Allowed values of a select field (BIZKIT-133). Ignored for other types.","type":"array","items":{"type":"object","required":["value"],"properties":{"value":{"type":"string"},"label":{"type":"string"}}}}}}}}}}},"/bff/contact/custom-field/set":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactCustom-fieldSet","tags":["Contact"],"summary":"Set custom field value","description":"Sets a custom field value for a specific contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","key","value"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"key":{"description":"Custom field key.","type":"string"},"value":{"description":"Value to set for the custom field.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","key","value"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"key":{"description":"Custom field key.","type":"string"},"value":{"description":"Value to set for the custom field.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","key","value"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"key":{"description":"Custom field key.","type":"string"},"value":{"description":"Value to set for the custom field.","type":"string"}}}}}}}},"/bff/contact/custom-field/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactCustom-fieldDelete","tags":["Contact"],"summary":"Delete custom field value","description":"Removes a custom field value from a specific contact.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","key"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"key":{"description":"Custom field key to delete.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","key"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"key":{"description":"Custom field key to delete.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","key"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"key":{"description":"Custom field key to delete.","type":"string"}}}}}}}},"/bff/contact/hierarchy":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactHierarchy","tags":["Contact"],"summary":"Get contact hierarchy","description":"Returns the direct superior (single parent), all direct subordinates (children), and colleagues (contacts sharing the same non-null superior) for a contact.","responses":{"200":{}}}},"/bff/contact/set-parent":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactSet-parent","tags":["Contact"],"summary":"Set contact superior","description":"Assigns a parent (superior) contact. Pass null/omit `parentCustomerId` to detach. Rejected when the target would create a cycle or when contact equals parent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID whose superior is being changed.","type":"string"},"parentCustomerId":{"nullable":true,"anyOf":[{"description":"External ID of the new superior. Pass null or omit to detach (contact becomes a root node).","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID whose superior is being changed.","type":"string"},"parentCustomerId":{"nullable":true,"anyOf":[{"description":"External ID of the new superior. Pass null or omit to detach (contact becomes a root node).","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID whose superior is being changed.","type":"string"},"parentCustomerId":{"nullable":true,"anyOf":[{"description":"External ID of the new superior. Pass null or omit to detach (contact becomes a root node).","type":"string"},{"type":"null"}]}}}}}}}},"/bff/contact/org-tree":{"get":{"parameters":[{"description":"Focused contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactOrg-tree","tags":["Contact"],"summary":"Get organisational tree around a contact","description":"Returns the focused contact together with its ancestor chain (root-first) and the full subtree rooted at the focused contact. Useful for MS Teams-style org charts. Depth is capped at 32 levels in each direction.","responses":{"200":{}}}},"/bff/contact/set-billing-flags":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactSet-billing-flags","tags":["Contact"],"summary":"Set contact billing flags (reverse charge / tax exempt)","description":"Updates the EU reverse-charge default and tax-exempt status of a contact. Only the provided fields are changed; omit a field to keep its current value.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"reverseCharge":{"description":"When true, invoices for this contact default to 0 % VAT with the \"reverse charge\" note (EU B2B intra-community supply). Set true after a successful VIES validation for non-CZ EU contacts.","type":"boolean"},"taxExempt":{"description":"When true, the contact is exempt from VAT (non-profits, government bodies, etc.).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"reverseCharge":{"description":"When true, invoices for this contact default to 0 % VAT with the \"reverse charge\" note (EU B2B intra-community supply). Set true after a successful VIES validation for non-CZ EU contacts.","type":"boolean"},"taxExempt":{"description":"When true, the contact is exempt from VAT (non-profits, government bodies, etc.).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"reverseCharge":{"description":"When true, invoices for this contact default to 0 % VAT with the \"reverse charge\" note (EU B2B intra-community supply). Set true after a successful VIES validation for non-CZ EU contacts.","type":"boolean"},"taxExempt":{"description":"When true, the contact is exempt from VAT (non-profits, government bodies, etc.).","type":"boolean"}}}}}}}},"/bff/contact/email-list":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","email","label","sendInvoices","sendReminders","sendMarketing","position","insertedDate","updatedDate"],"properties":{"id":{"description":"Internal row id (use it for update / delete).","type":"number"},"email":{"type":"string"},"label":{"description":"Free-form role label, e.g. \"Účetní\", \"Project manager\", \"Billing\".","anyOf":[{"type":"string"},{"type":"null"}]},"sendInvoices":{"type":"boolean"},"sendReminders":{"type":"boolean"},"sendMarketing":{"type":"boolean"},"position":{"description":"Display order within the contact (lower = primary).","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","email","label","sendInvoices","sendReminders","sendMarketing","position","insertedDate","updatedDate"],"properties":{"id":{"description":"Internal row id (use it for update / delete).","type":"number"},"email":{"type":"string"},"label":{"description":"Free-form role label, e.g. \"Účetní\", \"Project manager\", \"Billing\".","anyOf":[{"type":"string"},{"type":"null"}]},"sendInvoices":{"type":"boolean"},"sendReminders":{"type":"boolean"},"sendMarketing":{"type":"boolean"},"position":{"description":"Display order within the contact (lower = primary).","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","email","label","sendInvoices","sendReminders","sendMarketing","position","insertedDate","updatedDate"],"properties":{"id":{"description":"Internal row id (use it for update / delete).","type":"number"},"email":{"type":"string"},"label":{"description":"Free-form role label, e.g. \"Účetní\", \"Project manager\", \"Billing\".","anyOf":[{"type":"string"},{"type":"null"}]},"sendInvoices":{"type":"boolean"},"sendReminders":{"type":"boolean"},"sendMarketing":{"type":"boolean"},"position":{"description":"Display order within the contact (lower = primary).","type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffContactEmail-list","tags":["Contact"],"summary":"List billing email roles for a contact","description":"Returns every additional email associated with the contact and the channel toggles (invoices / reminders / marketing). The contact's primary `shop__contact.email` is NOT included — render it separately in the UI."}},"/bff/contact/email-upsert":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Row id of the inserted or updated record.","type":"number"},"inserted":{"description":"True for new rows, false when an existing row was updated.","type":"boolean"}},"required":["id","inserted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Row id of the inserted or updated record.","type":"number"},"inserted":{"description":"True for new rows, false when an existing row was updated.","type":"boolean"}},"required":["id","inserted"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Row id of the inserted or updated record.","type":"number"},"inserted":{"description":"True for new rows, false when an existing row was updated.","type":"boolean"}},"required":["id","inserted"]}}}}},"operationId":"postBffContactEmail-upsert","tags":["Contact"],"summary":"Insert or update a billing email role","description":"Idempotent on (contact, lower(email)). When the same email already exists on the contact, the row is updated; otherwise a new row is inserted. Position auto-fills as \"max + 1\" when omitted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","email"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Existing row id — provide to update; omit to insert (or upsert by email).","type":"number"},"email":{"description":"Email address.","examples":["accountant@client.cz"],"type":"string"},"label":{"description":"Role label.","examples":["Účetní","PM","Billing"],"type":"string"},"sendInvoices":{"description":"Receive invoices? Default true.","type":"boolean"},"sendReminders":{"description":"Receive overdue reminders? Default true.","type":"boolean"},"sendMarketing":{"description":"Receive marketing? Default false.","type":"boolean"},"position":{"description":"Display order; auto-assigned to \"max + 1\" when omitted.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","email"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Existing row id — provide to update; omit to insert (or upsert by email).","type":"number"},"email":{"description":"Email address.","examples":["accountant@client.cz"],"type":"string"},"label":{"description":"Role label.","examples":["Účetní","PM","Billing"],"type":"string"},"sendInvoices":{"description":"Receive invoices? Default true.","type":"boolean"},"sendReminders":{"description":"Receive overdue reminders? Default true.","type":"boolean"},"sendMarketing":{"description":"Receive marketing? Default false.","type":"boolean"},"position":{"description":"Display order; auto-assigned to \"max + 1\" when omitted.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","email"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Existing row id — provide to update; omit to insert (or upsert by email).","type":"number"},"email":{"description":"Email address.","examples":["accountant@client.cz"],"type":"string"},"label":{"description":"Role label.","examples":["Účetní","PM","Billing"],"type":"string"},"sendInvoices":{"description":"Receive invoices? Default true.","type":"boolean"},"sendReminders":{"description":"Receive overdue reminders? Default true.","type":"boolean"},"sendMarketing":{"description":"Receive marketing? Default false.","type":"boolean"},"position":{"description":"Display order; auto-assigned to \"max + 1\" when omitted.","type":"number"}}}}}}}},"/bff/contact/email-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactEmail-delete","tags":["Contact"],"summary":"Remove a billing email role","description":"Deletes one email row from a contact. The primary `shop__contact.email` is unaffected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","id"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Row id of the email to remove.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","id"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Row id of the email to remove.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","id"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Row id of the email to remove.","type":"number"}}}}}}}},"/bff/contact/bank-account-list":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","iban","domesticLabel","primary","insertedDate"],"properties":{"id":{"description":"Internal row id (use it for delete).","type":"number"},"iban":{"description":"Normalised IBAN.","examples":["CZ6508000000192000145399"],"type":"string"},"domesticLabel":{"description":"Domestic form of the account when known (e.g. \"192000145399/0800\").","anyOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True for the account marked as primary on the contact.","type":"boolean"},"insertedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","iban","domesticLabel","primary","insertedDate"],"properties":{"id":{"description":"Internal row id (use it for delete).","type":"number"},"iban":{"description":"Normalised IBAN.","examples":["CZ6508000000192000145399"],"type":"string"},"domesticLabel":{"description":"Domestic form of the account when known (e.g. \"192000145399/0800\").","anyOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True for the account marked as primary on the contact.","type":"boolean"},"insertedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","iban","domesticLabel","primary","insertedDate"],"properties":{"id":{"description":"Internal row id (use it for delete).","type":"number"},"iban":{"description":"Normalised IBAN.","examples":["CZ6508000000192000145399"],"type":"string"},"domesticLabel":{"description":"Domestic form of the account when known (e.g. \"192000145399/0800\").","anyOf":[{"type":"string"},{"type":"null"}]},"primary":{"description":"True for the account marked as primary on the contact.","type":"boolean"},"insertedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffContactBank-account-list","tags":["Contact"],"summary":"List bank accounts of a contact","description":"Returns every bank account associated with the contact. Any input form (IBAN, Czech account with/without prefix and bank code) is normalised to IBAN on write; this endpoint always returns the canonical IBAN plus the domestic label for display."}},"/bff/contact/bank-account-upsert":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Row id of the inserted or updated record.","type":"number"},"iban":{"description":"Normalised IBAN.","type":"string"},"inserted":{"description":"True for new rows, false when an existing row was updated.","type":"boolean"}},"required":["id","iban","inserted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Row id of the inserted or updated record.","type":"number"},"iban":{"description":"Normalised IBAN.","type":"string"},"inserted":{"description":"True for new rows, false when an existing row was updated.","type":"boolean"}},"required":["id","iban","inserted"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Row id of the inserted or updated record.","type":"number"},"iban":{"description":"Normalised IBAN.","type":"string"},"inserted":{"description":"True for new rows, false when an existing row was updated.","type":"boolean"}},"required":["id","iban","inserted"]}}}}},"operationId":"postBffContactBank-account-upsert","tags":["Contact"],"summary":"Insert or update a bank account on a contact","description":"Idempotent on (contact, IBAN). The user may submit an IBAN or a Czech account in any common form; `getOrCreateBankAccountRef` normalises it and rejects invalid values (throws 500 with the reason). The first account added to a contact is always primary regardless of the `primary` flag.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","bankAccount"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Existing row id — provide to update; omit to insert (or upsert by IBAN).","type":"number"},"bankAccount":{"description":"IBAN or Czech account (any of \"1234567890\", \"1234567890/0100\", \"123456-1234567890/0100\"). Normalised to IBAN on save.","examples":["CZ6508000000192000145399","192000145399/0800"],"type":"string"},"primary":{"description":"Promote to primary account (demotes all others). First account is always primary.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","bankAccount"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Existing row id — provide to update; omit to insert (or upsert by IBAN).","type":"number"},"bankAccount":{"description":"IBAN or Czech account (any of \"1234567890\", \"1234567890/0100\", \"123456-1234567890/0100\"). Normalised to IBAN on save.","examples":["CZ6508000000192000145399","192000145399/0800"],"type":"string"},"primary":{"description":"Promote to primary account (demotes all others). First account is always primary.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","bankAccount"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Existing row id — provide to update; omit to insert (or upsert by IBAN).","type":"number"},"bankAccount":{"description":"IBAN or Czech account (any of \"1234567890\", \"1234567890/0100\", \"123456-1234567890/0100\"). Normalised to IBAN on save.","examples":["CZ6508000000192000145399","192000145399/0800"],"type":"string"},"primary":{"description":"Promote to primary account (demotes all others). First account is always primary.","type":"boolean"}}}}}}}},"/bff/contact/bank-account-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContactBank-account-delete","tags":["Contact"],"summary":"Remove a bank account from a contact","description":"Deletes one bank-account row. When the deleted row was the primary account and other rows remain, the oldest remaining row is promoted to primary so exactly one primary is preserved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","id"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Row id of the bank account to remove.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","id"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Row id of the bank account to remove.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","id"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"id":{"description":"Row id of the bank account to remove.","type":"number"}}}}}}}},"/bff/contact/export-gdpr":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"operationId":"getBffContactExport-gdpr","tags":["Contact"],"summary":"Download personal data export (GDPR Art. 15)","description":"Generates a ZIP bundle with all personal data the organisation holds about the contact — profile, addresses, company record, additional e-mails, consent audit trail, orders, invoices, subscriptions, comments, and the system activity log. Companion `README.md` and `index.html` are rendered in the contact’s preferred language. Internal identifiers, hashes and other non-personal data are deliberately omitted.","responses":{"200":{}}}},"/bff/contact/export-gdpr-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"recipientEmail":{"type":"string"},"filename":{"type":"string"}},"required":["success","recipientEmail","filename"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"recipientEmail":{"type":"string"},"filename":{"type":"string"}},"required":["success","recipientEmail","filename"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"recipientEmail":{"type":"string"},"filename":{"type":"string"}},"required":["success","recipientEmail","filename"]}}}}},"operationId":"postBffContactExport-gdpr-email","tags":["Contact"],"summary":"E-mail personal data export to the contact (GDPR Art. 15)","description":"Generates the same ZIP bundle as `/export-gdpr` and dispatches it as an attachment to the contact’s primary e-mail address. The message body is rendered from the `contact-gdpr-export` notification template (per-org override or system default) in the contact’s preferred language. The ZIP is also persisted in blob storage so it remains downloadable from the e-mail audit log.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"}}}}}}}},"/bff/contact-credit/list":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"credit":{"description":"Current credit balance (number of credits).","examples":[3300],"type":"number"},"creditMoney":{"description":"Current credit balance expressed in the organisation default currency.","examples":[3000],"type":"number"},"currency":{"description":"ISO 4217 code of the organisation default currency used for all *Money fields.","examples":["CZK"],"type":"string"},"items":{"description":"Credit transactions ordered from most recent to oldest.","type":"array","items":{"type":"object","required":["id","amount","amountMoney","balance","balanceMoney","insertedDate"],"properties":{"id":{"description":"Transaction external ID.","examples":["HxanU4a1n4El61zx"],"type":"string"},"amount":{"description":"Credit amount (positive = added, negative = spent).","examples":[3300,-100],"type":"number"},"amountMoney":{"description":"Monetary value of the transaction in the organisation default currency. Defaults to the same value as `amount` (1:1) when no explicit money value was stored.","examples":[3000,-100,0],"type":"number"},"balance":{"description":"Running credit balance after this transaction.","examples":[3300],"type":"number"},"balanceMoney":{"description":"Running monetary balance after this transaction (in the organisation default currency).","examples":[3000],"type":"number"},"order":{"type":"object","required":["orderNumber","hash","groupName"],"properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"groupName":{"examples":["GymRoom Vinohrady"],"type":"string"}}},"expiration":{"type":"object","required":["date","status"],"properties":{"date":{"examples":["2026-12-31T00:00:00.000Z"],"anyOf":[{"examples":["2026-12-31T00:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"processed","type":"string"},{"const":"expired","type":"string"}]},"processed":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"reason":{"type":"object","required":["externalId","code","name"],"properties":{"externalId":{"description":"Credit reason external ID.","examples":["rsn1234567890abc"],"type":"string"},"code":{"description":"Credit reason code.","examples":["cleaning-complaint"],"type":"string"},"name":{"description":"Credit reason display name.","examples":["Reklamace úklidu"],"type":"string"}}},"payerBranch":{"description":"Branch that internally bears the cost of this credit movement. Omitted when the organisation absorbs it.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the branch that internally bears this credit cost.","type":"string"},"name":{"description":"Display name of the payer branch.","type":"string"}}},"linkedWriteoff":{"description":"Branch write-off that was auto-spawned for this credit (1:1 via shop__contact_credit_expense_link). Omitted when no branch was picked, or when the spawn failed and was logged.","type":"object","required":["externalId","status","isDeleted"],"properties":{"externalId":{"description":"External id of the linked shop__expense write-off row.","type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"pending","type":"string"},{"const":"approved","type":"string"},{"const":"rejected","type":"string"}]},"isDeleted":{"type":"boolean"}}},"description":{"examples":["Order 25000087"],"type":"string"},"insertedDate":{"examples":["2026-04-21T10:00:00.000Z"],"anyOf":[{"examples":["2026-04-21T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of credit transactions.","examples":[42],"type":"number"}},"required":["credit","creditMoney","currency","items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"credit":{"description":"Current credit balance (number of credits).","examples":[3300],"type":"number"},"creditMoney":{"description":"Current credit balance expressed in the organisation default currency.","examples":[3000],"type":"number"},"currency":{"description":"ISO 4217 code of the organisation default currency used for all *Money fields.","examples":["CZK"],"type":"string"},"items":{"description":"Credit transactions ordered from most recent to oldest.","type":"array","items":{"type":"object","required":["id","amount","amountMoney","balance","balanceMoney","insertedDate"],"properties":{"id":{"description":"Transaction external ID.","examples":["HxanU4a1n4El61zx"],"type":"string"},"amount":{"description":"Credit amount (positive = added, negative = spent).","examples":[3300,-100],"type":"number"},"amountMoney":{"description":"Monetary value of the transaction in the organisation default currency. Defaults to the same value as `amount` (1:1) when no explicit money value was stored.","examples":[3000,-100,0],"type":"number"},"balance":{"description":"Running credit balance after this transaction.","examples":[3300],"type":"number"},"balanceMoney":{"description":"Running monetary balance after this transaction (in the organisation default currency).","examples":[3000],"type":"number"},"order":{"type":"object","required":["orderNumber","hash","groupName"],"properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"groupName":{"examples":["GymRoom Vinohrady"],"type":"string"}}},"expiration":{"type":"object","required":["date","status"],"properties":{"date":{"examples":["2026-12-31T00:00:00.000Z"],"anyOf":[{"examples":["2026-12-31T00:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"processed","type":"string"},{"const":"expired","type":"string"}]},"processed":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"reason":{"type":"object","required":["externalId","code","name"],"properties":{"externalId":{"description":"Credit reason external ID.","examples":["rsn1234567890abc"],"type":"string"},"code":{"description":"Credit reason code.","examples":["cleaning-complaint"],"type":"string"},"name":{"description":"Credit reason display name.","examples":["Reklamace úklidu"],"type":"string"}}},"payerBranch":{"description":"Branch that internally bears the cost of this credit movement. Omitted when the organisation absorbs it.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the branch that internally bears this credit cost.","type":"string"},"name":{"description":"Display name of the payer branch.","type":"string"}}},"linkedWriteoff":{"description":"Branch write-off that was auto-spawned for this credit (1:1 via shop__contact_credit_expense_link). Omitted when no branch was picked, or when the spawn failed and was logged.","type":"object","required":["externalId","status","isDeleted"],"properties":{"externalId":{"description":"External id of the linked shop__expense write-off row.","type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"pending","type":"string"},{"const":"approved","type":"string"},{"const":"rejected","type":"string"}]},"isDeleted":{"type":"boolean"}}},"description":{"examples":["Order 25000087"],"type":"string"},"insertedDate":{"examples":["2026-04-21T10:00:00.000Z"],"anyOf":[{"examples":["2026-04-21T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of credit transactions.","examples":[42],"type":"number"}},"required":["credit","creditMoney","currency","items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"credit":{"description":"Current credit balance (number of credits).","examples":[3300],"type":"number"},"creditMoney":{"description":"Current credit balance expressed in the organisation default currency.","examples":[3000],"type":"number"},"currency":{"description":"ISO 4217 code of the organisation default currency used for all *Money fields.","examples":["CZK"],"type":"string"},"items":{"description":"Credit transactions ordered from most recent to oldest.","type":"array","items":{"type":"object","required":["id","amount","amountMoney","balance","balanceMoney","insertedDate"],"properties":{"id":{"description":"Transaction external ID.","examples":["HxanU4a1n4El61zx"],"type":"string"},"amount":{"description":"Credit amount (positive = added, negative = spent).","examples":[3300,-100],"type":"number"},"amountMoney":{"description":"Monetary value of the transaction in the organisation default currency. Defaults to the same value as `amount` (1:1) when no explicit money value was stored.","examples":[3000,-100,0],"type":"number"},"balance":{"description":"Running credit balance after this transaction.","examples":[3300],"type":"number"},"balanceMoney":{"description":"Running monetary balance after this transaction (in the organisation default currency).","examples":[3000],"type":"number"},"order":{"type":"object","required":["orderNumber","hash","groupName"],"properties":{"orderNumber":{"examples":["25000087"],"type":"string"},"hash":{"examples":["sSO98YxzR4KJiOu66Jn6K3wRwa4FPI7S"],"type":"string"},"groupName":{"examples":["GymRoom Vinohrady"],"type":"string"}}},"expiration":{"type":"object","required":["date","status"],"properties":{"date":{"examples":["2026-12-31T00:00:00.000Z"],"anyOf":[{"examples":["2026-12-31T00:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"processed","type":"string"},{"const":"expired","type":"string"}]},"processed":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},"reason":{"type":"object","required":["externalId","code","name"],"properties":{"externalId":{"description":"Credit reason external ID.","examples":["rsn1234567890abc"],"type":"string"},"code":{"description":"Credit reason code.","examples":["cleaning-complaint"],"type":"string"},"name":{"description":"Credit reason display name.","examples":["Reklamace úklidu"],"type":"string"}}},"payerBranch":{"description":"Branch that internally bears the cost of this credit movement. Omitted when the organisation absorbs it.","type":"object","required":["slug","name"],"properties":{"slug":{"description":"Slug of the branch that internally bears this credit cost.","type":"string"},"name":{"description":"Display name of the payer branch.","type":"string"}}},"linkedWriteoff":{"description":"Branch write-off that was auto-spawned for this credit (1:1 via shop__contact_credit_expense_link). Omitted when no branch was picked, or when the spawn failed and was logged.","type":"object","required":["externalId","status","isDeleted"],"properties":{"externalId":{"description":"External id of the linked shop__expense write-off row.","type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"pending","type":"string"},{"const":"approved","type":"string"},{"const":"rejected","type":"string"}]},"isDeleted":{"type":"boolean"}}},"description":{"examples":["Order 25000087"],"type":"string"},"insertedDate":{"examples":["2026-04-21T10:00:00.000Z"],"anyOf":[{"examples":["2026-04-21T10:00:00.000Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of credit transactions.","examples":[42],"type":"number"}},"required":["credit","creditMoney","currency","items","itemCount"]}}}}},"operationId":"getBffContact-creditList","tags":["Contact Credit"],"summary":"Get contact credit history","description":"Returns the current credit balance (both in credits and monetary value) and a list of credit transactions for a contact. The `creditMoney` / `amountMoney` / `balanceMoney` values are in the organisation default currency (`currency`) and are purely bookkeeping — the order payment logic always uses 1 credit = 1 unit of money. Each item may include an optional `reason` selected from the per-organisation credit-reason catalog."}},"/bff/contact-credit/care-status":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"description":"Care events for this contact in the last 365 days.","examples":[0,3,12],"type":"number"},"tier":{"description":"Retention tier — see endpoint description.","anyOf":[{"const":"ok","type":"string"},{"const":"watch","type":"string"},{"const":"elevated","type":"string"},{"const":"flag","type":"string"}]},"scorePenalty":{"description":"Score adjustment currently applied for this care-count (0 for ok, negative otherwise).","examples":[0,-3,-8,-15],"type":"number"},"baseline":{"type":"object","required":["enabled","sampleSize","contactCount","p75","p90","p95","computedAt","windowDays"],"properties":{"enabled":{"description":"True when the org has enough care events for the percentiles to be meaningful.","type":"boolean"},"sampleSize":{"description":"Total care events in the org over the window.","type":"number"},"contactCount":{"description":"Distinct contacts who received a care event in the window.","type":"number"},"p75":{"description":"Watch threshold (care events per contact).","examples":[2],"type":"number"},"p90":{"description":"Elevated threshold (care events per contact).","examples":[5],"type":"number"},"p95":{"description":"Flag threshold (care events per contact).","examples":[9],"type":"number"},"computedAt":{"description":"Timestamp the baseline was materialized.","type":"string"},"windowDays":{"description":"Sliding window length in days.","examples":[365],"type":"number"}}}},"required":["count","tier","scorePenalty","baseline"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"count":{"description":"Care events for this contact in the last 365 days.","examples":[0,3,12],"type":"number"},"tier":{"description":"Retention tier — see endpoint description.","anyOf":[{"const":"ok","type":"string"},{"const":"watch","type":"string"},{"const":"elevated","type":"string"},{"const":"flag","type":"string"}]},"scorePenalty":{"description":"Score adjustment currently applied for this care-count (0 for ok, negative otherwise).","examples":[0,-3,-8,-15],"type":"number"},"baseline":{"type":"object","required":["enabled","sampleSize","contactCount","p75","p90","p95","computedAt","windowDays"],"properties":{"enabled":{"description":"True when the org has enough care events for the percentiles to be meaningful.","type":"boolean"},"sampleSize":{"description":"Total care events in the org over the window.","type":"number"},"contactCount":{"description":"Distinct contacts who received a care event in the window.","type":"number"},"p75":{"description":"Watch threshold (care events per contact).","examples":[2],"type":"number"},"p90":{"description":"Elevated threshold (care events per contact).","examples":[5],"type":"number"},"p95":{"description":"Flag threshold (care events per contact).","examples":[9],"type":"number"},"computedAt":{"description":"Timestamp the baseline was materialized.","type":"string"},"windowDays":{"description":"Sliding window length in days.","examples":[365],"type":"number"}}}},"required":["count","tier","scorePenalty","baseline"]}},"text/plain":{"schema":{"type":"object","properties":{"count":{"description":"Care events for this contact in the last 365 days.","examples":[0,3,12],"type":"number"},"tier":{"description":"Retention tier — see endpoint description.","anyOf":[{"const":"ok","type":"string"},{"const":"watch","type":"string"},{"const":"elevated","type":"string"},{"const":"flag","type":"string"}]},"scorePenalty":{"description":"Score adjustment currently applied for this care-count (0 for ok, negative otherwise).","examples":[0,-3,-8,-15],"type":"number"},"baseline":{"type":"object","required":["enabled","sampleSize","contactCount","p75","p90","p95","computedAt","windowDays"],"properties":{"enabled":{"description":"True when the org has enough care events for the percentiles to be meaningful.","type":"boolean"},"sampleSize":{"description":"Total care events in the org over the window.","type":"number"},"contactCount":{"description":"Distinct contacts who received a care event in the window.","type":"number"},"p75":{"description":"Watch threshold (care events per contact).","examples":[2],"type":"number"},"p90":{"description":"Elevated threshold (care events per contact).","examples":[5],"type":"number"},"p95":{"description":"Flag threshold (care events per contact).","examples":[9],"type":"number"},"computedAt":{"description":"Timestamp the baseline was materialized.","type":"string"},"windowDays":{"description":"Sliding window length in days.","examples":[365],"type":"number"}}}},"required":["count","tier","scorePenalty","baseline"]}}}}},"operationId":"getBffContact-creditCare-status","tags":["Contact Credit"],"summary":"Get a contact's customer-care recipient status","description":"Returns the number of customer-care credits (reklamace / kompenzace / omluva) the contact has received in the last 365 days, alongside the organisation-wide baseline (p75/p90/p95 of care-events per credited contact). The `tier` is derived by comparing the count to the baseline: `'ok'` (no penalty), `'watch'` (≥ p75, −3 to score), `'elevated'` (≥ p90, −8), `'flag'` (≥ p95, −15). When `baseline.enabled` is false the org has too few care events to compute meaningful thresholds and the tier is always `'ok'`."}},"/bff/contact-credit/expiration-breakdown":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Sum of all buckets — matches shop__contact.credit when outstandingDebt is 0.","examples":[36,3677],"type":"number"},"totalAmountMoney":{"description":"Sum of all bucket money values.","examples":[36,3677],"type":"number"},"outstandingDebt":{"description":"Unpaid debt not yet absorbed by a positive credit. > 0 means the customer is in the red.","examples":[0],"default":0,"type":"number"},"currency":{"description":"ISO 4217 code of the organisation default currency used for all *Money fields.","examples":["CZK"],"type":"string"},"buckets":{"description":"Buckets ordered: overdue first, then by date ascending, never-expires last.","type":"array","items":{"type":"object","required":["expirationDate","overdue","amount","amountMoney","sources"],"properties":{"expirationDate":{"description":"Calendar date when the credits in this bucket expire. null = bucket holds credits with no scheduled expiration.","anyOf":[{"description":"YYYY-MM-DD calendar date.","examples":["2026-06-13"],"type":"string"},{"type":"null"}]},"overdue":{"description":"True when the expiration date is in the past but the cron has not yet processed it. The next cron tick will sweep these.","examples":[false],"default":false,"type":"boolean"},"amount":{"description":"Total unspent credits in this bucket.","examples":[36],"type":"number"},"amountMoney":{"description":"Total money value in this bucket (scaled proportionally).","examples":[36],"type":"number"},"sources":{"type":"array","items":{"type":"object","required":["creditId","creditExternalId","originalAmount","amount","amountMoney","expirationAt"],"properties":{"creditId":{"description":"Internal id of the source credit.","examples":[8422],"type":"number"},"creditExternalId":{"description":"External (16-char) id of the source credit — link target for drill-down.","examples":["4L0jcnkzA8SPW1gE"],"type":"string"},"originalAmount":{"description":"Face value of the source credit before any FIFO consumption.","examples":[300],"type":"number"},"amount":{"description":"Unspent portion of the source credit contributed to this bucket.","examples":[36],"type":"number"},"amountMoney":{"description":"Money value scaled proportionally to `amount`.","examples":[36],"type":"number"},"expirationAt":{"description":"Exact expiration timestamp of the source credit. null when the bucket is the never-expires bucket.","anyOf":[{"description":"Exact ISO timestamp of the source credit expiration.","type":"string"},{"type":"null"}]}}}}}}}},"required":["totalAmount","totalAmountMoney","outstandingDebt","currency","buckets"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Sum of all buckets — matches shop__contact.credit when outstandingDebt is 0.","examples":[36,3677],"type":"number"},"totalAmountMoney":{"description":"Sum of all bucket money values.","examples":[36,3677],"type":"number"},"outstandingDebt":{"description":"Unpaid debt not yet absorbed by a positive credit. > 0 means the customer is in the red.","examples":[0],"default":0,"type":"number"},"currency":{"description":"ISO 4217 code of the organisation default currency used for all *Money fields.","examples":["CZK"],"type":"string"},"buckets":{"description":"Buckets ordered: overdue first, then by date ascending, never-expires last.","type":"array","items":{"type":"object","required":["expirationDate","overdue","amount","amountMoney","sources"],"properties":{"expirationDate":{"description":"Calendar date when the credits in this bucket expire. null = bucket holds credits with no scheduled expiration.","anyOf":[{"description":"YYYY-MM-DD calendar date.","examples":["2026-06-13"],"type":"string"},{"type":"null"}]},"overdue":{"description":"True when the expiration date is in the past but the cron has not yet processed it. The next cron tick will sweep these.","examples":[false],"default":false,"type":"boolean"},"amount":{"description":"Total unspent credits in this bucket.","examples":[36],"type":"number"},"amountMoney":{"description":"Total money value in this bucket (scaled proportionally).","examples":[36],"type":"number"},"sources":{"type":"array","items":{"type":"object","required":["creditId","creditExternalId","originalAmount","amount","amountMoney","expirationAt"],"properties":{"creditId":{"description":"Internal id of the source credit.","examples":[8422],"type":"number"},"creditExternalId":{"description":"External (16-char) id of the source credit — link target for drill-down.","examples":["4L0jcnkzA8SPW1gE"],"type":"string"},"originalAmount":{"description":"Face value of the source credit before any FIFO consumption.","examples":[300],"type":"number"},"amount":{"description":"Unspent portion of the source credit contributed to this bucket.","examples":[36],"type":"number"},"amountMoney":{"description":"Money value scaled proportionally to `amount`.","examples":[36],"type":"number"},"expirationAt":{"description":"Exact expiration timestamp of the source credit. null when the bucket is the never-expires bucket.","anyOf":[{"description":"Exact ISO timestamp of the source credit expiration.","type":"string"},{"type":"null"}]}}}}}}}},"required":["totalAmount","totalAmountMoney","outstandingDebt","currency","buckets"]}},"text/plain":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Sum of all buckets — matches shop__contact.credit when outstandingDebt is 0.","examples":[36,3677],"type":"number"},"totalAmountMoney":{"description":"Sum of all bucket money values.","examples":[36,3677],"type":"number"},"outstandingDebt":{"description":"Unpaid debt not yet absorbed by a positive credit. > 0 means the customer is in the red.","examples":[0],"default":0,"type":"number"},"currency":{"description":"ISO 4217 code of the organisation default currency used for all *Money fields.","examples":["CZK"],"type":"string"},"buckets":{"description":"Buckets ordered: overdue first, then by date ascending, never-expires last.","type":"array","items":{"type":"object","required":["expirationDate","overdue","amount","amountMoney","sources"],"properties":{"expirationDate":{"description":"Calendar date when the credits in this bucket expire. null = bucket holds credits with no scheduled expiration.","anyOf":[{"description":"YYYY-MM-DD calendar date.","examples":["2026-06-13"],"type":"string"},{"type":"null"}]},"overdue":{"description":"True when the expiration date is in the past but the cron has not yet processed it. The next cron tick will sweep these.","examples":[false],"default":false,"type":"boolean"},"amount":{"description":"Total unspent credits in this bucket.","examples":[36],"type":"number"},"amountMoney":{"description":"Total money value in this bucket (scaled proportionally).","examples":[36],"type":"number"},"sources":{"type":"array","items":{"type":"object","required":["creditId","creditExternalId","originalAmount","amount","amountMoney","expirationAt"],"properties":{"creditId":{"description":"Internal id of the source credit.","examples":[8422],"type":"number"},"creditExternalId":{"description":"External (16-char) id of the source credit — link target for drill-down.","examples":["4L0jcnkzA8SPW1gE"],"type":"string"},"originalAmount":{"description":"Face value of the source credit before any FIFO consumption.","examples":[300],"type":"number"},"amount":{"description":"Unspent portion of the source credit contributed to this bucket.","examples":[36],"type":"number"},"amountMoney":{"description":"Money value scaled proportionally to `amount`.","examples":[36],"type":"number"},"expirationAt":{"description":"Exact expiration timestamp of the source credit. null when the bucket is the never-expires bucket.","anyOf":[{"description":"Exact ISO timestamp of the source credit expiration.","type":"string"},{"type":"null"}]}}}}}}}},"required":["totalAmount","totalAmountMoney","outstandingDebt","currency","buckets"]}}}}},"operationId":"getBffContact-creditExpiration-breakdown","tags":["Contact Credit"],"summary":"Get a breakdown of a contact's currently open credits grouped by expiration date","description":"Returns the customer's unspent credits sliced into buckets by their expiration date. FIFO-aware: each bucket reports only what is still unspent of the underlying source credit(s), not the original face value. Buckets are ordered: overdue first (past expiration but not yet processed by the cron), then by date ascending, never-expires last. A non-zero `outstandingDebt` reports a negative running balance that has not yet been paid off."}},"/bff/contact-credit/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"spawnedWriteoffExternalId":{"description":"External id of the shop__expense row spawned as a branch write-off when `payerBranchSlug` was set. Null when the credit went to the organisation default (no branch attribution) or when the spawn failed (the failure is logged; the credit still applies).","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","spawnedWriteoffExternalId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"spawnedWriteoffExternalId":{"description":"External id of the shop__expense row spawned as a branch write-off when `payerBranchSlug` was set. Null when the credit went to the organisation default (no branch attribution) or when the spawn failed (the failure is logged; the credit still applies).","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","spawnedWriteoffExternalId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"spawnedWriteoffExternalId":{"description":"External id of the shop__expense row spawned as a branch write-off when `payerBranchSlug` was set. Null when the credit went to the organisation default (no branch attribution) or when the spawn failed (the failure is logged; the credit still applies).","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","spawnedWriteoffExternalId"]}}}}},"operationId":"postBffContact-creditCreate","tags":["Contact Credit"],"summary":"Create credit transaction","description":"Adds a credit transaction to a contact. Optionally tag it with a per-organisation credit reason via `reasonExternalId`, and optionally attribute the internal cost to a branch via `payerBranchSlug` so the credit shows up in that branch's payer-credit ledger in addition to the customer history.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","amount","useExpiration"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"amount":{"description":"Credit amount to add (positive or negative).","examples":[100,-50],"type":"number"},"amountMoney":{"description":"Value in default currency. If omitted, defaults to same as amount (1:1).","examples":[90,-45],"type":"number"},"description":{"description":"Optional free-form note for the transaction.","type":"string"},"useExpiration":{"description":"Whether the credit has an expiration date.","type":"boolean"},"expirationDate":{"description":"Expiration date for the credit (ISO format).","examples":["2026-12-31"],"type":"string"},"reasonExternalId":{"description":"External ID of a configured credit reason (16 chars). Optional label tagging the transaction.","examples":["rsn1234567890abc"],"type":"string"},"payerBranchSlug":{"description":"Slug of the branch that internally bears the cost of this credit. Omit / empty = the organisation absorbs it (default).","examples":["gymroom-plzen"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","amount","useExpiration"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"amount":{"description":"Credit amount to add (positive or negative).","examples":[100,-50],"type":"number"},"amountMoney":{"description":"Value in default currency. If omitted, defaults to same as amount (1:1).","examples":[90,-45],"type":"number"},"description":{"description":"Optional free-form note for the transaction.","type":"string"},"useExpiration":{"description":"Whether the credit has an expiration date.","type":"boolean"},"expirationDate":{"description":"Expiration date for the credit (ISO format).","examples":["2026-12-31"],"type":"string"},"reasonExternalId":{"description":"External ID of a configured credit reason (16 chars). Optional label tagging the transaction.","examples":["rsn1234567890abc"],"type":"string"},"payerBranchSlug":{"description":"Slug of the branch that internally bears the cost of this credit. Omit / empty = the organisation absorbs it (default).","examples":["gymroom-plzen"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","amount","useExpiration"],"properties":{"customerId":{"description":"Contact external ID.","type":"string"},"amount":{"description":"Credit amount to add (positive or negative).","examples":[100,-50],"type":"number"},"amountMoney":{"description":"Value in default currency. If omitted, defaults to same as amount (1:1).","examples":[90,-45],"type":"number"},"description":{"description":"Optional free-form note for the transaction.","type":"string"},"useExpiration":{"description":"Whether the credit has an expiration date.","type":"boolean"},"expirationDate":{"description":"Expiration date for the credit (ISO format).","examples":["2026-12-31"],"type":"string"},"reasonExternalId":{"description":"External ID of a configured credit reason (16 chars). Optional label tagging the transaction.","examples":["rsn1234567890abc"],"type":"string"},"payerBranchSlug":{"description":"Slug of the branch that internally bears the cost of this credit. Omit / empty = the organisation absorbs it (default).","examples":["gymroom-plzen"],"type":"string"}}}}}}}},"/bff/contact-credit/reason/list":{"get":{"parameters":[{"description":"Page number (1-based).","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Items per page (default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffContact-creditReasonList","tags":["Contact Credit"],"summary":"List credit reasons","description":"Paginated list of configured credit reasons for the organisation.","responses":{"200":{}}}},"/bff/contact-credit/reason/list-selectbox":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","code","name","defaultAmount"],"properties":{"externalId":{"description":"Reason external ID (16 chars).","type":"string"},"code":{"description":"Reason code.","type":"string"},"name":{"description":"Display name.","type":"string"},"description":{"description":"Internal note shown in admin to clarify when this reason should be used.","type":"string"},"defaultAmount":{"description":"Preset credit amount.","type":"number"},"defaultAmountMoney":{"description":"Preset monetary value in the organisation default currency. Omitted when not configured — clients should fall back to `defaultAmount` (1:1).","type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","code","name","defaultAmount"],"properties":{"externalId":{"description":"Reason external ID (16 chars).","type":"string"},"code":{"description":"Reason code.","type":"string"},"name":{"description":"Display name.","type":"string"},"description":{"description":"Internal note shown in admin to clarify when this reason should be used.","type":"string"},"defaultAmount":{"description":"Preset credit amount.","type":"number"},"defaultAmountMoney":{"description":"Preset monetary value in the organisation default currency. Omitted when not configured — clients should fall back to `defaultAmount` (1:1).","type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","code","name","defaultAmount"],"properties":{"externalId":{"description":"Reason external ID (16 chars).","type":"string"},"code":{"description":"Reason code.","type":"string"},"name":{"description":"Display name.","type":"string"},"description":{"description":"Internal note shown in admin to clarify when this reason should be used.","type":"string"},"defaultAmount":{"description":"Preset credit amount.","type":"number"},"defaultAmountMoney":{"description":"Preset monetary value in the organisation default currency. Omitted when not configured — clients should fall back to `defaultAmount` (1:1).","type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffContact-creditReasonList-selectbox","tags":["Contact Credit"],"summary":"List credit reasons for selectbox","description":"Returns active, non-deleted credit reasons with default amounts so the admin UI can pre-fill the credit form when a reason is selected."}},"/bff/contact-credit/reason/detail":{"get":{"parameters":[{"description":"Credit reason code.","examples":["cleaning-complaint"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"operationId":"getBffContact-creditReasonDetail","tags":["Contact Credit"],"summary":"Get credit reason detail","description":"Returns full detail of a single credit reason by its code.","responses":{"200":{}}}},"/bff/contact-credit/reason/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"description":"Generated external ID (16 chars).","type":"string"},"code":{"description":"Final code assigned to the reason.","type":"string"}},"required":["success","externalId","code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"description":"Generated external ID (16 chars).","type":"string"},"code":{"description":"Final code assigned to the reason.","type":"string"}},"required":["success","externalId","code"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"externalId":{"description":"Generated external ID (16 chars).","type":"string"},"code":{"description":"Final code assigned to the reason.","type":"string"}},"required":["success","externalId","code"]}}}}},"operationId":"postBffContact-creditReasonCreate","tags":["Contact Credit"],"summary":"Create credit reason","description":"Creates a new credit reason for the organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","defaultAmount"],"properties":{"name":{"description":"Display name.","examples":["Reklamace úklidu"],"type":"string"},"code":{"description":"Unique code (slug-like). Auto-generated from name when omitted.","examples":["cleaning-complaint"],"type":"string"},"description":{"description":"Internal description shown in admin.","type":"string"},"defaultAmount":{"description":"Default credit amount when this reason is selected.","examples":[50],"type":"number"},"defaultAmountMoney":{"description":"Default monetary value in the organisation default currency. Omit to inherit from `defaultAmount` (1:1).","examples":[50],"type":"number"},"active":{"description":"Whether the reason is selectable. Defaults to true.","type":"boolean"},"isCustomerCare":{"description":"Marks the reason as a customer-care event (reklamace / kompenzace / omluva). Credits linked to reasons with this flag contribute to the per-contact customer-care count that penalises repeat-recipients in the CRM score. Defaults to false.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","defaultAmount"],"properties":{"name":{"description":"Display name.","examples":["Reklamace úklidu"],"type":"string"},"code":{"description":"Unique code (slug-like). Auto-generated from name when omitted.","examples":["cleaning-complaint"],"type":"string"},"description":{"description":"Internal description shown in admin.","type":"string"},"defaultAmount":{"description":"Default credit amount when this reason is selected.","examples":[50],"type":"number"},"defaultAmountMoney":{"description":"Default monetary value in the organisation default currency. Omit to inherit from `defaultAmount` (1:1).","examples":[50],"type":"number"},"active":{"description":"Whether the reason is selectable. Defaults to true.","type":"boolean"},"isCustomerCare":{"description":"Marks the reason as a customer-care event (reklamace / kompenzace / omluva). Credits linked to reasons with this flag contribute to the per-contact customer-care count that penalises repeat-recipients in the CRM score. Defaults to false.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["name","defaultAmount"],"properties":{"name":{"description":"Display name.","examples":["Reklamace úklidu"],"type":"string"},"code":{"description":"Unique code (slug-like). Auto-generated from name when omitted.","examples":["cleaning-complaint"],"type":"string"},"description":{"description":"Internal description shown in admin.","type":"string"},"defaultAmount":{"description":"Default credit amount when this reason is selected.","examples":[50],"type":"number"},"defaultAmountMoney":{"description":"Default monetary value in the organisation default currency. Omit to inherit from `defaultAmount` (1:1).","examples":[50],"type":"number"},"active":{"description":"Whether the reason is selectable. Defaults to true.","type":"boolean"},"isCustomerCare":{"description":"Marks the reason as a customer-care event (reklamace / kompenzace / omluva). Credits linked to reasons with this flag contribute to the per-contact customer-care count that penalises repeat-recipients in the CRM score. Defaults to false.","type":"boolean"}}}}}}}},"/bff/contact-credit/reason/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContact-creditReasonUpdate","tags":["Contact Credit"],"summary":"Update credit reason","description":"Patches an existing credit reason. Only provided fields are changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code identifying the reason to update.","type":"string"},"name":{"description":"New display name.","type":"string"},"description":{"description":"New description.","type":"string"},"defaultAmount":{"description":"New default credit amount.","type":"number"},"defaultAmountMoney":{"nullable":true,"anyOf":[{"description":"New default monetary value. Pass null to clear and inherit from `defaultAmount`.","type":"number"},{"type":"null"}]},"position":{"description":"New ordering position.","type":"number"},"active":{"description":"Whether the reason is active.","type":"boolean"},"isCustomerCare":{"description":"Toggle the customer-care flag on this reason.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code identifying the reason to update.","type":"string"},"name":{"description":"New display name.","type":"string"},"description":{"description":"New description.","type":"string"},"defaultAmount":{"description":"New default credit amount.","type":"number"},"defaultAmountMoney":{"nullable":true,"anyOf":[{"description":"New default monetary value. Pass null to clear and inherit from `defaultAmount`.","type":"number"},{"type":"null"}]},"position":{"description":"New ordering position.","type":"number"},"active":{"description":"Whether the reason is active.","type":"boolean"},"isCustomerCare":{"description":"Toggle the customer-care flag on this reason.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code identifying the reason to update.","type":"string"},"name":{"description":"New display name.","type":"string"},"description":{"description":"New description.","type":"string"},"defaultAmount":{"description":"New default credit amount.","type":"number"},"defaultAmountMoney":{"nullable":true,"anyOf":[{"description":"New default monetary value. Pass null to clear and inherit from `defaultAmount`.","type":"number"},{"type":"null"}]},"position":{"description":"New ordering position.","type":"number"},"active":{"description":"Whether the reason is active.","type":"boolean"},"isCustomerCare":{"description":"Toggle the customer-care flag on this reason.","type":"boolean"}}}}}}}},"/bff/contact-credit/reason/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContact-creditReasonDelete","tags":["Contact Credit"],"summary":"Soft-delete credit reason","description":"Marks a credit reason as deleted. Existing transaction links remain valid; the reason no longer appears in selectbox or list endpoints.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code identifying the reason to soft-delete.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code identifying the reason to soft-delete.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code identifying the reason to soft-delete.","type":"string"}}}}}}}},"/bff/contact-credit/credit-by-payer-branch":{"get":{"parameters":[{"description":"Branch slug.","examples":["gymroom-plzen"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"branchId":{"description":"Branch internal id as string.","type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"totalAmount":{"description":"Signed sum of credit counts.","type":"number"},"totalAmountMoney":{"description":"Signed sum of monetary values in the org currency.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","amount","amountMoney","customer","insertedDate"],"properties":{"id":{"description":"Credit transaction external ID.","type":"string"},"amount":{"type":"number"},"amountMoney":{"type":"number"},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"Customer external ID (CuRefNo).","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"}}},"reason":{"type":"object","required":["externalId","code","name"],"properties":{"externalId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}}},"description":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["branchId","branchSlug","branchName","currency","totalAmount","totalAmountMoney","items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"branchId":{"description":"Branch internal id as string.","type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"totalAmount":{"description":"Signed sum of credit counts.","type":"number"},"totalAmountMoney":{"description":"Signed sum of monetary values in the org currency.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","amount","amountMoney","customer","insertedDate"],"properties":{"id":{"description":"Credit transaction external ID.","type":"string"},"amount":{"type":"number"},"amountMoney":{"type":"number"},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"Customer external ID (CuRefNo).","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"}}},"reason":{"type":"object","required":["externalId","code","name"],"properties":{"externalId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}}},"description":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["branchId","branchSlug","branchName","currency","totalAmount","totalAmountMoney","items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"branchId":{"description":"Branch internal id as string.","type":"string"},"branchSlug":{"type":"string"},"branchName":{"type":"string"},"currency":{"description":"ISO 4217 code of the organisation default currency.","type":"string"},"totalAmount":{"description":"Signed sum of credit counts.","type":"number"},"totalAmountMoney":{"description":"Signed sum of monetary values in the org currency.","type":"number"},"items":{"type":"array","items":{"type":"object","required":["id","amount","amountMoney","customer","insertedDate"],"properties":{"id":{"description":"Credit transaction external ID.","type":"string"},"amount":{"type":"number"},"amountMoney":{"type":"number"},"customer":{"type":"object","required":["contactId"],"properties":{"contactId":{"description":"Customer external ID (CuRefNo).","type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"companyName":{"type":"string"}}},"order":{"type":"object","required":["orderNumber","hash"],"properties":{"orderNumber":{"type":"string"},"hash":{"type":"string"}}},"reason":{"type":"object","required":["externalId","code","name"],"properties":{"externalId":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"}}},"description":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["branchId","branchSlug","branchName","currency","totalAmount","totalAmountMoney","items","itemCount"]}}}}},"operationId":"getBffContact-creditCredit-by-payer-branch","tags":["Contact Credit"],"summary":"List credit transactions paid by branch","description":"Returns credit transactions whose `payer_branch_id` resolves to the requested branch — i.e. credits the operator attributed to this branch as the internal payer. Ordered by inserted date desc. `totalAmount` is the signed sum of credit counts; `totalAmountMoney` is the signed sum in the organisation default currency."}},"/bff/contact-segment/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"schema":{"type":"string"},"in":"query","name":"orderBy","required":false}],"operationId":"getBffContact-segmentList","tags":["Contact"],"summary":"List contact segments","description":"Returns the list of dynamic contact segments owned by the current organisation.","responses":{"200":{}}}},"/bff/contact-segment/fields":{"get":{"operationId":"getBffContact-segmentFields","tags":["Contact"],"summary":"List available segment filter fields","description":"Returns the catalogue of filter fields (and the operators each supports) so the admin UI can render the segment editor.","responses":{"200":{}}}},"/bff/contact-segment/detail":{"get":{"parameters":[{"description":"Segment external ID.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffContact-segmentDetail","tags":["Contact"],"summary":"Get contact segment detail","responses":{"200":{}}}},"/bff/contact-segment/create":{"post":{"parameters":[],"operationId":"postBffContact-segmentCreate","tags":["Contact"],"summary":"Create a new contact segment","description":"Creates an empty contact segment with the supplied name. The filter definition starts empty and can be edited via /update.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"description":"Segment display name.","type":"string"},"description":{"maxLength":512,"description":"Optional description.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"description":"Segment display name.","type":"string"},"description":{"maxLength":512,"description":"Optional description.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"description":"Segment display name.","type":"string"},"description":{"maxLength":512,"description":"Optional description.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/contact-segment/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContact-segmentUpdate","tags":["Contact"],"summary":"Update a contact segment","description":"Partial update — only provided fields change. Editing the definition is validated against the field registry.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Segment external ID.","type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"anyOf":[{"maxLength":512,"type":"string"},{"type":"null"}]},"definition":{"$id":"T1","anyOf":[{"type":"object","required":["type","operator","children"],"properties":{"type":{"const":"group","type":"string"},"operator":{"anyOf":[{"const":"AND","type":"string"},{"const":"OR","type":"string"}]},"children":{"type":"array","items":{"$ref":"T1"}}}},{"type":"object","required":["type","field","operator"],"properties":{"type":{"const":"condition","type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{},"value2":{}}}]},"isActive":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Segment external ID.","type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"anyOf":[{"maxLength":512,"type":"string"},{"type":"null"}]},"definition":{"$id":"T1","anyOf":[{"type":"object","required":["type","operator","children"],"properties":{"type":{"const":"group","type":"string"},"operator":{"anyOf":[{"const":"AND","type":"string"},{"const":"OR","type":"string"}]},"children":{"type":"array","items":{"$ref":"T1"}}}},{"type":"object","required":["type","field","operator"],"properties":{"type":{"const":"condition","type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{},"value2":{}}}]},"isActive":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Segment external ID.","type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"anyOf":[{"maxLength":512,"type":"string"},{"type":"null"}]},"definition":{"$id":"T1","anyOf":[{"type":"object","required":["type","operator","children"],"properties":{"type":{"const":"group","type":"string"},"operator":{"anyOf":[{"const":"AND","type":"string"},{"const":"OR","type":"string"}]},"children":{"type":"array","items":{"$ref":"T1"}}}},{"type":"object","required":["type","field","operator"],"properties":{"type":{"const":"condition","type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{},"value2":{}}}]},"isActive":{"type":"boolean"}}}}}}}},"/bff/contact-segment/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContact-segmentDelete","tags":["Contact"],"summary":"Delete a contact segment (soft delete)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}}},"/bff/contact-segment/contacts":{"get":{"parameters":[{"description":"Segment external ID.","schema":{"type":"string"},"in":"query","name":"id","required":true},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"schema":{"type":"string"},"in":"query","name":"orderBy","required":false}],"operationId":"getBffContact-segmentContacts","tags":["Contact"],"summary":"List contacts that match a segment","description":"Real-time list — the segment definition is translated to SQL on every request, so any edit is reflected immediately without precomputed membership.","responses":{"200":{}}}},"/bff/contact-segment/count":{"get":{"parameters":[{"description":"Segment external ID.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"text/plain":{"schema":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}}}}},"operationId":"getBffContact-segmentCount","tags":["Contact"],"summary":"Count contacts matching a segment","description":"Returns just the COUNT(*) of contacts currently matching the segment definition, excluding banned and soft-deleted contacts. No row data, no badges. Cheap enough to call from a banner / preview UI."}},"/bff/contact-segment/preview":{"post":{"parameters":[],"operationId":"postBffContact-segmentPreview","tags":["Contact"],"summary":"Preview an unsaved segment definition","description":"Translates the definition to SQL and returns the first 50 matching contacts without persisting anything.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["definition"],"properties":{"definition":{"$id":"T1","anyOf":[{"type":"object","required":["type","operator","children"],"properties":{"type":{"const":"group","type":"string"},"operator":{"anyOf":[{"const":"AND","type":"string"},{"const":"OR","type":"string"}]},"children":{"type":"array","items":{"$ref":"T1"}}}},{"type":"object","required":["type","field","operator"],"properties":{"type":{"const":"condition","type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{},"value2":{}}}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["definition"],"properties":{"definition":{"$id":"T1","anyOf":[{"type":"object","required":["type","operator","children"],"properties":{"type":{"const":"group","type":"string"},"operator":{"anyOf":[{"const":"AND","type":"string"},{"const":"OR","type":"string"}]},"children":{"type":"array","items":{"$ref":"T1"}}}},{"type":"object","required":["type","field","operator"],"properties":{"type":{"const":"condition","type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{},"value2":{}}}]}}}},"text/plain":{"schema":{"type":"object","required":["definition"],"properties":{"definition":{"$id":"T1","anyOf":[{"type":"object","required":["type","operator","children"],"properties":{"type":{"const":"group","type":"string"},"operator":{"anyOf":[{"const":"AND","type":"string"},{"const":"OR","type":"string"}]},"children":{"type":"array","items":{"$ref":"T1"}}}},{"type":"object","required":["type","field","operator"],"properties":{"type":{"const":"condition","type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{},"value2":{}}}]}}}}}},"responses":{"200":{}}}},"/bff/contact-segment/contacts-export":{"get":{"parameters":[{"description":"Segment external ID.","schema":{"type":"string"},"in":"query","name":"id","required":true},{"schema":{"type":"string"},"in":"query","name":"orderBy","required":false}],"operationId":"getBffContact-segmentContacts-export","tags":["Contact"],"summary":"Export all contacts matching a segment","description":"Returns every contact that currently matches the segment definition (up to a hard cap of 10000 rows), without pagination — meant to feed a client-side CSV/JSON download.","responses":{"200":{}}}},"/bff/contact-segment/options":{"get":{"parameters":[{"description":"One of: orderGroup, product, productCategory.","schema":{"type":"string"},"in":"query","name":"refType","required":true},{"description":"Free-text search query.","schema":{"type":"string"},"in":"query","name":"q","required":false},{"description":"Comma-separated list of codes to resolve to {value,label} pairs (used to render existing selections without an extra round-trip per chip).","schema":{"type":"string"},"in":"query","name":"codes","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["value","label"],"properties":{"value":{"type":"string"},"label":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["value","label"],"properties":{"value":{"type":"string"},"label":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["value","label"],"properties":{"value":{"type":"string"},"label":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffContact-segmentOptions","tags":["Contact"],"summary":"Autocomplete options for segment entity-ref fields","description":"Returns {value,label} pairs scoped to the caller organisation. value = opaque per-organisation code (orderGroup.code / product.code / productCategory.code); internal numeric IDs are never exposed. Used by the admin segment editor to populate autocomplete pickers and to render chip labels for already-selected codes."}},"/bff/currency/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"All currencies, org default first, then alphabetical.","type":"array","items":{"type":"object","required":["code","name","symbol","decimals","numericCode","rateLock","rate","rateDate","hops"],"properties":{"code":{"description":"ISO 4217 alphabetic code.","examples":["EUR"],"type":"string"},"name":{"nullable":true,"anyOf":[{"description":"English display name.","examples":["Euro"],"type":"string"},{"type":"null"}]},"symbol":{"description":"Native symbol or ISO code as fallback.","examples":["€","Kč"],"type":"string"},"decimals":{"description":"ISO 4217 fractional digits (JPY/HUF/KRW=0, BHD=3, others 2).","examples":[2,0],"type":"number"},"numericCode":{"nullable":true,"anyOf":[{"description":"ISO 4217 numeric code (3 chars), null if unknown.","examples":["978"],"type":"string"},{"type":"null"}]},"rateLock":{"description":"When true, the daily multi-source sync skips this currency on either side of the pair (manual override wins).","default":false,"type":"boolean"},"rate":{"nullable":true,"anyOf":[{"description":"Latest available rate: how many units of the org default currency 1 unit of `code` is worth. Null when no rate is reachable in the graph within the lookback window.","examples":[24.355,1,null],"type":"number"},{"type":"null"}]},"rateDate":{"nullable":true,"anyOf":[{"description":"YYYY-MM-DD of the oldest fixing in the resolution path. Null when `rate` is null.","examples":["2026-04-28"],"type":"string"},{"type":"null"}]},"hops":{"nullable":true,"anyOf":[{"description":"Number of pivot hops to reach the rate (0 = direct quote / identity, 1+ = via cross-rate path).","examples":[0,1,2],"type":"number"},{"type":"null"}]}}}},"itemCount":{"examples":[158],"type":"number"},"defaultCurrencyCode":{"description":"ISO code of the organisation default currency.","examples":["CZK"],"type":"string"}},"required":["items","itemCount","defaultCurrencyCode"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"All currencies, org default first, then alphabetical.","type":"array","items":{"type":"object","required":["code","name","symbol","decimals","numericCode","rateLock","rate","rateDate","hops"],"properties":{"code":{"description":"ISO 4217 alphabetic code.","examples":["EUR"],"type":"string"},"name":{"nullable":true,"anyOf":[{"description":"English display name.","examples":["Euro"],"type":"string"},{"type":"null"}]},"symbol":{"description":"Native symbol or ISO code as fallback.","examples":["€","Kč"],"type":"string"},"decimals":{"description":"ISO 4217 fractional digits (JPY/HUF/KRW=0, BHD=3, others 2).","examples":[2,0],"type":"number"},"numericCode":{"nullable":true,"anyOf":[{"description":"ISO 4217 numeric code (3 chars), null if unknown.","examples":["978"],"type":"string"},{"type":"null"}]},"rateLock":{"description":"When true, the daily multi-source sync skips this currency on either side of the pair (manual override wins).","default":false,"type":"boolean"},"rate":{"nullable":true,"anyOf":[{"description":"Latest available rate: how many units of the org default currency 1 unit of `code` is worth. Null when no rate is reachable in the graph within the lookback window.","examples":[24.355,1,null],"type":"number"},{"type":"null"}]},"rateDate":{"nullable":true,"anyOf":[{"description":"YYYY-MM-DD of the oldest fixing in the resolution path. Null when `rate` is null.","examples":["2026-04-28"],"type":"string"},{"type":"null"}]},"hops":{"nullable":true,"anyOf":[{"description":"Number of pivot hops to reach the rate (0 = direct quote / identity, 1+ = via cross-rate path).","examples":[0,1,2],"type":"number"},{"type":"null"}]}}}},"itemCount":{"examples":[158],"type":"number"},"defaultCurrencyCode":{"description":"ISO code of the organisation default currency.","examples":["CZK"],"type":"string"}},"required":["items","itemCount","defaultCurrencyCode"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"All currencies, org default first, then alphabetical.","type":"array","items":{"type":"object","required":["code","name","symbol","decimals","numericCode","rateLock","rate","rateDate","hops"],"properties":{"code":{"description":"ISO 4217 alphabetic code.","examples":["EUR"],"type":"string"},"name":{"nullable":true,"anyOf":[{"description":"English display name.","examples":["Euro"],"type":"string"},{"type":"null"}]},"symbol":{"description":"Native symbol or ISO code as fallback.","examples":["€","Kč"],"type":"string"},"decimals":{"description":"ISO 4217 fractional digits (JPY/HUF/KRW=0, BHD=3, others 2).","examples":[2,0],"type":"number"},"numericCode":{"nullable":true,"anyOf":[{"description":"ISO 4217 numeric code (3 chars), null if unknown.","examples":["978"],"type":"string"},{"type":"null"}]},"rateLock":{"description":"When true, the daily multi-source sync skips this currency on either side of the pair (manual override wins).","default":false,"type":"boolean"},"rate":{"nullable":true,"anyOf":[{"description":"Latest available rate: how many units of the org default currency 1 unit of `code` is worth. Null when no rate is reachable in the graph within the lookback window.","examples":[24.355,1,null],"type":"number"},{"type":"null"}]},"rateDate":{"nullable":true,"anyOf":[{"description":"YYYY-MM-DD of the oldest fixing in the resolution path. Null when `rate` is null.","examples":["2026-04-28"],"type":"string"},{"type":"null"}]},"hops":{"nullable":true,"anyOf":[{"description":"Number of pivot hops to reach the rate (0 = direct quote / identity, 1+ = via cross-rate path).","examples":[0,1,2],"type":"number"},{"type":"null"}]}}}},"itemCount":{"examples":[158],"type":"number"},"defaultCurrencyCode":{"description":"ISO code of the organisation default currency.","examples":["CZK"],"type":"string"}},"required":["items","itemCount","defaultCurrencyCode"]}}}}},"operationId":"getBffCurrencyList","tags":["Currency"],"summary":"List all currencies (with latest rate against org default)","description":"Returns the full currency master with metadata (name, symbol, decimals, ISO 4217 numeric code, rate-lock flag) plus the latest rate against the organisation default currency: `rate` (units of base per 1 unit of code), `rateDate` (the oldest fixing in the resolution path), and `hops` (0 = direct quote / identity, 1+ = via pivot). Sort: org default first, then alphabetical by ISO code."}},"/bff/currency/rate-sheet":{"get":{"parameters":[{"description":"Target date in YYYY-MM-DD. Defaults to today. The actual fixing returned (`fixingDate`) may be earlier when the requested date is a weekend, holiday, or before the daily CNB publication.","examples":["2026-04-27"],"schema":{"type":"string"},"in":"query","name":"date","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"baseCode":{"description":"Base (org default) currency code.","examples":["EUR"],"type":"string"},"baseName":{"nullable":true,"anyOf":[{"examples":["Euro"],"type":"string"},{"type":"null"}]},"baseSymbol":{"examples":["€"],"type":"string"},"fixingDate":{"description":"Latest fixing date represented in the sheet.","examples":["2026-04-27"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["code","name","symbol","decimals","rate","hops","rateDate"],"properties":{"code":{"examples":["USD"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["US Dollar"],"type":"string"},{"type":"null"}]},"symbol":{"examples":["$"],"type":"string"},"decimals":{"examples":[2],"type":"number"},"rate":{"description":"How many units of the base currency 1 unit of `code` is worth on the fixing date.","examples":[0.85],"type":"number"},"hops":{"description":"Number of pivot currencies traversed to reach `code` (0 = direct quote, 1+ = via cross-rate path).","examples":[0,1,2],"type":"number"},"rateDate":{"description":"YYYY-MM-DD of the oldest fixing in the resolution path (the rate is only as fresh as this).","examples":["2026-04-27"],"type":"string"}}}},"itemCount":{"examples":[120],"type":"number"}},"required":["baseCode","baseName","baseSymbol","fixingDate","items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"baseCode":{"description":"Base (org default) currency code.","examples":["EUR"],"type":"string"},"baseName":{"nullable":true,"anyOf":[{"examples":["Euro"],"type":"string"},{"type":"null"}]},"baseSymbol":{"examples":["€"],"type":"string"},"fixingDate":{"description":"Latest fixing date represented in the sheet.","examples":["2026-04-27"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["code","name","symbol","decimals","rate","hops","rateDate"],"properties":{"code":{"examples":["USD"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["US Dollar"],"type":"string"},{"type":"null"}]},"symbol":{"examples":["$"],"type":"string"},"decimals":{"examples":[2],"type":"number"},"rate":{"description":"How many units of the base currency 1 unit of `code` is worth on the fixing date.","examples":[0.85],"type":"number"},"hops":{"description":"Number of pivot currencies traversed to reach `code` (0 = direct quote, 1+ = via cross-rate path).","examples":[0,1,2],"type":"number"},"rateDate":{"description":"YYYY-MM-DD of the oldest fixing in the resolution path (the rate is only as fresh as this).","examples":["2026-04-27"],"type":"string"}}}},"itemCount":{"examples":[120],"type":"number"}},"required":["baseCode","baseName","baseSymbol","fixingDate","items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"baseCode":{"description":"Base (org default) currency code.","examples":["EUR"],"type":"string"},"baseName":{"nullable":true,"anyOf":[{"examples":["Euro"],"type":"string"},{"type":"null"}]},"baseSymbol":{"examples":["€"],"type":"string"},"fixingDate":{"description":"Latest fixing date represented in the sheet.","examples":["2026-04-27"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["code","name","symbol","decimals","rate","hops","rateDate"],"properties":{"code":{"examples":["USD"],"type":"string"},"name":{"nullable":true,"anyOf":[{"examples":["US Dollar"],"type":"string"},{"type":"null"}]},"symbol":{"examples":["$"],"type":"string"},"decimals":{"examples":[2],"type":"number"},"rate":{"description":"How many units of the base currency 1 unit of `code` is worth on the fixing date.","examples":[0.85],"type":"number"},"hops":{"description":"Number of pivot currencies traversed to reach `code` (0 = direct quote, 1+ = via cross-rate path).","examples":[0,1,2],"type":"number"},"rateDate":{"description":"YYYY-MM-DD of the oldest fixing in the resolution path (the rate is only as fresh as this).","examples":["2026-04-27"],"type":"string"}}}},"itemCount":{"examples":[120],"type":"number"}},"required":["baseCode","baseName","baseSymbol","fixingDate","items","itemCount"]}}}}},"operationId":"getBffCurrencyRate-sheet","tags":["Currency"],"summary":"Get rate sheet (in org default currency)","description":"Daily rate sheet re-expressed in the organisation default currency. Combines fixings from CNB, ECB, and Fawaz Ahmed Currency API; pairs without a direct quote are resolved via cross-rate paths through pivot currencies (CZK / EUR / USD). Each `rate` says how many units of the base currency one unit of `code` is worth."}},"/bff/currency/rate-history":{"get":{"parameters":[{"description":"ISO 4217 code to chart.","examples":["USD"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Window length in calendar days (default 30, max 1825 = 5 years).","examples":["30","90","365"],"schema":{"type":"string"},"in":"query","name":"days","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"examples":["USD"],"type":"string"},"baseCode":{"examples":["EUR"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["date","rate"],"properties":{"date":{"description":"YYYY-MM-DD of the CNB fixing.","examples":["2026-04-27"],"type":"string"},"rate":{"description":"Units of base currency per 1 unit of code on this date.","examples":[24.355],"type":"number"}}}},"itemCount":{"examples":[22],"type":"number"}},"required":["code","baseCode","items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"code":{"examples":["USD"],"type":"string"},"baseCode":{"examples":["EUR"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["date","rate"],"properties":{"date":{"description":"YYYY-MM-DD of the CNB fixing.","examples":["2026-04-27"],"type":"string"},"rate":{"description":"Units of base currency per 1 unit of code on this date.","examples":[24.355],"type":"number"}}}},"itemCount":{"examples":[22],"type":"number"}},"required":["code","baseCode","items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"code":{"examples":["USD"],"type":"string"},"baseCode":{"examples":["EUR"],"type":"string"},"items":{"type":"array","items":{"type":"object","required":["date","rate"],"properties":{"date":{"description":"YYYY-MM-DD of the CNB fixing.","examples":["2026-04-27"],"type":"string"},"rate":{"description":"Units of base currency per 1 unit of code on this date.","examples":[24.355],"type":"number"}}}},"itemCount":{"examples":[22],"type":"number"}},"required":["code","baseCode","items","itemCount"]}}}}},"operationId":"getBffCurrencyRate-history","tags":["Currency"],"summary":"Get rate history (in org default currency)","description":"Daily middle-rate time series for a single currency over the last N days, expressed in the organisation default currency. Each point is resolved through the cross-rate graph, so currencies covered only by Fawaz (e.g., AED, SAR, EGP) work too. Returns one point per business day."}},"/bff/currency/convert":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"description":"Converted amount, rounded to target decimals.","examples":[2435.5],"type":"number"},"rate":{"description":"Effective from→to rate.","examples":[24.355],"type":"number"},"rateDate":{"description":"YYYY-MM-DD of the oldest fixing in the resolution path (rate is only as fresh as this).","examples":["2026-04-27"],"type":"string"}},"required":["amount","rate","rateDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"amount":{"description":"Converted amount, rounded to target decimals.","examples":[2435.5],"type":"number"},"rate":{"description":"Effective from→to rate.","examples":[24.355],"type":"number"},"rateDate":{"description":"YYYY-MM-DD of the oldest fixing in the resolution path (rate is only as fresh as this).","examples":["2026-04-27"],"type":"string"}},"required":["amount","rate","rateDate"]}},"text/plain":{"schema":{"type":"object","properties":{"amount":{"description":"Converted amount, rounded to target decimals.","examples":[2435.5],"type":"number"},"rate":{"description":"Effective from→to rate.","examples":[24.355],"type":"number"},"rateDate":{"description":"YYYY-MM-DD of the oldest fixing in the resolution path (rate is only as fresh as this).","examples":["2026-04-27"],"type":"string"}},"required":["amount","rate","rateDate"]}}}}},"operationId":"postBffCurrencyConvert","tags":["Currency"],"summary":"Convert between currencies","description":"Utility for forms: converts `amount` from `from` to `to` using the cross-rate resolver (CNB / ECB / Fawaz combined; pivots through CZK / EUR / USD when no direct quote exists). Result is rounded to the target currency ISO 4217 decimals.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["amount","from","to"],"properties":{"amount":{"description":"Amount in the source currency.","examples":[100],"type":"number"},"from":{"description":"Source ISO 4217 code.","examples":["EUR"],"type":"string"},"to":{"description":"Target ISO 4217 code.","examples":["CZK"],"type":"string"},"date":{"description":"Conversion date in YYYY-MM-DD. Defaults to today. Falls back to the most recent earlier fixing.","examples":["2026-04-27"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["amount","from","to"],"properties":{"amount":{"description":"Amount in the source currency.","examples":[100],"type":"number"},"from":{"description":"Source ISO 4217 code.","examples":["EUR"],"type":"string"},"to":{"description":"Target ISO 4217 code.","examples":["CZK"],"type":"string"},"date":{"description":"Conversion date in YYYY-MM-DD. Defaults to today. Falls back to the most recent earlier fixing.","examples":["2026-04-27"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["amount","from","to"],"properties":{"amount":{"description":"Amount in the source currency.","examples":[100],"type":"number"},"from":{"description":"Source ISO 4217 code.","examples":["EUR"],"type":"string"},"to":{"description":"Target ISO 4217 code.","examples":["CZK"],"type":"string"},"date":{"description":"Conversion date in YYYY-MM-DD. Defaults to today. Falls back to the most recent earlier fixing.","examples":["2026-04-27"],"type":"string"}}}}}}}},"/bff/currency/eu-distance-sales":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"thresholdEur":{"examples":[10000],"type":"number"},"homeCountry":{"examples":["CZ"],"anyOf":[{"type":"string"},{"type":"null"}]},"vatPayer":{"type":"boolean"},"exceeded":{"description":"The current or the previous year is over the threshold.","type":"boolean"},"years":{"description":"Current year first, then the previous one.","type":"array","items":{"type":"object","required":["year","totalEur","status","projectedEur","countries"],"properties":{"year":{"examples":[2026],"type":"number"},"totalEur":{"type":"number"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"approaching","type":"string"},{"const":"exceeded","type":"string"}]},"projectedEur":{"description":"Current year at today's pace.","anyOf":[{"type":"number"},{"type":"null"}]},"countries":{"type":"array","items":{"type":"object","required":["country","orders","totalEur"],"properties":{"country":{"type":"string"},"orders":{"type":"number"},"totalEur":{"type":"number"}}}}}}},"b2bOrders":{"description":"EU orders left out as B2B (customer with a tax ID).","type":"number"},"unknownCountryOrders":{"description":"Orders without an address country.","type":"number"},"unconvertedMonths":{"description":"Months whose currency had no EUR rate (left out).","type":"number"}},"required":["thresholdEur","homeCountry","vatPayer","exceeded","years","b2bOrders","unknownCountryOrders","unconvertedMonths"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"thresholdEur":{"examples":[10000],"type":"number"},"homeCountry":{"examples":["CZ"],"anyOf":[{"type":"string"},{"type":"null"}]},"vatPayer":{"type":"boolean"},"exceeded":{"description":"The current or the previous year is over the threshold.","type":"boolean"},"years":{"description":"Current year first, then the previous one.","type":"array","items":{"type":"object","required":["year","totalEur","status","projectedEur","countries"],"properties":{"year":{"examples":[2026],"type":"number"},"totalEur":{"type":"number"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"approaching","type":"string"},{"const":"exceeded","type":"string"}]},"projectedEur":{"description":"Current year at today's pace.","anyOf":[{"type":"number"},{"type":"null"}]},"countries":{"type":"array","items":{"type":"object","required":["country","orders","totalEur"],"properties":{"country":{"type":"string"},"orders":{"type":"number"},"totalEur":{"type":"number"}}}}}}},"b2bOrders":{"description":"EU orders left out as B2B (customer with a tax ID).","type":"number"},"unknownCountryOrders":{"description":"Orders without an address country.","type":"number"},"unconvertedMonths":{"description":"Months whose currency had no EUR rate (left out).","type":"number"}},"required":["thresholdEur","homeCountry","vatPayer","exceeded","years","b2bOrders","unknownCountryOrders","unconvertedMonths"]}},"text/plain":{"schema":{"type":"object","properties":{"thresholdEur":{"examples":[10000],"type":"number"},"homeCountry":{"examples":["CZ"],"anyOf":[{"type":"string"},{"type":"null"}]},"vatPayer":{"type":"boolean"},"exceeded":{"description":"The current or the previous year is over the threshold.","type":"boolean"},"years":{"description":"Current year first, then the previous one.","type":"array","items":{"type":"object","required":["year","totalEur","status","projectedEur","countries"],"properties":{"year":{"examples":[2026],"type":"number"},"totalEur":{"type":"number"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"approaching","type":"string"},{"const":"exceeded","type":"string"}]},"projectedEur":{"description":"Current year at today's pace.","anyOf":[{"type":"number"},{"type":"null"}]},"countries":{"type":"array","items":{"type":"object","required":["country","orders","totalEur"],"properties":{"country":{"type":"string"},"orders":{"type":"number"},"totalEur":{"type":"number"}}}}}}},"b2bOrders":{"description":"EU orders left out as B2B (customer with a tax ID).","type":"number"},"unknownCountryOrders":{"description":"Orders without an address country.","type":"number"},"unconvertedMonths":{"description":"Months whose currency had no EUR rate (left out).","type":"number"}},"required":["thresholdEur","homeCountry","vatPayer","exceeded","years","b2bOrders","unknownCountryOrders","unconvertedMonths"]}}}}},"operationId":"getBffCurrencyEu-distance-sales","tags":["Currency"],"summary":"EU distance sales vs the 10 000 EUR threshold","description":"B2C goods shipped to other EU countries this and last calendar year, in EUR per country, against the EU-wide 10 000 EUR threshold above which VAT of the customer's country applies (OSS). Paid or finished orders; tickets, services and B2B customers (with a tax ID) are left out. Monitoring only."}},"/bff/currency/shop-settings":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["CZK"],"type":"string"},"driftThreshold":{"description":"Exchange rate drift threshold of manual prices in % (default 8).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","inUse","fixedRate","rounding","liveRate","liveRateDate"],"properties":{"code":{"examples":["EUR"],"type":"string"},"inUse":{"description":"The organisation sells in it: set up here, used by a manual product price, or by an order in 90 days.","type":"boolean"},"fixedRate":{"nullable":true,"anyOf":[{"description":"Units of default currency per 1 unit of code. Null = live daily rate.","examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"description":"Rounding step of converted prices incl. VAT.","examples":["0.1"],"type":"string"},"liveRate":{"nullable":true,"anyOf":[{"examples":[24.31],"type":"number"},{"type":"null"}]},"liveRateDate":{"nullable":true,"anyOf":[{"examples":["2026-11-10"],"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","driftThreshold","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["CZK"],"type":"string"},"driftThreshold":{"description":"Exchange rate drift threshold of manual prices in % (default 8).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","inUse","fixedRate","rounding","liveRate","liveRateDate"],"properties":{"code":{"examples":["EUR"],"type":"string"},"inUse":{"description":"The organisation sells in it: set up here, used by a manual product price, or by an order in 90 days.","type":"boolean"},"fixedRate":{"nullable":true,"anyOf":[{"description":"Units of default currency per 1 unit of code. Null = live daily rate.","examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"description":"Rounding step of converted prices incl. VAT.","examples":["0.1"],"type":"string"},"liveRate":{"nullable":true,"anyOf":[{"examples":[24.31],"type":"number"},{"type":"null"}]},"liveRateDate":{"nullable":true,"anyOf":[{"examples":["2026-11-10"],"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","driftThreshold","items"]}},"text/plain":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["CZK"],"type":"string"},"driftThreshold":{"description":"Exchange rate drift threshold of manual prices in % (default 8).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","inUse","fixedRate","rounding","liveRate","liveRateDate"],"properties":{"code":{"examples":["EUR"],"type":"string"},"inUse":{"description":"The organisation sells in it: set up here, used by a manual product price, or by an order in 90 days.","type":"boolean"},"fixedRate":{"nullable":true,"anyOf":[{"description":"Units of default currency per 1 unit of code. Null = live daily rate.","examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"description":"Rounding step of converted prices incl. VAT.","examples":["0.1"],"type":"string"},"liveRate":{"nullable":true,"anyOf":[{"examples":[24.31],"type":"number"},{"type":"null"}]},"liveRateDate":{"nullable":true,"anyOf":[{"examples":["2026-11-10"],"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","driftThreshold","items"]}}}}},"operationId":"getBffCurrencyShop-settings","tags":["Currency"],"summary":"Selling currencies: rate + rounding (BIZKIT-90)","description":"Currencies the public API can price products / carts / orders in besides the organisation default, with the fixed price-list rate (null = live daily rate), rounding step and today's live rate for reference."}},"/bff/currency/shop-settings-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["CZK"],"type":"string"},"driftThreshold":{"description":"Exchange rate drift threshold of manual prices in % (default 8).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","inUse","fixedRate","rounding","liveRate","liveRateDate"],"properties":{"code":{"examples":["EUR"],"type":"string"},"inUse":{"description":"The organisation sells in it: set up here, used by a manual product price, or by an order in 90 days.","type":"boolean"},"fixedRate":{"nullable":true,"anyOf":[{"description":"Units of default currency per 1 unit of code. Null = live daily rate.","examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"description":"Rounding step of converted prices incl. VAT.","examples":["0.1"],"type":"string"},"liveRate":{"nullable":true,"anyOf":[{"examples":[24.31],"type":"number"},{"type":"null"}]},"liveRateDate":{"nullable":true,"anyOf":[{"examples":["2026-11-10"],"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","driftThreshold","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["CZK"],"type":"string"},"driftThreshold":{"description":"Exchange rate drift threshold of manual prices in % (default 8).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","inUse","fixedRate","rounding","liveRate","liveRateDate"],"properties":{"code":{"examples":["EUR"],"type":"string"},"inUse":{"description":"The organisation sells in it: set up here, used by a manual product price, or by an order in 90 days.","type":"boolean"},"fixedRate":{"nullable":true,"anyOf":[{"description":"Units of default currency per 1 unit of code. Null = live daily rate.","examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"description":"Rounding step of converted prices incl. VAT.","examples":["0.1"],"type":"string"},"liveRate":{"nullable":true,"anyOf":[{"examples":[24.31],"type":"number"},{"type":"null"}]},"liveRateDate":{"nullable":true,"anyOf":[{"examples":["2026-11-10"],"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","driftThreshold","items"]}},"text/plain":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["CZK"],"type":"string"},"driftThreshold":{"description":"Exchange rate drift threshold of manual prices in % (default 8).","examples":[8],"type":"number"},"items":{"type":"array","items":{"type":"object","required":["code","inUse","fixedRate","rounding","liveRate","liveRateDate"],"properties":{"code":{"examples":["EUR"],"type":"string"},"inUse":{"description":"The organisation sells in it: set up here, used by a manual product price, or by an order in 90 days.","type":"boolean"},"fixedRate":{"nullable":true,"anyOf":[{"description":"Units of default currency per 1 unit of code. Null = live daily rate.","examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"description":"Rounding step of converted prices incl. VAT.","examples":["0.1"],"type":"string"},"liveRate":{"nullable":true,"anyOf":[{"examples":[24.31],"type":"number"},{"type":"null"}]},"liveRateDate":{"nullable":true,"anyOf":[{"examples":["2026-11-10"],"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","driftThreshold","items"]}}}}},"operationId":"postBffCurrencyShop-settings-update","tags":["Currency"],"summary":"Save selling currency rate + rounding (BIZKIT-90)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["code","fixedRate","rounding"],"properties":{"code":{"examples":["EUR"],"type":"string"},"fixedRate":{"nullable":true,"anyOf":[{"minimum":0,"examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"examples":["0.1"],"type":"string"}}}},"driftThreshold":{"anyOf":[{"minimum":1,"maximum":100,"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["code","fixedRate","rounding"],"properties":{"code":{"examples":["EUR"],"type":"string"},"fixedRate":{"nullable":true,"anyOf":[{"minimum":0,"examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"examples":["0.1"],"type":"string"}}}},"driftThreshold":{"anyOf":[{"minimum":1,"maximum":100,"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["code","fixedRate","rounding"],"properties":{"code":{"examples":["EUR"],"type":"string"},"fixedRate":{"nullable":true,"anyOf":[{"minimum":0,"examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"examples":["0.1"],"type":"string"}}}},"driftThreshold":{"anyOf":[{"minimum":1,"maximum":100,"type":"number"},{"type":"null"}]}}}}}}}},"/bff/currency/shop-settings-impact":{"post":{"parameters":[],"operationId":"postBffCurrencyShop-settings-impact","tags":["Currency"],"summary":"Preview what new selling currency settings would change","description":"Read only. Per currency whose rate, rounding or the drift threshold changes: how many converted prices move and by how much (biggest moves as a sample), and how many manual prices drift from the rate before and after.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["code","fixedRate","rounding"],"properties":{"code":{"examples":["EUR"],"type":"string"},"fixedRate":{"nullable":true,"anyOf":[{"minimum":0,"examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"examples":["0.1"],"type":"string"}}}},"driftThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["code","fixedRate","rounding"],"properties":{"code":{"examples":["EUR"],"type":"string"},"fixedRate":{"nullable":true,"anyOf":[{"minimum":0,"examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"examples":["0.1"],"type":"string"}}}},"driftThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["code","fixedRate","rounding"],"properties":{"code":{"examples":["EUR"],"type":"string"},"fixedRate":{"nullable":true,"anyOf":[{"minimum":0,"examples":[25],"type":"number"},{"type":"null"}]},"rounding":{"examples":["0.1"],"type":"string"}}}},"driftThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/number-series/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["entity","format","defaultFormat","isCustom","nextNumber"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"Active format.","examples":["REK{YY}{NNNN}"],"type":"string"},"defaultFormat":{"description":"Platform default format.","type":"string"},"isCustom":{"description":"The organisation overrides the default.","type":"boolean"},"nextNumber":{"description":"What the next document would get today (not reserved).","examples":["REK260001"],"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["entity","format","defaultFormat","isCustom","nextNumber"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"Active format.","examples":["REK{YY}{NNNN}"],"type":"string"},"defaultFormat":{"description":"Platform default format.","type":"string"},"isCustom":{"description":"The organisation overrides the default.","type":"boolean"},"nextNumber":{"description":"What the next document would get today (not reserved).","examples":["REK260001"],"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["entity","format","defaultFormat","isCustom","nextNumber"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"Active format.","examples":["REK{YY}{NNNN}"],"type":"string"},"defaultFormat":{"description":"Platform default format.","type":"string"},"isCustom":{"description":"The organisation overrides the default.","type":"boolean"},"nextNumber":{"description":"What the next document would get today (not reserved).","examples":["REK260001"],"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffNumber-seriesList","tags":["Settings"],"summary":"Document number series","description":"Format and next number of each document number series (complaints, purchase orders, production orders)."}},"/bff/number-series/document-formats":{"get":{"parameters":[{"description":"Accounting entity external id; default entity when omitted.","schema":{"type":"string"},"in":"query","name":"entityId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"entityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entities":{"type":"array","items":{"type":"object","required":["id","name","isDefault"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"}}}},"orderGroups":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number"},"name":{"type":"string"}}}},"items":{"type":"array","items":{"type":"object","required":["scope","kind","defaultFormat","allowsOrderGroup","currentFormat","rules"],"properties":{"scope":{"description":"invoice.<type>, ledger.<CODE> or asset.<class>.","examples":["invoice.invoice","ledger.PPD"],"type":"string"},"kind":{"anyOf":[{"const":"invoice","type":"string"},{"const":"ledger","type":"string"},{"const":"asset","type":"string"}]},"defaultFormat":{"description":"Built-in numbering shown as a format.","type":"string"},"allowsOrderGroup":{"type":"boolean"},"currentFormat":{"description":"Organisation / entity-wide format in effect today; null = built-in.","anyOf":[{"type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["id","scope","orderGroupId","orderGroupName","accountingEntityId","format","validFrom"],"properties":{"id":{"type":"number"},"scope":{"type":"string"},"orderGroupId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderGroupName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingEntityId":{"anyOf":[{"type":"number"},{"type":"null"}]},"format":{"type":"string"},"validFrom":{"description":"YYYY-MM-DD; 2000-01-01 = always.","type":"string"}}}}}}}},"required":["entityId","entities","orderGroups","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"entityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entities":{"type":"array","items":{"type":"object","required":["id","name","isDefault"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"}}}},"orderGroups":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number"},"name":{"type":"string"}}}},"items":{"type":"array","items":{"type":"object","required":["scope","kind","defaultFormat","allowsOrderGroup","currentFormat","rules"],"properties":{"scope":{"description":"invoice.<type>, ledger.<CODE> or asset.<class>.","examples":["invoice.invoice","ledger.PPD"],"type":"string"},"kind":{"anyOf":[{"const":"invoice","type":"string"},{"const":"ledger","type":"string"},{"const":"asset","type":"string"}]},"defaultFormat":{"description":"Built-in numbering shown as a format.","type":"string"},"allowsOrderGroup":{"type":"boolean"},"currentFormat":{"description":"Organisation / entity-wide format in effect today; null = built-in.","anyOf":[{"type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["id","scope","orderGroupId","orderGroupName","accountingEntityId","format","validFrom"],"properties":{"id":{"type":"number"},"scope":{"type":"string"},"orderGroupId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderGroupName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingEntityId":{"anyOf":[{"type":"number"},{"type":"null"}]},"format":{"type":"string"},"validFrom":{"description":"YYYY-MM-DD; 2000-01-01 = always.","type":"string"}}}}}}}},"required":["entityId","entities","orderGroups","items"]}},"text/plain":{"schema":{"type":"object","properties":{"entityId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entities":{"type":"array","items":{"type":"object","required":["id","name","isDefault"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"}}}},"orderGroups":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"number"},"name":{"type":"string"}}}},"items":{"type":"array","items":{"type":"object","required":["scope","kind","defaultFormat","allowsOrderGroup","currentFormat","rules"],"properties":{"scope":{"description":"invoice.<type>, ledger.<CODE> or asset.<class>.","examples":["invoice.invoice","ledger.PPD"],"type":"string"},"kind":{"anyOf":[{"const":"invoice","type":"string"},{"const":"ledger","type":"string"},{"const":"asset","type":"string"}]},"defaultFormat":{"description":"Built-in numbering shown as a format.","type":"string"},"allowsOrderGroup":{"type":"boolean"},"currentFormat":{"description":"Organisation / entity-wide format in effect today; null = built-in.","anyOf":[{"type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","required":["id","scope","orderGroupId","orderGroupName","accountingEntityId","format","validFrom"],"properties":{"id":{"type":"number"},"scope":{"type":"string"},"orderGroupId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderGroupName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountingEntityId":{"anyOf":[{"type":"number"},{"type":"null"}]},"format":{"type":"string"},"validFrom":{"description":"YYYY-MM-DD; 2000-01-01 = always.","type":"string"}}}}}}}},"required":["entityId","entities","orderGroups","items"]}}}}},"operationId":"getBffNumber-seriesDocument-formats","tags":["Settings"],"summary":"Number series of accounting agendas (BIZKIT-162)","description":"Invoices per document type (optionally per order group), ledger journal agendas and fixed-asset inventory numbers of one accounting entity. Each scope lists its rules (format + valid-from); no rule = built-in numbering."}},"/bff/number-series/document-format/preview":{"get":{"parameters":[{"schema":{"type":"string","maxLength":40},"in":"query","name":"scope","required":true},{"examples":["{YY}01{NNNNN}"],"schema":{"type":"string","maxLength":128},"in":"query","name":"format","required":true},{"schema":{"type":"string"},"in":"query","name":"entityId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"nextNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["valid","nextNumber","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"nextNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["valid","nextNumber","error"]}},"text/plain":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"nextNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["valid","nextNumber","error"]}}}}},"operationId":"getBffNumber-seriesDocument-formatPreview","tags":["Settings"],"summary":"Validate an agenda number format and show the next number it would give today"}},"/bff/number-series/document-format/set":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","error"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","error"]}}}}},"operationId":"postBffNumber-seriesDocument-formatSet","tags":["Settings"],"summary":"Set or remove a number format of an accounting agenda (BIZKIT-162)","description":"Tokens: {YYYY}, {YY}, {MM} and one sequence {N…}. Ledger formats need a year token and no {MM}. Invoice formats must not give the same variable symbols (digits) as another invoice series; identical formats share one sequence.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["scope","format"],"properties":{"scope":{"maxLength":40,"examples":["invoice.invoice"],"type":"string"},"orderGroupId":{"description":"Invoice scopes: order group override.","anyOf":[{"type":"number"},{"type":"null"}]},"entityId":{"description":"Ledger / asset scopes: accounting entity external id.","anyOf":[{"type":"string"},{"type":"null"}]},"validFrom":{"description":"Effective from (YYYY-MM-DD); omitted = always.","anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},{"type":"null"}]},"format":{"description":"Format; null or empty removes the rule.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["scope","format"],"properties":{"scope":{"maxLength":40,"examples":["invoice.invoice"],"type":"string"},"orderGroupId":{"description":"Invoice scopes: order group override.","anyOf":[{"type":"number"},{"type":"null"}]},"entityId":{"description":"Ledger / asset scopes: accounting entity external id.","anyOf":[{"type":"string"},{"type":"null"}]},"validFrom":{"description":"Effective from (YYYY-MM-DD); omitted = always.","anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},{"type":"null"}]},"format":{"description":"Format; null or empty removes the rule.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["scope","format"],"properties":{"scope":{"maxLength":40,"examples":["invoice.invoice"],"type":"string"},"orderGroupId":{"description":"Invoice scopes: order group override.","anyOf":[{"type":"number"},{"type":"null"}]},"entityId":{"description":"Ledger / asset scopes: accounting entity external id.","anyOf":[{"type":"string"},{"type":"null"}]},"validFrom":{"description":"Effective from (YYYY-MM-DD); omitted = always.","anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},{"type":"null"}]},"format":{"description":"Format; null or empty removes the rule.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/number-series/preview":{"get":{"parameters":[{"examples":["REK{YY}{NNNN}"],"schema":{"type":"string","maxLength":128},"in":"query","name":"format","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"sample":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["valid","sample","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"sample":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["valid","sample","error"]}},"text/plain":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"sample":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["valid","sample","error"]}}}}},"operationId":"getBffNumber-seriesPreview","tags":["Settings"],"summary":"Validate a number format and render the first number of the current period"}},"/bff/number-series/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"False when the format is invalid; `error` explains why.","type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"item":{"anyOf":[{"type":"object","required":["entity","format","defaultFormat","isCustom","nextNumber"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"Active format.","examples":["REK{YY}{NNNN}"],"type":"string"},"defaultFormat":{"description":"Platform default format.","type":"string"},"isCustom":{"description":"The organisation overrides the default.","type":"boolean"},"nextNumber":{"description":"What the next document would get today (not reserved).","examples":["REK260001"],"type":"string"}}},{"type":"null"}]}},"required":["success","error","item"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"False when the format is invalid; `error` explains why.","type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"item":{"anyOf":[{"type":"object","required":["entity","format","defaultFormat","isCustom","nextNumber"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"Active format.","examples":["REK{YY}{NNNN}"],"type":"string"},"defaultFormat":{"description":"Platform default format.","type":"string"},"isCustom":{"description":"The organisation overrides the default.","type":"boolean"},"nextNumber":{"description":"What the next document would get today (not reserved).","examples":["REK260001"],"type":"string"}}},{"type":"null"}]}},"required":["success","error","item"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"False when the format is invalid; `error` explains why.","type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"item":{"anyOf":[{"type":"object","required":["entity","format","defaultFormat","isCustom","nextNumber"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"Active format.","examples":["REK{YY}{NNNN}"],"type":"string"},"defaultFormat":{"description":"Platform default format.","type":"string"},"isCustom":{"description":"The organisation overrides the default.","type":"boolean"},"nextNumber":{"description":"What the next document would get today (not reserved).","examples":["REK260001"],"type":"string"}}},{"type":"null"}]}},"required":["success","error","item"]}}}}},"operationId":"postBffNumber-seriesUpdate","tags":["Settings"],"summary":"Set the format of a document number series","description":"Tokens: {YYYY}, {YY}, {MM} and one sequence {N…} (1–9 digits of padding). The counter restarts monthly with {MM}, yearly with a year token, never otherwise. Already issued numbers are not changed; the next number never collides with them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entity","format"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"New format; null or empty resets to the platform default.","examples":["REK{YY}{NNNN}"],"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entity","format"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"New format; null or empty resets to the platform default.","examples":["REK{YY}{NNNN}"],"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entity","format"],"properties":{"entity":{"description":"Document type.","anyOf":[{"const":"complaint","type":"string"},{"const":"purchaseOrder","type":"string"},{"const":"productionOrder","type":"string"}]},"format":{"description":"New format; null or empty resets to the platform default.","examples":["REK{YY}{NNNN}"],"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/contract/list":{"get":{"parameters":[{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"in":"query","name":"status","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","title","status","partyCount","hasPdf","validFrom","validTo","insertedDate","updatedDate"],"properties":{"id":{"description":"Contract external ID.","type":"string"},"internalId":{"description":"Contract internal ID.","type":"number"},"title":{"description":"Contract title.","type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"partyCount":{"description":"Number of contract parties.","type":"number"},"hasPdf":{"description":"Whether the contract has a finalized PDF.","type":"boolean"},"validFrom":{"nullable":true,"anyOf":[{"description":"Contract validity start.","anyOf":[{"description":"Contract validity start.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"Contract validity end.","anyOf":[{"description":"Contract validity end.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total matching contracts.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","title","status","partyCount","hasPdf","validFrom","validTo","insertedDate","updatedDate"],"properties":{"id":{"description":"Contract external ID.","type":"string"},"internalId":{"description":"Contract internal ID.","type":"number"},"title":{"description":"Contract title.","type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"partyCount":{"description":"Number of contract parties.","type":"number"},"hasPdf":{"description":"Whether the contract has a finalized PDF.","type":"boolean"},"validFrom":{"nullable":true,"anyOf":[{"description":"Contract validity start.","anyOf":[{"description":"Contract validity start.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"Contract validity end.","anyOf":[{"description":"Contract validity end.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total matching contracts.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","title","status","partyCount","hasPdf","validFrom","validTo","insertedDate","updatedDate"],"properties":{"id":{"description":"Contract external ID.","type":"string"},"internalId":{"description":"Contract internal ID.","type":"number"},"title":{"description":"Contract title.","type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"partyCount":{"description":"Number of contract parties.","type":"number"},"hasPdf":{"description":"Whether the contract has a finalized PDF.","type":"boolean"},"validFrom":{"nullable":true,"anyOf":[{"description":"Contract validity start.","anyOf":[{"description":"Contract validity start.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"Contract validity end.","anyOf":[{"description":"Contract validity end.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total matching contracts.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffContractList","tags":["Contract"],"summary":"List contracts","description":"Returns a paginated list of contracts for the authenticated organisation. Supports filtering by status and full-text search by title."}},"/bff/contract/detail":{"get":{"parameters":[{"description":"Contract external ID.","examples":["ctr_abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Contract external ID.","type":"string"},"internalId":{"description":"Contract internal ID.","type":"number"},"title":{"description":"Contract title.","type":"string"},"content":{"description":"Contract body in Markdown format.","type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"locale":{"description":"Locale code of the contract (cs, en, de, ...).","examples":["cs","en"],"type":"string"},"validFrom":{"nullable":true,"anyOf":[{"description":"Validity start.","anyOf":[{"description":"Validity start.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"Validity end.","anyOf":[{"description":"Validity end.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"signedDate":{"nullable":true,"anyOf":[{"description":"Date when the contract was signed.","anyOf":[{"description":"Date when the contract was signed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"hasPdf":{"description":"Whether a finalized PDF exists in blob storage.","type":"boolean"},"templateId":{"nullable":true,"anyOf":[{"description":"ID of the template used to create this contract.","type":"number"},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"parties":{"description":"List of contract parties (signatories).","type":"array","items":{"type":"object","required":["contactId","contactExternalId","role","name","email","companyName"],"properties":{"contactId":{"description":"Internal contact ID.","examples":[42],"type":"number"},"contactExternalId":{"description":"Public contact external ID.","examples":["cnt_abc123"],"type":"string"},"role":{"description":"Party role in the contract (issuer, party).","examples":["party","issuer"],"type":"string"},"name":{"description":"Full name or email as fallback.","examples":["Jan Novak"],"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Party e-mail. `null` for phone-only contacts and anonymised contacts. Contracts with a `null` issuer e-mail cannot be sent for e-signature via e-mail link; UI should warn before letting the user trigger that flow.","examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"description":"Company name if the contact is a legal entity.","examples":["Acme s.r.o."],"type":"string"},{"type":"null"}]}}}}},"required":["id","internalId","title","content","status","locale","validFrom","validTo","signedDate","hasPdf","templateId","insertedDate","updatedDate","parties"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Contract external ID.","type":"string"},"internalId":{"description":"Contract internal ID.","type":"number"},"title":{"description":"Contract title.","type":"string"},"content":{"description":"Contract body in Markdown format.","type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"locale":{"description":"Locale code of the contract (cs, en, de, ...).","examples":["cs","en"],"type":"string"},"validFrom":{"nullable":true,"anyOf":[{"description":"Validity start.","anyOf":[{"description":"Validity start.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"Validity end.","anyOf":[{"description":"Validity end.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"signedDate":{"nullable":true,"anyOf":[{"description":"Date when the contract was signed.","anyOf":[{"description":"Date when the contract was signed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"hasPdf":{"description":"Whether a finalized PDF exists in blob storage.","type":"boolean"},"templateId":{"nullable":true,"anyOf":[{"description":"ID of the template used to create this contract.","type":"number"},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"parties":{"description":"List of contract parties (signatories).","type":"array","items":{"type":"object","required":["contactId","contactExternalId","role","name","email","companyName"],"properties":{"contactId":{"description":"Internal contact ID.","examples":[42],"type":"number"},"contactExternalId":{"description":"Public contact external ID.","examples":["cnt_abc123"],"type":"string"},"role":{"description":"Party role in the contract (issuer, party).","examples":["party","issuer"],"type":"string"},"name":{"description":"Full name or email as fallback.","examples":["Jan Novak"],"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Party e-mail. `null` for phone-only contacts and anonymised contacts. Contracts with a `null` issuer e-mail cannot be sent for e-signature via e-mail link; UI should warn before letting the user trigger that flow.","examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"description":"Company name if the contact is a legal entity.","examples":["Acme s.r.o."],"type":"string"},{"type":"null"}]}}}}},"required":["id","internalId","title","content","status","locale","validFrom","validTo","signedDate","hasPdf","templateId","insertedDate","updatedDate","parties"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Contract external ID.","type":"string"},"internalId":{"description":"Contract internal ID.","type":"number"},"title":{"description":"Contract title.","type":"string"},"content":{"description":"Contract body in Markdown format.","type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"locale":{"description":"Locale code of the contract (cs, en, de, ...).","examples":["cs","en"],"type":"string"},"validFrom":{"nullable":true,"anyOf":[{"description":"Validity start.","anyOf":[{"description":"Validity start.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"nullable":true,"anyOf":[{"description":"Validity end.","anyOf":[{"description":"Validity end.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"signedDate":{"nullable":true,"anyOf":[{"description":"Date when the contract was signed.","anyOf":[{"description":"Date when the contract was signed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"hasPdf":{"description":"Whether a finalized PDF exists in blob storage.","type":"boolean"},"templateId":{"nullable":true,"anyOf":[{"description":"ID of the template used to create this contract.","type":"number"},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"parties":{"description":"List of contract parties (signatories).","type":"array","items":{"type":"object","required":["contactId","contactExternalId","role","name","email","companyName"],"properties":{"contactId":{"description":"Internal contact ID.","examples":[42],"type":"number"},"contactExternalId":{"description":"Public contact external ID.","examples":["cnt_abc123"],"type":"string"},"role":{"description":"Party role in the contract (issuer, party).","examples":["party","issuer"],"type":"string"},"name":{"description":"Full name or email as fallback.","examples":["Jan Novak"],"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Party e-mail. `null` for phone-only contacts and anonymised contacts. Contracts with a `null` issuer e-mail cannot be sent for e-signature via e-mail link; UI should warn before letting the user trigger that flow.","examples":["jan@example.com"],"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"description":"Company name if the contact is a legal entity.","examples":["Acme s.r.o."],"type":"string"},{"type":"null"}]}}}}},"required":["id","internalId","title","content","status","locale","validFrom","validTo","signedDate","hasPdf","templateId","insertedDate","updatedDate","parties"]}}}}},"operationId":"getBffContractDetail","tags":["Contract"],"summary":"Get contract detail","description":"Returns full contract detail including markdown content, status, validity dates, and all contract parties with their roles."}},"/bff/contract/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was created successfully.","type":"boolean"},"id":{"description":"External ID of the created contract.","examples":["ctr_abc123"],"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was created successfully.","type":"boolean"},"id":{"description":"External ID of the created contract.","examples":["ctr_abc123"],"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was created successfully.","type":"boolean"},"id":{"description":"External ID of the created contract.","examples":["ctr_abc123"],"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffContractCreate","tags":["Contract"],"summary":"Create contract","description":"Creates a new contract in draft status. The organisation internal contact is automatically added as the issuer party. Additional contacts provided via contactIds are added as regular parties.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","content","locale"],"properties":{"title":{"minLength":1,"description":"Contract title.","examples":["Service Agreement 2026"],"type":"string"},"content":{"description":"Contract body in Markdown format.","examples":["# Service Agreement\n\nThis contract..."],"type":"string"},"locale":{"description":"Locale code for the contract language.","examples":["cs","en","de"],"type":"string"},"contactIds":{"description":"Internal IDs of contacts to add as contract parties. The organisation contact is always added automatically as issuer.","examples":[[1,2,3]],"type":"array","items":{"examples":[1],"type":"number"}},"templateId":{"description":"Template ID if the contract was created from a template.","examples":[5],"type":"number"},"validFrom":{"description":"Validity start (ISO timestamp).","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"Validity end (ISO timestamp).","examples":["2027-01-01T00:00:00.000Z"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["title","content","locale"],"properties":{"title":{"minLength":1,"description":"Contract title.","examples":["Service Agreement 2026"],"type":"string"},"content":{"description":"Contract body in Markdown format.","examples":["# Service Agreement\n\nThis contract..."],"type":"string"},"locale":{"description":"Locale code for the contract language.","examples":["cs","en","de"],"type":"string"},"contactIds":{"description":"Internal IDs of contacts to add as contract parties. The organisation contact is always added automatically as issuer.","examples":[[1,2,3]],"type":"array","items":{"examples":[1],"type":"number"}},"templateId":{"description":"Template ID if the contract was created from a template.","examples":[5],"type":"number"},"validFrom":{"description":"Validity start (ISO timestamp).","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"Validity end (ISO timestamp).","examples":["2027-01-01T00:00:00.000Z"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["title","content","locale"],"properties":{"title":{"minLength":1,"description":"Contract title.","examples":["Service Agreement 2026"],"type":"string"},"content":{"description":"Contract body in Markdown format.","examples":["# Service Agreement\n\nThis contract..."],"type":"string"},"locale":{"description":"Locale code for the contract language.","examples":["cs","en","de"],"type":"string"},"contactIds":{"description":"Internal IDs of contacts to add as contract parties. The organisation contact is always added automatically as issuer.","examples":[[1,2,3]],"type":"array","items":{"examples":[1],"type":"number"}},"templateId":{"description":"Template ID if the contract was created from a template.","examples":[5],"type":"number"},"validFrom":{"description":"Validity start (ISO timestamp).","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"Validity end (ISO timestamp).","examples":["2027-01-01T00:00:00.000Z"],"type":"string"}}}}}}}},"/bff/contract/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was updated successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was updated successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was updated successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContractUpdate","tags":["Contract"],"summary":"Update contract","description":"Updates contract fields. Only provided fields are changed. Cannot update a finalized (PDF-generated) contract.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contractId"],"properties":{"contractId":{"description":"Internal contract ID to update.","examples":[10],"type":"number"},"title":{"minLength":1,"description":"New contract title.","examples":["Updated Agreement"],"type":"string"},"content":{"description":"New contract body in Markdown format.","examples":["# Updated content"],"type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"validFrom":{"description":"New validity start (ISO timestamp).","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"New validity end (ISO timestamp).","examples":["2027-01-01T00:00:00.000Z"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["contractId"],"properties":{"contractId":{"description":"Internal contract ID to update.","examples":[10],"type":"number"},"title":{"minLength":1,"description":"New contract title.","examples":["Updated Agreement"],"type":"string"},"content":{"description":"New contract body in Markdown format.","examples":["# Updated content"],"type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"validFrom":{"description":"New validity start (ISO timestamp).","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"New validity end (ISO timestamp).","examples":["2027-01-01T00:00:00.000Z"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["contractId"],"properties":{"contractId":{"description":"Internal contract ID to update.","examples":[10],"type":"number"},"title":{"minLength":1,"description":"New contract title.","examples":["Updated Agreement"],"type":"string"},"content":{"description":"New contract body in Markdown format.","examples":["# Updated content"],"type":"string"},"status":{"description":"Contract lifecycle status.","examples":["draft","active","signed"],"anyOf":[{"const":"draft","type":"string"},{"const":"pending_review","type":"string"},{"const":"approved","type":"string"},{"const":"signed","type":"string"},{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"cancelled","type":"string"},{"const":"archived","type":"string"}]},"validFrom":{"description":"New validity start (ISO timestamp).","examples":["2026-01-01T00:00:00.000Z"],"type":"string"},"validTo":{"description":"New validity end (ISO timestamp).","examples":["2027-01-01T00:00:00.000Z"],"type":"string"}}}}}}}},"/bff/contract/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was deleted successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was deleted successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was deleted successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContractDelete","tags":["Contract"],"summary":"Delete contract","description":"Soft-deletes a contract by setting deleted_date. The contract is excluded from listings but remains in the database.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contractId"],"properties":{"contractId":{"description":"Internal contract ID to soft-delete.","examples":[10],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["contractId"],"properties":{"contractId":{"description":"Internal contract ID to soft-delete.","examples":[10],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["contractId"],"properties":{"contractId":{"description":"Internal contract ID to soft-delete.","examples":[10],"type":"number"}}}}}}}},"/bff/contract/party/add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the party was added successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the party was added successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the party was added successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContractPartyAdd","tags":["Contract"],"summary":"Add contract party","description":"Adds a contact as a new contract party with the specified role. There is no limit on the number of parties.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contractId","contactId"],"properties":{"contractId":{"description":"Internal contract ID.","examples":[10],"type":"number"},"contactId":{"description":"Internal contact ID to add as a party.","examples":[42],"type":"number"},"role":{"default":"party","description":"Role of the contact in the contract. Use \"issuer\" for the issuing side or \"party\" for a signatory.","examples":["party","issuer","witness","guarantor"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["contractId","contactId"],"properties":{"contractId":{"description":"Internal contract ID.","examples":[10],"type":"number"},"contactId":{"description":"Internal contact ID to add as a party.","examples":[42],"type":"number"},"role":{"default":"party","description":"Role of the contact in the contract. Use \"issuer\" for the issuing side or \"party\" for a signatory.","examples":["party","issuer","witness","guarantor"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["contractId","contactId"],"properties":{"contractId":{"description":"Internal contract ID.","examples":[10],"type":"number"},"contactId":{"description":"Internal contact ID to add as a party.","examples":[42],"type":"number"},"role":{"default":"party","description":"Role of the contact in the contract. Use \"issuer\" for the issuing side or \"party\" for a signatory.","examples":["party","issuer","witness","guarantor"],"type":"string"}}}}}}}},"/bff/contract/party/remove":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the party was removed successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the party was removed successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the party was removed successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffContractPartyRemove","tags":["Contract"],"summary":"Remove contract party","description":"Removes a contact from the contract parties. Deletes the junction record entirely.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contractId","contactId"],"properties":{"contractId":{"description":"Internal contract ID.","examples":[10],"type":"number"},"contactId":{"description":"Internal contact ID to remove from contract parties.","examples":[42],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["contractId","contactId"],"properties":{"contractId":{"description":"Internal contract ID.","examples":[10],"type":"number"},"contactId":{"description":"Internal contact ID to remove from contract parties.","examples":[42],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["contractId","contactId"],"properties":{"contractId":{"description":"Internal contract ID.","examples":[10],"type":"number"},"contactId":{"description":"Internal contact ID to remove from contract parties.","examples":[42],"type":"number"}}}}}}}},"/bff/contract/pdf-preview":{"get":{"parameters":[{"description":"Contract external ID.","examples":["ctr_abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffContractPdf-preview","tags":["Contract"],"summary":"Preview contract as PDF","description":"Renders the current contract content (Markdown to HTML to PDF) and returns the PDF binary for inline preview. This does not persist the PDF — use /finalize for permanent storage.","responses":{"200":{}}}},"/bff/contract/finalize":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was finalized successfully.","type":"boolean"},"blobId":{"description":"Internal blob ID of the stored PDF file.","examples":[101],"type":"number"}},"required":["success","blobId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was finalized successfully.","type":"boolean"},"blobId":{"description":"Internal blob ID of the stored PDF file.","examples":[101],"type":"number"}},"required":["success","blobId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contract was finalized successfully.","type":"boolean"},"blobId":{"description":"Internal blob ID of the stored PDF file.","examples":[101],"type":"number"}},"required":["success","blobId"]}}}}},"operationId":"postBffContractFinalize","tags":["Contract"],"summary":"Finalize contract","description":"Generates the final PDF from the contract content, uploads it to blob storage, and links it to the contract record. Sets the contract status to \"approved\" and records the signed date. A finalized contract is considered ready for signing. This operation is irreversible — once a PDF is generated, the contract cannot be finalized again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contract external ID to finalize.","examples":["ctr_abc123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contract external ID to finalize.","examples":["ctr_abc123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Contract external ID to finalize.","examples":["ctr_abc123"],"type":"string"}}}}}}}},"/bff/contract/template/list":{"get":{"parameters":[{"description":"Filter by template category ID.","examples":["3"],"schema":{"type":"string"},"in":"query","name":"categoryId","required":false},{"description":"Filter by locale code.","examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","title","description","categoryName","locale","active","insertedDate"],"properties":{"id":{"description":"Template external ID.","type":"string"},"internalId":{"description":"Template internal ID.","type":"number"},"title":{"description":"Template title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Short description of the template purpose.","type":"string"},{"type":"null"}]},"categoryName":{"nullable":true,"anyOf":[{"description":"Name of the assigned category.","type":"string"},{"type":"null"}]},"locale":{"description":"Locale code of the template.","examples":["cs","en"],"type":"string"},"active":{"description":"Whether the template is active and available for use.","type":"boolean"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total matching templates.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","title","description","categoryName","locale","active","insertedDate"],"properties":{"id":{"description":"Template external ID.","type":"string"},"internalId":{"description":"Template internal ID.","type":"number"},"title":{"description":"Template title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Short description of the template purpose.","type":"string"},{"type":"null"}]},"categoryName":{"nullable":true,"anyOf":[{"description":"Name of the assigned category.","type":"string"},{"type":"null"}]},"locale":{"description":"Locale code of the template.","examples":["cs","en"],"type":"string"},"active":{"description":"Whether the template is active and available for use.","type":"boolean"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total matching templates.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","title","description","categoryName","locale","active","insertedDate"],"properties":{"id":{"description":"Template external ID.","type":"string"},"internalId":{"description":"Template internal ID.","type":"number"},"title":{"description":"Template title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Short description of the template purpose.","type":"string"},{"type":"null"}]},"categoryName":{"nullable":true,"anyOf":[{"description":"Name of the assigned category.","type":"string"},{"type":"null"}]},"locale":{"description":"Locale code of the template.","examples":["cs","en"],"type":"string"},"active":{"description":"Whether the template is active and available for use.","type":"boolean"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total matching templates.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffContractTemplateList","tags":["Contract"],"summary":"List contract templates","description":"Returns all active contract templates for the organisation. Templates serve as reusable blueprints for creating new contracts with predefined content."}},"/bff/contract/template/detail":{"get":{"parameters":[{"description":"Template external ID.","examples":["tpl_xyz789"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Template external ID.","type":"string"},"internalId":{"description":"Template internal ID.","type":"number"},"title":{"description":"Template title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Template description.","type":"string"},{"type":"null"}]},"content":{"description":"Template body in Markdown format — use as initial contract content.","type":"string"},"categoryId":{"nullable":true,"anyOf":[{"description":"Assigned category ID.","type":"number"},{"type":"null"}]},"categoryName":{"nullable":true,"anyOf":[{"description":"Assigned category name.","type":"string"},{"type":"null"}]},"locale":{"description":"Locale code.","examples":["cs","en"],"type":"string"},"active":{"description":"Whether the template is active.","type":"boolean"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","internalId","title","description","content","categoryId","categoryName","locale","active","insertedDate","updatedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Template external ID.","type":"string"},"internalId":{"description":"Template internal ID.","type":"number"},"title":{"description":"Template title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Template description.","type":"string"},{"type":"null"}]},"content":{"description":"Template body in Markdown format — use as initial contract content.","type":"string"},"categoryId":{"nullable":true,"anyOf":[{"description":"Assigned category ID.","type":"number"},{"type":"null"}]},"categoryName":{"nullable":true,"anyOf":[{"description":"Assigned category name.","type":"string"},{"type":"null"}]},"locale":{"description":"Locale code.","examples":["cs","en"],"type":"string"},"active":{"description":"Whether the template is active.","type":"boolean"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","internalId","title","description","content","categoryId","categoryName","locale","active","insertedDate","updatedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Template external ID.","type":"string"},"internalId":{"description":"Template internal ID.","type":"number"},"title":{"description":"Template title.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Template description.","type":"string"},{"type":"null"}]},"content":{"description":"Template body in Markdown format — use as initial contract content.","type":"string"},"categoryId":{"nullable":true,"anyOf":[{"description":"Assigned category ID.","type":"number"},{"type":"null"}]},"categoryName":{"nullable":true,"anyOf":[{"description":"Assigned category name.","type":"string"},{"type":"null"}]},"locale":{"description":"Locale code.","examples":["cs","en"],"type":"string"},"active":{"description":"Whether the template is active.","type":"boolean"},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","internalId","title","description","content","categoryId","categoryName","locale","active","insertedDate","updatedDate"]}}}}},"operationId":"getBffContractTemplateDetail","tags":["Contract"],"summary":"Get contract template detail","description":"Returns full template detail including the Markdown content. Use this content as the initial body when creating a new contract from a template."}},"/bff/dashboard/daily-revenue":{"get":{"parameters":[{"description":"Number of days to fetch. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Daily revenue response with period comparison.","content":{"application/json":{"schema":{"type":"object","properties":{"currentPeriod":{"description":"Summary for the current period.","type":"object","required":["totalRevenue","orderCount","startDate","endDate"],"properties":{"totalRevenue":{"description":"Total revenue in current period.","type":"number"},"orderCount":{"description":"Number of paid orders in current period.","type":"number"},"startDate":{"description":"Start date of current period (YYYY-MM-DD).","type":"string"},"endDate":{"description":"End date of current period (YYYY-MM-DD).","type":"string"}}},"previousPeriod":{"description":"Summary for the previous period (same length, for comparison).","type":"object","required":["totalRevenue","orderCount","startDate","endDate"],"properties":{"totalRevenue":{"description":"Total revenue in previous period.","type":"number"},"orderCount":{"description":"Number of paid orders in previous period.","type":"number"},"startDate":{"description":"Start date of previous period (YYYY-MM-DD).","type":"string"},"endDate":{"description":"End date of previous period (YYYY-MM-DD).","type":"string"}}},"revenueChange":{"description":"Percentage change in revenue vs previous period.","type":"number"},"orderCountChange":{"description":"Percentage change in order count vs previous period.","type":"number"},"dailyData":{"description":"Array of daily revenue data for charting.","type":"array","items":{"description":"Daily revenue data point.","type":"object","required":["date","revenue","orderCount"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"revenue":{"description":"Revenue for this day.","type":"number"},"orderCount":{"description":"Number of paid orders for this day.","type":"number"}}}}},"required":["currentPeriod","previousPeriod","revenueChange","orderCountChange","dailyData"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"currentPeriod":{"description":"Summary for the current period.","type":"object","required":["totalRevenue","orderCount","startDate","endDate"],"properties":{"totalRevenue":{"description":"Total revenue in current period.","type":"number"},"orderCount":{"description":"Number of paid orders in current period.","type":"number"},"startDate":{"description":"Start date of current period (YYYY-MM-DD).","type":"string"},"endDate":{"description":"End date of current period (YYYY-MM-DD).","type":"string"}}},"previousPeriod":{"description":"Summary for the previous period (same length, for comparison).","type":"object","required":["totalRevenue","orderCount","startDate","endDate"],"properties":{"totalRevenue":{"description":"Total revenue in previous period.","type":"number"},"orderCount":{"description":"Number of paid orders in previous period.","type":"number"},"startDate":{"description":"Start date of previous period (YYYY-MM-DD).","type":"string"},"endDate":{"description":"End date of previous period (YYYY-MM-DD).","type":"string"}}},"revenueChange":{"description":"Percentage change in revenue vs previous period.","type":"number"},"orderCountChange":{"description":"Percentage change in order count vs previous period.","type":"number"},"dailyData":{"description":"Array of daily revenue data for charting.","type":"array","items":{"description":"Daily revenue data point.","type":"object","required":["date","revenue","orderCount"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"revenue":{"description":"Revenue for this day.","type":"number"},"orderCount":{"description":"Number of paid orders for this day.","type":"number"}}}}},"required":["currentPeriod","previousPeriod","revenueChange","orderCountChange","dailyData"]}},"text/plain":{"schema":{"type":"object","properties":{"currentPeriod":{"description":"Summary for the current period.","type":"object","required":["totalRevenue","orderCount","startDate","endDate"],"properties":{"totalRevenue":{"description":"Total revenue in current period.","type":"number"},"orderCount":{"description":"Number of paid orders in current period.","type":"number"},"startDate":{"description":"Start date of current period (YYYY-MM-DD).","type":"string"},"endDate":{"description":"End date of current period (YYYY-MM-DD).","type":"string"}}},"previousPeriod":{"description":"Summary for the previous period (same length, for comparison).","type":"object","required":["totalRevenue","orderCount","startDate","endDate"],"properties":{"totalRevenue":{"description":"Total revenue in previous period.","type":"number"},"orderCount":{"description":"Number of paid orders in previous period.","type":"number"},"startDate":{"description":"Start date of previous period (YYYY-MM-DD).","type":"string"},"endDate":{"description":"End date of previous period (YYYY-MM-DD).","type":"string"}}},"revenueChange":{"description":"Percentage change in revenue vs previous period.","type":"number"},"orderCountChange":{"description":"Percentage change in order count vs previous period.","type":"number"},"dailyData":{"description":"Array of daily revenue data for charting.","type":"array","items":{"description":"Daily revenue data point.","type":"object","required":["date","revenue","orderCount"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"revenue":{"description":"Revenue for this day.","type":"number"},"orderCount":{"description":"Number of paid orders for this day.","type":"number"}}}}},"required":["currentPeriod","previousPeriod","revenueChange","orderCountChange","dailyData"]}}}}},"operationId":"getBffDashboardDaily-revenue","tags":["Dashboard"],"summary":"Daily revenue overview","description":"Returns daily revenue data for the specified period with comparison to the previous period. Essential for monitoring business health and cash flow trends."}},"/bff/dashboard/unpaid-orders":{"get":{"responses":{"200":{"description":"Unpaid orders summary with expiration breakdown.","content":{"application/json":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Total value of all unpaid orders.","type":"number"},"orderCount":{"description":"Number of unpaid orders.","type":"number"},"expiringWithin24h":{"description":"Orders at imminent risk of expiration.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Value of orders expiring within 24 hours.","type":"number"},"count":{"description":"Count of orders expiring within 24 hours.","type":"number"}}},"expiringWithin7d":{"description":"Orders expiring soon.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Value of orders expiring within 7 days.","type":"number"},"count":{"description":"Count of orders expiring within 7 days.","type":"number"}}},"oldestUnpaidDays":{"description":"Age of the oldest unpaid order in days. Undefined if no unpaid orders.","type":"number"},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalAmount","orderCount","expiringWithin24h","expiringWithin7d","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Total value of all unpaid orders.","type":"number"},"orderCount":{"description":"Number of unpaid orders.","type":"number"},"expiringWithin24h":{"description":"Orders at imminent risk of expiration.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Value of orders expiring within 24 hours.","type":"number"},"count":{"description":"Count of orders expiring within 24 hours.","type":"number"}}},"expiringWithin7d":{"description":"Orders expiring soon.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Value of orders expiring within 7 days.","type":"number"},"count":{"description":"Count of orders expiring within 7 days.","type":"number"}}},"oldestUnpaidDays":{"description":"Age of the oldest unpaid order in days. Undefined if no unpaid orders.","type":"number"},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalAmount","orderCount","expiringWithin24h","expiringWithin7d","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Total value of all unpaid orders.","type":"number"},"orderCount":{"description":"Number of unpaid orders.","type":"number"},"expiringWithin24h":{"description":"Orders at imminent risk of expiration.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Value of orders expiring within 24 hours.","type":"number"},"count":{"description":"Count of orders expiring within 24 hours.","type":"number"}}},"expiringWithin7d":{"description":"Orders expiring soon.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Value of orders expiring within 7 days.","type":"number"},"count":{"description":"Count of orders expiring within 7 days.","type":"number"}}},"oldestUnpaidDays":{"description":"Age of the oldest unpaid order in days. Undefined if no unpaid orders.","type":"number"},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalAmount","orderCount","expiringWithin24h","expiringWithin7d","currency"]}}}}},"operationId":"getBffDashboardUnpaid-orders","tags":["Dashboard"],"summary":"Unpaid orders summary","description":"Returns summary of orders awaiting payment. Critical for identifying revenue at risk and orders requiring follow-up."}},"/bff/dashboard/overdue-invoices":{"get":{"responses":{"200":{"description":"Overdue invoices summary with aging analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"totalOverdue":{"description":"Total value of all overdue invoices.","type":"number"},"invoiceCount":{"description":"Number of overdue invoices.","type":"number"},"agingBuckets":{"description":"Aging buckets for receivables analysis.","type":"object","required":["days1to7","days8to30","days31to60","days61plus"],"properties":{"days1to7":{"description":"Invoices 1-7 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 1-7 days overdue.","type":"number"},"count":{"description":"Number of invoices 1-7 days overdue.","type":"number"}}},"days8to30":{"description":"Invoices 8-30 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 8-30 days overdue.","type":"number"},"count":{"description":"Number of invoices 8-30 days overdue.","type":"number"}}},"days31to60":{"description":"Invoices 31-60 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 31-60 days overdue.","type":"number"},"count":{"description":"Number of invoices 31-60 days overdue.","type":"number"}}},"days61plus":{"description":"Invoices more than 60 days past due date (high risk).","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 61+ days overdue.","type":"number"},"count":{"description":"Number of invoices 61+ days overdue.","type":"number"}}}}},"topDebtors":{"description":"Top 5 customers with highest overdue amounts.","type":"array","items":{"description":"Customer with overdue invoices.","type":"object","required":["customerId","customerName","amount","invoiceCount","oldestDueDays"],"properties":{"customerId":{"description":"Customer external ID.","type":"string"},"customerName":{"description":"Customer name or email.","type":"string"},"amount":{"description":"Total overdue amount for this customer.","type":"number"},"invoiceCount":{"description":"Number of overdue invoices.","type":"number"},"oldestDueDays":{"description":"Days since the oldest invoice was due.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalOverdue","invoiceCount","agingBuckets","topDebtors","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalOverdue":{"description":"Total value of all overdue invoices.","type":"number"},"invoiceCount":{"description":"Number of overdue invoices.","type":"number"},"agingBuckets":{"description":"Aging buckets for receivables analysis.","type":"object","required":["days1to7","days8to30","days31to60","days61plus"],"properties":{"days1to7":{"description":"Invoices 1-7 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 1-7 days overdue.","type":"number"},"count":{"description":"Number of invoices 1-7 days overdue.","type":"number"}}},"days8to30":{"description":"Invoices 8-30 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 8-30 days overdue.","type":"number"},"count":{"description":"Number of invoices 8-30 days overdue.","type":"number"}}},"days31to60":{"description":"Invoices 31-60 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 31-60 days overdue.","type":"number"},"count":{"description":"Number of invoices 31-60 days overdue.","type":"number"}}},"days61plus":{"description":"Invoices more than 60 days past due date (high risk).","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 61+ days overdue.","type":"number"},"count":{"description":"Number of invoices 61+ days overdue.","type":"number"}}}}},"topDebtors":{"description":"Top 5 customers with highest overdue amounts.","type":"array","items":{"description":"Customer with overdue invoices.","type":"object","required":["customerId","customerName","amount","invoiceCount","oldestDueDays"],"properties":{"customerId":{"description":"Customer external ID.","type":"string"},"customerName":{"description":"Customer name or email.","type":"string"},"amount":{"description":"Total overdue amount for this customer.","type":"number"},"invoiceCount":{"description":"Number of overdue invoices.","type":"number"},"oldestDueDays":{"description":"Days since the oldest invoice was due.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalOverdue","invoiceCount","agingBuckets","topDebtors","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"totalOverdue":{"description":"Total value of all overdue invoices.","type":"number"},"invoiceCount":{"description":"Number of overdue invoices.","type":"number"},"agingBuckets":{"description":"Aging buckets for receivables analysis.","type":"object","required":["days1to7","days8to30","days31to60","days61plus"],"properties":{"days1to7":{"description":"Invoices 1-7 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 1-7 days overdue.","type":"number"},"count":{"description":"Number of invoices 1-7 days overdue.","type":"number"}}},"days8to30":{"description":"Invoices 8-30 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 8-30 days overdue.","type":"number"},"count":{"description":"Number of invoices 8-30 days overdue.","type":"number"}}},"days31to60":{"description":"Invoices 31-60 days past due date.","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 31-60 days overdue.","type":"number"},"count":{"description":"Number of invoices 31-60 days overdue.","type":"number"}}},"days61plus":{"description":"Invoices more than 60 days past due date (high risk).","type":"object","required":["amount","count"],"properties":{"amount":{"description":"Total amount 61+ days overdue.","type":"number"},"count":{"description":"Number of invoices 61+ days overdue.","type":"number"}}}}},"topDebtors":{"description":"Top 5 customers with highest overdue amounts.","type":"array","items":{"description":"Customer with overdue invoices.","type":"object","required":["customerId","customerName","amount","invoiceCount","oldestDueDays"],"properties":{"customerId":{"description":"Customer external ID.","type":"string"},"customerName":{"description":"Customer name or email.","type":"string"},"amount":{"description":"Total overdue amount for this customer.","type":"number"},"invoiceCount":{"description":"Number of overdue invoices.","type":"number"},"oldestDueDays":{"description":"Days since the oldest invoice was due.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalOverdue","invoiceCount","agingBuckets","topDebtors","currency"]}}}}},"operationId":"getBffDashboardOverdue-invoices","tags":["Dashboard"],"summary":"Overdue invoices (receivables)","description":"Returns invoices past their due date grouped by aging buckets. Critical for B2B businesses to manage cash flow and credit risk."}},"/bff/dashboard/orders-by-status":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Orders grouped by status.","content":{"application/json":{"schema":{"type":"object","properties":{"totalOrders":{"description":"Total number of orders in the analyzed period.","type":"number"},"totalValue":{"description":"Total value of all orders.","type":"number"},"byStatus":{"description":"Breakdown by order status, sorted by workflow position.","type":"array","items":{"description":"Status breakdown item.","type":"object","required":["statusId","statusCode","statusLabel","orderCount","totalValue","percentage"],"properties":{"statusId":{"description":"Internal status ID.","type":"number"},"statusCode":{"description":"Status code (e.g., \"new\", \"paid\", \"done\", \"storno\").","type":"string"},"statusLabel":{"description":"Human-readable status label.","type":"string"},"orderCount":{"description":"Number of orders in this status.","type":"number"},"totalValue":{"description":"Total value of orders in this status.","type":"number"},"percentage":{"description":"Percentage of total orders (0-100).","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalOrders","totalValue","byStatus","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalOrders":{"description":"Total number of orders in the analyzed period.","type":"number"},"totalValue":{"description":"Total value of all orders.","type":"number"},"byStatus":{"description":"Breakdown by order status, sorted by workflow position.","type":"array","items":{"description":"Status breakdown item.","type":"object","required":["statusId","statusCode","statusLabel","orderCount","totalValue","percentage"],"properties":{"statusId":{"description":"Internal status ID.","type":"number"},"statusCode":{"description":"Status code (e.g., \"new\", \"paid\", \"done\", \"storno\").","type":"string"},"statusLabel":{"description":"Human-readable status label.","type":"string"},"orderCount":{"description":"Number of orders in this status.","type":"number"},"totalValue":{"description":"Total value of orders in this status.","type":"number"},"percentage":{"description":"Percentage of total orders (0-100).","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalOrders","totalValue","byStatus","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"totalOrders":{"description":"Total number of orders in the analyzed period.","type":"number"},"totalValue":{"description":"Total value of all orders.","type":"number"},"byStatus":{"description":"Breakdown by order status, sorted by workflow position.","type":"array","items":{"description":"Status breakdown item.","type":"object","required":["statusId","statusCode","statusLabel","orderCount","totalValue","percentage"],"properties":{"statusId":{"description":"Internal status ID.","type":"number"},"statusCode":{"description":"Status code (e.g., \"new\", \"paid\", \"done\", \"storno\").","type":"string"},"statusLabel":{"description":"Human-readable status label.","type":"string"},"orderCount":{"description":"Number of orders in this status.","type":"number"},"totalValue":{"description":"Total value of orders in this status.","type":"number"},"percentage":{"description":"Percentage of total orders (0-100).","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["totalOrders","totalValue","byStatus","currency"]}}}}},"operationId":"getBffDashboardOrders-by-status","tags":["Dashboard"],"summary":"Orders by status breakdown","description":"Returns order counts and values grouped by status. Helps identify bottlenecks in order processing workflow."}},"/bff/dashboard/average-order-value":{"get":{"parameters":[{"description":"Number of months to analyze. Defaults to 6.","schema":{"type":"number","default":6},"in":"query","name":"months","required":false}],"responses":{"200":{"description":"AOV analysis with monthly trend.","content":{"application/json":{"schema":{"type":"object","properties":{"currentAov":{"description":"Average order value for the current month.","type":"number"},"previousAov":{"description":"Average order value for the previous month.","type":"number"},"aovChange":{"description":"Percentage change in AOV vs previous month.","type":"number"},"monthlyData":{"description":"Monthly AOV trend data, oldest first.","type":"array","items":{"description":"Monthly AOV data point.","type":"object","required":["month","aov","orderCount","totalRevenue"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"aov":{"description":"Average order value for the month.","type":"number"},"orderCount":{"description":"Number of paid orders in the month.","type":"number"},"totalRevenue":{"description":"Total revenue for the month.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["currentAov","previousAov","aovChange","monthlyData","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"currentAov":{"description":"Average order value for the current month.","type":"number"},"previousAov":{"description":"Average order value for the previous month.","type":"number"},"aovChange":{"description":"Percentage change in AOV vs previous month.","type":"number"},"monthlyData":{"description":"Monthly AOV trend data, oldest first.","type":"array","items":{"description":"Monthly AOV data point.","type":"object","required":["month","aov","orderCount","totalRevenue"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"aov":{"description":"Average order value for the month.","type":"number"},"orderCount":{"description":"Number of paid orders in the month.","type":"number"},"totalRevenue":{"description":"Total revenue for the month.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["currentAov","previousAov","aovChange","monthlyData","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"currentAov":{"description":"Average order value for the current month.","type":"number"},"previousAov":{"description":"Average order value for the previous month.","type":"number"},"aovChange":{"description":"Percentage change in AOV vs previous month.","type":"number"},"monthlyData":{"description":"Monthly AOV trend data, oldest first.","type":"array","items":{"description":"Monthly AOV data point.","type":"object","required":["month","aov","orderCount","totalRevenue"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"aov":{"description":"Average order value for the month.","type":"number"},"orderCount":{"description":"Number of paid orders in the month.","type":"number"},"totalRevenue":{"description":"Total revenue for the month.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["currentAov","previousAov","aovChange","monthlyData","currency"]}}}}},"operationId":"getBffDashboardAverage-order-value","tags":["Dashboard"],"summary":"Average Order Value (AOV) trend","description":"Returns average order value over time. Key metric for pricing optimization, upselling effectiveness, and bundle strategies."}},"/bff/dashboard/payment-success-rate":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Payment success rate analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"overallSuccessRate":{"description":"Overall payment success rate (0-100%).","type":"number"},"totalPayments":{"description":"Total number of payment attempts.","type":"number"},"successfulPayments":{"description":"Number of successful (paid) payments.","type":"number"},"failedPayments":{"description":"Number of failed/cancelled payments.","type":"number"},"pendingPayments":{"description":"Number of pending/in-progress payments.","type":"number"},"byGateway":{"description":"Success rate breakdown by payment gateway.","type":"array","items":{"description":"Payment gateway performance.","type":"object","required":["gatewayCode","gatewayName","successRate","totalPayments","successfulPayments","failedPayments"],"properties":{"gatewayCode":{"description":"Payment gateway identifier code.","type":"string"},"gatewayName":{"description":"Payment gateway display name.","type":"string"},"successRate":{"description":"Success rate for this gateway (0-100%).","type":"number"},"totalPayments":{"description":"Total payments via this gateway.","type":"number"},"successfulPayments":{"description":"Successful payments via this gateway.","type":"number"},"failedPayments":{"description":"Failed payments via this gateway.","type":"number"}}}},"dailyTrend":{"description":"Daily success rate trend for charting.","type":"array","items":{"description":"Daily success rate data point.","type":"object","required":["date","successRate","total"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"successRate":{"description":"Success rate for this day (0-100%).","type":"number"},"total":{"description":"Total payment attempts on this day.","type":"number"}}}}},"required":["overallSuccessRate","totalPayments","successfulPayments","failedPayments","pendingPayments","byGateway","dailyTrend"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"overallSuccessRate":{"description":"Overall payment success rate (0-100%).","type":"number"},"totalPayments":{"description":"Total number of payment attempts.","type":"number"},"successfulPayments":{"description":"Number of successful (paid) payments.","type":"number"},"failedPayments":{"description":"Number of failed/cancelled payments.","type":"number"},"pendingPayments":{"description":"Number of pending/in-progress payments.","type":"number"},"byGateway":{"description":"Success rate breakdown by payment gateway.","type":"array","items":{"description":"Payment gateway performance.","type":"object","required":["gatewayCode","gatewayName","successRate","totalPayments","successfulPayments","failedPayments"],"properties":{"gatewayCode":{"description":"Payment gateway identifier code.","type":"string"},"gatewayName":{"description":"Payment gateway display name.","type":"string"},"successRate":{"description":"Success rate for this gateway (0-100%).","type":"number"},"totalPayments":{"description":"Total payments via this gateway.","type":"number"},"successfulPayments":{"description":"Successful payments via this gateway.","type":"number"},"failedPayments":{"description":"Failed payments via this gateway.","type":"number"}}}},"dailyTrend":{"description":"Daily success rate trend for charting.","type":"array","items":{"description":"Daily success rate data point.","type":"object","required":["date","successRate","total"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"successRate":{"description":"Success rate for this day (0-100%).","type":"number"},"total":{"description":"Total payment attempts on this day.","type":"number"}}}}},"required":["overallSuccessRate","totalPayments","successfulPayments","failedPayments","pendingPayments","byGateway","dailyTrend"]}},"text/plain":{"schema":{"type":"object","properties":{"overallSuccessRate":{"description":"Overall payment success rate (0-100%).","type":"number"},"totalPayments":{"description":"Total number of payment attempts.","type":"number"},"successfulPayments":{"description":"Number of successful (paid) payments.","type":"number"},"failedPayments":{"description":"Number of failed/cancelled payments.","type":"number"},"pendingPayments":{"description":"Number of pending/in-progress payments.","type":"number"},"byGateway":{"description":"Success rate breakdown by payment gateway.","type":"array","items":{"description":"Payment gateway performance.","type":"object","required":["gatewayCode","gatewayName","successRate","totalPayments","successfulPayments","failedPayments"],"properties":{"gatewayCode":{"description":"Payment gateway identifier code.","type":"string"},"gatewayName":{"description":"Payment gateway display name.","type":"string"},"successRate":{"description":"Success rate for this gateway (0-100%).","type":"number"},"totalPayments":{"description":"Total payments via this gateway.","type":"number"},"successfulPayments":{"description":"Successful payments via this gateway.","type":"number"},"failedPayments":{"description":"Failed payments via this gateway.","type":"number"}}}},"dailyTrend":{"description":"Daily success rate trend for charting.","type":"array","items":{"description":"Daily success rate data point.","type":"object","required":["date","successRate","total"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"successRate":{"description":"Success rate for this day (0-100%).","type":"number"},"total":{"description":"Total payment attempts on this day.","type":"number"}}}}},"required":["overallSuccessRate","totalPayments","successfulPayments","failedPayments","pendingPayments","byGateway","dailyTrend"]}}}}},"operationId":"getBffDashboardPayment-success-rate","tags":["Dashboard"],"summary":"Payment success rate","description":"Returns payment success/failure statistics by gateway. Helps detect payment gateway issues before they impact revenue significantly."}},"/bff/dashboard/customer-segmentation":{"get":{"parameters":[{"description":"Number of months to analyze. Defaults to 6.","schema":{"type":"number","default":6},"in":"query","name":"months","required":false}],"responses":{"200":{"description":"Customer segmentation analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"currentMonth":{"description":"Current month customer breakdown.","type":"object","required":["newCustomers","returningCustomers","newCustomerRevenue","returningCustomerRevenue","newCustomerPercentage"],"properties":{"newCustomers":{"description":"Customers making their first-ever order this month.","type":"number"},"returningCustomers":{"description":"Customers with at least one previous order.","type":"number"},"newCustomerRevenue":{"description":"Revenue from new customers.","type":"number"},"returningCustomerRevenue":{"description":"Revenue from returning customers.","type":"number"},"newCustomerPercentage":{"description":"Percentage of customers who are new (0-100).","type":"number"}}},"previousMonth":{"description":"Previous month for comparison.","type":"object","required":["newCustomers","returningCustomers","newCustomerPercentage"],"properties":{"newCustomers":{"description":"New customers in previous month.","type":"number"},"returningCustomers":{"description":"Returning customers in previous month.","type":"number"},"newCustomerPercentage":{"description":"New customer percentage in previous month.","type":"number"}}},"monthlyTrend":{"description":"Monthly trend data, oldest first.","type":"array","items":{"description":"Monthly customer segmentation data point.","type":"object","required":["month","newCustomers","returningCustomers","newCustomerPercentage"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"newCustomers":{"description":"New customers count.","type":"number"},"returningCustomers":{"description":"Returning customers count.","type":"number"},"newCustomerPercentage":{"description":"Percentage of new customers (0-100).","type":"number"}}}},"currency":{"description":"Currency code for revenue amounts (e.g., \"CZK\").","type":"string"}},"required":["currentMonth","previousMonth","monthlyTrend","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"currentMonth":{"description":"Current month customer breakdown.","type":"object","required":["newCustomers","returningCustomers","newCustomerRevenue","returningCustomerRevenue","newCustomerPercentage"],"properties":{"newCustomers":{"description":"Customers making their first-ever order this month.","type":"number"},"returningCustomers":{"description":"Customers with at least one previous order.","type":"number"},"newCustomerRevenue":{"description":"Revenue from new customers.","type":"number"},"returningCustomerRevenue":{"description":"Revenue from returning customers.","type":"number"},"newCustomerPercentage":{"description":"Percentage of customers who are new (0-100).","type":"number"}}},"previousMonth":{"description":"Previous month for comparison.","type":"object","required":["newCustomers","returningCustomers","newCustomerPercentage"],"properties":{"newCustomers":{"description":"New customers in previous month.","type":"number"},"returningCustomers":{"description":"Returning customers in previous month.","type":"number"},"newCustomerPercentage":{"description":"New customer percentage in previous month.","type":"number"}}},"monthlyTrend":{"description":"Monthly trend data, oldest first.","type":"array","items":{"description":"Monthly customer segmentation data point.","type":"object","required":["month","newCustomers","returningCustomers","newCustomerPercentage"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"newCustomers":{"description":"New customers count.","type":"number"},"returningCustomers":{"description":"Returning customers count.","type":"number"},"newCustomerPercentage":{"description":"Percentage of new customers (0-100).","type":"number"}}}},"currency":{"description":"Currency code for revenue amounts (e.g., \"CZK\").","type":"string"}},"required":["currentMonth","previousMonth","monthlyTrend","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"currentMonth":{"description":"Current month customer breakdown.","type":"object","required":["newCustomers","returningCustomers","newCustomerRevenue","returningCustomerRevenue","newCustomerPercentage"],"properties":{"newCustomers":{"description":"Customers making their first-ever order this month.","type":"number"},"returningCustomers":{"description":"Customers with at least one previous order.","type":"number"},"newCustomerRevenue":{"description":"Revenue from new customers.","type":"number"},"returningCustomerRevenue":{"description":"Revenue from returning customers.","type":"number"},"newCustomerPercentage":{"description":"Percentage of customers who are new (0-100).","type":"number"}}},"previousMonth":{"description":"Previous month for comparison.","type":"object","required":["newCustomers","returningCustomers","newCustomerPercentage"],"properties":{"newCustomers":{"description":"New customers in previous month.","type":"number"},"returningCustomers":{"description":"Returning customers in previous month.","type":"number"},"newCustomerPercentage":{"description":"New customer percentage in previous month.","type":"number"}}},"monthlyTrend":{"description":"Monthly trend data, oldest first.","type":"array","items":{"description":"Monthly customer segmentation data point.","type":"object","required":["month","newCustomers","returningCustomers","newCustomerPercentage"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"newCustomers":{"description":"New customers count.","type":"number"},"returningCustomers":{"description":"Returning customers count.","type":"number"},"newCustomerPercentage":{"description":"Percentage of new customers (0-100).","type":"number"}}}},"currency":{"description":"Currency code for revenue amounts (e.g., \"CZK\").","type":"string"}},"required":["currentMonth","previousMonth","monthlyTrend","currency"]}}}}},"operationId":"getBffDashboardCustomer-segmentation","tags":["Dashboard"],"summary":"New vs returning customers","description":"Returns customer segmentation showing new vs returning customer ratio. Essential for understanding growth vs retention balance and marketing effectiveness."}},"/bff/dashboard/revenue-retention":{"get":{"parameters":[{"description":"Granularity: yearly (3 pairs) or quarterly YoY (12 pairs). Defaults to year.","schema":{"default":"year","anyOf":[{"const":"year","type":"string"},{"const":"quarter","type":"string"}]},"in":"query","name":"period","required":false}],"responses":{"200":{"description":"Year-over-year revenue retention analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"description":"Granularity actually used.","anyOf":[{"const":"year","type":"string"},{"const":"quarter","type":"string"}]},"currency":{"description":"Currency code for all revenue values (org default).","type":"string"},"warning":{"description":"Warning summary.","type":"object","required":["level","firstOrderDate","organisationAgeDays"],"properties":{"level":{"description":"Health classification of the latest (floating) retention.","anyOf":[{"const":"insufficient_data","type":"string"},{"const":"healthy","type":"string"},{"const":"low_retention","type":"string"}]},"note":{"description":"Extra advisory when retention is below 50%.","const":"marketing_dependency","type":"string"},"firstOrderDate":{"description":"Date of the first paid order in the organisation (YYYY-MM-DD), null if none.","anyOf":[{"type":"string"},{"type":"null"}]},"organisationAgeDays":{"description":"Days since the first paid order — used for the \"younger than 2 years\" gate.","type":"number"}}},"periods":{"description":"Periods ordered newest first (idx 0 = floating current).","type":"array","items":{"description":"Single retention pair.","type":"object","required":["periodIdx","label","baselineStart","baselineEnd","currentStart","currentEnd","isFloating","baselineCustomers","retainedCustomers","lostCustomers","customerRetentionRate","baselineRevenue","currentRevenueFromBaselineCustomers","grossRetentionRate","netRetentionRate","avgRevenuePerCustomerBaseline","avgRevenuePerCustomerCurrent","avgRevenuePerCustomerChange","bands"],"properties":{"periodIdx":{"description":"0 = most recent (floating), N = N periods back.","type":"number"},"label":{"description":"Human label, e.g. \"2024 → 2025\" or \"Q2 2024 → Q2 2025\".","type":"string"},"baselineStart":{"description":"Baseline window start (YYYY-MM-DD).","type":"string"},"baselineEnd":{"description":"Baseline window end (YYYY-MM-DD).","type":"string"},"currentStart":{"description":"Current window start (YYYY-MM-DD).","type":"string"},"currentEnd":{"description":"Current window end (YYYY-MM-DD).","type":"string"},"isFloating":{"description":"True if the current window is in-progress (truncated to today).","type":"boolean"},"baselineCustomers":{"description":"Distinct customers paying in baseline.","type":"number"},"retainedCustomers":{"description":"Of those, how many also paid in current.","type":"number"},"lostCustomers":{"description":"Baseline minus retained.","type":"number"},"customerRetentionRate":{"description":"retainedCustomers / baselineCustomers, in %.","type":"number"},"baselineRevenue":{"description":"Revenue in baseline from baseline customers.","type":"number"},"currentRevenueFromBaselineCustomers":{"description":"Revenue in current from those same baseline customers.","type":"number"},"grossRetentionRate":{"description":"GRR: SUM(MIN(current, baseline)) / SUM(baseline) — capped, no upsell.","type":"number"},"netRetentionRate":{"description":"NRR: SUM(current) / SUM(baseline) — can exceed 100% with upsell.","type":"number"},"avgRevenuePerCustomerBaseline":{"description":"Avg baseline revenue, averaged over retained customers (like-for-like).","type":"number"},"avgRevenuePerCustomerCurrent":{"description":"Avg current revenue, averaged over retained customers.","type":"number"},"avgRevenuePerCustomerChange":{"description":"Percentage change in avg spend from the same customers.","type":"number"},"bands":{"description":"Per-customer retention bands (6 fixed buckets).","type":"array","items":{"type":"object","required":["band","customerCount","customerPercentage","baselineRevenue","currentRevenue"],"properties":{"band":{"anyOf":[{"const":"growing","type":"string"},{"const":"holding","type":"string"},{"const":"declining","type":"string"},{"const":"at_risk","type":"string"},{"const":"critical","type":"string"},{"const":"lost","type":"string"}]},"customerCount":{"description":"Customers in this band.","type":"number"},"customerPercentage":{"description":"Share of baseline customers (0-100).","type":"number"},"baselineRevenue":{"description":"Baseline revenue from this band.","type":"number"},"currentRevenue":{"description":"Current revenue from this band.","type":"number"}}}}}}},"stability":{"description":"Null when warning.level is insufficient_data.","anyOf":[{"type":"object","required":["weightedRetention","weightedGrossRetention","volatility","score","rating","projectedAnnualRevenue"],"properties":{"weightedRetention":{"description":"Baseline-weighted NRR across all periods (%).","type":"number"},"weightedGrossRetention":{"description":"Baseline-weighted GRR across all periods (%).","type":"number"},"volatility":{"description":"Standard deviation of NRR across periods (pp).","type":"number"},"score":{"description":"Stability score 0-100.","type":"number"},"rating":{"anyOf":[{"const":"excellent","type":"string"},{"const":"good","type":"string"},{"const":"moderate","type":"string"},{"const":"concerning","type":"string"},{"const":"critical","type":"string"}]},"projectedAnnualRevenue":{"description":"Estimated revenue we can count on next period from existing customers.","type":"number"}}},{"type":"null"}]},"currencyMix":{"description":"Currency situation — retention is computed only in the org default.","type":"object","required":["primaryCurrencyId","primaryCurrencyCode","otherCurrenciesPresent","otherCurrenciesRevenue"],"properties":{"primaryCurrencyId":{"description":"Org default currency ID.","type":"number"},"primaryCurrencyCode":{"description":"Org default currency code.","type":"string"},"otherCurrenciesPresent":{"description":"True if orders in other currencies exist in the windows.","type":"boolean"},"otherCurrenciesRevenue":{"description":"Total revenue ignored due to non-default currency.","type":"number"}}}},"required":["period","currency","warning","periods","stability","currencyMix"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"period":{"description":"Granularity actually used.","anyOf":[{"const":"year","type":"string"},{"const":"quarter","type":"string"}]},"currency":{"description":"Currency code for all revenue values (org default).","type":"string"},"warning":{"description":"Warning summary.","type":"object","required":["level","firstOrderDate","organisationAgeDays"],"properties":{"level":{"description":"Health classification of the latest (floating) retention.","anyOf":[{"const":"insufficient_data","type":"string"},{"const":"healthy","type":"string"},{"const":"low_retention","type":"string"}]},"note":{"description":"Extra advisory when retention is below 50%.","const":"marketing_dependency","type":"string"},"firstOrderDate":{"description":"Date of the first paid order in the organisation (YYYY-MM-DD), null if none.","anyOf":[{"type":"string"},{"type":"null"}]},"organisationAgeDays":{"description":"Days since the first paid order — used for the \"younger than 2 years\" gate.","type":"number"}}},"periods":{"description":"Periods ordered newest first (idx 0 = floating current).","type":"array","items":{"description":"Single retention pair.","type":"object","required":["periodIdx","label","baselineStart","baselineEnd","currentStart","currentEnd","isFloating","baselineCustomers","retainedCustomers","lostCustomers","customerRetentionRate","baselineRevenue","currentRevenueFromBaselineCustomers","grossRetentionRate","netRetentionRate","avgRevenuePerCustomerBaseline","avgRevenuePerCustomerCurrent","avgRevenuePerCustomerChange","bands"],"properties":{"periodIdx":{"description":"0 = most recent (floating), N = N periods back.","type":"number"},"label":{"description":"Human label, e.g. \"2024 → 2025\" or \"Q2 2024 → Q2 2025\".","type":"string"},"baselineStart":{"description":"Baseline window start (YYYY-MM-DD).","type":"string"},"baselineEnd":{"description":"Baseline window end (YYYY-MM-DD).","type":"string"},"currentStart":{"description":"Current window start (YYYY-MM-DD).","type":"string"},"currentEnd":{"description":"Current window end (YYYY-MM-DD).","type":"string"},"isFloating":{"description":"True if the current window is in-progress (truncated to today).","type":"boolean"},"baselineCustomers":{"description":"Distinct customers paying in baseline.","type":"number"},"retainedCustomers":{"description":"Of those, how many also paid in current.","type":"number"},"lostCustomers":{"description":"Baseline minus retained.","type":"number"},"customerRetentionRate":{"description":"retainedCustomers / baselineCustomers, in %.","type":"number"},"baselineRevenue":{"description":"Revenue in baseline from baseline customers.","type":"number"},"currentRevenueFromBaselineCustomers":{"description":"Revenue in current from those same baseline customers.","type":"number"},"grossRetentionRate":{"description":"GRR: SUM(MIN(current, baseline)) / SUM(baseline) — capped, no upsell.","type":"number"},"netRetentionRate":{"description":"NRR: SUM(current) / SUM(baseline) — can exceed 100% with upsell.","type":"number"},"avgRevenuePerCustomerBaseline":{"description":"Avg baseline revenue, averaged over retained customers (like-for-like).","type":"number"},"avgRevenuePerCustomerCurrent":{"description":"Avg current revenue, averaged over retained customers.","type":"number"},"avgRevenuePerCustomerChange":{"description":"Percentage change in avg spend from the same customers.","type":"number"},"bands":{"description":"Per-customer retention bands (6 fixed buckets).","type":"array","items":{"type":"object","required":["band","customerCount","customerPercentage","baselineRevenue","currentRevenue"],"properties":{"band":{"anyOf":[{"const":"growing","type":"string"},{"const":"holding","type":"string"},{"const":"declining","type":"string"},{"const":"at_risk","type":"string"},{"const":"critical","type":"string"},{"const":"lost","type":"string"}]},"customerCount":{"description":"Customers in this band.","type":"number"},"customerPercentage":{"description":"Share of baseline customers (0-100).","type":"number"},"baselineRevenue":{"description":"Baseline revenue from this band.","type":"number"},"currentRevenue":{"description":"Current revenue from this band.","type":"number"}}}}}}},"stability":{"description":"Null when warning.level is insufficient_data.","anyOf":[{"type":"object","required":["weightedRetention","weightedGrossRetention","volatility","score","rating","projectedAnnualRevenue"],"properties":{"weightedRetention":{"description":"Baseline-weighted NRR across all periods (%).","type":"number"},"weightedGrossRetention":{"description":"Baseline-weighted GRR across all periods (%).","type":"number"},"volatility":{"description":"Standard deviation of NRR across periods (pp).","type":"number"},"score":{"description":"Stability score 0-100.","type":"number"},"rating":{"anyOf":[{"const":"excellent","type":"string"},{"const":"good","type":"string"},{"const":"moderate","type":"string"},{"const":"concerning","type":"string"},{"const":"critical","type":"string"}]},"projectedAnnualRevenue":{"description":"Estimated revenue we can count on next period from existing customers.","type":"number"}}},{"type":"null"}]},"currencyMix":{"description":"Currency situation — retention is computed only in the org default.","type":"object","required":["primaryCurrencyId","primaryCurrencyCode","otherCurrenciesPresent","otherCurrenciesRevenue"],"properties":{"primaryCurrencyId":{"description":"Org default currency ID.","type":"number"},"primaryCurrencyCode":{"description":"Org default currency code.","type":"string"},"otherCurrenciesPresent":{"description":"True if orders in other currencies exist in the windows.","type":"boolean"},"otherCurrenciesRevenue":{"description":"Total revenue ignored due to non-default currency.","type":"number"}}}},"required":["period","currency","warning","periods","stability","currencyMix"]}},"text/plain":{"schema":{"type":"object","properties":{"period":{"description":"Granularity actually used.","anyOf":[{"const":"year","type":"string"},{"const":"quarter","type":"string"}]},"currency":{"description":"Currency code for all revenue values (org default).","type":"string"},"warning":{"description":"Warning summary.","type":"object","required":["level","firstOrderDate","organisationAgeDays"],"properties":{"level":{"description":"Health classification of the latest (floating) retention.","anyOf":[{"const":"insufficient_data","type":"string"},{"const":"healthy","type":"string"},{"const":"low_retention","type":"string"}]},"note":{"description":"Extra advisory when retention is below 50%.","const":"marketing_dependency","type":"string"},"firstOrderDate":{"description":"Date of the first paid order in the organisation (YYYY-MM-DD), null if none.","anyOf":[{"type":"string"},{"type":"null"}]},"organisationAgeDays":{"description":"Days since the first paid order — used for the \"younger than 2 years\" gate.","type":"number"}}},"periods":{"description":"Periods ordered newest first (idx 0 = floating current).","type":"array","items":{"description":"Single retention pair.","type":"object","required":["periodIdx","label","baselineStart","baselineEnd","currentStart","currentEnd","isFloating","baselineCustomers","retainedCustomers","lostCustomers","customerRetentionRate","baselineRevenue","currentRevenueFromBaselineCustomers","grossRetentionRate","netRetentionRate","avgRevenuePerCustomerBaseline","avgRevenuePerCustomerCurrent","avgRevenuePerCustomerChange","bands"],"properties":{"periodIdx":{"description":"0 = most recent (floating), N = N periods back.","type":"number"},"label":{"description":"Human label, e.g. \"2024 → 2025\" or \"Q2 2024 → Q2 2025\".","type":"string"},"baselineStart":{"description":"Baseline window start (YYYY-MM-DD).","type":"string"},"baselineEnd":{"description":"Baseline window end (YYYY-MM-DD).","type":"string"},"currentStart":{"description":"Current window start (YYYY-MM-DD).","type":"string"},"currentEnd":{"description":"Current window end (YYYY-MM-DD).","type":"string"},"isFloating":{"description":"True if the current window is in-progress (truncated to today).","type":"boolean"},"baselineCustomers":{"description":"Distinct customers paying in baseline.","type":"number"},"retainedCustomers":{"description":"Of those, how many also paid in current.","type":"number"},"lostCustomers":{"description":"Baseline minus retained.","type":"number"},"customerRetentionRate":{"description":"retainedCustomers / baselineCustomers, in %.","type":"number"},"baselineRevenue":{"description":"Revenue in baseline from baseline customers.","type":"number"},"currentRevenueFromBaselineCustomers":{"description":"Revenue in current from those same baseline customers.","type":"number"},"grossRetentionRate":{"description":"GRR: SUM(MIN(current, baseline)) / SUM(baseline) — capped, no upsell.","type":"number"},"netRetentionRate":{"description":"NRR: SUM(current) / SUM(baseline) — can exceed 100% with upsell.","type":"number"},"avgRevenuePerCustomerBaseline":{"description":"Avg baseline revenue, averaged over retained customers (like-for-like).","type":"number"},"avgRevenuePerCustomerCurrent":{"description":"Avg current revenue, averaged over retained customers.","type":"number"},"avgRevenuePerCustomerChange":{"description":"Percentage change in avg spend from the same customers.","type":"number"},"bands":{"description":"Per-customer retention bands (6 fixed buckets).","type":"array","items":{"type":"object","required":["band","customerCount","customerPercentage","baselineRevenue","currentRevenue"],"properties":{"band":{"anyOf":[{"const":"growing","type":"string"},{"const":"holding","type":"string"},{"const":"declining","type":"string"},{"const":"at_risk","type":"string"},{"const":"critical","type":"string"},{"const":"lost","type":"string"}]},"customerCount":{"description":"Customers in this band.","type":"number"},"customerPercentage":{"description":"Share of baseline customers (0-100).","type":"number"},"baselineRevenue":{"description":"Baseline revenue from this band.","type":"number"},"currentRevenue":{"description":"Current revenue from this band.","type":"number"}}}}}}},"stability":{"description":"Null when warning.level is insufficient_data.","anyOf":[{"type":"object","required":["weightedRetention","weightedGrossRetention","volatility","score","rating","projectedAnnualRevenue"],"properties":{"weightedRetention":{"description":"Baseline-weighted NRR across all periods (%).","type":"number"},"weightedGrossRetention":{"description":"Baseline-weighted GRR across all periods (%).","type":"number"},"volatility":{"description":"Standard deviation of NRR across periods (pp).","type":"number"},"score":{"description":"Stability score 0-100.","type":"number"},"rating":{"anyOf":[{"const":"excellent","type":"string"},{"const":"good","type":"string"},{"const":"moderate","type":"string"},{"const":"concerning","type":"string"},{"const":"critical","type":"string"}]},"projectedAnnualRevenue":{"description":"Estimated revenue we can count on next period from existing customers.","type":"number"}}},{"type":"null"}]},"currencyMix":{"description":"Currency situation — retention is computed only in the org default.","type":"object","required":["primaryCurrencyId","primaryCurrencyCode","otherCurrenciesPresent","otherCurrenciesRevenue"],"properties":{"primaryCurrencyId":{"description":"Org default currency ID.","type":"number"},"primaryCurrencyCode":{"description":"Org default currency code.","type":"string"},"otherCurrenciesPresent":{"description":"True if orders in other currencies exist in the windows.","type":"boolean"},"otherCurrenciesRevenue":{"description":"Total revenue ignored due to non-default currency.","type":"number"}}}},"required":["period","currency","warning","periods","stability","currencyMix"]}}}}},"operationId":"getBffDashboardRevenue-retention","tags":["Dashboard"],"summary":"Year-over-year revenue retention","description":"Cohort-based revenue retention: for customers who paid in a previous period, how much do they still pay this period? Returns per-period stats, per-customer retention bands, a stability score and a warning level. The most recent period is \"floating\" (truncated to today) and compared to the same offset in the prior period for a fair in-progress comparison. Returns insufficient_data if the organisation's first paid order is younger than 2 years."}},"/bff/dashboard/mrr":{"get":{"parameters":[{"description":"Number of months to analyze. Defaults to 12.","schema":{"type":"number","default":12},"in":"query","name":"months","required":false}],"responses":{"200":{"description":"MRR and subscription metrics.","content":{"application/json":{"schema":{"type":"object","properties":{"currentMrr":{"description":"Current Monthly Recurring Revenue.","type":"number"},"previousMrr":{"description":"Previous month MRR.","type":"number"},"mrrChange":{"description":"Percentage change in MRR vs previous month.","type":"number"},"activeSubscriptions":{"description":"Number of currently active subscriptions.","type":"number"},"churnedSubscriptions":{"description":"Subscriptions cancelled/expired this month.","type":"number"},"newSubscriptions":{"description":"New subscriptions created this month.","type":"number"},"churnRate":{"description":"Monthly churn rate (0-100%).","type":"number"},"monthlyTrend":{"description":"Monthly MRR trend, oldest first.","type":"array","items":{"description":"Monthly MRR data point.","type":"object","required":["month","mrr","activeSubscriptions","newSubscriptions","churnedSubscriptions"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"mrr":{"description":"MRR for the month.","type":"number"},"activeSubscriptions":{"description":"Active subscriptions at end of month.","type":"number"},"newSubscriptions":{"description":"New subscriptions in the month.","type":"number"},"churnedSubscriptions":{"description":"Churned subscriptions in the month.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["currentMrr","previousMrr","mrrChange","activeSubscriptions","churnedSubscriptions","newSubscriptions","churnRate","monthlyTrend","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"currentMrr":{"description":"Current Monthly Recurring Revenue.","type":"number"},"previousMrr":{"description":"Previous month MRR.","type":"number"},"mrrChange":{"description":"Percentage change in MRR vs previous month.","type":"number"},"activeSubscriptions":{"description":"Number of currently active subscriptions.","type":"number"},"churnedSubscriptions":{"description":"Subscriptions cancelled/expired this month.","type":"number"},"newSubscriptions":{"description":"New subscriptions created this month.","type":"number"},"churnRate":{"description":"Monthly churn rate (0-100%).","type":"number"},"monthlyTrend":{"description":"Monthly MRR trend, oldest first.","type":"array","items":{"description":"Monthly MRR data point.","type":"object","required":["month","mrr","activeSubscriptions","newSubscriptions","churnedSubscriptions"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"mrr":{"description":"MRR for the month.","type":"number"},"activeSubscriptions":{"description":"Active subscriptions at end of month.","type":"number"},"newSubscriptions":{"description":"New subscriptions in the month.","type":"number"},"churnedSubscriptions":{"description":"Churned subscriptions in the month.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["currentMrr","previousMrr","mrrChange","activeSubscriptions","churnedSubscriptions","newSubscriptions","churnRate","monthlyTrend","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"currentMrr":{"description":"Current Monthly Recurring Revenue.","type":"number"},"previousMrr":{"description":"Previous month MRR.","type":"number"},"mrrChange":{"description":"Percentage change in MRR vs previous month.","type":"number"},"activeSubscriptions":{"description":"Number of currently active subscriptions.","type":"number"},"churnedSubscriptions":{"description":"Subscriptions cancelled/expired this month.","type":"number"},"newSubscriptions":{"description":"New subscriptions created this month.","type":"number"},"churnRate":{"description":"Monthly churn rate (0-100%).","type":"number"},"monthlyTrend":{"description":"Monthly MRR trend, oldest first.","type":"array","items":{"description":"Monthly MRR data point.","type":"object","required":["month","mrr","activeSubscriptions","newSubscriptions","churnedSubscriptions"],"properties":{"month":{"description":"Month in YYYY-MM format.","type":"string"},"mrr":{"description":"MRR for the month.","type":"number"},"activeSubscriptions":{"description":"Active subscriptions at end of month.","type":"number"},"newSubscriptions":{"description":"New subscriptions in the month.","type":"number"},"churnedSubscriptions":{"description":"Churned subscriptions in the month.","type":"number"}}}},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["currentMrr","previousMrr","mrrChange","activeSubscriptions","churnedSubscriptions","newSubscriptions","churnRate","monthlyTrend","currency"]}}}}},"operationId":"getBffDashboardMrr","tags":["Dashboard"],"summary":"Monthly Recurring Revenue (MRR)","description":"Returns MRR metrics for subscription-based revenue. The \"north star\" metric for businesses with recurring revenue models."}},"/bff/dashboard/top-products":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false},{"description":"Number of products to return. Defaults to 10.","schema":{"type":"number","default":10},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Top products analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"description":"Top products sorted by revenue (highest first).","type":"array","items":{"description":"Top product item.","type":"object","required":["rank","productName","quantitySold","revenue","orderCount","averagePrice","revenuePercentage"],"properties":{"rank":{"description":"Rank by revenue (1 = highest revenue).","type":"number"},"productId":{"description":"Internal product ID. Undefined for ad-hoc items.","type":"number"},"productCode":{"description":"Product code. Undefined for ad-hoc items.","type":"string"},"productName":{"description":"Product name or order item label.","type":"string"},"quantitySold":{"description":"Total quantity sold.","type":"number"},"revenue":{"description":"Total revenue generated.","type":"number"},"orderCount":{"description":"Number of orders containing this product.","type":"number"},"averagePrice":{"description":"Average selling price per unit.","type":"number"},"revenuePercentage":{"description":"Percentage of total revenue (0-100).","type":"number"}}}},"totalRevenue":{"description":"Total revenue for the period (for percentage calculation).","type":"number"},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["products","totalRevenue","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"products":{"description":"Top products sorted by revenue (highest first).","type":"array","items":{"description":"Top product item.","type":"object","required":["rank","productName","quantitySold","revenue","orderCount","averagePrice","revenuePercentage"],"properties":{"rank":{"description":"Rank by revenue (1 = highest revenue).","type":"number"},"productId":{"description":"Internal product ID. Undefined for ad-hoc items.","type":"number"},"productCode":{"description":"Product code. Undefined for ad-hoc items.","type":"string"},"productName":{"description":"Product name or order item label.","type":"string"},"quantitySold":{"description":"Total quantity sold.","type":"number"},"revenue":{"description":"Total revenue generated.","type":"number"},"orderCount":{"description":"Number of orders containing this product.","type":"number"},"averagePrice":{"description":"Average selling price per unit.","type":"number"},"revenuePercentage":{"description":"Percentage of total revenue (0-100).","type":"number"}}}},"totalRevenue":{"description":"Total revenue for the period (for percentage calculation).","type":"number"},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["products","totalRevenue","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"products":{"description":"Top products sorted by revenue (highest first).","type":"array","items":{"description":"Top product item.","type":"object","required":["rank","productName","quantitySold","revenue","orderCount","averagePrice","revenuePercentage"],"properties":{"rank":{"description":"Rank by revenue (1 = highest revenue).","type":"number"},"productId":{"description":"Internal product ID. Undefined for ad-hoc items.","type":"number"},"productCode":{"description":"Product code. Undefined for ad-hoc items.","type":"string"},"productName":{"description":"Product name or order item label.","type":"string"},"quantitySold":{"description":"Total quantity sold.","type":"number"},"revenue":{"description":"Total revenue generated.","type":"number"},"orderCount":{"description":"Number of orders containing this product.","type":"number"},"averagePrice":{"description":"Average selling price per unit.","type":"number"},"revenuePercentage":{"description":"Percentage of total revenue (0-100).","type":"number"}}}},"totalRevenue":{"description":"Total revenue for the period (for percentage calculation).","type":"number"},"currency":{"description":"Currency code for all amounts (e.g., \"CZK\").","type":"string"}},"required":["products","totalRevenue","currency"]}}}}},"operationId":"getBffDashboardTop-products","tags":["Dashboard"],"summary":"Top selling products","description":"Returns best-selling products by revenue and quantity. Identifies what generates revenue vs marketing noise."}},"/bff/dashboard/calendar-utilization":{"get":{"parameters":[{"description":"Number of days ahead to analyze. Defaults to 14.","schema":{"type":"number","default":14},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Calendar utilization metrics.","content":{"application/json":{"schema":{"type":"object","properties":{"overallUtilization":{"description":"Overall utilization rate (0-100%).","type":"number"},"totalSlots":{"description":"Total number of events/slots in the period.","type":"number"},"bookedSlots":{"description":"Number of active (non-cancelled) bookings.","type":"number"},"cancelledEvents":{"description":"Number of cancelled events in the period.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"},"byCalendar":{"description":"Utilization breakdown by calendar.","type":"array","items":{"description":"Calendar utilization item.","type":"object","required":["calendarId","calendarName","utilization","bookedHours","availableHours"],"properties":{"calendarId":{"description":"Calendar ID.","type":"number"},"calendarName":{"description":"Calendar name.","type":"string"},"utilization":{"description":"Utilization rate for this calendar (0-100%).","type":"number"},"bookedHours":{"description":"Total booked hours.","type":"number"},"availableHours":{"description":"Total available hours (estimated).","type":"number"}}}},"dailyUtilization":{"description":"Daily utilization trend for charting.","type":"array","items":{"description":"Daily utilization data point.","type":"object","required":["date","utilization","bookedEvents"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"utilization":{"description":"Utilization for this day (0-100%).","type":"number"},"bookedEvents":{"description":"Number of booked events on this day.","type":"number"}}}}},"required":["overallUtilization","totalSlots","bookedSlots","cancelledEvents","cancellationRate","byCalendar","dailyUtilization"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"overallUtilization":{"description":"Overall utilization rate (0-100%).","type":"number"},"totalSlots":{"description":"Total number of events/slots in the period.","type":"number"},"bookedSlots":{"description":"Number of active (non-cancelled) bookings.","type":"number"},"cancelledEvents":{"description":"Number of cancelled events in the period.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"},"byCalendar":{"description":"Utilization breakdown by calendar.","type":"array","items":{"description":"Calendar utilization item.","type":"object","required":["calendarId","calendarName","utilization","bookedHours","availableHours"],"properties":{"calendarId":{"description":"Calendar ID.","type":"number"},"calendarName":{"description":"Calendar name.","type":"string"},"utilization":{"description":"Utilization rate for this calendar (0-100%).","type":"number"},"bookedHours":{"description":"Total booked hours.","type":"number"},"availableHours":{"description":"Total available hours (estimated).","type":"number"}}}},"dailyUtilization":{"description":"Daily utilization trend for charting.","type":"array","items":{"description":"Daily utilization data point.","type":"object","required":["date","utilization","bookedEvents"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"utilization":{"description":"Utilization for this day (0-100%).","type":"number"},"bookedEvents":{"description":"Number of booked events on this day.","type":"number"}}}}},"required":["overallUtilization","totalSlots","bookedSlots","cancelledEvents","cancellationRate","byCalendar","dailyUtilization"]}},"text/plain":{"schema":{"type":"object","properties":{"overallUtilization":{"description":"Overall utilization rate (0-100%).","type":"number"},"totalSlots":{"description":"Total number of events/slots in the period.","type":"number"},"bookedSlots":{"description":"Number of active (non-cancelled) bookings.","type":"number"},"cancelledEvents":{"description":"Number of cancelled events in the period.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"},"byCalendar":{"description":"Utilization breakdown by calendar.","type":"array","items":{"description":"Calendar utilization item.","type":"object","required":["calendarId","calendarName","utilization","bookedHours","availableHours"],"properties":{"calendarId":{"description":"Calendar ID.","type":"number"},"calendarName":{"description":"Calendar name.","type":"string"},"utilization":{"description":"Utilization rate for this calendar (0-100%).","type":"number"},"bookedHours":{"description":"Total booked hours.","type":"number"},"availableHours":{"description":"Total available hours (estimated).","type":"number"}}}},"dailyUtilization":{"description":"Daily utilization trend for charting.","type":"array","items":{"description":"Daily utilization data point.","type":"object","required":["date","utilization","bookedEvents"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"utilization":{"description":"Utilization for this day (0-100%).","type":"number"},"bookedEvents":{"description":"Number of booked events on this day.","type":"number"}}}}},"required":["overallUtilization","totalSlots","bookedSlots","cancelledEvents","cancellationRate","byCalendar","dailyUtilization"]}}}}},"operationId":"getBffDashboardCalendar-utilization","tags":["Dashboard"],"summary":"Calendar utilization","description":"Returns calendar slot utilization metrics. Critical for service businesses, consultants, rentals, and booking-based models."}},"/bff/dashboard/unmatched-payments":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Unmatched payments analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Total value of unmatched transactions.","type":"number"},"transactionCount":{"description":"Number of unmatched transactions.","type":"number"},"agingBuckets":{"description":"Transactions grouped by age.","type":"object","required":["today","thisWeek","thisMonth","older"],"properties":{"today":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received today.","type":"number"},"count":{"description":"Count of transactions today.","type":"number"}}},"thisWeek":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received this week.","type":"number"},"count":{"description":"Count of transactions this week.","type":"number"}}},"thisMonth":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received this month.","type":"number"},"count":{"description":"Count of transactions this month.","type":"number"}}},"older":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount from older transactions.","type":"number"},"count":{"description":"Count of older transactions.","type":"number"}}}}},"recentTransactions":{"description":"Recent unmatched transactions (max 20).","type":"array","items":{"type":"object","required":["id","bankTransactionId","date","amount"],"properties":{"id":{"description":"Transaction ID.","type":"number"},"bankTransactionId":{"description":"Bank transaction reference.","type":"string"},"date":{"description":"Transaction date (YYYY-MM-DD).","type":"string"},"amount":{"description":"Transaction amount.","type":"number"},"variableSymbol":{"description":"Variable symbol if present.","type":"string"},"accountName":{"description":"Sender account name.","type":"string"},"message":{"description":"Transaction message.","type":"string"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalAmount","transactionCount","agingBuckets","recentTransactions","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Total value of unmatched transactions.","type":"number"},"transactionCount":{"description":"Number of unmatched transactions.","type":"number"},"agingBuckets":{"description":"Transactions grouped by age.","type":"object","required":["today","thisWeek","thisMonth","older"],"properties":{"today":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received today.","type":"number"},"count":{"description":"Count of transactions today.","type":"number"}}},"thisWeek":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received this week.","type":"number"},"count":{"description":"Count of transactions this week.","type":"number"}}},"thisMonth":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received this month.","type":"number"},"count":{"description":"Count of transactions this month.","type":"number"}}},"older":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount from older transactions.","type":"number"},"count":{"description":"Count of older transactions.","type":"number"}}}}},"recentTransactions":{"description":"Recent unmatched transactions (max 20).","type":"array","items":{"type":"object","required":["id","bankTransactionId","date","amount"],"properties":{"id":{"description":"Transaction ID.","type":"number"},"bankTransactionId":{"description":"Bank transaction reference.","type":"string"},"date":{"description":"Transaction date (YYYY-MM-DD).","type":"string"},"amount":{"description":"Transaction amount.","type":"number"},"variableSymbol":{"description":"Variable symbol if present.","type":"string"},"accountName":{"description":"Sender account name.","type":"string"},"message":{"description":"Transaction message.","type":"string"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalAmount","transactionCount","agingBuckets","recentTransactions","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"totalAmount":{"description":"Total value of unmatched transactions.","type":"number"},"transactionCount":{"description":"Number of unmatched transactions.","type":"number"},"agingBuckets":{"description":"Transactions grouped by age.","type":"object","required":["today","thisWeek","thisMonth","older"],"properties":{"today":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received today.","type":"number"},"count":{"description":"Count of transactions today.","type":"number"}}},"thisWeek":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received this week.","type":"number"},"count":{"description":"Count of transactions this week.","type":"number"}}},"thisMonth":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount received this month.","type":"number"},"count":{"description":"Count of transactions this month.","type":"number"}}},"older":{"type":"object","required":["amount","count"],"properties":{"amount":{"description":"Amount from older transactions.","type":"number"},"count":{"description":"Count of older transactions.","type":"number"}}}}},"recentTransactions":{"description":"Recent unmatched transactions (max 20).","type":"array","items":{"type":"object","required":["id","bankTransactionId","date","amount"],"properties":{"id":{"description":"Transaction ID.","type":"number"},"bankTransactionId":{"description":"Bank transaction reference.","type":"string"},"date":{"description":"Transaction date (YYYY-MM-DD).","type":"string"},"amount":{"description":"Transaction amount.","type":"number"},"variableSymbol":{"description":"Variable symbol if present.","type":"string"},"accountName":{"description":"Sender account name.","type":"string"},"message":{"description":"Transaction message.","type":"string"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalAmount","transactionCount","agingBuckets","recentTransactions","currency"]}}}}},"operationId":"getBffDashboardUnmatched-payments","tags":["Dashboard"],"summary":"Unmatched bank payments","description":"Returns bank transactions not matched to any order. Critical for cash recovery - identifies failed variable symbols, gateway issues, and import errors."}},"/bff/dashboard/cash-flow":{"get":{"parameters":[{"description":"Number of months to analyze. Defaults to 6.","schema":{"type":"number","default":6},"in":"query","name":"months","required":false}],"responses":{"200":{"description":"Cash flow analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"currentMonth":{"type":"object","required":["invoiced","received","gap","collectionRate"],"properties":{"invoiced":{"description":"Total invoiced this month.","type":"number"},"received":{"description":"Total cash received this month.","type":"number"},"gap":{"description":"Difference between invoiced and received.","type":"number"},"collectionRate":{"description":"Collection rate (0-100%).","type":"number"}}},"pendingInvoices":{"description":"Total value of unpaid invoices.","type":"number"},"pendingOrders":{"description":"Total value of unpaid orders.","type":"number"},"monthlyTrend":{"description":"Monthly cash flow trend.","type":"array","items":{"type":"object","required":["month","invoiced","received","gap"],"properties":{"month":{"description":"Month (YYYY-MM).","type":"string"},"invoiced":{"description":"Amount invoiced.","type":"number"},"received":{"description":"Amount received.","type":"number"},"gap":{"description":"Cash flow gap.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["currentMonth","pendingInvoices","pendingOrders","monthlyTrend","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"currentMonth":{"type":"object","required":["invoiced","received","gap","collectionRate"],"properties":{"invoiced":{"description":"Total invoiced this month.","type":"number"},"received":{"description":"Total cash received this month.","type":"number"},"gap":{"description":"Difference between invoiced and received.","type":"number"},"collectionRate":{"description":"Collection rate (0-100%).","type":"number"}}},"pendingInvoices":{"description":"Total value of unpaid invoices.","type":"number"},"pendingOrders":{"description":"Total value of unpaid orders.","type":"number"},"monthlyTrend":{"description":"Monthly cash flow trend.","type":"array","items":{"type":"object","required":["month","invoiced","received","gap"],"properties":{"month":{"description":"Month (YYYY-MM).","type":"string"},"invoiced":{"description":"Amount invoiced.","type":"number"},"received":{"description":"Amount received.","type":"number"},"gap":{"description":"Cash flow gap.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["currentMonth","pendingInvoices","pendingOrders","monthlyTrend","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"currentMonth":{"type":"object","required":["invoiced","received","gap","collectionRate"],"properties":{"invoiced":{"description":"Total invoiced this month.","type":"number"},"received":{"description":"Total cash received this month.","type":"number"},"gap":{"description":"Difference between invoiced and received.","type":"number"},"collectionRate":{"description":"Collection rate (0-100%).","type":"number"}}},"pendingInvoices":{"description":"Total value of unpaid invoices.","type":"number"},"pendingOrders":{"description":"Total value of unpaid orders.","type":"number"},"monthlyTrend":{"description":"Monthly cash flow trend.","type":"array","items":{"type":"object","required":["month","invoiced","received","gap"],"properties":{"month":{"description":"Month (YYYY-MM).","type":"string"},"invoiced":{"description":"Amount invoiced.","type":"number"},"received":{"description":"Amount received.","type":"number"},"gap":{"description":"Cash flow gap.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["currentMonth","pendingInvoices","pendingOrders","monthlyTrend","currency"]}}}}},"operationId":"getBffDashboardCash-flow","tags":["Dashboard"],"summary":"Cash flow overview","description":"Compares invoiced amounts vs actual cash received. Essential for financial planning - invoices ≠ cash in hand."}},"/bff/dashboard/payment-methods":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Payment methods analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"totalOrders":{"description":"Total paid orders.","type":"number"},"totalRevenue":{"description":"Total revenue.","type":"number"},"methods":{"description":"Payment methods breakdown.","type":"array","items":{"type":"object","required":["methodId","methodCode","methodName","orderCount","revenue","avgOrderValue","orderPercentage","revenuePercentage"],"properties":{"methodId":{"description":"Payment method ID.","type":"number"},"methodCode":{"description":"Payment method code.","type":"string"},"methodName":{"description":"Payment method name.","type":"string"},"orderCount":{"description":"Orders using this method.","type":"number"},"revenue":{"description":"Revenue from this method.","type":"number"},"avgOrderValue":{"description":"Average order value.","type":"number"},"orderPercentage":{"description":"Percentage of orders (0-100).","type":"number"},"revenuePercentage":{"description":"Percentage of revenue (0-100).","type":"number"}}}},"gateways":{"description":"Online gateway performance.","type":"array","items":{"type":"object","required":["gatewayCode","gatewayName","paymentCount","successCount","successRate"],"properties":{"gatewayCode":{"description":"Gateway code.","type":"string"},"gatewayName":{"description":"Gateway name.","type":"string"},"paymentCount":{"description":"Total payment attempts.","type":"number"},"successCount":{"description":"Successful payments.","type":"number"},"successRate":{"description":"Success rate (0-100%).","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalOrders","totalRevenue","methods","gateways","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalOrders":{"description":"Total paid orders.","type":"number"},"totalRevenue":{"description":"Total revenue.","type":"number"},"methods":{"description":"Payment methods breakdown.","type":"array","items":{"type":"object","required":["methodId","methodCode","methodName","orderCount","revenue","avgOrderValue","orderPercentage","revenuePercentage"],"properties":{"methodId":{"description":"Payment method ID.","type":"number"},"methodCode":{"description":"Payment method code.","type":"string"},"methodName":{"description":"Payment method name.","type":"string"},"orderCount":{"description":"Orders using this method.","type":"number"},"revenue":{"description":"Revenue from this method.","type":"number"},"avgOrderValue":{"description":"Average order value.","type":"number"},"orderPercentage":{"description":"Percentage of orders (0-100).","type":"number"},"revenuePercentage":{"description":"Percentage of revenue (0-100).","type":"number"}}}},"gateways":{"description":"Online gateway performance.","type":"array","items":{"type":"object","required":["gatewayCode","gatewayName","paymentCount","successCount","successRate"],"properties":{"gatewayCode":{"description":"Gateway code.","type":"string"},"gatewayName":{"description":"Gateway name.","type":"string"},"paymentCount":{"description":"Total payment attempts.","type":"number"},"successCount":{"description":"Successful payments.","type":"number"},"successRate":{"description":"Success rate (0-100%).","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalOrders","totalRevenue","methods","gateways","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"totalOrders":{"description":"Total paid orders.","type":"number"},"totalRevenue":{"description":"Total revenue.","type":"number"},"methods":{"description":"Payment methods breakdown.","type":"array","items":{"type":"object","required":["methodId","methodCode","methodName","orderCount","revenue","avgOrderValue","orderPercentage","revenuePercentage"],"properties":{"methodId":{"description":"Payment method ID.","type":"number"},"methodCode":{"description":"Payment method code.","type":"string"},"methodName":{"description":"Payment method name.","type":"string"},"orderCount":{"description":"Orders using this method.","type":"number"},"revenue":{"description":"Revenue from this method.","type":"number"},"avgOrderValue":{"description":"Average order value.","type":"number"},"orderPercentage":{"description":"Percentage of orders (0-100).","type":"number"},"revenuePercentage":{"description":"Percentage of revenue (0-100).","type":"number"}}}},"gateways":{"description":"Online gateway performance.","type":"array","items":{"type":"object","required":["gatewayCode","gatewayName","paymentCount","successCount","successRate"],"properties":{"gatewayCode":{"description":"Gateway code.","type":"string"},"gatewayName":{"description":"Gateway name.","type":"string"},"paymentCount":{"description":"Total payment attempts.","type":"number"},"successCount":{"description":"Successful payments.","type":"number"},"successRate":{"description":"Success rate (0-100%).","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalOrders","totalRevenue","methods","gateways","currency"]}}}}},"operationId":"getBffDashboardPayment-methods","tags":["Dashboard"],"summary":"Payment methods popularity","description":"Shows which payment methods customers prefer. Helps optimize conversion and reduce gateway fees by focusing on efficient methods."}},"/bff/dashboard/order-funnel":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Order funnel analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"stages":{"type":"object","required":["cartsCreated","cartsWithItems","ordersCreated","ordersPaid","ordersCompleted","ordersCancelled"],"properties":{"cartsCreated":{"description":"Total carts created.","type":"number"},"cartsWithItems":{"description":"Carts with at least one item.","type":"number"},"ordersCreated":{"description":"Orders created from carts.","type":"number"},"ordersPaid":{"description":"Orders successfully paid.","type":"number"},"ordersCompleted":{"description":"Orders marked as completed.","type":"number"},"ordersCancelled":{"description":"Orders cancelled/storno.","type":"number"}}},"conversionRates":{"type":"object","required":["cartToOrder","orderToPaid","paidToCompleted","overallConversion","cancellationRate"],"properties":{"cartToOrder":{"description":"Cart to order conversion (0-100%).","type":"number"},"orderToPaid":{"description":"Order to paid conversion (0-100%).","type":"number"},"paidToCompleted":{"description":"Paid to completed rate (0-100%).","type":"number"},"overallConversion":{"description":"Cart to paid overall (0-100%).","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}},"abandonedByStatus":{"description":"Abandoned orders by status.","type":"array","items":{"type":"object","required":["statusCode","statusLabel","count"],"properties":{"statusCode":{"description":"Order status code.","type":"string"},"statusLabel":{"description":"Status label.","type":"string"},"count":{"description":"Number of abandoned orders.","type":"number"}}}},"dailyTrend":{"description":"Daily conversion trend.","type":"array","items":{"type":"object","required":["date","ordersCreated","ordersPaid","conversionRate"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"ordersCreated":{"description":"Orders created.","type":"number"},"ordersPaid":{"description":"Orders paid.","type":"number"},"conversionRate":{"description":"Daily conversion rate (0-100%).","type":"number"}}}}},"required":["stages","conversionRates","abandonedByStatus","dailyTrend"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"stages":{"type":"object","required":["cartsCreated","cartsWithItems","ordersCreated","ordersPaid","ordersCompleted","ordersCancelled"],"properties":{"cartsCreated":{"description":"Total carts created.","type":"number"},"cartsWithItems":{"description":"Carts with at least one item.","type":"number"},"ordersCreated":{"description":"Orders created from carts.","type":"number"},"ordersPaid":{"description":"Orders successfully paid.","type":"number"},"ordersCompleted":{"description":"Orders marked as completed.","type":"number"},"ordersCancelled":{"description":"Orders cancelled/storno.","type":"number"}}},"conversionRates":{"type":"object","required":["cartToOrder","orderToPaid","paidToCompleted","overallConversion","cancellationRate"],"properties":{"cartToOrder":{"description":"Cart to order conversion (0-100%).","type":"number"},"orderToPaid":{"description":"Order to paid conversion (0-100%).","type":"number"},"paidToCompleted":{"description":"Paid to completed rate (0-100%).","type":"number"},"overallConversion":{"description":"Cart to paid overall (0-100%).","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}},"abandonedByStatus":{"description":"Abandoned orders by status.","type":"array","items":{"type":"object","required":["statusCode","statusLabel","count"],"properties":{"statusCode":{"description":"Order status code.","type":"string"},"statusLabel":{"description":"Status label.","type":"string"},"count":{"description":"Number of abandoned orders.","type":"number"}}}},"dailyTrend":{"description":"Daily conversion trend.","type":"array","items":{"type":"object","required":["date","ordersCreated","ordersPaid","conversionRate"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"ordersCreated":{"description":"Orders created.","type":"number"},"ordersPaid":{"description":"Orders paid.","type":"number"},"conversionRate":{"description":"Daily conversion rate (0-100%).","type":"number"}}}}},"required":["stages","conversionRates","abandonedByStatus","dailyTrend"]}},"text/plain":{"schema":{"type":"object","properties":{"stages":{"type":"object","required":["cartsCreated","cartsWithItems","ordersCreated","ordersPaid","ordersCompleted","ordersCancelled"],"properties":{"cartsCreated":{"description":"Total carts created.","type":"number"},"cartsWithItems":{"description":"Carts with at least one item.","type":"number"},"ordersCreated":{"description":"Orders created from carts.","type":"number"},"ordersPaid":{"description":"Orders successfully paid.","type":"number"},"ordersCompleted":{"description":"Orders marked as completed.","type":"number"},"ordersCancelled":{"description":"Orders cancelled/storno.","type":"number"}}},"conversionRates":{"type":"object","required":["cartToOrder","orderToPaid","paidToCompleted","overallConversion","cancellationRate"],"properties":{"cartToOrder":{"description":"Cart to order conversion (0-100%).","type":"number"},"orderToPaid":{"description":"Order to paid conversion (0-100%).","type":"number"},"paidToCompleted":{"description":"Paid to completed rate (0-100%).","type":"number"},"overallConversion":{"description":"Cart to paid overall (0-100%).","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}},"abandonedByStatus":{"description":"Abandoned orders by status.","type":"array","items":{"type":"object","required":["statusCode","statusLabel","count"],"properties":{"statusCode":{"description":"Order status code.","type":"string"},"statusLabel":{"description":"Status label.","type":"string"},"count":{"description":"Number of abandoned orders.","type":"number"}}}},"dailyTrend":{"description":"Daily conversion trend.","type":"array","items":{"type":"object","required":["date","ordersCreated","ordersPaid","conversionRate"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"ordersCreated":{"description":"Orders created.","type":"number"},"ordersPaid":{"description":"Orders paid.","type":"number"},"conversionRate":{"description":"Daily conversion rate (0-100%).","type":"number"}}}}},"required":["stages","conversionRates","abandonedByStatus","dailyTrend"]}}}}},"operationId":"getBffDashboardOrder-funnel","tags":["Dashboard"],"summary":"Order conversion funnel","description":"Shows conversion rates at each stage: cart → order → paid → completed. Identifies where UX or system issues lose money."}},"/bff/dashboard/voucher-performance":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Voucher performance analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["ordersWithVoucher","ordersTotal","voucherUsageRate","revenueWithVoucher","revenueTotal","totalDiscount","avgDiscountPerOrder"],"properties":{"ordersWithVoucher":{"description":"Orders using a voucher.","type":"number"},"ordersTotal":{"description":"Total paid orders.","type":"number"},"voucherUsageRate":{"description":"Voucher usage rate (0-100%).","type":"number"},"revenueWithVoucher":{"description":"Revenue from voucher orders.","type":"number"},"revenueTotal":{"description":"Total revenue.","type":"number"},"totalDiscount":{"description":"Total discount amount given.","type":"number"},"avgDiscountPerOrder":{"description":"Average discount per order.","type":"number"}}},"topVouchers":{"description":"Top 10 vouchers by usage.","type":"array","items":{"type":"object","required":["voucherId","voucherCode","voucherType","voucherValue","usageCount","revenue"],"properties":{"voucherId":{"description":"Voucher ID.","type":"number"},"voucherCode":{"description":"Voucher code.","type":"string"},"voucherType":{"description":"Voucher type name.","type":"string"},"voucherValue":{"description":"Voucher value.","type":"string"},"usageCount":{"description":"Times used.","type":"number"},"revenue":{"description":"Revenue from orders with this voucher.","type":"number"}}}},"byType":{"description":"Vouchers grouped by type.","type":"array","items":{"type":"object","required":["typeId","typeName","usageCount","revenue"],"properties":{"typeId":{"description":"Voucher type ID.","type":"number"},"typeName":{"description":"Voucher type name.","type":"string"},"usageCount":{"description":"Usage count.","type":"number"},"revenue":{"description":"Revenue generated.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","topVouchers","byType","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["ordersWithVoucher","ordersTotal","voucherUsageRate","revenueWithVoucher","revenueTotal","totalDiscount","avgDiscountPerOrder"],"properties":{"ordersWithVoucher":{"description":"Orders using a voucher.","type":"number"},"ordersTotal":{"description":"Total paid orders.","type":"number"},"voucherUsageRate":{"description":"Voucher usage rate (0-100%).","type":"number"},"revenueWithVoucher":{"description":"Revenue from voucher orders.","type":"number"},"revenueTotal":{"description":"Total revenue.","type":"number"},"totalDiscount":{"description":"Total discount amount given.","type":"number"},"avgDiscountPerOrder":{"description":"Average discount per order.","type":"number"}}},"topVouchers":{"description":"Top 10 vouchers by usage.","type":"array","items":{"type":"object","required":["voucherId","voucherCode","voucherType","voucherValue","usageCount","revenue"],"properties":{"voucherId":{"description":"Voucher ID.","type":"number"},"voucherCode":{"description":"Voucher code.","type":"string"},"voucherType":{"description":"Voucher type name.","type":"string"},"voucherValue":{"description":"Voucher value.","type":"string"},"usageCount":{"description":"Times used.","type":"number"},"revenue":{"description":"Revenue from orders with this voucher.","type":"number"}}}},"byType":{"description":"Vouchers grouped by type.","type":"array","items":{"type":"object","required":["typeId","typeName","usageCount","revenue"],"properties":{"typeId":{"description":"Voucher type ID.","type":"number"},"typeName":{"description":"Voucher type name.","type":"string"},"usageCount":{"description":"Usage count.","type":"number"},"revenue":{"description":"Revenue generated.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","topVouchers","byType","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["ordersWithVoucher","ordersTotal","voucherUsageRate","revenueWithVoucher","revenueTotal","totalDiscount","avgDiscountPerOrder"],"properties":{"ordersWithVoucher":{"description":"Orders using a voucher.","type":"number"},"ordersTotal":{"description":"Total paid orders.","type":"number"},"voucherUsageRate":{"description":"Voucher usage rate (0-100%).","type":"number"},"revenueWithVoucher":{"description":"Revenue from voucher orders.","type":"number"},"revenueTotal":{"description":"Total revenue.","type":"number"},"totalDiscount":{"description":"Total discount amount given.","type":"number"},"avgDiscountPerOrder":{"description":"Average discount per order.","type":"number"}}},"topVouchers":{"description":"Top 10 vouchers by usage.","type":"array","items":{"type":"object","required":["voucherId","voucherCode","voucherType","voucherValue","usageCount","revenue"],"properties":{"voucherId":{"description":"Voucher ID.","type":"number"},"voucherCode":{"description":"Voucher code.","type":"string"},"voucherType":{"description":"Voucher type name.","type":"string"},"voucherValue":{"description":"Voucher value.","type":"string"},"usageCount":{"description":"Times used.","type":"number"},"revenue":{"description":"Revenue from orders with this voucher.","type":"number"}}}},"byType":{"description":"Vouchers grouped by type.","type":"array","items":{"type":"object","required":["typeId","typeName","usageCount","revenue"],"properties":{"typeId":{"description":"Voucher type ID.","type":"number"},"typeName":{"description":"Voucher type name.","type":"string"},"usageCount":{"description":"Usage count.","type":"number"},"revenue":{"description":"Revenue generated.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","topVouchers","byType","currency"]}}}}},"operationId":"getBffDashboardVoucher-performance","tags":["Dashboard"],"summary":"Voucher/discount code performance","description":"Analyzes effectiveness of discount codes. Shows whether vouchers drive revenue or just burn margin."}},"/bff/dashboard/inactive-customers":{"get":{"parameters":[{"description":"Days without order to be considered inactive. Defaults to 90.","schema":{"type":"number","default":90},"in":"query","name":"inactiveDays","required":false}],"responses":{"200":{"description":"Inactive customers analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalCustomers","activeCustomers","inactiveCustomers","inactivityRate","inactiveRevenuePotential"],"properties":{"totalCustomers":{"description":"Total customers.","type":"number"},"activeCustomers":{"description":"Customers who ordered recently.","type":"number"},"inactiveCustomers":{"description":"Customers inactive for the threshold period.","type":"number"},"inactivityRate":{"description":"Inactivity rate (0-100%).","type":"number"},"inactiveRevenuePotential":{"description":"Estimated revenue potential from reactivation.","type":"number"}}},"bySegment":{"description":"Inactive customers by segment.","type":"array","items":{"type":"object","required":["segment","segmentLabel","customerCount","avgLifetimeValue","avgOrders"],"properties":{"segment":{"description":"Segment code.","type":"string"},"segmentLabel":{"description":"Segment label.","type":"string"},"customerCount":{"description":"Customers in segment.","type":"number"},"avgLifetimeValue":{"description":"Average lifetime value.","type":"number"},"avgOrders":{"description":"Average order count.","type":"number"}}}},"topInactiveCustomers":{"description":"Top 20 inactive customers by value.","type":"array","items":{"type":"object","required":["customerId","externalId","customerName","email","orderCount","totalSpent"],"properties":{"customerId":{"description":"Customer ID.","type":"number"},"externalId":{"description":"External customer ID.","type":"string"},"customerName":{"description":"Customer name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts — UI should fall back to `customerName` or `externalId`.","type":"string"},{"type":"null"}]},"lastOrderDate":{"description":"Last order date.","type":"string"},"orderCount":{"description":"Total orders.","type":"number"},"totalSpent":{"description":"Total amount spent.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","bySegment","topInactiveCustomers","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalCustomers","activeCustomers","inactiveCustomers","inactivityRate","inactiveRevenuePotential"],"properties":{"totalCustomers":{"description":"Total customers.","type":"number"},"activeCustomers":{"description":"Customers who ordered recently.","type":"number"},"inactiveCustomers":{"description":"Customers inactive for the threshold period.","type":"number"},"inactivityRate":{"description":"Inactivity rate (0-100%).","type":"number"},"inactiveRevenuePotential":{"description":"Estimated revenue potential from reactivation.","type":"number"}}},"bySegment":{"description":"Inactive customers by segment.","type":"array","items":{"type":"object","required":["segment","segmentLabel","customerCount","avgLifetimeValue","avgOrders"],"properties":{"segment":{"description":"Segment code.","type":"string"},"segmentLabel":{"description":"Segment label.","type":"string"},"customerCount":{"description":"Customers in segment.","type":"number"},"avgLifetimeValue":{"description":"Average lifetime value.","type":"number"},"avgOrders":{"description":"Average order count.","type":"number"}}}},"topInactiveCustomers":{"description":"Top 20 inactive customers by value.","type":"array","items":{"type":"object","required":["customerId","externalId","customerName","email","orderCount","totalSpent"],"properties":{"customerId":{"description":"Customer ID.","type":"number"},"externalId":{"description":"External customer ID.","type":"string"},"customerName":{"description":"Customer name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts — UI should fall back to `customerName` or `externalId`.","type":"string"},{"type":"null"}]},"lastOrderDate":{"description":"Last order date.","type":"string"},"orderCount":{"description":"Total orders.","type":"number"},"totalSpent":{"description":"Total amount spent.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","bySegment","topInactiveCustomers","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalCustomers","activeCustomers","inactiveCustomers","inactivityRate","inactiveRevenuePotential"],"properties":{"totalCustomers":{"description":"Total customers.","type":"number"},"activeCustomers":{"description":"Customers who ordered recently.","type":"number"},"inactiveCustomers":{"description":"Customers inactive for the threshold period.","type":"number"},"inactivityRate":{"description":"Inactivity rate (0-100%).","type":"number"},"inactiveRevenuePotential":{"description":"Estimated revenue potential from reactivation.","type":"number"}}},"bySegment":{"description":"Inactive customers by segment.","type":"array","items":{"type":"object","required":["segment","segmentLabel","customerCount","avgLifetimeValue","avgOrders"],"properties":{"segment":{"description":"Segment code.","type":"string"},"segmentLabel":{"description":"Segment label.","type":"string"},"customerCount":{"description":"Customers in segment.","type":"number"},"avgLifetimeValue":{"description":"Average lifetime value.","type":"number"},"avgOrders":{"description":"Average order count.","type":"number"}}}},"topInactiveCustomers":{"description":"Top 20 inactive customers by value.","type":"array","items":{"type":"object","required":["customerId","externalId","customerName","email","orderCount","totalSpent"],"properties":{"customerId":{"description":"Customer ID.","type":"number"},"externalId":{"description":"External customer ID.","type":"string"},"customerName":{"description":"Customer name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts — UI should fall back to `customerName` or `externalId`.","type":"string"},{"type":"null"}]},"lastOrderDate":{"description":"Last order date.","type":"string"},"orderCount":{"description":"Total orders.","type":"number"},"totalSpent":{"description":"Total amount spent.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","bySegment","topInactiveCustomers","currency"]}}}}},"operationId":"getBffDashboardInactive-customers","tags":["Dashboard"],"summary":"Inactive customers","description":"Identifies customers who have not ordered recently. Perfect input for reactivation campaigns and retention efforts."}},"/bff/dashboard/brand-performance":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false},{"description":"Locale for the unbranded fallback label.","examples":["en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"description":"Brand performance analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"totalRevenue":{"description":"Total revenue.","type":"number"},"totalQuantity":{"description":"Total quantity sold.","type":"number"},"brands":{"description":"Top 20 brands by revenue.","type":"array","items":{"type":"object","required":["brandCode","brandName","revenue","quantity","orderCount","productCount","revenuePercentage","revenueChange"],"properties":{"brandId":{"description":"Brand ID. Null for unbranded.","type":"number"},"brandCode":{"description":"Brand code.","type":"string"},"brandName":{"description":"Brand name.","type":"string"},"revenue":{"description":"Revenue from this brand.","type":"number"},"quantity":{"description":"Quantity sold.","type":"number"},"orderCount":{"description":"Number of orders.","type":"number"},"productCount":{"description":"Number of products sold.","type":"number"},"revenuePercentage":{"description":"Revenue share (0-100%).","type":"number"},"revenueChange":{"description":"Revenue change vs previous period (%).","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalRevenue","totalQuantity","brands","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalRevenue":{"description":"Total revenue.","type":"number"},"totalQuantity":{"description":"Total quantity sold.","type":"number"},"brands":{"description":"Top 20 brands by revenue.","type":"array","items":{"type":"object","required":["brandCode","brandName","revenue","quantity","orderCount","productCount","revenuePercentage","revenueChange"],"properties":{"brandId":{"description":"Brand ID. Null for unbranded.","type":"number"},"brandCode":{"description":"Brand code.","type":"string"},"brandName":{"description":"Brand name.","type":"string"},"revenue":{"description":"Revenue from this brand.","type":"number"},"quantity":{"description":"Quantity sold.","type":"number"},"orderCount":{"description":"Number of orders.","type":"number"},"productCount":{"description":"Number of products sold.","type":"number"},"revenuePercentage":{"description":"Revenue share (0-100%).","type":"number"},"revenueChange":{"description":"Revenue change vs previous period (%).","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalRevenue","totalQuantity","brands","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"totalRevenue":{"description":"Total revenue.","type":"number"},"totalQuantity":{"description":"Total quantity sold.","type":"number"},"brands":{"description":"Top 20 brands by revenue.","type":"array","items":{"type":"object","required":["brandCode","brandName","revenue","quantity","orderCount","productCount","revenuePercentage","revenueChange"],"properties":{"brandId":{"description":"Brand ID. Null for unbranded.","type":"number"},"brandCode":{"description":"Brand code.","type":"string"},"brandName":{"description":"Brand name.","type":"string"},"revenue":{"description":"Revenue from this brand.","type":"number"},"quantity":{"description":"Quantity sold.","type":"number"},"orderCount":{"description":"Number of orders.","type":"number"},"productCount":{"description":"Number of products sold.","type":"number"},"revenuePercentage":{"description":"Revenue share (0-100%).","type":"number"},"revenueChange":{"description":"Revenue change vs previous period (%).","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["totalRevenue","totalQuantity","brands","currency"]}}}}},"operationId":"getBffDashboardBrand-performance","tags":["Dashboard"],"summary":"Brand performance","description":"Shows which brands generate revenue vs catalog noise. Critical for e-commerce product strategy and supplier negotiations."}},"/bff/dashboard/upcoming-renewals":{"get":{"parameters":[{"description":"Days ahead to check. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Upcoming renewals analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalRenewals","totalMrrAtRisk","autoRenewCount","manualRenewCount"],"properties":{"totalRenewals":{"description":"Total renewals in period.","type":"number"},"totalMrrAtRisk":{"description":"MRR value at risk.","type":"number"},"autoRenewCount":{"description":"Auto-renew subscriptions.","type":"number"},"manualRenewCount":{"description":"Manual renewal required.","type":"number"}}},"byTimeBucket":{"type":"object","required":["thisWeek","nextWeek","thisMonth","later"],"properties":{"thisWeek":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals this week.","type":"number"},"mrr":{"description":"MRR this week.","type":"number"}}},"nextWeek":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals next week.","type":"number"},"mrr":{"description":"MRR next week.","type":"number"}}},"thisMonth":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals this month.","type":"number"},"mrr":{"description":"MRR this month.","type":"number"}}},"later":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals later.","type":"number"},"mrr":{"description":"MRR later.","type":"number"}}}}},"renewals":{"description":"Upcoming renewals list (max 50).","type":"array","items":{"type":"object","required":["subscriptionId","externalId","customerName","customerEmail","productName","renewalDate","price","autoRenew","daysUntilRenewal"],"properties":{"subscriptionId":{"description":"Subscription ID.","type":"number"},"externalId":{"description":"External subscription ID.","type":"string"},"customerName":{"description":"Customer name.","type":"string"},"customerEmail":{"description":"Customer email.","type":"string"},"productName":{"description":"Subscription product.","type":"string"},"renewalDate":{"description":"Renewal date (YYYY-MM-DD).","type":"string"},"price":{"description":"Subscription price.","type":"number"},"autoRenew":{"description":"Auto-renew enabled.","type":"boolean"},"daysUntilRenewal":{"description":"Days until renewal.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","byTimeBucket","renewals","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalRenewals","totalMrrAtRisk","autoRenewCount","manualRenewCount"],"properties":{"totalRenewals":{"description":"Total renewals in period.","type":"number"},"totalMrrAtRisk":{"description":"MRR value at risk.","type":"number"},"autoRenewCount":{"description":"Auto-renew subscriptions.","type":"number"},"manualRenewCount":{"description":"Manual renewal required.","type":"number"}}},"byTimeBucket":{"type":"object","required":["thisWeek","nextWeek","thisMonth","later"],"properties":{"thisWeek":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals this week.","type":"number"},"mrr":{"description":"MRR this week.","type":"number"}}},"nextWeek":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals next week.","type":"number"},"mrr":{"description":"MRR next week.","type":"number"}}},"thisMonth":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals this month.","type":"number"},"mrr":{"description":"MRR this month.","type":"number"}}},"later":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals later.","type":"number"},"mrr":{"description":"MRR later.","type":"number"}}}}},"renewals":{"description":"Upcoming renewals list (max 50).","type":"array","items":{"type":"object","required":["subscriptionId","externalId","customerName","customerEmail","productName","renewalDate","price","autoRenew","daysUntilRenewal"],"properties":{"subscriptionId":{"description":"Subscription ID.","type":"number"},"externalId":{"description":"External subscription ID.","type":"string"},"customerName":{"description":"Customer name.","type":"string"},"customerEmail":{"description":"Customer email.","type":"string"},"productName":{"description":"Subscription product.","type":"string"},"renewalDate":{"description":"Renewal date (YYYY-MM-DD).","type":"string"},"price":{"description":"Subscription price.","type":"number"},"autoRenew":{"description":"Auto-renew enabled.","type":"boolean"},"daysUntilRenewal":{"description":"Days until renewal.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","byTimeBucket","renewals","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalRenewals","totalMrrAtRisk","autoRenewCount","manualRenewCount"],"properties":{"totalRenewals":{"description":"Total renewals in period.","type":"number"},"totalMrrAtRisk":{"description":"MRR value at risk.","type":"number"},"autoRenewCount":{"description":"Auto-renew subscriptions.","type":"number"},"manualRenewCount":{"description":"Manual renewal required.","type":"number"}}},"byTimeBucket":{"type":"object","required":["thisWeek","nextWeek","thisMonth","later"],"properties":{"thisWeek":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals this week.","type":"number"},"mrr":{"description":"MRR this week.","type":"number"}}},"nextWeek":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals next week.","type":"number"},"mrr":{"description":"MRR next week.","type":"number"}}},"thisMonth":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals this month.","type":"number"},"mrr":{"description":"MRR this month.","type":"number"}}},"later":{"type":"object","required":["count","mrr"],"properties":{"count":{"description":"Renewals later.","type":"number"},"mrr":{"description":"MRR later.","type":"number"}}}}},"renewals":{"description":"Upcoming renewals list (max 50).","type":"array","items":{"type":"object","required":["subscriptionId","externalId","customerName","customerEmail","productName","renewalDate","price","autoRenew","daysUntilRenewal"],"properties":{"subscriptionId":{"description":"Subscription ID.","type":"number"},"externalId":{"description":"External subscription ID.","type":"string"},"customerName":{"description":"Customer name.","type":"string"},"customerEmail":{"description":"Customer email.","type":"string"},"productName":{"description":"Subscription product.","type":"string"},"renewalDate":{"description":"Renewal date (YYYY-MM-DD).","type":"string"},"price":{"description":"Subscription price.","type":"number"},"autoRenew":{"description":"Auto-renew enabled.","type":"boolean"},"daysUntilRenewal":{"description":"Days until renewal.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","byTimeBucket","renewals","currency"]}}}}},"operationId":"getBffDashboardUpcoming-renewals","tags":["Dashboard"],"summary":"Upcoming subscription renewals","description":"Lists subscriptions due for renewal soon. Enables proactive churn prevention - better than reacting after the fact."}},"/bff/dashboard/cancelled-events":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Cancelled events analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalEvents","cancelledEvents","cancellationRate","lostRevenue"],"properties":{"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"},"lostRevenue":{"description":"Estimated lost revenue.","type":"number"}}},"byCalendar":{"description":"Cancellations by calendar.","type":"array","items":{"type":"object","required":["calendarId","calendarName","totalEvents","cancelledEvents","cancellationRate"],"properties":{"calendarId":{"description":"Calendar ID.","type":"number"},"calendarName":{"description":"Calendar name.","type":"string"},"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}}},"byDayOfWeek":{"description":"Cancellations by day of week.","type":"array","items":{"type":"object","required":["dayOfWeek","dayName","totalEvents","cancelledEvents","cancellationRate"],"properties":{"dayOfWeek":{"description":"Day of week (0=Sunday).","type":"number"},"dayName":{"description":"Day name.","type":"string"},"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}}},"recentCancellations":{"description":"Recent cancellations (max 20).","type":"array","items":{"type":"object","required":["eventId","eventTitle","calendarName","startTime"],"properties":{"eventId":{"description":"Event ID.","type":"number"},"eventTitle":{"description":"Event title.","type":"string"},"calendarName":{"description":"Calendar name.","type":"string"},"startTime":{"description":"Event start time (ISO).","type":"string"},"customerName":{"description":"Customer name.","type":"string"}}}},"lateCancellationByWeek":{"description":"Late cancellations without refund per week and calendar (BIZKIT-20).","type":"array","items":{"type":"object","required":["weekStart","calendarId","calendarName","byCustomer","byAdmin","rebooked"],"properties":{"weekStart":{"description":"Monday of the week (YYYY-MM-DD, Europe/Prague).","type":"string"},"calendarId":{"type":"number"},"calendarName":{"type":"string"},"byCustomer":{"description":"Late cancellations by the customer.","type":"number"},"byAdmin":{"description":"Late cancellations by an administrator.","type":"number"},"rebooked":{"description":"Released slots booked again by someone else.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","byCalendar","byDayOfWeek","recentCancellations","lateCancellationByWeek","currency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalEvents","cancelledEvents","cancellationRate","lostRevenue"],"properties":{"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"},"lostRevenue":{"description":"Estimated lost revenue.","type":"number"}}},"byCalendar":{"description":"Cancellations by calendar.","type":"array","items":{"type":"object","required":["calendarId","calendarName","totalEvents","cancelledEvents","cancellationRate"],"properties":{"calendarId":{"description":"Calendar ID.","type":"number"},"calendarName":{"description":"Calendar name.","type":"string"},"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}}},"byDayOfWeek":{"description":"Cancellations by day of week.","type":"array","items":{"type":"object","required":["dayOfWeek","dayName","totalEvents","cancelledEvents","cancellationRate"],"properties":{"dayOfWeek":{"description":"Day of week (0=Sunday).","type":"number"},"dayName":{"description":"Day name.","type":"string"},"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}}},"recentCancellations":{"description":"Recent cancellations (max 20).","type":"array","items":{"type":"object","required":["eventId","eventTitle","calendarName","startTime"],"properties":{"eventId":{"description":"Event ID.","type":"number"},"eventTitle":{"description":"Event title.","type":"string"},"calendarName":{"description":"Calendar name.","type":"string"},"startTime":{"description":"Event start time (ISO).","type":"string"},"customerName":{"description":"Customer name.","type":"string"}}}},"lateCancellationByWeek":{"description":"Late cancellations without refund per week and calendar (BIZKIT-20).","type":"array","items":{"type":"object","required":["weekStart","calendarId","calendarName","byCustomer","byAdmin","rebooked"],"properties":{"weekStart":{"description":"Monday of the week (YYYY-MM-DD, Europe/Prague).","type":"string"},"calendarId":{"type":"number"},"calendarName":{"type":"string"},"byCustomer":{"description":"Late cancellations by the customer.","type":"number"},"byAdmin":{"description":"Late cancellations by an administrator.","type":"number"},"rebooked":{"description":"Released slots booked again by someone else.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","byCalendar","byDayOfWeek","recentCancellations","lateCancellationByWeek","currency"]}},"text/plain":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalEvents","cancelledEvents","cancellationRate","lostRevenue"],"properties":{"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"},"lostRevenue":{"description":"Estimated lost revenue.","type":"number"}}},"byCalendar":{"description":"Cancellations by calendar.","type":"array","items":{"type":"object","required":["calendarId","calendarName","totalEvents","cancelledEvents","cancellationRate"],"properties":{"calendarId":{"description":"Calendar ID.","type":"number"},"calendarName":{"description":"Calendar name.","type":"string"},"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}}},"byDayOfWeek":{"description":"Cancellations by day of week.","type":"array","items":{"type":"object","required":["dayOfWeek","dayName","totalEvents","cancelledEvents","cancellationRate"],"properties":{"dayOfWeek":{"description":"Day of week (0=Sunday).","type":"number"},"dayName":{"description":"Day name.","type":"string"},"totalEvents":{"description":"Total events.","type":"number"},"cancelledEvents":{"description":"Cancelled events.","type":"number"},"cancellationRate":{"description":"Cancellation rate (0-100%).","type":"number"}}}},"recentCancellations":{"description":"Recent cancellations (max 20).","type":"array","items":{"type":"object","required":["eventId","eventTitle","calendarName","startTime"],"properties":{"eventId":{"description":"Event ID.","type":"number"},"eventTitle":{"description":"Event title.","type":"string"},"calendarName":{"description":"Calendar name.","type":"string"},"startTime":{"description":"Event start time (ISO).","type":"string"},"customerName":{"description":"Customer name.","type":"string"}}}},"lateCancellationByWeek":{"description":"Late cancellations without refund per week and calendar (BIZKIT-20).","type":"array","items":{"type":"object","required":["weekStart","calendarId","calendarName","byCustomer","byAdmin","rebooked"],"properties":{"weekStart":{"description":"Monday of the week (YYYY-MM-DD, Europe/Prague).","type":"string"},"calendarId":{"type":"number"},"calendarName":{"type":"string"},"byCustomer":{"description":"Late cancellations by the customer.","type":"number"},"byAdmin":{"description":"Late cancellations by an administrator.","type":"number"},"rebooked":{"description":"Released slots booked again by someone else.","type":"number"}}}},"currency":{"description":"Currency code.","type":"string"}},"required":["summary","byCalendar","byDayOfWeek","recentCancellations","lateCancellationByWeek","currency"]}}}}},"operationId":"getBffDashboardCancelled-events","tags":["Dashboard"],"summary":"Cancelled calendar events","description":"Analyzes event cancellations by calendar and day of week. For service businesses, reveals issues with pricing, capacity, or communication."}},"/bff/dashboard/email-stats":{"get":{"parameters":[{"description":"Number of days to analyze. Defaults to 30.","schema":{"type":"number","default":30},"in":"query","name":"days","required":false}],"responses":{"200":{"description":"Email statistics analysis.","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalEmails","sentEmails","failedEmails","pendingEmails","openedEmails","deliveryRate","openRate"],"properties":{"totalEmails":{"description":"Total emails.","type":"number"},"sentEmails":{"description":"Successfully sent.","type":"number"},"failedEmails":{"description":"Failed to send.","type":"number"},"pendingEmails":{"description":"Pending/queued.","type":"number"},"openedEmails":{"description":"Opened emails.","type":"number"},"deliveryRate":{"description":"Delivery rate (0-100%).","type":"number"},"openRate":{"description":"Open rate (0-100%).","type":"number"}}},"byTag":{"description":"Stats by email type.","type":"array","items":{"type":"object","required":["tag","tagLabel","total","sent","failed","opened","deliveryRate","openRate"],"properties":{"tag":{"description":"Email tag/type.","type":"string"},"tagLabel":{"description":"Tag label.","type":"string"},"total":{"description":"Total emails.","type":"number"},"sent":{"description":"Sent emails.","type":"number"},"failed":{"description":"Failed emails.","type":"number"},"opened":{"description":"Opened emails.","type":"number"},"deliveryRate":{"description":"Delivery rate (0-100%).","type":"number"},"openRate":{"description":"Open rate (0-100%).","type":"number"}}}},"dailyTrend":{"description":"Daily email trend.","type":"array","items":{"type":"object","required":["date","sent","failed","opened"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"sent":{"description":"Sent count.","type":"number"},"failed":{"description":"Failed count.","type":"number"},"opened":{"description":"Opened count.","type":"number"}}}},"recentFailures":{"description":"Recent failed emails (max 20).","type":"array","items":{"type":"object","required":["emailId","externalId","subject","insertedDate","failedAttempts"],"properties":{"emailId":{"description":"Email ID.","type":"number"},"externalId":{"description":"External email ID.","type":"string"},"subject":{"description":"Email subject.","type":"string"},"insertedDate":{"description":"Creation date (ISO).","type":"string"},"failedAttempts":{"description":"Failed attempt count.","type":"number"}}}}},"required":["summary","byTag","dailyTrend","recentFailures"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalEmails","sentEmails","failedEmails","pendingEmails","openedEmails","deliveryRate","openRate"],"properties":{"totalEmails":{"description":"Total emails.","type":"number"},"sentEmails":{"description":"Successfully sent.","type":"number"},"failedEmails":{"description":"Failed to send.","type":"number"},"pendingEmails":{"description":"Pending/queued.","type":"number"},"openedEmails":{"description":"Opened emails.","type":"number"},"deliveryRate":{"description":"Delivery rate (0-100%).","type":"number"},"openRate":{"description":"Open rate (0-100%).","type":"number"}}},"byTag":{"description":"Stats by email type.","type":"array","items":{"type":"object","required":["tag","tagLabel","total","sent","failed","opened","deliveryRate","openRate"],"properties":{"tag":{"description":"Email tag/type.","type":"string"},"tagLabel":{"description":"Tag label.","type":"string"},"total":{"description":"Total emails.","type":"number"},"sent":{"description":"Sent emails.","type":"number"},"failed":{"description":"Failed emails.","type":"number"},"opened":{"description":"Opened emails.","type":"number"},"deliveryRate":{"description":"Delivery rate (0-100%).","type":"number"},"openRate":{"description":"Open rate (0-100%).","type":"number"}}}},"dailyTrend":{"description":"Daily email trend.","type":"array","items":{"type":"object","required":["date","sent","failed","opened"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"sent":{"description":"Sent count.","type":"number"},"failed":{"description":"Failed count.","type":"number"},"opened":{"description":"Opened count.","type":"number"}}}},"recentFailures":{"description":"Recent failed emails (max 20).","type":"array","items":{"type":"object","required":["emailId","externalId","subject","insertedDate","failedAttempts"],"properties":{"emailId":{"description":"Email ID.","type":"number"},"externalId":{"description":"External email ID.","type":"string"},"subject":{"description":"Email subject.","type":"string"},"insertedDate":{"description":"Creation date (ISO).","type":"string"},"failedAttempts":{"description":"Failed attempt count.","type":"number"}}}}},"required":["summary","byTag","dailyTrend","recentFailures"]}},"text/plain":{"schema":{"type":"object","properties":{"summary":{"type":"object","required":["totalEmails","sentEmails","failedEmails","pendingEmails","openedEmails","deliveryRate","openRate"],"properties":{"totalEmails":{"description":"Total emails.","type":"number"},"sentEmails":{"description":"Successfully sent.","type":"number"},"failedEmails":{"description":"Failed to send.","type":"number"},"pendingEmails":{"description":"Pending/queued.","type":"number"},"openedEmails":{"description":"Opened emails.","type":"number"},"deliveryRate":{"description":"Delivery rate (0-100%).","type":"number"},"openRate":{"description":"Open rate (0-100%).","type":"number"}}},"byTag":{"description":"Stats by email type.","type":"array","items":{"type":"object","required":["tag","tagLabel","total","sent","failed","opened","deliveryRate","openRate"],"properties":{"tag":{"description":"Email tag/type.","type":"string"},"tagLabel":{"description":"Tag label.","type":"string"},"total":{"description":"Total emails.","type":"number"},"sent":{"description":"Sent emails.","type":"number"},"failed":{"description":"Failed emails.","type":"number"},"opened":{"description":"Opened emails.","type":"number"},"deliveryRate":{"description":"Delivery rate (0-100%).","type":"number"},"openRate":{"description":"Open rate (0-100%).","type":"number"}}}},"dailyTrend":{"description":"Daily email trend.","type":"array","items":{"type":"object","required":["date","sent","failed","opened"],"properties":{"date":{"description":"Date (YYYY-MM-DD).","type":"string"},"sent":{"description":"Sent count.","type":"number"},"failed":{"description":"Failed count.","type":"number"},"opened":{"description":"Opened count.","type":"number"}}}},"recentFailures":{"description":"Recent failed emails (max 20).","type":"array","items":{"type":"object","required":["emailId","externalId","subject","insertedDate","failedAttempts"],"properties":{"emailId":{"description":"Email ID.","type":"number"},"externalId":{"description":"External email ID.","type":"string"},"subject":{"description":"Email subject.","type":"string"},"insertedDate":{"description":"Creation date (ISO).","type":"string"},"failedAttempts":{"description":"Failed attempt count.","type":"number"}}}}},"required":["summary","byTag","dailyTrend","recentFailures"]}}}}},"operationId":"getBffDashboardEmail-stats","tags":["Dashboard"],"summary":"System email statistics","description":"Shows health of transactional emails (invoices, notifications, password resets). Not marketing - critical system health indicator."}},"/bff/domain/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of domains.","type":"number"},"items":{"description":"List of domain items.","type":"array","items":{"type":"object","required":["id","domainVerified","isPublicDefault"],"properties":{"id":{"description":"Domain identifier (domain name or fallback ID).","examples":["example.com"],"type":"string"},"domainVerified":{"description":"Whether domain ownership has been verified.","type":"boolean"},"isPublicDefault":{"description":"True when this domain is the canonical public URL of the organisation (used by post digest, RSS, article links).","type":"boolean"},"environment":{"description":"Environment label (e.g. production, staging).","examples":["production"],"type":"string"},"label":{"description":"Custom label for the domain.","type":"string"},"description":{"description":"Custom description.","type":"string"},"domain":{"description":"Fully qualified domain name.","examples":["example.com"],"type":"string"},"insertedDate":{"description":"When the domain was first added.","anyOf":[{"description":"When the domain was first added.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastCheckDate":{"description":"Last health check timestamp.","anyOf":[{"description":"Last health check timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"httpCode":{"description":"Last HTTP status code.","examples":[200],"type":"number"},"httpsSupport":{"description":"Whether the domain supports HTTPS.","type":"boolean"},"title":{"description":"Page title from last crawl.","type":"string"},"responseTime":{"description":"Response time in milliseconds.","type":"number"},"uptimeOk":{"description":"Whether the domain is considered up.","type":"boolean"}}}}},"required":["itemCount","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of domains.","type":"number"},"items":{"description":"List of domain items.","type":"array","items":{"type":"object","required":["id","domainVerified","isPublicDefault"],"properties":{"id":{"description":"Domain identifier (domain name or fallback ID).","examples":["example.com"],"type":"string"},"domainVerified":{"description":"Whether domain ownership has been verified.","type":"boolean"},"isPublicDefault":{"description":"True when this domain is the canonical public URL of the organisation (used by post digest, RSS, article links).","type":"boolean"},"environment":{"description":"Environment label (e.g. production, staging).","examples":["production"],"type":"string"},"label":{"description":"Custom label for the domain.","type":"string"},"description":{"description":"Custom description.","type":"string"},"domain":{"description":"Fully qualified domain name.","examples":["example.com"],"type":"string"},"insertedDate":{"description":"When the domain was first added.","anyOf":[{"description":"When the domain was first added.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastCheckDate":{"description":"Last health check timestamp.","anyOf":[{"description":"Last health check timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"httpCode":{"description":"Last HTTP status code.","examples":[200],"type":"number"},"httpsSupport":{"description":"Whether the domain supports HTTPS.","type":"boolean"},"title":{"description":"Page title from last crawl.","type":"string"},"responseTime":{"description":"Response time in milliseconds.","type":"number"},"uptimeOk":{"description":"Whether the domain is considered up.","type":"boolean"}}}}},"required":["itemCount","items"]}},"text/plain":{"schema":{"type":"object","properties":{"itemCount":{"description":"Total number of domains.","type":"number"},"items":{"description":"List of domain items.","type":"array","items":{"type":"object","required":["id","domainVerified","isPublicDefault"],"properties":{"id":{"description":"Domain identifier (domain name or fallback ID).","examples":["example.com"],"type":"string"},"domainVerified":{"description":"Whether domain ownership has been verified.","type":"boolean"},"isPublicDefault":{"description":"True when this domain is the canonical public URL of the organisation (used by post digest, RSS, article links).","type":"boolean"},"environment":{"description":"Environment label (e.g. production, staging).","examples":["production"],"type":"string"},"label":{"description":"Custom label for the domain.","type":"string"},"description":{"description":"Custom description.","type":"string"},"domain":{"description":"Fully qualified domain name.","examples":["example.com"],"type":"string"},"insertedDate":{"description":"When the domain was first added.","anyOf":[{"description":"When the domain was first added.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastCheckDate":{"description":"Last health check timestamp.","anyOf":[{"description":"Last health check timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"httpCode":{"description":"Last HTTP status code.","examples":[200],"type":"number"},"httpsSupport":{"description":"Whether the domain supports HTTPS.","type":"boolean"},"title":{"description":"Page title from last crawl.","type":"string"},"responseTime":{"description":"Response time in milliseconds.","type":"number"},"uptimeOk":{"description":"Whether the domain is considered up.","type":"boolean"}}}}},"required":["itemCount","items"]}}}}},"operationId":"getBffDomainList","tags":["Domain"],"summary":"List organisation domains","description":"Returns all domains linked to the current organisation with their verification status, HTTP health and DNS information."}},"/bff/domain/show-verify-token":{"get":{"parameters":[{"description":"Domain name to get verification token for.","examples":["example.com"],"schema":{"type":"string"},"in":"query","name":"domain","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"verifyToken":{"description":"Raw verification token.","examples":["abc123def456"],"type":"string"},"dnsHeader":{"description":"Full DNS TXT record value to set.","examples":["brj-verify=abc123def456"],"type":"string"}},"required":["verifyToken","dnsHeader"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"verifyToken":{"description":"Raw verification token.","examples":["abc123def456"],"type":"string"},"dnsHeader":{"description":"Full DNS TXT record value to set.","examples":["brj-verify=abc123def456"],"type":"string"}},"required":["verifyToken","dnsHeader"]}},"text/plain":{"schema":{"type":"object","properties":{"verifyToken":{"description":"Raw verification token.","examples":["abc123def456"],"type":"string"},"dnsHeader":{"description":"Full DNS TXT record value to set.","examples":["brj-verify=abc123def456"],"type":"string"}},"required":["verifyToken","dnsHeader"]}}}}},"operationId":"getBffDomainShow-verify-token","tags":["Domain"],"summary":"Show domain verification token","description":"Returns the verification token and DNS TXT record value needed to prove domain ownership."}},"/bff/domain/check-verify-token":{"get":{"parameters":[{"description":"Domain name to verify.","examples":["example.com"],"schema":{"type":"string"},"in":"query","name":"domain","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"True if the domain verification token was found in DNS.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"True if the domain verification token was found in DNS.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"True if the domain verification token was found in DNS.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffDomainCheck-verify-token","tags":["Domain"],"summary":"Check domain verification","description":"Checks whether the DNS TXT verification record is properly set for the given domain."}},"/bff/domain/add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"True if the domain was successfully added.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"True if the domain was successfully added.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"True if the domain was successfully added.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDomainAdd","tags":["Domain"],"summary":"Add domain to organisation","description":"Registers a new domain for the current organisation. The domain must be verified separately via the verification flow.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name to add to the organisation.","examples":["example.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name to add to the organisation.","examples":["example.com"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name to add to the organisation.","examples":["example.com"],"type":"string"}}}}}}}},"/bff/domain/set-primary":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"True if the primary flag was updated.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"True if the primary flag was updated.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"True if the primary flag was updated.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDomainSet-primary","tags":["Domain"],"summary":"Set canonical public domain","description":"Marks the given verified production domain as the organisation's canonical public URL. Post digest, RSS and article-URL builders read this flag; unset defaults fall back to `{slug}.bizkithub.com`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name to mark as the organisation's canonical public URL.","examples":["example.com"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name to mark as the organisation's canonical public URL.","examples":["example.com"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"description":"Domain name to mark as the organisation's canonical public URL.","examples":["example.com"],"type":"string"}}}}}}}},"/bff/drive/scope":{"get":{"parameters":[{"schema":{"anyOf":[{"const":"recent","type":"string"},{"const":"all","type":"string"},{"const":"root","type":"string"},{"const":"large","type":"string"},{"const":"search","type":"string"},{"const":"starred","type":"string"},{"const":"old","type":"string"},{"const":"duplicates","type":"string"},{"const":"label","type":"string"}]},"in":"query","name":"scope","required":true},{"description":"scope=label.","schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"description":"scope=label.","type":"number"}]},"in":"query","name":"labelId","required":false},{"description":"Search term (scope=search, min. 2 chars). Case- and diacritics-insensitive.","schema":{"type":"string","maxLength":200},"in":"query","name":"q","required":false},{"schema":{"anyOf":[{"const":"name","type":"string"},{"const":"size","type":"string"},{"const":"date","type":"string"},{"const":"kind","type":"string"}]},"in":"query","name":"sort","required":false},{"schema":{"anyOf":[{"const":"asc","type":"string"},{"const":"desc","type":"string"}]},"in":"query","name":"direction","required":false},{"schema":{"minimum":0,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":0,"type":"number"}]},"in":"query","name":"offset","required":false},{"schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"number"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string"},"folderList":{"type":"array","items":{"type":"object","required":["id","name","path","itemsCount","insertedDate"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"location":{"type":"string"},"itemsCount":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"color":{"type":"string"},"starred":{"type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}}}}},"fileList":{"type":"array","items":{"type":"object","required":["id","filename","size","contentType","insertedDate","isPrivate"],"properties":{"id":{"description":"Blob token.","type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"isPrivate":{"type":"boolean"},"uploadedBy":{"type":"string"},"location":{"description":"Folder path ('' = root); cross-folder views only.","type":"string"},"starred":{"description":"Starred by the viewer.","type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}},"versionCount":{"description":"Older versions kept in the history.","type":"number"},"duplicateKey":{"description":"Duplicates view: equal key = identical content.","type":"string"}}}},"fileCount":{"type":"number"},"offset":{"type":"number"},"limit":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["scope","folderList","fileList","fileCount","offset","limit","hasMore"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"scope":{"type":"string"},"folderList":{"type":"array","items":{"type":"object","required":["id","name","path","itemsCount","insertedDate"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"location":{"type":"string"},"itemsCount":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"color":{"type":"string"},"starred":{"type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}}}}},"fileList":{"type":"array","items":{"type":"object","required":["id","filename","size","contentType","insertedDate","isPrivate"],"properties":{"id":{"description":"Blob token.","type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"isPrivate":{"type":"boolean"},"uploadedBy":{"type":"string"},"location":{"description":"Folder path ('' = root); cross-folder views only.","type":"string"},"starred":{"description":"Starred by the viewer.","type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}},"versionCount":{"description":"Older versions kept in the history.","type":"number"},"duplicateKey":{"description":"Duplicates view: equal key = identical content.","type":"string"}}}},"fileCount":{"type":"number"},"offset":{"type":"number"},"limit":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["scope","folderList","fileList","fileCount","offset","limit","hasMore"]}},"text/plain":{"schema":{"type":"object","properties":{"scope":{"type":"string"},"folderList":{"type":"array","items":{"type":"object","required":["id","name","path","itemsCount","insertedDate"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"location":{"type":"string"},"itemsCount":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"color":{"type":"string"},"starred":{"type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}}}}},"fileList":{"type":"array","items":{"type":"object","required":["id","filename","size","contentType","insertedDate","isPrivate"],"properties":{"id":{"description":"Blob token.","type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"isPrivate":{"type":"boolean"},"uploadedBy":{"type":"string"},"location":{"description":"Folder path ('' = root); cross-folder views only.","type":"string"},"starred":{"description":"Starred by the viewer.","type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}},"versionCount":{"description":"Older versions kept in the history.","type":"number"},"duplicateKey":{"description":"Duplicates view: equal key = identical content.","type":"string"}}}},"fileCount":{"type":"number"},"offset":{"type":"number"},"limit":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["scope","folderList","fileList","fileCount","offset","limit","hasMore"]}}}}},"operationId":"getBffDriveScope","tags":["Drive"],"summary":"Files across folders (paged)","description":"recent = uploaded in the last 90 days, newest first; all = every file; root = files outside any folder; large = biggest first; search = filename and folder-name match; starred = starred by the viewer; old = not changed for a year; duplicates = identical content (grouped by `duplicateKey`); label = carries `labelId`. Files carry their folder path in `location`."}},"/bff/drive/storage-report":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","required":["key","bytes","count"],"properties":{"key":{"type":"string"},"bytes":{"type":"number"},"count":{"type":"number"}}}},"folders":{"type":"array","items":{"type":"object","required":["id","name","bytes","count"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"bytes":{"type":"number"},"count":{"type":"number"}}}},"duplicates":{"type":"object","required":["groups","files","wastedBytes"],"properties":{"groups":{"type":"number"},"files":{"type":"number"},"wastedBytes":{"type":"number"}}},"old":{"type":"object","required":["files","bytes"],"properties":{"files":{"type":"number"},"bytes":{"type":"number"}}}},"required":["categories","folders","duplicates","old"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","required":["key","bytes","count"],"properties":{"key":{"type":"string"},"bytes":{"type":"number"},"count":{"type":"number"}}}},"folders":{"type":"array","items":{"type":"object","required":["id","name","bytes","count"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"bytes":{"type":"number"},"count":{"type":"number"}}}},"duplicates":{"type":"object","required":["groups","files","wastedBytes"],"properties":{"groups":{"type":"number"},"files":{"type":"number"},"wastedBytes":{"type":"number"}}},"old":{"type":"object","required":["files","bytes"],"properties":{"files":{"type":"number"},"bytes":{"type":"number"}}}},"required":["categories","folders","duplicates","old"]}},"text/plain":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","required":["key","bytes","count"],"properties":{"key":{"type":"string"},"bytes":{"type":"number"},"count":{"type":"number"}}}},"folders":{"type":"array","items":{"type":"object","required":["id","name","bytes","count"],"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"bytes":{"type":"number"},"count":{"type":"number"}}}},"duplicates":{"type":"object","required":["groups","files","wastedBytes"],"properties":{"groups":{"type":"number"},"files":{"type":"number"},"wastedBytes":{"type":"number"}}},"old":{"type":"object","required":["files","bytes"],"properties":{"files":{"type":"number"},"bytes":{"type":"number"}}}},"required":["categories","folders","duplicates","old"]}}}}},"operationId":"getBffDriveStorage-report","tags":["Drive"],"summary":"Storage page","description":"Space by category and top-level folder, duplicates and old files."}},"/bff/drive/star":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDriveStar","tags":["Drive"],"summary":"Star / unstar","description":"Stars are personal (per user).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["starred"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"starred":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["starred"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"starred":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["starred"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"starred":{"type":"boolean"}}}}}}}},"/bff/drive/labels":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","required":["id","name","color","count"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}},"required":["labels"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","required":["id","name","color","count"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}},"required":["labels"]}},"text/plain":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","required":["id","name","color","count"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}},"required":["labels"]}}}}},"operationId":"getBffDriveLabels","tags":["Drive"],"summary":"Labels","description":"Organisation-wide color labels with item counts."}},"/bff/drive/label-save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}}},"operationId":"postBffDriveLabel-save","tags":["Drive"],"summary":"Create or update a label","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","color"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"color":{"anyOf":[{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"yellow","type":"string"},{"const":"green","type":"string"},{"const":"blue","type":"string"},{"const":"purple","type":"string"},{"const":"gray","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","color"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"color":{"anyOf":[{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"yellow","type":"string"},{"const":"green","type":"string"},{"const":"blue","type":"string"},{"const":"purple","type":"string"},{"const":"gray","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["name","color"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"color":{"anyOf":[{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"yellow","type":"string"},{"const":"green","type":"string"},{"const":"blue","type":"string"},{"const":"purple","type":"string"},{"const":"gray","type":"string"}]}}}}}}}},"/bff/drive/label-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDriveLabel-delete","tags":["Drive"],"summary":"Delete a label","description":"Files keep existing; only the label goes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}}}},"/bff/drive/label-assign":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDriveLabel-assign","tags":["Drive"],"summary":"Add / remove a label","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["labelId","assigned"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"labelId":{"type":"number"},"assigned":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["labelId","assigned"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"labelId":{"type":"number"},"assigned":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["labelId","assigned"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"labelId":{"type":"number"},"assigned":{"type":"boolean"}}}}}}}},"/bff/drive/folder-color":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDriveFolder-color","tags":["Drive"],"summary":"Folder color","description":"null = default color.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["folders","color"],"properties":{"folders":{"maxItems":500,"type":"array","items":{"type":"string"}},"color":{"anyOf":[{"anyOf":[{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"yellow","type":"string"},{"const":"green","type":"string"},{"const":"blue","type":"string"},{"const":"purple","type":"string"},{"const":"gray","type":"string"}]},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["folders","color"],"properties":{"folders":{"maxItems":500,"type":"array","items":{"type":"string"}},"color":{"anyOf":[{"anyOf":[{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"yellow","type":"string"},{"const":"green","type":"string"},{"const":"blue","type":"string"},{"const":"purple","type":"string"},{"const":"gray","type":"string"}]},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["folders","color"],"properties":{"folders":{"maxItems":500,"type":"array","items":{"type":"string"}},"color":{"anyOf":[{"anyOf":[{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"yellow","type":"string"},{"const":"green","type":"string"},{"const":"blue","type":"string"},{"const":"purple","type":"string"},{"const":"gray","type":"string"}]},{"type":"null"}]}}}}}}}},"/bff/drive/versions":{"get":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"query","name":"token","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","required":["id","size","date"],"properties":{"id":{"type":"string"},"size":{"type":"number"},"date":{"type":"string"},"uploadedBy":{"type":"string"}}}}},"required":["versions"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","required":["id","size","date"],"properties":{"id":{"type":"string"},"size":{"type":"number"},"date":{"type":"string"},"uploadedBy":{"type":"string"}}}}},"required":["versions"]}},"text/plain":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"type":"object","required":["id","size","date"],"properties":{"id":{"type":"string"},"size":{"type":"number"},"date":{"type":"string"},"uploadedBy":{"type":"string"}}}}},"required":["versions"]}}}}},"operationId":"getBffDriveVersions","tags":["Drive"],"summary":"Version history","description":"Older contents of a file, newest first. Download a version via `/download?token=<version id>`."}},"/bff/drive/version-restore":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDriveVersion-restore","tags":["Drive"],"summary":"Restore a version","description":"The current content becomes a version; nothing is lost.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","versionId"],"properties":{"token":{"type":"string"},"versionId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","versionId"],"properties":{"token":{"type":"string"},"versionId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token","versionId"],"properties":{"token":{"type":"string"},"versionId":{"type":"string"}}}}}}}},"/bff/drive/version-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDriveVersion-delete","tags":["Drive"],"summary":"Delete a version","description":"Permanent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","versionId"],"properties":{"token":{"type":"string"},"versionId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","versionId"],"properties":{"token":{"type":"string"},"versionId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token","versionId"],"properties":{"token":{"type":"string"},"versionId":{"type":"string"}}}}}}}},"/bff/drive/copy":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"copied":{"type":"number"}},"required":["copied"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"copied":{"type":"number"}},"required":["copied"]}},"text/plain":{"schema":{"type":"object","properties":{"copied":{"type":"number"}},"required":["copied"]}}}}},"operationId":"postBffDriveCopy","tags":["Drive"],"summary":"Copy files","description":"Server-side copy; names stay unique (\"Report (2).pdf\"). Counts against the storage limit.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["files","targetFolderId"],"properties":{"files":{"maxItems":200,"type":"array","items":{"type":"string"}},"targetFolderId":{"description":"Target folder external id; null = root.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["files","targetFolderId"],"properties":{"files":{"maxItems":200,"type":"array","items":{"type":"string"}},"targetFolderId":{"description":"Target folder external id; null = root.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["files","targetFolderId"],"properties":{"files":{"maxItems":200,"type":"array","items":{"type":"string"}},"targetFolderId":{"description":"Target folder external id; null = root.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/drive/download-selection":{"get":{"parameters":[{"description":"Comma-separated file tokens.","schema":{"type":"string"},"in":"query","name":"files","required":false},{"description":"Comma-separated folder ids.","schema":{"type":"string"},"in":"query","name":"folders","required":false}],"operationId":"getBffDriveDownload-selection","tags":["Drive"],"summary":"Download a selection as ZIP","description":"Same limits as the folder ZIP.","responses":{"200":{}}}},"/bff/drive/shares":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"file","required":false},{"schema":{"type":"string"},"in":"query","name":"folder","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"shares":{"type":"array","items":{"type":"object","required":["id","url","mode","status","target","hasPassword","downloadCount","uploadCount","insertedDate"],"properties":{"id":{"type":"string"},"url":{"type":"string"},"mode":{"anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"exhausted","type":"string"},{"const":"revoked","type":"string"}]},"target":{"type":"object","required":["type","id","name","path"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}}},"title":{"type":"string"},"message":{"type":"string"},"hasPassword":{"type":"boolean"},"expiresDate":{"type":"string"},"maxDownloads":{"type":"number"},"downloadCount":{"type":"number"},"uploadCount":{"type":"number"},"lastAccessDate":{"type":"string"},"insertedDate":{"type":"string"},"createdBy":{"type":"string"},"contact":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"orderNumber":{"type":"string"}}}}},"required":["shares"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"shares":{"type":"array","items":{"type":"object","required":["id","url","mode","status","target","hasPassword","downloadCount","uploadCount","insertedDate"],"properties":{"id":{"type":"string"},"url":{"type":"string"},"mode":{"anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"exhausted","type":"string"},{"const":"revoked","type":"string"}]},"target":{"type":"object","required":["type","id","name","path"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}}},"title":{"type":"string"},"message":{"type":"string"},"hasPassword":{"type":"boolean"},"expiresDate":{"type":"string"},"maxDownloads":{"type":"number"},"downloadCount":{"type":"number"},"uploadCount":{"type":"number"},"lastAccessDate":{"type":"string"},"insertedDate":{"type":"string"},"createdBy":{"type":"string"},"contact":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"orderNumber":{"type":"string"}}}}},"required":["shares"]}},"text/plain":{"schema":{"type":"object","properties":{"shares":{"type":"array","items":{"type":"object","required":["id","url","mode","status","target","hasPassword","downloadCount","uploadCount","insertedDate"],"properties":{"id":{"type":"string"},"url":{"type":"string"},"mode":{"anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"exhausted","type":"string"},{"const":"revoked","type":"string"}]},"target":{"type":"object","required":["type","id","name","path"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}}},"title":{"type":"string"},"message":{"type":"string"},"hasPassword":{"type":"boolean"},"expiresDate":{"type":"string"},"maxDownloads":{"type":"number"},"downloadCount":{"type":"number"},"uploadCount":{"type":"number"},"lastAccessDate":{"type":"string"},"insertedDate":{"type":"string"},"createdBy":{"type":"string"},"contact":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"orderNumber":{"type":"string"}}}}},"required":["shares"]}}}}},"operationId":"getBffDriveShares","tags":["Drive"],"summary":"Shared links","description":"Share links and file requests, active first. Filter by file or folder."}},"/bff/drive/share-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"mode":{"anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"exhausted","type":"string"},{"const":"revoked","type":"string"}]},"target":{"type":"object","required":["type","id","name","path"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}}},"title":{"type":"string"},"message":{"type":"string"},"hasPassword":{"type":"boolean"},"expiresDate":{"type":"string"},"maxDownloads":{"type":"number"},"downloadCount":{"type":"number"},"uploadCount":{"type":"number"},"lastAccessDate":{"type":"string"},"insertedDate":{"type":"string"},"createdBy":{"type":"string"},"contact":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"orderNumber":{"type":"string"}},"required":["id","url","mode","status","target","hasPassword","downloadCount","uploadCount","insertedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"mode":{"anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"exhausted","type":"string"},{"const":"revoked","type":"string"}]},"target":{"type":"object","required":["type","id","name","path"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}}},"title":{"type":"string"},"message":{"type":"string"},"hasPassword":{"type":"boolean"},"expiresDate":{"type":"string"},"maxDownloads":{"type":"number"},"downloadCount":{"type":"number"},"uploadCount":{"type":"number"},"lastAccessDate":{"type":"string"},"insertedDate":{"type":"string"},"createdBy":{"type":"string"},"contact":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"orderNumber":{"type":"string"}},"required":["id","url","mode","status","target","hasPassword","downloadCount","uploadCount","insertedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"mode":{"anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"status":{"anyOf":[{"const":"active","type":"string"},{"const":"expired","type":"string"},{"const":"exhausted","type":"string"},{"const":"revoked","type":"string"}]},"target":{"type":"object","required":["type","id","name","path"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}}},"title":{"type":"string"},"message":{"type":"string"},"hasPassword":{"type":"boolean"},"expiresDate":{"type":"string"},"maxDownloads":{"type":"number"},"downloadCount":{"type":"number"},"uploadCount":{"type":"number"},"lastAccessDate":{"type":"string"},"insertedDate":{"type":"string"},"createdBy":{"type":"string"},"contact":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"orderNumber":{"type":"string"}},"required":["id","url","mode","status","target","hasPassword","downloadCount","uploadCount","insertedDate"]}}}}},"operationId":"postBffDriveShare-create","tags":["Drive"],"summary":"Create a share link or file request","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"description":"view = download link; upload = file request into a folder.","anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"file":{"anyOf":[{"type":"string"},{"type":"null"}]},"folder":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"password":{"anyOf":[{"minLength":4,"maxLength":128,"type":"string"},{"type":"null"}]},"expiresDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"maxDownloads":{"anyOf":[{"minimum":1,"maximum":100000,"type":"number"},{"type":"null"}]},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"description":"view = download link; upload = file request into a folder.","anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"file":{"anyOf":[{"type":"string"},{"type":"null"}]},"folder":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"password":{"anyOf":[{"minLength":4,"maxLength":128,"type":"string"},{"type":"null"}]},"expiresDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"maxDownloads":{"anyOf":[{"minimum":1,"maximum":100000,"type":"number"},{"type":"null"}]},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["mode"],"properties":{"mode":{"description":"view = download link; upload = file request into a folder.","anyOf":[{"const":"view","type":"string"},{"const":"upload","type":"string"}]},"file":{"anyOf":[{"type":"string"},{"type":"null"}]},"folder":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"password":{"anyOf":[{"minLength":4,"maxLength":128,"type":"string"},{"type":"null"}]},"expiresDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"maxDownloads":{"anyOf":[{"minimum":1,"maximum":100000,"type":"number"},{"type":"null"}]},"contactId":{"anyOf":[{"type":"string"},{"type":"null"}]},"orderNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/drive/share-revoke":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]}},"text/plain":{"schema":{"type":"object","properties":{"revoked":{"type":"boolean"}},"required":["revoked"]}}}}},"operationId":"postBffDriveShare-revoke","tags":["Drive"],"summary":"Revoke a share link","description":"The link stops working immediately.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}}},"/bff/drive/upload-start":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"uploadSessionId":{"type":"string"},"partSize":{"type":"number"},"partCount":{"type":"number"}},"required":["uploadSessionId","partSize","partCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"uploadSessionId":{"type":"string"},"partSize":{"type":"number"},"partCount":{"type":"number"}},"required":["uploadSessionId","partSize","partCount"]}},"text/plain":{"schema":{"type":"object","properties":{"uploadSessionId":{"type":"string"},"partSize":{"type":"number"},"partCount":{"type":"number"}},"required":["uploadSessionId","partSize","partCount"]}}}}},"operationId":"postBffDriveUpload-start","tags":["Drive"],"summary":"Start a large upload","description":"Chunked upload for big files (up to 10 GB): send `partCount` parts of `partSize` bytes to /upload-part, then /upload-complete.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filename","size"],"properties":{"path":{"type":"string"},"filename":{"minLength":1,"maxLength":255,"type":"string"},"size":{"minimum":1,"type":"number"},"conflict":{"anyOf":[{"const":"keepBoth","type":"string"},{"const":"replace","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["filename","size"],"properties":{"path":{"type":"string"},"filename":{"minLength":1,"maxLength":255,"type":"string"},"size":{"minimum":1,"type":"number"},"conflict":{"anyOf":[{"const":"keepBoth","type":"string"},{"const":"replace","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["filename","size"],"properties":{"path":{"type":"string"},"filename":{"minLength":1,"maxLength":255,"type":"string"},"size":{"minimum":1,"type":"number"},"conflict":{"anyOf":[{"const":"keepBoth","type":"string"},{"const":"replace","type":"string"}]}}}}}}}},"/bff/drive/upload-part":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDriveUpload-part","tags":["Drive"],"summary":"Upload one part","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["uploadSessionId","partNumber","chunk"],"properties":{"uploadSessionId":{"type":"string"},"partNumber":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"chunk":{"default":"File","type":"string","format":"binary"}}}},"multipart/form-data":{"schema":{"type":"object","required":["uploadSessionId","partNumber","chunk"],"properties":{"uploadSessionId":{"type":"string"},"partNumber":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"chunk":{"default":"File","type":"string","format":"binary"}}}},"text/plain":{"schema":{"type":"object","required":["uploadSessionId","partNumber","chunk"],"properties":{"uploadSessionId":{"type":"string"},"partNumber":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"chunk":{"default":"File","type":"string","format":"binary"}}}}}}}},"/bff/drive/upload-complete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"blobToken":{"type":"string"},"filename":{"type":"string"},"replaced":{"type":"number"},"replaceBlocked":{"type":"number"}},"required":["blobToken","filename","replaced","replaceBlocked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"blobToken":{"type":"string"},"filename":{"type":"string"},"replaced":{"type":"number"},"replaceBlocked":{"type":"number"}},"required":["blobToken","filename","replaced","replaceBlocked"]}},"text/plain":{"schema":{"type":"object","properties":{"blobToken":{"type":"string"},"filename":{"type":"string"},"replaced":{"type":"number"},"replaceBlocked":{"type":"number"}},"required":["blobToken","filename","replaced","replaceBlocked"]}}}}},"operationId":"postBffDriveUpload-complete","tags":["Drive"],"summary":"Finish a large upload","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["uploadSessionId"],"properties":{"uploadSessionId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["uploadSessionId"],"properties":{"uploadSessionId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["uploadSessionId"],"properties":{"uploadSessionId":{"type":"string"}}}}}}}},"/bff/drive/upload-abort":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDriveUpload-abort","tags":["Drive"],"summary":"Cancel a large upload","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["uploadSessionId"],"properties":{"uploadSessionId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["uploadSessionId"],"properties":{"uploadSessionId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["uploadSessionId"],"properties":{"uploadSessionId":{"type":"string"}}}}}}}},"/bff/drive/usage":{"get":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"in":"query","name":"token","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"usage":{"type":"array","items":{"type":"object","required":["kind","count"],"properties":{"kind":{"anyOf":[{"const":"invoice","type":"string"},{"const":"accounting","type":"string"},{"const":"email","type":"string"},{"const":"order","type":"string"},{"const":"product","type":"string"},{"const":"content","type":"string"},{"const":"contact","type":"string"},{"const":"issue","type":"string"},{"const":"shipment","type":"string"},{"const":"contract","type":"string"},{"const":"import","type":"string"},{"const":"backup","type":"string"},{"const":"other","type":"string"}]},"count":{"type":"number"}}}}},"required":["usage"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"usage":{"type":"array","items":{"type":"object","required":["kind","count"],"properties":{"kind":{"anyOf":[{"const":"invoice","type":"string"},{"const":"accounting","type":"string"},{"const":"email","type":"string"},{"const":"order","type":"string"},{"const":"product","type":"string"},{"const":"content","type":"string"},{"const":"contact","type":"string"},{"const":"issue","type":"string"},{"const":"shipment","type":"string"},{"const":"contract","type":"string"},{"const":"import","type":"string"},{"const":"backup","type":"string"},{"const":"other","type":"string"}]},"count":{"type":"number"}}}}},"required":["usage"]}},"text/plain":{"schema":{"type":"object","properties":{"usage":{"type":"array","items":{"type":"object","required":["kind","count"],"properties":{"kind":{"anyOf":[{"const":"invoice","type":"string"},{"const":"accounting","type":"string"},{"const":"email","type":"string"},{"const":"order","type":"string"},{"const":"product","type":"string"},{"const":"content","type":"string"},{"const":"contact","type":"string"},{"const":"issue","type":"string"},{"const":"shipment","type":"string"},{"const":"contract","type":"string"},{"const":"import","type":"string"},{"const":"backup","type":"string"},{"const":"other","type":"string"}]},"count":{"type":"number"}}}}},"required":["usage"]}}}}},"operationId":"getBffDriveUsage","tags":["Drive"],"summary":"Business records using a file","description":"Kinds of records that reference the blob, with counts. Empty = not used."}},"/bff/drive/storage-summary":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"usedBytes":{"type":"number"},"fileCount":{"type":"number"},"folderCount":{"type":"number"},"trashBytes":{"type":"number"},"trashCount":{"type":"number"},"versionBytes":{"type":"number"},"quotaUsedBytes":{"type":"number"},"quotaLimitBytes":{"description":"null = unlimited plan.","anyOf":[{"type":"number"},{"type":"null"}]}},"required":["usedBytes","fileCount","folderCount","trashBytes","trashCount","versionBytes","quotaUsedBytes","quotaLimitBytes"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"usedBytes":{"type":"number"},"fileCount":{"type":"number"},"folderCount":{"type":"number"},"trashBytes":{"type":"number"},"trashCount":{"type":"number"},"versionBytes":{"type":"number"},"quotaUsedBytes":{"type":"number"},"quotaLimitBytes":{"description":"null = unlimited plan.","anyOf":[{"type":"number"},{"type":"null"}]}},"required":["usedBytes","fileCount","folderCount","trashBytes","trashCount","versionBytes","quotaUsedBytes","quotaLimitBytes"]}},"text/plain":{"schema":{"type":"object","properties":{"usedBytes":{"type":"number"},"fileCount":{"type":"number"},"folderCount":{"type":"number"},"trashBytes":{"type":"number"},"trashCount":{"type":"number"},"versionBytes":{"type":"number"},"quotaUsedBytes":{"type":"number"},"quotaLimitBytes":{"description":"null = unlimited plan.","anyOf":[{"type":"number"},{"type":"null"}]}},"required":["usedBytes","fileCount","folderCount","trashBytes","trashCount","versionBytes","quotaUsedBytes","quotaLimitBytes"]}}}}},"operationId":"getBffDriveStorage-summary","tags":["Drive"],"summary":"Drive storage summary","description":"Bytes and counts in Drive, the trash and old versions, plus the plan limit."}},"/bff/drive/name-conflicts":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"conflicts":{"type":"array","items":{"type":"object","required":["filename","id"],"properties":{"filename":{"type":"string"},"id":{"type":"string"}}}}},"required":["conflicts"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"conflicts":{"type":"array","items":{"type":"object","required":["filename","id"],"properties":{"filename":{"type":"string"},"id":{"type":"string"}}}}},"required":["conflicts"]}},"text/plain":{"schema":{"type":"object","properties":{"conflicts":{"type":"array","items":{"type":"object","required":["filename","id"],"properties":{"filename":{"type":"string"},"id":{"type":"string"}}}}},"required":["conflicts"]}}}}},"operationId":"postBffDriveName-conflicts","tags":["Drive"],"summary":"Upload name conflicts","description":"Which file names already exist in the target folder (case-insensitive).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["filenames"],"properties":{"path":{"type":"string"},"filenames":{"maxItems":1000,"type":"array","items":{"maxLength":255,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["filenames"],"properties":{"path":{"type":"string"},"filenames":{"maxItems":1000,"type":"array","items":{"maxLength":255,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["filenames"],"properties":{"path":{"type":"string"},"filenames":{"maxItems":1000,"type":"array","items":{"maxLength":255,"type":"string"}}}}}}}}},"/bff/drive/list":{"get":{"parameters":[{"description":"Folder path, e.g. \"Contracts/2026\". Empty = root.","examples":["","documents/invoices"],"schema":{"type":"string"},"in":"query","name":"path","required":false},{"schema":{"anyOf":[{"const":"name","type":"string"},{"const":"size","type":"string"},{"const":"date","type":"string"},{"const":"kind","type":"string"}]},"in":"query","name":"sort","required":false},{"schema":{"anyOf":[{"const":"asc","type":"string"},{"const":"desc","type":"string"}]},"in":"query","name":"direction","required":false},{"schema":{"minimum":0,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":0,"type":"number"}]},"in":"query","name":"offset","required":false},{"schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"number"}]},"in":"query","name":"limit","required":false},{"description":"Skip files (folder pickers).","schema":{"anyOf":[{"description":"Skip files (folder pickers).","type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"foldersOnly","required":false},{"description":"A missing folder lists as empty (`notFound: true`) instead of an error.","schema":{"anyOf":[{"description":"A missing folder lists as empty (`notFound: true`) instead of an error.","type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"missingAsEmpty","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"path":{"type":"string"},"folder":{"anyOf":[{"type":"object","required":["id","name","path"],"properties":{"id":{"description":"Folder external id.","type":"string"},"name":{"type":"string"},"path":{"description":"Full path, e.g. \"Contracts/2026\".","type":"string"}}},{"type":"null"}]},"folderList":{"type":"array","items":{"type":"object","required":["id","name","itemsCount","insertedDate"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"itemsCount":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"color":{"type":"string"},"starred":{"type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}}}}},"fileList":{"type":"array","items":{"type":"object","required":["id","filename","size","contentType","insertedDate","isPrivate"],"properties":{"id":{"description":"Blob token.","type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"isPrivate":{"type":"boolean"},"uploadedBy":{"type":"string"},"location":{"description":"Folder path ('' = root); cross-folder views only.","type":"string"},"starred":{"description":"Starred by the viewer.","type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}},"versionCount":{"description":"Older versions kept in the history.","type":"number"},"duplicateKey":{"description":"Duplicates view: equal key = identical content.","type":"string"}}}},"fileCount":{"description":"Files directly in this folder (all pages).","type":"number"},"offset":{"type":"number"},"limit":{"type":"number"},"hasMore":{"type":"boolean"},"notFound":{"type":"boolean"}},"required":["path","folder","folderList","fileList","fileCount","offset","limit","hasMore"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"path":{"type":"string"},"folder":{"anyOf":[{"type":"object","required":["id","name","path"],"properties":{"id":{"description":"Folder external id.","type":"string"},"name":{"type":"string"},"path":{"description":"Full path, e.g. \"Contracts/2026\".","type":"string"}}},{"type":"null"}]},"folderList":{"type":"array","items":{"type":"object","required":["id","name","itemsCount","insertedDate"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"itemsCount":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"color":{"type":"string"},"starred":{"type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}}}}},"fileList":{"type":"array","items":{"type":"object","required":["id","filename","size","contentType","insertedDate","isPrivate"],"properties":{"id":{"description":"Blob token.","type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"isPrivate":{"type":"boolean"},"uploadedBy":{"type":"string"},"location":{"description":"Folder path ('' = root); cross-folder views only.","type":"string"},"starred":{"description":"Starred by the viewer.","type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}},"versionCount":{"description":"Older versions kept in the history.","type":"number"},"duplicateKey":{"description":"Duplicates view: equal key = identical content.","type":"string"}}}},"fileCount":{"description":"Files directly in this folder (all pages).","type":"number"},"offset":{"type":"number"},"limit":{"type":"number"},"hasMore":{"type":"boolean"},"notFound":{"type":"boolean"}},"required":["path","folder","folderList","fileList","fileCount","offset","limit","hasMore"]}},"text/plain":{"schema":{"type":"object","properties":{"path":{"type":"string"},"folder":{"anyOf":[{"type":"object","required":["id","name","path"],"properties":{"id":{"description":"Folder external id.","type":"string"},"name":{"type":"string"},"path":{"description":"Full path, e.g. \"Contracts/2026\".","type":"string"}}},{"type":"null"}]},"folderList":{"type":"array","items":{"type":"object","required":["id","name","itemsCount","insertedDate"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"itemsCount":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"color":{"type":"string"},"starred":{"type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}}}}},"fileList":{"type":"array","items":{"type":"object","required":["id","filename","size","contentType","insertedDate","isPrivate"],"properties":{"id":{"description":"Blob token.","type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"isPrivate":{"type":"boolean"},"uploadedBy":{"type":"string"},"location":{"description":"Folder path ('' = root); cross-folder views only.","type":"string"},"starred":{"description":"Starred by the viewer.","type":"boolean"},"labelIds":{"type":"array","items":{"type":"number"}},"versionCount":{"description":"Older versions kept in the history.","type":"number"},"duplicateKey":{"description":"Duplicates view: equal key = identical content.","type":"string"}}}},"fileCount":{"description":"Files directly in this folder (all pages).","type":"number"},"offset":{"type":"number"},"limit":{"type":"number"},"hasMore":{"type":"boolean"},"notFound":{"type":"boolean"}},"required":["path","folder","folderList","fileList","fileCount","offset","limit","hasMore"]}}}}},"operationId":"getBffDriveList","tags":["Drive"],"summary":"List one folder (paged)","description":"Subfolders (not paged) and one page of files of a single folder. Trashed items are excluded. Folder item counts are direct children only; recursive size is served by `/folder-stats`."}},"/bff/drive/folder-stats":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"path","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"fileCount":{"type":"number"},"folderCount":{"type":"number"},"totalSize":{"type":"number"},"totalSizeFormatted":{"type":"string"},"canDownload":{"description":"Within the ZIP export limits.","type":"boolean"}},"required":["fileCount","folderCount","totalSize","totalSizeFormatted","canDownload"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"fileCount":{"type":"number"},"folderCount":{"type":"number"},"totalSize":{"type":"number"},"totalSizeFormatted":{"type":"string"},"canDownload":{"description":"Within the ZIP export limits.","type":"boolean"}},"required":["fileCount","folderCount","totalSize","totalSizeFormatted","canDownload"]}},"text/plain":{"schema":{"type":"object","properties":{"fileCount":{"type":"number"},"folderCount":{"type":"number"},"totalSize":{"type":"number"},"totalSizeFormatted":{"type":"string"},"canDownload":{"description":"Within the ZIP export limits.","type":"boolean"}},"required":["fileCount","folderCount","totalSize","totalSizeFormatted","canDownload"]}}}}},"operationId":"getBffDriveFolder-stats","tags":["Drive"],"summary":"Recursive folder size and counts","description":"Root = whole organisation. Trash excluded."}},"/bff/drive/download-directory":{"get":{"parameters":[{"description":"Folder path. Empty = whole Drive.","schema":{"type":"string"},"in":"query","name":"path","required":false}],"operationId":"getBffDriveDownload-directory","tags":["Drive"],"summary":"Download folder as ZIP (streamed)","description":"Streams the folder recursively as a ZIP with a `_manifest.txt`. Limits: 20 000 files / 20 GB.","responses":{"200":{}}}},"/bff/drive/detail":{"get":{"parameters":[{"description":"Unique file token.","examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"token","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"extension":{"type":"string"},"size":{"type":"number"},"sizeFormatted":{"type":"string"},"contentType":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"folderId":{"type":"number"},"folderPath":{"type":"string"},"blobPath":{"type":"string"},"downloadUrl":{"type":"string"},"viewUrl":{"description":"Same-origin streaming URL (inline).","type":"string"},"isPrivate":{"description":"No permanent public URL exists; never share `downloadUrl`.","type":"boolean"},"backupDate":{"description":"ISO time the copy in the geo-separated backup datacenter was confirmed. Missing = not mirrored yet.","type":"string"},"backupRegion":{"description":"Backup datacenter region code, e.g. `nbg1` (Hetzner Nuremberg).","type":"string"}},"required":["token","filename","size","sizeFormatted","contentType","insertedDate","blobPath","viewUrl","isPrivate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"extension":{"type":"string"},"size":{"type":"number"},"sizeFormatted":{"type":"string"},"contentType":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"folderId":{"type":"number"},"folderPath":{"type":"string"},"blobPath":{"type":"string"},"downloadUrl":{"type":"string"},"viewUrl":{"description":"Same-origin streaming URL (inline).","type":"string"},"isPrivate":{"description":"No permanent public URL exists; never share `downloadUrl`.","type":"boolean"},"backupDate":{"description":"ISO time the copy in the geo-separated backup datacenter was confirmed. Missing = not mirrored yet.","type":"string"},"backupRegion":{"description":"Backup datacenter region code, e.g. `nbg1` (Hetzner Nuremberg).","type":"string"}},"required":["token","filename","size","sizeFormatted","contentType","insertedDate","blobPath","viewUrl","isPrivate"]}},"text/plain":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"extension":{"type":"string"},"size":{"type":"number"},"sizeFormatted":{"type":"string"},"contentType":{"type":"string"},"tag":{"type":"string"},"insertedDate":{"type":"string"},"folderId":{"type":"number"},"folderPath":{"type":"string"},"blobPath":{"type":"string"},"downloadUrl":{"type":"string"},"viewUrl":{"description":"Same-origin streaming URL (inline).","type":"string"},"isPrivate":{"description":"No permanent public URL exists; never share `downloadUrl`.","type":"boolean"},"backupDate":{"description":"ISO time the copy in the geo-separated backup datacenter was confirmed. Missing = not mirrored yet.","type":"string"},"backupRegion":{"description":"Backup datacenter region code, e.g. `nbg1` (Hetzner Nuremberg).","type":"string"}},"required":["token","filename","size","sizeFormatted","contentType","insertedDate","blobPath","viewUrl","isPrivate"]}}}}},"operationId":"getBffDriveDetail","tags":["Drive"],"summary":"Get file detail","description":"Metadata plus URLs for download and viewing. Private files get a time-limited `downloadUrl`."}},"/bff/drive/viewer":{"get":{"parameters":[{"examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getBffDriveViewer","tags":["Drive"],"summary":"Stream file inline","description":"Streams the file (supports `Range`). For iframes, img and video tags.","responses":{"200":{}}}},"/bff/drive/download":{"get":{"parameters":[{"examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getBffDriveDownload","tags":["Drive"],"summary":"Download file","description":"Streams the file as an attachment with its display name.","responses":{"200":{}}}},"/bff/drive/rename":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"changed":{"type":"boolean"}},"required":["token","filename","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"changed":{"type":"boolean"}},"required":["token","filename","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"changed":{"type":"boolean"}},"required":["token","filename","changed"]}}}}},"operationId":"postBffDriveRename","tags":["Drive"],"summary":"Rename a file","description":"Changes the display name only; the storage key is unchanged. Must be unique within the folder.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","filename"],"properties":{"token":{"description":"File token.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"filename":{"minLength":1,"description":"New display name, with or without extension. Case, spaces and diacritics are kept; the extension never changes.","examples":["Smlouva Novák 2026","invoice-2026-03.pdf"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","filename"],"properties":{"token":{"description":"File token.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"filename":{"minLength":1,"description":"New display name, with or without extension. Case, spaces and diacritics are kept; the extension never changes.","examples":["Smlouva Novák 2026","invoice-2026-03.pdf"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["token","filename"],"properties":{"token":{"description":"File token.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"filename":{"minLength":1,"description":"New display name, with or without extension. Case, spaces and diacritics are kept; the extension never changes.","examples":["Smlouva Novák 2026","invoice-2026-03.pdf"],"type":"string"}}}}}}}},"/bff/drive/rename-folder":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"changed":{"type":"boolean"}},"required":["id","name","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"changed":{"type":"boolean"}},"required":["id","name","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"changed":{"type":"boolean"}},"required":["id","name","changed"]}}}}},"operationId":"postBffDriveRename-folder","tags":["Drive"],"summary":"Rename a folder","description":"Name must be unique within the parent folder.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["folderId","name"],"properties":{"folderId":{"description":"Folder external id.","type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["folderId","name"],"properties":{"folderId":{"description":"Folder external id.","type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["folderId","name"],"properties":{"folderId":{"description":"Folder external id.","type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"}}}}}}}},"/bff/drive/create-directory":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}},"required":["externalId","name","path"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"externalId":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}},"required":["externalId","name","path"]}},"text/plain":{"schema":{"type":"object","properties":{"externalId":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"}},"required":["externalId","name","path"]}}}}},"operationId":"postBffDriveCreate-directory","tags":["Drive"],"summary":"Create a folder","description":"Creates the folder and missing parents. Existing folder = returned without error; a trashed one is restored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["path"],"properties":{"path":{"examples":["documents/invoices"],"description":"Full folder path; missing parents are created.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["path"],"properties":{"path":{"examples":["documents/invoices"],"description":"Full folder path; missing parents are created.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["path"],"properties":{"path":{"examples":["documents/invoices"],"description":"Full folder path; missing parents are created.","type":"string"}}}}}}}},"/bff/drive/move":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"moved":{"type":"number"},"previous":{"description":"Undo data: where the items were (move them back per entry).","type":"array","items":{"type":"object","required":["folderId","files","folders"],"properties":{"folderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"string"}},"folders":{"type":"array","items":{"type":"string"}}}}}},"required":["moved","previous"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"moved":{"type":"number"},"previous":{"description":"Undo data: where the items were (move them back per entry).","type":"array","items":{"type":"object","required":["folderId","files","folders"],"properties":{"folderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"string"}},"folders":{"type":"array","items":{"type":"string"}}}}}},"required":["moved","previous"]}},"text/plain":{"schema":{"type":"object","properties":{"moved":{"type":"number"},"previous":{"description":"Undo data: where the items were (move them back per entry).","type":"array","items":{"type":"object","required":["folderId","files","folders"],"properties":{"folderId":{"anyOf":[{"type":"string"},{"type":"null"}]},"files":{"type":"array","items":{"type":"string"}},"folders":{"type":"array","items":{"type":"string"}}}}}},"required":["moved","previous"]}}}}},"operationId":"postBffDriveMove","tags":["Drive"],"summary":"Move files and folders","description":"Re-parents items. Storage keys and module links are unchanged. Rejects cycles and folder name conflicts.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetFolderId"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"targetFolderId":{"description":"Target folder external id; null = root.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["targetFolderId"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"targetFolderId":{"description":"Target folder external id; null = root.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["targetFolderId"],"properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}},"targetFolderId":{"description":"Target folder external id; null = root.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/drive/trash":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"trashed":{"type":"number"},"blocked":{"type":"array","items":{"type":"object","required":["type","id","name","usedIn"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"usedIn":{"type":"array","items":{"anyOf":[{"const":"invoice","type":"string"},{"const":"accounting","type":"string"},{"const":"email","type":"string"},{"const":"order","type":"string"},{"const":"product","type":"string"},{"const":"content","type":"string"},{"const":"contact","type":"string"},{"const":"issue","type":"string"},{"const":"shipment","type":"string"},{"const":"contract","type":"string"},{"const":"import","type":"string"},{"const":"backup","type":"string"},{"const":"other","type":"string"}]}},"referencedFileCount":{"type":"number"}}}}},"required":["trashed","blocked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"trashed":{"type":"number"},"blocked":{"type":"array","items":{"type":"object","required":["type","id","name","usedIn"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"usedIn":{"type":"array","items":{"anyOf":[{"const":"invoice","type":"string"},{"const":"accounting","type":"string"},{"const":"email","type":"string"},{"const":"order","type":"string"},{"const":"product","type":"string"},{"const":"content","type":"string"},{"const":"contact","type":"string"},{"const":"issue","type":"string"},{"const":"shipment","type":"string"},{"const":"contract","type":"string"},{"const":"import","type":"string"},{"const":"backup","type":"string"},{"const":"other","type":"string"}]}},"referencedFileCount":{"type":"number"}}}}},"required":["trashed","blocked"]}},"text/plain":{"schema":{"type":"object","properties":{"trashed":{"type":"number"},"blocked":{"type":"array","items":{"type":"object","required":["type","id","name","usedIn"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"usedIn":{"type":"array","items":{"anyOf":[{"const":"invoice","type":"string"},{"const":"accounting","type":"string"},{"const":"email","type":"string"},{"const":"order","type":"string"},{"const":"product","type":"string"},{"const":"content","type":"string"},{"const":"contact","type":"string"},{"const":"issue","type":"string"},{"const":"shipment","type":"string"},{"const":"contract","type":"string"},{"const":"import","type":"string"},{"const":"backup","type":"string"},{"const":"other","type":"string"}]}},"referencedFileCount":{"type":"number"}}}}},"required":["trashed","blocked"]}}}}},"operationId":"postBffDriveTrash","tags":["Drive"],"summary":"Move to trash","description":"Files still used by a business record (invoice, order, e-mail, product, …) are never trashed and come back in `blocked`; a folder is blocked when anything in its subtree is used. Trashed items are purged after 30 days.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}}}}},"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["type","id","name","location","trashedDate","purgeDate"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"location":{"type":"string"},"trashedDate":{"type":"string"},"purgeDate":{"type":"string"},"trashedBy":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["type","id","name","location","trashedDate","purgeDate"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"location":{"type":"string"},"trashedDate":{"type":"string"},"purgeDate":{"type":"string"},"trashedBy":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["type","id","name","location","trashedDate","purgeDate"],"properties":{"type":{"anyOf":[{"const":"file","type":"string"},{"const":"folder","type":"string"}]},"id":{"type":"string"},"name":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"extension":{"type":"string"},"location":{"type":"string"},"trashedDate":{"type":"string"},"purgeDate":{"type":"string"},"trashedBy":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffDriveTrash","tags":["Drive"],"summary":"List trash","description":"Trashed files and folders (top level), newest first."}},"/bff/drive/restore":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"restored":{"type":"number"}},"required":["restored"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"restored":{"type":"number"}},"required":["restored"]}},"text/plain":{"schema":{"type":"object","properties":{"restored":{"type":"number"}},"required":["restored"]}}}}},"operationId":"postBffDriveRestore","tags":["Drive"],"summary":"Restore from trash","description":"Restores to the original folder (and its trashed ancestors).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}}}}}},"/bff/drive/delete-permanently":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"deletedFiles":{"type":"number"},"deletedFolders":{"type":"number"},"restored":{"type":"number"}},"required":["deletedFiles","deletedFolders","restored"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"deletedFiles":{"type":"number"},"deletedFolders":{"type":"number"},"restored":{"type":"number"}},"required":["deletedFiles","deletedFolders","restored"]}},"text/plain":{"schema":{"type":"object","properties":{"deletedFiles":{"type":"number"},"deletedFolders":{"type":"number"},"restored":{"type":"number"}},"required":["deletedFiles","deletedFolders","restored"]}}}}},"operationId":"postBffDriveDelete-permanently","tags":["Drive"],"summary":"Delete permanently","description":"Only items already in the trash. Items that became used meanwhile are restored instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","properties":{"files":{"description":"Blob tokens.","maxItems":5000,"type":"array","items":{"type":"string"}},"folders":{"description":"Folder external ids.","maxItems":500,"type":"array","items":{"type":"string"}}}}}}}}},"/bff/ecommerce/company/detail":{"get":{"parameters":[{"description":"Company registration number (IČO) to look up.","examples":["05103118"],"schema":{"type":"string"},"in":"query","name":"ico","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"ico":{"description":"The IČO that was queried (lowercase).","examples":["05103118"],"type":"string"},"ares":{"description":"Structured company and address data from ARES."}},"required":["ico","ares"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"ico":{"description":"The IČO that was queried (lowercase).","examples":["05103118"],"type":"string"},"ares":{"description":"Structured company and address data from ARES."}},"required":["ico","ares"]}},"text/plain":{"schema":{"type":"object","properties":{"ico":{"description":"The IČO that was queried (lowercase).","examples":["05103118"],"type":"string"},"ares":{"description":"Structured company and address data from ARES."}},"required":["ico","ares"]}}}}},"operationId":"getBffEcommerceCompanyDetail","tags":["Ecommerce"],"summary":"Look up company by registration number","description":"Fetches company details from ARES (Czech business register) by IČO and returns structured address and company data."}},"/bff/ecommerce/vies/detail":{"get":{"parameters":[{"description":"EU VAT identifier including country prefix (e.g., \"SK2020317068\").","examples":["SK2020317068"],"schema":{"type":"string"},"in":"query","name":"vatId","required":true},{"description":"Set to \"true\" to bypass the 4-week cache and re-query VIES.","schema":{"type":"string"},"in":"query","name":"force","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"vatId":{"description":"The VAT ID that was queried.","type":"string"},"isValid":{"description":"True if VIES confirmed the VAT identifier.","type":"boolean"},"countryCode":{"description":"ISO 3166-1 alpha-2 country code (or \"EL\" for Greece in VIES).","type":"string"},"vatNumber":{"description":"VAT identifier without the country prefix.","type":"string"},"name":{"description":"Registered name as held by the member state.","type":"string"},"address":{"description":"Registered address (may contain newlines).","type":"string"},"requestDate":{"description":"ISO date when VIES queried the national registry.","type":"string"},"suggestReverseCharge":{"description":"UI hint: true when the contact qualifies for EU intra-community supply (valid non-CZ EU VAT ID).","type":"boolean"}},"required":["vatId","isValid","countryCode","vatNumber","suggestReverseCharge"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"vatId":{"description":"The VAT ID that was queried.","type":"string"},"isValid":{"description":"True if VIES confirmed the VAT identifier.","type":"boolean"},"countryCode":{"description":"ISO 3166-1 alpha-2 country code (or \"EL\" for Greece in VIES).","type":"string"},"vatNumber":{"description":"VAT identifier without the country prefix.","type":"string"},"name":{"description":"Registered name as held by the member state.","type":"string"},"address":{"description":"Registered address (may contain newlines).","type":"string"},"requestDate":{"description":"ISO date when VIES queried the national registry.","type":"string"},"suggestReverseCharge":{"description":"UI hint: true when the contact qualifies for EU intra-community supply (valid non-CZ EU VAT ID).","type":"boolean"}},"required":["vatId","isValid","countryCode","vatNumber","suggestReverseCharge"]}},"text/plain":{"schema":{"type":"object","properties":{"vatId":{"description":"The VAT ID that was queried.","type":"string"},"isValid":{"description":"True if VIES confirmed the VAT identifier.","type":"boolean"},"countryCode":{"description":"ISO 3166-1 alpha-2 country code (or \"EL\" for Greece in VIES).","type":"string"},"vatNumber":{"description":"VAT identifier without the country prefix.","type":"string"},"name":{"description":"Registered name as held by the member state.","type":"string"},"address":{"description":"Registered address (may contain newlines).","type":"string"},"requestDate":{"description":"ISO date when VIES queried the national registry.","type":"string"},"suggestReverseCharge":{"description":"UI hint: true when the contact qualifies for EU intra-community supply (valid non-CZ EU VAT ID).","type":"boolean"}},"required":["vatId","isValid","countryCode","vatNumber","suggestReverseCharge"]}}}}},"operationId":"getBffEcommerceViesDetail","tags":["Ecommerce"],"summary":"Look up EU VAT identifier via VIES","description":"Validates an EU VAT identifier through the VIES REST API and caches the result for 4 weeks. Returns the validity flag, registered name, address, the VIES request date, and a UI hint (`suggestReverseCharge`) that is true for valid non-CZ EU VAT IDs — the typical case where the admin should set the contact's `reverseCharge` flag."}},"/bff/emailer/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Filter by message status code.","schema":{"type":"string"},"in":"query","name":"status","required":false},{"description":"Filter by message tag.","schema":{"type":"string"},"in":"query","name":"tag","required":false},{"description":"Filter by recipient contact external ID.","schema":{"type":"string"},"in":"query","name":"emailToContactId","required":false},{"description":"Fulltext query — searches subject, body and sender/recipient name & email.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false}],"operationId":"getBffEmailerList","tags":["Emailer"],"summary":"List email messages","description":"Returns a paginated list of email messages for the current organisation with optional filters.","responses":{"200":{}}}},"/bff/emailer/received-list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Filter by any participant contact external ID (from/to/cc/bcc/replyTo).","schema":{"type":"string"},"in":"query","name":"contactExternalId","required":false},{"description":"Fulltext query — matches the message subject and plain-text body.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false}],"operationId":"getBffEmailerReceived-list","tags":["Emailer"],"summary":"List received e-mails","description":"Returns a paginated list of inbound e-mails pulled from Resend into the organisation mailbox.","responses":{"200":{}}}},"/bff/emailer/received-detail":{"get":{"parameters":[{"description":"Opaque 16-char public identifier of the received e-mail (brj__emailer_received_email.external_id).","examples":["gJhvIDjTU8IPU573"],"schema":{"type":"string"},"in":"query","name":"externalId","required":true}],"operationId":"getBffEmailerReceived-detail","tags":["Emailer"],"summary":"Get received e-mail detail","description":"Returns full detail of a single inbound e-mail including the HTML body fetched from blob storage and raw headers.","responses":{"200":{}}}},"/bff/emailer/received-create-issue":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"issueKey":{"description":"Key of the created ticket (e.g. \"BRJ-1182\").","anyOf":[{"type":"string"},{"type":"null"}]},"reporterNotified":{"description":"True when the sender was sent the receipt e-mail with the public ticket status link.","type":"boolean"}},"required":["success","issueKey","reporterNotified"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"issueKey":{"description":"Key of the created ticket (e.g. \"BRJ-1182\").","anyOf":[{"type":"string"},{"type":"null"}]},"reporterNotified":{"description":"True when the sender was sent the receipt e-mail with the public ticket status link.","type":"boolean"}},"required":["success","issueKey","reporterNotified"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"issueKey":{"description":"Key of the created ticket (e.g. \"BRJ-1182\").","anyOf":[{"type":"string"},{"type":"null"}]},"reporterNotified":{"description":"True when the sender was sent the receipt e-mail with the public ticket status link.","type":"boolean"}},"required":["success","issueKey","reporterNotified"]}}}}},"operationId":"postBffEmailerReceived-create-issue","tags":["Emailer"],"summary":"Convert received e-mail to ticket","description":"Manually lifts an inbound e-mail into a `pm__issue` when the automatic classifier did not (spam, not actionable, accounting document, still queued). Same result as an automatic ticket: reporter, participants, attachments, AI workflow and reporter acknowledgement. Fails when the mail already has a ticket.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"description":"Opaque 16-char public identifier of the received e-mail (brj__emailer_received_email.external_id).","examples":["gJhvIDjTU8IPU573"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"description":"Opaque 16-char public identifier of the received e-mail (brj__emailer_received_email.external_id).","examples":["gJhvIDjTU8IPU573"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"description":"Opaque 16-char public identifier of the received e-mail (brj__emailer_received_email.external_id).","examples":["gJhvIDjTU8IPU573"],"type":"string"}}}}}}}},"/bff/emailer/received-attachment-list":{"get":{"parameters":[{"description":"Received e-mail external ID.","examples":["gJhvIDjTU8IPU573"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"attachmentList":{"type":"array","items":{"type":"object","required":["id","filename","size"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"}}}}},"required":["attachmentList"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"attachmentList":{"type":"array","items":{"type":"object","required":["id","filename","size"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"}}}}},"required":["attachmentList"]}},"text/plain":{"schema":{"type":"object","properties":{"attachmentList":{"type":"array","items":{"type":"object","required":["id","filename","size"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"}}}}},"required":["attachmentList"]}}}}},"operationId":"getBffEmailerReceived-attachment-list","tags":["Emailer"],"summary":"List attachments of an inbound e-mail (lightweight)","description":"Returns just the attachment list (filename + size) for one inbound e-mail. Reads only the Resend metadata blob — no S3 fetch, no MIME extraction. Used by the received-grid hover-preview."}},"/bff/emailer/detail":{"get":{"parameters":[{"description":"Email message ID.","examples":["abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffEmailerDetail","tags":["Emailer"],"summary":"Get email detail","description":"Returns full detail of a single email message including content and metadata.","responses":{"200":{}}}},"/bff/emailer/attachment-list":{"get":{"parameters":[{"description":"Email message external ID.","examples":["abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"attachmentList":{"type":"array","items":{"type":"object","required":["id","filename","downloadUrl","size"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"downloadUrl":{"type":"string"},"size":{"type":"number"}}}}},"required":["attachmentList"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"attachmentList":{"type":"array","items":{"type":"object","required":["id","filename","downloadUrl","size"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"downloadUrl":{"type":"string"},"size":{"type":"number"}}}}},"required":["attachmentList"]}},"text/plain":{"schema":{"type":"object","properties":{"attachmentList":{"type":"array","items":{"type":"object","required":["id","filename","downloadUrl","size"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"downloadUrl":{"type":"string"},"size":{"type":"number"}}}}},"required":["attachmentList"]}}}}},"operationId":"getBffEmailerAttachment-list","tags":["Emailer"],"summary":"List attachments of an email (lightweight)","description":"Returns just the attachment list (filename, size, download URL) for one outbound e-mail. Used by the grid hover-preview so the list endpoint can stay lightweight."}},"/bff/emailer/send":{"post":{"parameters":[],"operationId":"postBffEmailerSend","tags":["Emailer"],"summary":"Send email","description":"Queues a new email for sending on behalf of the current organisation. Attachments referenced by blobId / blobToken must belong to the current organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"object","required":["subject","from","to"],"properties":{"subject":{"maxLength":1000,"description":"Subject line.","type":"string"},"from":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},"to":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"cc":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"bcc":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"replyTo":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},"priority":{"description":"Queue priority.","type":"number"},"locale":{"maxLength":8,"type":"string"},"sendEarliestAt":{"description":"ISO datetime — do not send before.","type":"string"},"note":{"description":"Internal note (not sent to the recipient).","type":"string"},"htmlBody":{"description":"HTML body.","type":"string"},"attachmentList":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","required":["blobId"],"properties":{"blobId":{"description":"Blob id owned by the current organisation.","type":"number"},"filename":{"type":"string"},"tag":{"type":"string"}}},{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token owned by the current organisation.","type":"string"},"filename":{"type":"string"},"tag":{"type":"string"}}},{"type":"object","required":["rawTextContent"],"properties":{"rawTextContent":{"description":"Raw text attached as a file.","type":"string"},"filename":{"type":"string"},"tag":{"type":"string"}}}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"object","required":["subject","from","to"],"properties":{"subject":{"maxLength":1000,"description":"Subject line.","type":"string"},"from":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},"to":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"cc":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"bcc":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"replyTo":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},"priority":{"description":"Queue priority.","type":"number"},"locale":{"maxLength":8,"type":"string"},"sendEarliestAt":{"description":"ISO datetime — do not send before.","type":"string"},"note":{"description":"Internal note (not sent to the recipient).","type":"string"},"htmlBody":{"description":"HTML body.","type":"string"},"attachmentList":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","required":["blobId"],"properties":{"blobId":{"description":"Blob id owned by the current organisation.","type":"number"},"filename":{"type":"string"},"tag":{"type":"string"}}},{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token owned by the current organisation.","type":"string"},"filename":{"type":"string"},"tag":{"type":"string"}}},{"type":"object","required":["rawTextContent"],"properties":{"rawTextContent":{"description":"Raw text attached as a file.","type":"string"},"filename":{"type":"string"},"tag":{"type":"string"}}}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"object","required":["subject","from","to"],"properties":{"subject":{"maxLength":1000,"description":"Subject line.","type":"string"},"from":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},"to":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"cc":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"bcc":{"anyOf":[{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},{"maxItems":100,"type":"array","items":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]}}]},"replyTo":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"object","required":["name","email"],"properties":{"name":{"maxLength":200,"type":"string"},"email":{"maxLength":320,"type":"string"}}}]},"priority":{"description":"Queue priority.","type":"number"},"locale":{"maxLength":8,"type":"string"},"sendEarliestAt":{"description":"ISO datetime — do not send before.","type":"string"},"note":{"description":"Internal note (not sent to the recipient).","type":"string"},"htmlBody":{"description":"HTML body.","type":"string"},"attachmentList":{"maxItems":50,"type":"array","items":{"anyOf":[{"type":"object","required":["blobId"],"properties":{"blobId":{"description":"Blob id owned by the current organisation.","type":"number"},"filename":{"type":"string"},"tag":{"type":"string"}}},{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token owned by the current organisation.","type":"string"},"filename":{"type":"string"},"tag":{"type":"string"}}},{"type":"object","required":["rawTextContent"],"properties":{"rawTextContent":{"description":"Raw text attached as a file.","type":"string"},"filename":{"type":"string"},"tag":{"type":"string"}}}]}}}}}}}}},"responses":{"200":{}}}},"/bff/emailer/detail-log-explain":{"get":{"parameters":[{"description":"Email message ID to explain.","examples":["abc123"],"schema":{"type":"string"},"in":"query","name":"emailId","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"operationId":"getBffEmailerDetail-log-explain","tags":["Emailer"],"summary":"AI-explain email log entry","description":"Uses AI to generate a human-readable explanation of the email delivery log.","responses":{"200":{}}}},"/bff/emailer/status":{"get":{"operationId":"getBffEmailerStatus","tags":["Emailer"],"summary":"Get emailer status","description":"Returns whether SMTP is configured for the current organisation.","responses":{"200":{}}}},"/bff/emailer/send-now":{"get":{"parameters":[{"description":"Email message ID to send immediately.","examples":["abc123"],"schema":{"type":"string"},"in":"query","name":"emailId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffEmailerSend-now","tags":["Emailer"],"summary":"Send email immediately","description":"Bypasses the queue and sends the specified email right away."}},"/bff/emailer/send-again":{"get":{"parameters":[{"description":"Email message ID to re-send.","examples":["abc123"],"schema":{"type":"string"},"in":"query","name":"emailId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffEmailerSend-again","tags":["Emailer"],"summary":"Re-send email","description":"Re-sends a previously sent or failed email message."}},"/bff/emailer/resend":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"emailId":{"type":"string"},"to":{"type":"string"}},"required":["success","emailId","to"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"emailId":{"type":"string"},"to":{"type":"string"}},"required":["success","emailId","to"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"emailId":{"type":"string"},"to":{"type":"string"}},"required":["success","emailId","to"]}}}}},"operationId":"postBffEmailerResend","tags":["Emailer"],"summary":"Resend a copy of a logged e-mail","description":"Queues a new message with the stored subject, body, sender, layout and attachments of any logged e-mail (sent, failed or undeliverable). Optionally to a different address (cc/bcc are then dropped). The original message stays untouched as evidence. Recipients that hard-bounced in the last 24 h are still refused by the undeliverable gate.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["emailId"],"properties":{"emailId":{"description":"External ID of the logged e-mail to resend.","type":"string"},"to":{"description":"Send the copy to this address instead of the original recipients.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["emailId"],"properties":{"emailId":{"description":"External ID of the logged e-mail to resend.","type":"string"},"to":{"description":"Send the copy to this address instead of the original recipients.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["emailId"],"properties":{"emailId":{"description":"External ID of the logged e-mail to resend.","type":"string"},"to":{"description":"Send the copy to this address instead of the original recipients.","type":"string"}}}}}}}},"/bff/emailer/download-confirmation":{"get":{"parameters":[{"description":"Email message external ID to certify.","examples":["abc123"],"schema":{"type":"string"},"in":"query","name":"emailId","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"operationId":"getBffEmailerDownload-confirmation","tags":["Emailer"],"summary":"Download email send-confirmation PDF","description":"Generates a print-ready A4 PDF that serves as an evidentiary record of a sent e-mail. The certificate contains: internal message ID, SMTP `Message-ID`, current status, all key timestamps (created, sent, earliest scheduled, next retry), failed-attempt counter, message locale, open tracking, participants (from / to / cc / bcc / reply-to), the full system log, every recorded delivery event (bounces, SMTP rejections), the attachment list, and the exact HTML body handed to SMTP. Returned inline so the browser previews it in a new tab; not persisted to blob storage.","responses":{"200":{}}}},"/bff/emailer/smtp-info":{"get":{"operationId":"getBffEmailerSmtp-info","tags":["Emailer"],"summary":"Get SMTP configuration","description":"Returns the current SMTP server settings for the organisation.","responses":{"200":{}}}},"/bff/emailer/setup-smtp":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"steps":{"type":"array","items":{"type":"object","required":["step","status"],"properties":{"step":{"description":"target | connection | auth | send","type":"string"},"status":{"description":"ok | failed | skipped","type":"string"}}}},"diagnosis":{"type":"object","required":["stage","reason","provider","hints"],"properties":{"stage":{"description":"target | connect | tls | auth | sender | recipient | message | unknown","type":"string"},"reason":{"description":"Classified failure reason, e.g. AUTH_REJECTED.","type":"string"},"provider":{"description":"proton | google | microsoft | seznam | other","type":"string"},"hints":{"type":"array","items":{"description":"Actionable hint code, e.g. PROTON_TOKEN_USER.","type":"string"}},"smtpCode":{"description":"SMTP reply code, e.g. 535.","type":"number"},"enhancedCode":{"description":"Enhanced status code, e.g. 5.7.8.","type":"string"},"command":{"description":"SMTP verb the server answered, e.g. AUTH PLAIN.","type":"string"},"errorCode":{"description":"Transport error code, e.g. EAUTH.","type":"string"}}},"context":{"type":"object","required":["host","port","security","provider","authUser","from","passwordLength"],"properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"description":"SSL/TLS (465) or STARTTLS.","type":"string"},"provider":{"type":"string"},"authUser":{"type":"string"},"from":{"type":"string"},"passwordLength":{"type":"number"}}},"durationMs":{"type":"number"},"checkedAt":{"type":"string"}},"required":["success","steps","context","durationMs","checkedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"steps":{"type":"array","items":{"type":"object","required":["step","status"],"properties":{"step":{"description":"target | connection | auth | send","type":"string"},"status":{"description":"ok | failed | skipped","type":"string"}}}},"diagnosis":{"type":"object","required":["stage","reason","provider","hints"],"properties":{"stage":{"description":"target | connect | tls | auth | sender | recipient | message | unknown","type":"string"},"reason":{"description":"Classified failure reason, e.g. AUTH_REJECTED.","type":"string"},"provider":{"description":"proton | google | microsoft | seznam | other","type":"string"},"hints":{"type":"array","items":{"description":"Actionable hint code, e.g. PROTON_TOKEN_USER.","type":"string"}},"smtpCode":{"description":"SMTP reply code, e.g. 535.","type":"number"},"enhancedCode":{"description":"Enhanced status code, e.g. 5.7.8.","type":"string"},"command":{"description":"SMTP verb the server answered, e.g. AUTH PLAIN.","type":"string"},"errorCode":{"description":"Transport error code, e.g. EAUTH.","type":"string"}}},"context":{"type":"object","required":["host","port","security","provider","authUser","from","passwordLength"],"properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"description":"SSL/TLS (465) or STARTTLS.","type":"string"},"provider":{"type":"string"},"authUser":{"type":"string"},"from":{"type":"string"},"passwordLength":{"type":"number"}}},"durationMs":{"type":"number"},"checkedAt":{"type":"string"}},"required":["success","steps","context","durationMs","checkedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"steps":{"type":"array","items":{"type":"object","required":["step","status"],"properties":{"step":{"description":"target | connection | auth | send","type":"string"},"status":{"description":"ok | failed | skipped","type":"string"}}}},"diagnosis":{"type":"object","required":["stage","reason","provider","hints"],"properties":{"stage":{"description":"target | connect | tls | auth | sender | recipient | message | unknown","type":"string"},"reason":{"description":"Classified failure reason, e.g. AUTH_REJECTED.","type":"string"},"provider":{"description":"proton | google | microsoft | seznam | other","type":"string"},"hints":{"type":"array","items":{"description":"Actionable hint code, e.g. PROTON_TOKEN_USER.","type":"string"}},"smtpCode":{"description":"SMTP reply code, e.g. 535.","type":"number"},"enhancedCode":{"description":"Enhanced status code, e.g. 5.7.8.","type":"string"},"command":{"description":"SMTP verb the server answered, e.g. AUTH PLAIN.","type":"string"},"errorCode":{"description":"Transport error code, e.g. EAUTH.","type":"string"}}},"context":{"type":"object","required":["host","port","security","provider","authUser","from","passwordLength"],"properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"description":"SSL/TLS (465) or STARTTLS.","type":"string"},"provider":{"type":"string"},"authUser":{"type":"string"},"from":{"type":"string"},"passwordLength":{"type":"number"}}},"durationMs":{"type":"number"},"checkedAt":{"type":"string"}},"required":["success","steps","context","durationMs","checkedAt"]}}}}},"operationId":"postBffEmailerSetup-smtp","tags":["Emailer"],"summary":"Configure SMTP settings","description":"Checks the SMTP account step by step (target, TLS, AUTH, test e-mail to testAddress) and saves it only when every step passed. A failed check returns HTTP 200 with success=false and a classified diagnosis; nothing is saved.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["testAddress","host","port","from","authUser","authPassword"],"properties":{"testAddress":{"description":"Email address to send a test message to.","examples":["test@example.com"],"type":"string"},"host":{"description":"SMTP server hostname.","examples":["smtp.example.com"],"type":"string"},"port":{"description":"SMTP server port.","examples":["587"],"type":"string"},"from":{"description":"Sender email address (From header).","examples":["noreply@example.com"],"type":"string"},"authUser":{"description":"SMTP authentication username.","type":"string"},"authPassword":{"description":"SMTP authentication password.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["testAddress","host","port","from","authUser","authPassword"],"properties":{"testAddress":{"description":"Email address to send a test message to.","examples":["test@example.com"],"type":"string"},"host":{"description":"SMTP server hostname.","examples":["smtp.example.com"],"type":"string"},"port":{"description":"SMTP server port.","examples":["587"],"type":"string"},"from":{"description":"Sender email address (From header).","examples":["noreply@example.com"],"type":"string"},"authUser":{"description":"SMTP authentication username.","type":"string"},"authPassword":{"description":"SMTP authentication password.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["testAddress","host","port","from","authUser","authPassword"],"properties":{"testAddress":{"description":"Email address to send a test message to.","examples":["test@example.com"],"type":"string"},"host":{"description":"SMTP server hostname.","examples":["smtp.example.com"],"type":"string"},"port":{"description":"SMTP server port.","examples":["587"],"type":"string"},"from":{"description":"Sender email address (From header).","examples":["noreply@example.com"],"type":"string"},"authUser":{"description":"SMTP authentication username.","type":"string"},"authPassword":{"description":"SMTP authentication password.","type":"string"}}}}}}}},"/bff/emailer/check-smtp":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"usedStoredPassword":{"type":"boolean"},"steps":{"type":"array","items":{"type":"object","required":["step","status"],"properties":{"step":{"description":"target | connection | auth | send","type":"string"},"status":{"description":"ok | failed | skipped","type":"string"}}}},"diagnosis":{"type":"object","required":["stage","reason","provider","hints"],"properties":{"stage":{"description":"target | connect | tls | auth | sender | recipient | message | unknown","type":"string"},"reason":{"description":"Classified failure reason, e.g. AUTH_REJECTED.","type":"string"},"provider":{"description":"proton | google | microsoft | seznam | other","type":"string"},"hints":{"type":"array","items":{"description":"Actionable hint code, e.g. PROTON_TOKEN_USER.","type":"string"}},"smtpCode":{"description":"SMTP reply code, e.g. 535.","type":"number"},"enhancedCode":{"description":"Enhanced status code, e.g. 5.7.8.","type":"string"},"command":{"description":"SMTP verb the server answered, e.g. AUTH PLAIN.","type":"string"},"errorCode":{"description":"Transport error code, e.g. EAUTH.","type":"string"}}},"context":{"type":"object","required":["host","port","security","provider","authUser","from","passwordLength"],"properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"description":"SSL/TLS (465) or STARTTLS.","type":"string"},"provider":{"type":"string"},"authUser":{"type":"string"},"from":{"type":"string"},"passwordLength":{"type":"number"}}},"durationMs":{"type":"number"},"checkedAt":{"type":"string"}},"required":["success","usedStoredPassword","steps","context","durationMs","checkedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"usedStoredPassword":{"type":"boolean"},"steps":{"type":"array","items":{"type":"object","required":["step","status"],"properties":{"step":{"description":"target | connection | auth | send","type":"string"},"status":{"description":"ok | failed | skipped","type":"string"}}}},"diagnosis":{"type":"object","required":["stage","reason","provider","hints"],"properties":{"stage":{"description":"target | connect | tls | auth | sender | recipient | message | unknown","type":"string"},"reason":{"description":"Classified failure reason, e.g. AUTH_REJECTED.","type":"string"},"provider":{"description":"proton | google | microsoft | seznam | other","type":"string"},"hints":{"type":"array","items":{"description":"Actionable hint code, e.g. PROTON_TOKEN_USER.","type":"string"}},"smtpCode":{"description":"SMTP reply code, e.g. 535.","type":"number"},"enhancedCode":{"description":"Enhanced status code, e.g. 5.7.8.","type":"string"},"command":{"description":"SMTP verb the server answered, e.g. AUTH PLAIN.","type":"string"},"errorCode":{"description":"Transport error code, e.g. EAUTH.","type":"string"}}},"context":{"type":"object","required":["host","port","security","provider","authUser","from","passwordLength"],"properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"description":"SSL/TLS (465) or STARTTLS.","type":"string"},"provider":{"type":"string"},"authUser":{"type":"string"},"from":{"type":"string"},"passwordLength":{"type":"number"}}},"durationMs":{"type":"number"},"checkedAt":{"type":"string"}},"required":["success","usedStoredPassword","steps","context","durationMs","checkedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"usedStoredPassword":{"type":"boolean"},"steps":{"type":"array","items":{"type":"object","required":["step","status"],"properties":{"step":{"description":"target | connection | auth | send","type":"string"},"status":{"description":"ok | failed | skipped","type":"string"}}}},"diagnosis":{"type":"object","required":["stage","reason","provider","hints"],"properties":{"stage":{"description":"target | connect | tls | auth | sender | recipient | message | unknown","type":"string"},"reason":{"description":"Classified failure reason, e.g. AUTH_REJECTED.","type":"string"},"provider":{"description":"proton | google | microsoft | seznam | other","type":"string"},"hints":{"type":"array","items":{"description":"Actionable hint code, e.g. PROTON_TOKEN_USER.","type":"string"}},"smtpCode":{"description":"SMTP reply code, e.g. 535.","type":"number"},"enhancedCode":{"description":"Enhanced status code, e.g. 5.7.8.","type":"string"},"command":{"description":"SMTP verb the server answered, e.g. AUTH PLAIN.","type":"string"},"errorCode":{"description":"Transport error code, e.g. EAUTH.","type":"string"}}},"context":{"type":"object","required":["host","port","security","provider","authUser","from","passwordLength"],"properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"description":"SSL/TLS (465) or STARTTLS.","type":"string"},"provider":{"type":"string"},"authUser":{"type":"string"},"from":{"type":"string"},"passwordLength":{"type":"number"}}},"durationMs":{"type":"number"},"checkedAt":{"type":"string"}},"required":["success","usedStoredPassword","steps","context","durationMs","checkedAt"]}}}}},"operationId":"postBffEmailerCheck-smtp","tags":["Emailer"],"summary":"Check SMTP connection","description":"Connects and authenticates against the SMTP server without saving anything and without sending an e-mail. Returns a step-by-step classified result.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["host","port","from","authUser"],"properties":{"host":{"description":"SMTP server hostname.","examples":["smtp.example.com"],"type":"string"},"port":{"description":"SMTP server port.","examples":["587"],"type":"string"},"from":{"description":"Sender email address (From header).","type":"string"},"authUser":{"description":"SMTP authentication username.","type":"string"},"authPassword":{"description":"SMTP password. Empty = use the saved password.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["host","port","from","authUser"],"properties":{"host":{"description":"SMTP server hostname.","examples":["smtp.example.com"],"type":"string"},"port":{"description":"SMTP server port.","examples":["587"],"type":"string"},"from":{"description":"Sender email address (From header).","type":"string"},"authUser":{"description":"SMTP authentication username.","type":"string"},"authPassword":{"description":"SMTP password. Empty = use the saved password.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["host","port","from","authUser"],"properties":{"host":{"description":"SMTP server hostname.","examples":["smtp.example.com"],"type":"string"},"port":{"description":"SMTP server port.","examples":["587"],"type":"string"},"from":{"description":"Sender email address (From header).","type":"string"},"authUser":{"description":"SMTP authentication username.","type":"string"},"authPassword":{"description":"SMTP password. Empty = use the saved password.","type":"string"}}}}}}}},"/bff/emailer/send-smtp-configuration-request":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"issueExternalId":{"description":"16-char public identifier of the created ticket (support.bizkithub.com/ticket/<externalId>).","type":"string"},"issueKey":{"description":"Human-friendly issue key (e.g. SUP-123) — used by the admin UI to route to the ticket detail.","type":"string"},"assigneeEmail":{"description":"E-mail address of the technical contact the ticket was dispatched to — surfaced in the admin UI so the operator can see who was notified.","type":"string"},"targetLocale":{"description":"Locale the ticket + outbound mail were translated into (the recipient org primary locale).","type":"string"}},"required":["issueExternalId","issueKey","assigneeEmail","targetLocale"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"issueExternalId":{"description":"16-char public identifier of the created ticket (support.bizkithub.com/ticket/<externalId>).","type":"string"},"issueKey":{"description":"Human-friendly issue key (e.g. SUP-123) — used by the admin UI to route to the ticket detail.","type":"string"},"assigneeEmail":{"description":"E-mail address of the technical contact the ticket was dispatched to — surfaced in the admin UI so the operator can see who was notified.","type":"string"},"targetLocale":{"description":"Locale the ticket + outbound mail were translated into (the recipient org primary locale).","type":"string"}},"required":["issueExternalId","issueKey","assigneeEmail","targetLocale"]}},"text/plain":{"schema":{"type":"object","properties":{"issueExternalId":{"description":"16-char public identifier of the created ticket (support.bizkithub.com/ticket/<externalId>).","type":"string"},"issueKey":{"description":"Human-friendly issue key (e.g. SUP-123) — used by the admin UI to route to the ticket detail.","type":"string"},"assigneeEmail":{"description":"E-mail address of the technical contact the ticket was dispatched to — surfaced in the admin UI so the operator can see who was notified.","type":"string"},"targetLocale":{"description":"Locale the ticket + outbound mail were translated into (the recipient org primary locale).","type":"string"}},"required":["issueExternalId","issueKey","assigneeEmail","targetLocale"]}}}}},"operationId":"postBffEmailerSend-smtp-configuration-request","tags":["Emailer"],"summary":"Request SMTP configuration from the client","description":"Creates a pm__issue in the current organisation and dispatches the standard \"please send us your SMTP credentials\" ticket to the org admin contact. The ticket body is authored in English and translated into the recipient organisation primary locale before dispatch; the EN original is preserved in internal_description for the operator audit. Replies thread back via the [BKH-ISSUE:…] token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}},"multipart/form-data":{"schema":{"type":"object","properties":{}}},"text/plain":{"schema":{"type":"object","properties":{}}}}}}},"/bff/emailer/statistics":{"get":{"operationId":"getBffEmailerStatistics","tags":["Emailer"],"summary":"Get email statistics","description":"Returns sending statistics and currently running newsletter jobs for the organisation.","responses":{"200":{}}}},"/bff/emailer/analytics":{"get":{"parameters":[{"description":"Start of the analytics window (inclusive), ISO-8601 date or datetime. Defaults to 30 days ago.","examples":["2026-08-01"],"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"End of the analytics window (exclusive), ISO-8601 date or datetime. Defaults to tomorrow (midnight UTC).","examples":["2026-09-01"],"schema":{"type":"string"},"in":"query","name":"dateTo","required":false},{"description":"Optional template category filter (transactional | notification | newsletter | system | marketing | other).","examples":["transactional"],"schema":{"type":"string"},"in":"query","name":"category","required":false}],"operationId":"getBffEmailerAnalytics","tags":["Emailer"],"summary":"Emailer analytics bundle","description":"Returns a single aggregated bundle covering six analytics sections: KPI summary (with previous-period comparisons), daily volume by template category + weekly send-time heatmap, deliverability trends (bounces, complaints, top failing recipients, top rejecting MTAs, top SMTP codes), engagement (open-rate per template type, time-to-open distribution, geo of opens), per-template funnel with A/B variants, and inbound mail analytics (received volume, spam vs actionable classification, ticket promotion rate, top senders). All queries are organisation-scoped.","responses":{"200":{}}}},"/bff/emailer/audience-counts":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"audiences":{"type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["count","verified","quality","customers","extraVerified","excluded"],"properties":{"count":{"description":"Contacts the variant would mail right now.","type":"number"},"verified":{"description":"Of those, verified (confirmed) newsletter subscribers.","type":"number"},"quality":{"description":"Of those, quality contacts (score ≥ quality threshold).","type":"number"},"customers":{"description":"Of those, contacts with at least one paid order.","type":"number"},"extraVerified":{"description":"Of those, verified subscribers who are not quality contacts (for marketingReach: what B adds on top of A).","type":"number"},"excluded":{"description":"Contacts matching the audience but left out, per first matching reason.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"newsletterUnsubscribed":{"description":"Contacts who unsubscribed or opted out of bulk mail (never mailed).","type":"number"}},"required":["audiences","newsletterUnsubscribed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"audiences":{"type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["count","verified","quality","customers","extraVerified","excluded"],"properties":{"count":{"description":"Contacts the variant would mail right now.","type":"number"},"verified":{"description":"Of those, verified (confirmed) newsletter subscribers.","type":"number"},"quality":{"description":"Of those, quality contacts (score ≥ quality threshold).","type":"number"},"customers":{"description":"Of those, contacts with at least one paid order.","type":"number"},"extraVerified":{"description":"Of those, verified subscribers who are not quality contacts (for marketingReach: what B adds on top of A).","type":"number"},"excluded":{"description":"Contacts matching the audience but left out, per first matching reason.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"newsletterUnsubscribed":{"description":"Contacts who unsubscribed or opted out of bulk mail (never mailed).","type":"number"}},"required":["audiences","newsletterUnsubscribed"]}},"text/plain":{"schema":{"type":"object","properties":{"audiences":{"type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["count","verified","quality","customers","extraVerified","excluded"],"properties":{"count":{"description":"Contacts the variant would mail right now.","type":"number"},"verified":{"description":"Of those, verified (confirmed) newsletter subscribers.","type":"number"},"quality":{"description":"Of those, quality contacts (score ≥ quality threshold).","type":"number"},"customers":{"description":"Of those, contacts with at least one paid order.","type":"number"},"extraVerified":{"description":"Of those, verified subscribers who are not quality contacts (for marketingReach: what B adds on top of A).","type":"number"},"excluded":{"description":"Contacts matching the audience but left out, per first matching reason.","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"newsletterUnsubscribed":{"description":"Contacts who unsubscribed or opted out of bulk mail (never mailed).","type":"number"}},"required":["audiences","newsletterUnsubscribed"]}}}}},"operationId":"getBffEmailerAudience-counts","tags":["Emailer"],"summary":"Audience counts for compose variants","description":"Pre-send preview of every bulk audience: how many contacts will receive the mail, how many of them are verified newsletter subscribers / quality contacts / paying customers, and how many were left out per reason (banned, unsubscribed, bulk-mail opt-out, spam complaint, hard bounce, suspicious flag). Uses the same rules as the dispatch. Used by the admin compose audience picker."}},"/bff/emailer/compose":{"post":{"parameters":[],"operationId":"postBffEmailerCompose","tags":["Emailer"],"summary":"Compose and send email","description":"Composes a new email with the given subject, message, and optional attachments, then sends it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["variant","subject","message"],"properties":{"variant":{"description":"Sending variant: single | multiple | contactSegment | any bulk audience from BULK_AUDIENCES (marketingReach = quality contacts + verified subscribers, newsletter = verified subscribers, newsletterPending = unconfirmed sign-ups, newsletterAll = both, customers, repeatCustomers, recentCustomers, dormantCustomers, subscribers, topContacts, qualityContacts, activeRecently, newContacts, allContacts).","examples":["single"],"type":"string"},"contactList":{"description":"Comma-separated list of contact IDs to send to.","type":"string"},"segmentId":{"description":"External ID of a contact segment to use as recipient list. Required when variant = \"contactSegment\".","type":"string"},"subject":{"description":"Email subject line.","type":"string"},"message":{"description":"Email body content (HTML or plain text).","type":"string"},"attachmentTokens":{"description":"Optional list of blob tokens to attach to the e-mail. Blobs must belong to the same organisation as the request.","type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["variant","subject","message"],"properties":{"variant":{"description":"Sending variant: single | multiple | contactSegment | any bulk audience from BULK_AUDIENCES (marketingReach = quality contacts + verified subscribers, newsletter = verified subscribers, newsletterPending = unconfirmed sign-ups, newsletterAll = both, customers, repeatCustomers, recentCustomers, dormantCustomers, subscribers, topContacts, qualityContacts, activeRecently, newContacts, allContacts).","examples":["single"],"type":"string"},"contactList":{"description":"Comma-separated list of contact IDs to send to.","type":"string"},"segmentId":{"description":"External ID of a contact segment to use as recipient list. Required when variant = \"contactSegment\".","type":"string"},"subject":{"description":"Email subject line.","type":"string"},"message":{"description":"Email body content (HTML or plain text).","type":"string"},"attachmentTokens":{"description":"Optional list of blob tokens to attach to the e-mail. Blobs must belong to the same organisation as the request.","type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["variant","subject","message"],"properties":{"variant":{"description":"Sending variant: single | multiple | contactSegment | any bulk audience from BULK_AUDIENCES (marketingReach = quality contacts + verified subscribers, newsletter = verified subscribers, newsletterPending = unconfirmed sign-ups, newsletterAll = both, customers, repeatCustomers, recentCustomers, dormantCustomers, subscribers, topContacts, qualityContacts, activeRecently, newContacts, allContacts).","examples":["single"],"type":"string"},"contactList":{"description":"Comma-separated list of contact IDs to send to.","type":"string"},"segmentId":{"description":"External ID of a contact segment to use as recipient list. Required when variant = \"contactSegment\".","type":"string"},"subject":{"description":"Email subject line.","type":"string"},"message":{"description":"Email body content (HTML or plain text).","type":"string"},"attachmentTokens":{"description":"Optional list of blob tokens to attach to the e-mail. Blobs must belong to the same organisation as the request.","type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{}}}},"/bff/emailer/layout":{"get":{"operationId":"getBffEmailerLayout","tags":["Emailer"],"summary":"Get email layout","description":"Returns the current email layout settings including logo URL, footer HTML, and template HTML.","responses":{"200":{}}}},"/bff/emailer/layout-edit":{"post":{"parameters":[],"operationId":"postBffEmailerLayout-edit","tags":["Emailer"],"summary":"Update email layout","description":"Saves updated footer and template HTML for the organisation email layout.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"footer":{"description":"Footer HTML content for emails.","type":"string"},"template":{"description":"Base HTML template wrapping all emails.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"footer":{"description":"Footer HTML content for emails.","type":"string"},"template":{"description":"Base HTML template wrapping all emails.","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"footer":{"description":"Footer HTML content for emails.","type":"string"},"template":{"description":"Base HTML template wrapping all emails.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/emailer/layout-link-logo-blob":{"get":{"parameters":[{"description":"Blob storage token of the image to use as logo.","examples":["tok_abc123"],"schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"operationId":"getBffEmailerLayout-link-logo-blob","tags":["Emailer"],"summary":"Set logo from blob","description":"Links an uploaded image blob as the organisation logo used in email layouts.","responses":{"200":{}}}},"/bff/emailer/message-log":{"get":{"parameters":[{"description":"Email message ID to fetch logs for.","examples":["abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffEmailerMessage-log","tags":["Emailer"],"summary":"Get message delivery log","description":"Returns the delivery log entries for a specific email message.","responses":{"200":{}}}},"/bff/emailer/template-add":{"post":{"parameters":[],"operationId":"postBffEmailerTemplate-add","tags":["Emailer"],"summary":"Create email template","description":"Creates a new email template and optionally assigns it to an order group and status.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["templateTypeCode","templateCode","name","subject","locale"],"properties":{"templateTypeCode":{"description":"Template type code (e.g. order-confirmation).","examples":["order-confirmation"],"type":"string"},"templateCode":{"description":"Unique code identifier for the template.","examples":["order-confirmed-v1"],"type":"string"},"templateCodeVariant":{"description":"Optional variant suffix for the template code.","type":"string"},"name":{"description":"Human-readable template name.","examples":["Order Confirmation"],"type":"string"},"subject":{"description":"Default email subject line.","examples":["Your order has been confirmed"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"groupCode":{"description":"Order group code to auto-assign the template to.","type":"string"},"statusCode":{"description":"Order status code to auto-assign the template to.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["templateTypeCode","templateCode","name","subject","locale"],"properties":{"templateTypeCode":{"description":"Template type code (e.g. order-confirmation).","examples":["order-confirmation"],"type":"string"},"templateCode":{"description":"Unique code identifier for the template.","examples":["order-confirmed-v1"],"type":"string"},"templateCodeVariant":{"description":"Optional variant suffix for the template code.","type":"string"},"name":{"description":"Human-readable template name.","examples":["Order Confirmation"],"type":"string"},"subject":{"description":"Default email subject line.","examples":["Your order has been confirmed"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"groupCode":{"description":"Order group code to auto-assign the template to.","type":"string"},"statusCode":{"description":"Order status code to auto-assign the template to.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["templateTypeCode","templateCode","name","subject","locale"],"properties":{"templateTypeCode":{"description":"Template type code (e.g. order-confirmation).","examples":["order-confirmation"],"type":"string"},"templateCode":{"description":"Unique code identifier for the template.","examples":["order-confirmed-v1"],"type":"string"},"templateCodeVariant":{"description":"Optional variant suffix for the template code.","type":"string"},"name":{"description":"Human-readable template name.","examples":["Order Confirmation"],"type":"string"},"subject":{"description":"Default email subject line.","examples":["Your order has been confirmed"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"groupCode":{"description":"Order group code to auto-assign the template to.","type":"string"},"statusCode":{"description":"Order status code to auto-assign the template to.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/emailer/template-detail":{"get":{"parameters":[{"description":"Template code identifier.","examples":["order-confirmed-v1"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"operationId":"getBffEmailerTemplate-detail","tags":["Emailer"],"summary":"Get template detail","description":"Returns full detail of an email template including its content and metadata.","responses":{"200":{}}}},"/bff/emailer/template-edit":{"post":{"parameters":[],"operationId":"postBffEmailerTemplate-edit","tags":["Emailer"],"summary":"Update email template","description":"Updates the subject, content, locale and optionally the name and active flag of an existing email template.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["templateCode","subject","template","locale"],"properties":{"templateCode":{"description":"Template code identifier to update.","examples":["order-confirmed-v1"],"type":"string"},"name":{"description":"New human-readable template name. Omit or send blank to keep the current name.","maxLength":255,"type":"string"},"subject":{"description":"Updated email subject line.","type":"string"},"template":{"description":"Updated HTML template content.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"isActive":{"description":"When set, activates (true) or deactivates (false) the template. Omit to keep the current state.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["templateCode","subject","template","locale"],"properties":{"templateCode":{"description":"Template code identifier to update.","examples":["order-confirmed-v1"],"type":"string"},"name":{"description":"New human-readable template name. Omit or send blank to keep the current name.","maxLength":255,"type":"string"},"subject":{"description":"Updated email subject line.","type":"string"},"template":{"description":"Updated HTML template content.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"isActive":{"description":"When set, activates (true) or deactivates (false) the template. Omit to keep the current state.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["templateCode","subject","template","locale"],"properties":{"templateCode":{"description":"Template code identifier to update.","examples":["order-confirmed-v1"],"type":"string"},"name":{"description":"New human-readable template name. Omit or send blank to keep the current name.","maxLength":255,"type":"string"},"subject":{"description":"Updated email subject line.","type":"string"},"template":{"description":"Updated HTML template content.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"isActive":{"description":"When set, activates (true) or deactivates (false) the template. Omit to keep the current state.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/emailer/template-set-active":{"post":{"parameters":[],"operationId":"postBffEmailerTemplate-set-active","tags":["Emailer"],"summary":"Activate or deactivate email template","description":"Toggles whether a custom email template is used for sending. Inactive templates are kept (with history) but never selected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["templateCode","isActive"],"properties":{"templateCode":{"description":"Template code identifier.","examples":["order-confirmed-v1"],"type":"string"},"isActive":{"description":"true = active (used for sending), false = inactive (ignored).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["templateCode","isActive"],"properties":{"templateCode":{"description":"Template code identifier.","examples":["order-confirmed-v1"],"type":"string"},"isActive":{"description":"true = active (used for sending), false = inactive (ignored).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["templateCode","isActive"],"properties":{"templateCode":{"description":"Template code identifier.","examples":["order-confirmed-v1"],"type":"string"},"isActive":{"description":"true = active (used for sending), false = inactive (ignored).","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/emailer/template-list":{"get":{"operationId":"getBffEmailerTemplate-list","tags":["Emailer"],"summary":"List email templates","description":"Returns all email templates for the current organisation.","responses":{"200":{}}}},"/bff/emailer/template-send-debug-email":{"post":{"parameters":[],"operationId":"postBffEmailerTemplate-send-debug-email","tags":["Emailer"],"summary":"Send debug template email","description":"Sends a test email using the specified template to the current user for debugging.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["templateCode"],"properties":{"templateCode":{"description":"Template code to send a debug email for.","examples":["order-confirmed-v1"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["templateCode"],"properties":{"templateCode":{"description":"Template code to send a debug email for.","examples":["order-confirmed-v1"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["templateCode"],"properties":{"templateCode":{"description":"Template code to send a debug email for.","examples":["order-confirmed-v1"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/emailer/template-type-list":{"get":{"parameters":[{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"responses":{"200":{"description":"Template types response.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"List of available template types.","type":"array","items":{"description":"Template type item.","type":"object","required":["code","name"],"properties":{"code":{"description":"Unique template type code.","type":"string"},"name":{"description":"Localized template type name.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"List of available template types.","type":"array","items":{"description":"Template type item.","type":"object","required":["code","name"],"properties":{"code":{"description":"Unique template type code.","type":"string"},"name":{"description":"Localized template type name.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"List of available template types.","type":"array","items":{"description":"Template type item.","type":"object","required":["code","name"],"properties":{"code":{"description":"Unique template type code.","type":"string"},"name":{"description":"Localized template type name.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffEmailerTemplate-type-list","tags":["Emailer"],"summary":"List email template types","description":"Returns all available email template types with localized names. Use this to populate template type selectors in the admin UI."}},"/bff/emailer/template-variables":{"get":{"parameters":[{"description":"Template type code to resolve variables for.","examples":["order-confirmation"],"schema":{"type":"string"},"in":"query","name":"templateCode","required":true}],"operationId":"getBffEmailerTemplate-variables","tags":["Emailer"],"summary":"List template variables","description":"Returns available placeholder variables for the given template type code.","responses":{"200":{}}}},"/bff/emailer/template-validate":{"post":{"parameters":[],"operationId":"postBffEmailerTemplate-validate","tags":["Emailer"],"summary":"Validate email template","description":"Statically analyses an email template and returns a list of structural errors and unknown-variable warnings.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["template","templateCode"],"properties":{"template":{"description":"Template content (HTML or plain text) to validate.","type":"string"},"templateCode":{"description":"Template type code used to resolve the list of allowed variables.","examples":["order-status-notification"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["template","templateCode"],"properties":{"template":{"description":"Template content (HTML or plain text) to validate.","type":"string"},"templateCode":{"description":"Template type code used to resolve the list of allowed variables.","examples":["order-status-notification"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["template","templateCode"],"properties":{"template":{"description":"Template content (HTML or plain text) to validate.","type":"string"},"templateCode":{"description":"Template type code used to resolve the list of allowed variables.","examples":["order-status-notification"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/emailer/template-coverage":{"get":{"parameters":[{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"operationId":"getBffEmailerTemplate-coverage","tags":["Emailer"],"summary":"Email template coverage matrix","description":"Returns the catalogue of all template types and, for each one, whether the organisation has a custom override and whether a system default exists, broken down per the organisation's enabled locales. The optional `locale` query parameter only controls which dictionary is used for the type names; the coverage matrix itself is computed from the organisation's configured locales.","responses":{"200":{}}}},"/bff/emailer/template-create-override":{"post":{"parameters":[],"operationId":"postBffEmailerTemplate-create-override","tags":["Emailer"],"summary":"Create organisation override for a template type","description":"Creates a new per-organisation brj__emailer_template row for the given type + locale (+ optional code variant). When fromDefault=true, subject and body are seeded from the matching brj__emailer_template_default; otherwise the override starts empty and the admin can write it from scratch in the editor.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["typeCode","locale","fromDefault"],"properties":{"typeCode":{"description":"Template type code (must exist in brj__emailer_template_type).","type":"string"},"locale":{"description":"Target locale code (cs, en, ...).","type":"string"},"templateCodeVariant":{"description":"Optional variant suffix (used by order-status-notification).","type":"string"},"fromDefault":{"description":"When true, pre-fill subject + body from the system default; otherwise create an empty override.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["typeCode","locale","fromDefault"],"properties":{"typeCode":{"description":"Template type code (must exist in brj__emailer_template_type).","type":"string"},"locale":{"description":"Target locale code (cs, en, ...).","type":"string"},"templateCodeVariant":{"description":"Optional variant suffix (used by order-status-notification).","type":"string"},"fromDefault":{"description":"When true, pre-fill subject + body from the system default; otherwise create an empty override.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["typeCode","locale","fromDefault"],"properties":{"typeCode":{"description":"Template type code (must exist in brj__emailer_template_type).","type":"string"},"locale":{"description":"Target locale code (cs, en, ...).","type":"string"},"templateCodeVariant":{"description":"Optional variant suffix (used by order-status-notification).","type":"string"},"fromDefault":{"description":"When true, pre-fill subject + body from the system default; otherwise create an empty override.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/emailer/template-type-detail":{"get":{"parameters":[{"description":"Template type code (e.g. order-status-notification).","examples":["order-status-notification"],"schema":{"type":"string"},"in":"query","name":"typeCode","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"operationId":"getBffEmailerTemplate-type-detail","tags":["Emailer"],"summary":"Email template type detail","description":"Returns the per-locale view of one template type — the system default (if any) and all of the organisation's custom overrides for each enabled locale. Powers the admin template type detail page with locale tabs.","responses":{"200":{}}}},"/bff/emailer/template-url-attachment-list":{"get":{"parameters":[{"examples":["voucher-gift-created"],"schema":{"type":"string"},"in":"query","name":"typeCode","required":true}],"operationId":"getBffEmailerTemplate-url-attachment-list","tags":["Emailer"],"summary":"List URL attachments of a template type","description":"Files downloaded from a URL and attached whenever this organisation sends an e-mail of the given type (all locales, custom or default template). See /template-url-attachment-save.","responses":{"200":{}}}},"/bff/emailer/template-url-attachment-save":{"post":{"parameters":[],"operationId":"postBffEmailerTemplate-url-attachment-save","tags":["Emailer"],"summary":"Add or update a URL attachment of a template type","description":"When an e-mail of this type is sent, the address is filled with the e-mail variables, the file is downloaded (HTTPS, public host, max 15 MB, 15 s timeout, 2 attempts) and attached. If it cannot be downloaded, the e-mail is sent without it and a warning EML_URLATT_FAIL is logged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["typeCode","urlTemplate"],"properties":{"id":{"description":"Existing attachment id; omit to add a new one.","type":"number"},"typeCode":{"examples":["voucher-gift-created"],"type":"string"},"urlTemplate":{"maxLength":2000,"description":"HTTPS address of the file. May use the variables of the e-mail type in the path and query, e.g. https://gymroom.cz/api/v1/voucher/pdf?code={{ voucherCode }}. Values are URL-encoded; the host must be fixed.","type":"string"},"filenameTemplate":{"nullable":true,"anyOf":[{"maxLength":255,"description":"Attachment file name, may use variables. Empty = name sent by the server or taken from the URL.","examples":["Darkovy poukaz {{ voucherCode }}.pdf"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["typeCode","urlTemplate"],"properties":{"id":{"description":"Existing attachment id; omit to add a new one.","type":"number"},"typeCode":{"examples":["voucher-gift-created"],"type":"string"},"urlTemplate":{"maxLength":2000,"description":"HTTPS address of the file. May use the variables of the e-mail type in the path and query, e.g. https://gymroom.cz/api/v1/voucher/pdf?code={{ voucherCode }}. Values are URL-encoded; the host must be fixed.","type":"string"},"filenameTemplate":{"nullable":true,"anyOf":[{"maxLength":255,"description":"Attachment file name, may use variables. Empty = name sent by the server or taken from the URL.","examples":["Darkovy poukaz {{ voucherCode }}.pdf"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["typeCode","urlTemplate"],"properties":{"id":{"description":"Existing attachment id; omit to add a new one.","type":"number"},"typeCode":{"examples":["voucher-gift-created"],"type":"string"},"urlTemplate":{"maxLength":2000,"description":"HTTPS address of the file. May use the variables of the e-mail type in the path and query, e.g. https://gymroom.cz/api/v1/voucher/pdf?code={{ voucherCode }}. Values are URL-encoded; the host must be fixed.","type":"string"},"filenameTemplate":{"nullable":true,"anyOf":[{"maxLength":255,"description":"Attachment file name, may use variables. Empty = name sent by the server or taken from the URL.","examples":["Darkovy poukaz {{ voucherCode }}.pdf"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/emailer/template-url-attachment-delete":{"post":{"parameters":[],"operationId":"postBffEmailerTemplate-url-attachment-delete","tags":["Emailer"],"summary":"Remove a URL attachment of a template type","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}},"responses":{"200":{}}}},"/bff/emailer/template-url-attachment-test":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"url":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"filename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contentType":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","url","filename","contentType","size","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"url":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"filename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contentType":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","url","filename","contentType","size","error"]}},"text/plain":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"url":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"filename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contentType":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","url","filename","contentType","size","error"]}}}}},"operationId":"postBffEmailerTemplate-url-attachment-test","tags":["Emailer"],"summary":"Try downloading a URL attachment","description":"Fills the address with sample values, downloads it once and reports file name, type and size. Nothing is stored or sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["typeCode","urlTemplate"],"properties":{"typeCode":{"type":"string"},"urlTemplate":{"maxLength":2000,"type":"string"},"filenameTemplate":{"nullable":true,"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"sampleValues":{"type":"object","patternProperties":{"^(.*)$":{"maxLength":500,"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["typeCode","urlTemplate"],"properties":{"typeCode":{"type":"string"},"urlTemplate":{"maxLength":2000,"type":"string"},"filenameTemplate":{"nullable":true,"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"sampleValues":{"type":"object","patternProperties":{"^(.*)$":{"maxLength":500,"type":"string"}}}}}},"text/plain":{"schema":{"type":"object","required":["typeCode","urlTemplate"],"properties":{"typeCode":{"type":"string"},"urlTemplate":{"maxLength":2000,"type":"string"},"filenameTemplate":{"nullable":true,"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"sampleValues":{"type":"object","patternProperties":{"^(.*)$":{"maxLength":500,"type":"string"}}}}}}}}}},"/bff/emailer-incoming/info":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"hasKey":{"description":"Whether a Resend API key is currently stored for this organisation.","type":"boolean"},"maskedHint":{"description":"Human-readable hint showing the last 4 chars of the stored key. Null when no key is set.","anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncAt":{"description":"ISO timestamp of the newest received e-mail persisted for this organisation.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hasKey","maskedHint","lastSyncAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"hasKey":{"description":"Whether a Resend API key is currently stored for this organisation.","type":"boolean"},"maskedHint":{"description":"Human-readable hint showing the last 4 chars of the stored key. Null when no key is set.","anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncAt":{"description":"ISO timestamp of the newest received e-mail persisted for this organisation.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hasKey","maskedHint","lastSyncAt"]}},"text/plain":{"schema":{"type":"object","properties":{"hasKey":{"description":"Whether a Resend API key is currently stored for this organisation.","type":"boolean"},"maskedHint":{"description":"Human-readable hint showing the last 4 chars of the stored key. Null when no key is set.","anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncAt":{"description":"ISO timestamp of the newest received e-mail persisted for this organisation.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hasKey","maskedHint","lastSyncAt"]}}}}},"operationId":"getBffEmailer-incomingInfo","tags":["Emailer"],"summary":"Get inbound-email configuration status","description":"Returns whether a Resend API key is configured for inbound e-mail sync, a masked hint of the stored value, and the timestamp of the last message the cron surfaced."}},"/bff/emailer-incoming/set-api-key":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffEmailer-incomingSet-api-key","tags":["Emailer"],"summary":"Set inbound Resend API key","description":"Validates the supplied Resend API key by hitting `/emails/receiving?limit=1` and, on success, persists it into `cas__organisation_configuration` (key `resend_api_key`). Presence of this key enables the 10-minute inbound sync cron for this organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"description":"Full-access Resend API key (starts with `re_`). Used only for inbound message polling.","examples":["re_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"description":"Full-access Resend API key (starts with `re_`). Used only for inbound message polling.","examples":["re_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"description":"Full-access Resend API key (starts with `re_`). Used only for inbound message polling.","examples":["re_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"],"type":"string"}}}}}}}},"/bff/emailer-incoming/sync-now":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"sync":{"type":"object","required":["organisationsScanned","apiCallsMade","newMessages","skippedAlreadyStored","failedMessages"],"properties":{"organisationsScanned":{"type":"number"},"apiCallsMade":{"type":"number"},"newMessages":{"type":"number"},"skippedAlreadyStored":{"type":"number"},"failedMessages":{"type":"number"}}},"classification":{"type":"object","required":["processed","spam","ticketsCreated","commentsAdded","workflowsRun","workflowsDeferred","ignored","failed","parked","stoppedReason"],"properties":{"processed":{"type":"number"},"spam":{"type":"number"},"ticketsCreated":{"type":"number"},"commentsAdded":{"type":"number"},"workflowsRun":{"type":"number"},"workflowsDeferred":{"type":"number"},"ignored":{"type":"number"},"failed":{"type":"number"},"parked":{"type":"number"},"stoppedReason":{"anyOf":[{"const":"drained","type":"string"},{"const":"max-mails","type":"string"},{"const":"budget","type":"string"},{"const":"head-of-line-failure","type":"string"},{"const":"locked","type":"string"}]}}}},"required":["success","sync","classification"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"sync":{"type":"object","required":["organisationsScanned","apiCallsMade","newMessages","skippedAlreadyStored","failedMessages"],"properties":{"organisationsScanned":{"type":"number"},"apiCallsMade":{"type":"number"},"newMessages":{"type":"number"},"skippedAlreadyStored":{"type":"number"},"failedMessages":{"type":"number"}}},"classification":{"type":"object","required":["processed","spam","ticketsCreated","commentsAdded","workflowsRun","workflowsDeferred","ignored","failed","parked","stoppedReason"],"properties":{"processed":{"type":"number"},"spam":{"type":"number"},"ticketsCreated":{"type":"number"},"commentsAdded":{"type":"number"},"workflowsRun":{"type":"number"},"workflowsDeferred":{"type":"number"},"ignored":{"type":"number"},"failed":{"type":"number"},"parked":{"type":"number"},"stoppedReason":{"anyOf":[{"const":"drained","type":"string"},{"const":"max-mails","type":"string"},{"const":"budget","type":"string"},{"const":"head-of-line-failure","type":"string"},{"const":"locked","type":"string"}]}}}},"required":["success","sync","classification"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"sync":{"type":"object","required":["organisationsScanned","apiCallsMade","newMessages","skippedAlreadyStored","failedMessages"],"properties":{"organisationsScanned":{"type":"number"},"apiCallsMade":{"type":"number"},"newMessages":{"type":"number"},"skippedAlreadyStored":{"type":"number"},"failedMessages":{"type":"number"}}},"classification":{"type":"object","required":["processed","spam","ticketsCreated","commentsAdded","workflowsRun","workflowsDeferred","ignored","failed","parked","stoppedReason"],"properties":{"processed":{"type":"number"},"spam":{"type":"number"},"ticketsCreated":{"type":"number"},"commentsAdded":{"type":"number"},"workflowsRun":{"type":"number"},"workflowsDeferred":{"type":"number"},"ignored":{"type":"number"},"failed":{"type":"number"},"parked":{"type":"number"},"stoppedReason":{"anyOf":[{"const":"drained","type":"string"},{"const":"max-mails","type":"string"},{"const":"budget","type":"string"},{"const":"head-of-line-failure","type":"string"},{"const":"locked","type":"string"}]}}}},"required":["success","sync","classification"]}}}}},"operationId":"postBffEmailer-incomingSync-now","tags":["Emailer"],"summary":"Force inbound e-mail sync now","description":"Runs the same worker chain as the `/cron/sync-resend-received-emails` scheduler, but scoped to the caller's organisation and bypassing the adaptive next-sync-date filter. First pulls newly received mails from Resend into `brj__emailer_received_email`, then walks the classification queue so any freshly ingested mails get a spam verdict and (when actionable) an auto-created `pm__issue` in the same tick. Requires `resend_api_key` to be set for the organisation."}},"/bff/emailer-incoming/remove-api-key":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"description":"True when a key was actually removed; false when there was nothing to remove.","type":"boolean"}},"required":["success","removed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"description":"True when a key was actually removed; false when there was nothing to remove.","type":"boolean"}},"required":["success","removed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"description":"True when a key was actually removed; false when there was nothing to remove.","type":"boolean"}},"required":["success","removed"]}}}}},"operationId":"postBffEmailer-incomingRemove-api-key","tags":["Emailer"],"summary":"Remove inbound Resend API key","description":"Deletes the `resend_api_key` row from `cas__organisation_configuration`, which disables the inbound sync cron for this organisation. Already-imported messages remain in `brj__emailer_received_email`."}},"/bff/organisation-ai/info":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","required":["provider","label","keyHint","hasKey","maskedKey"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]},"label":{"type":"string"},"keyHint":{"type":"string"},"hasKey":{"type":"boolean"},"maskedKey":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["providers"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","required":["provider","label","keyHint","hasKey","maskedKey"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]},"label":{"type":"string"},"keyHint":{"type":"string"},"hasKey":{"type":"boolean"},"maskedKey":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["providers"]}},"text/plain":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","required":["provider","label","keyHint","hasKey","maskedKey"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]},"label":{"type":"string"},"keyHint":{"type":"string"},"hasKey":{"type":"boolean"},"maskedKey":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["providers"]}}}}},"operationId":"getBffOrganisation-aiInfo","tags":["Organisation"],"summary":"List configured AI provider keys","description":"Returns per-provider status of the organisation-scoped AI API keys. Presence flips billing for that provider from the shared BizKitHub key to the organisation (recorded in ai__question.paid_by_organisation_id)."}},"/bff/organisation-ai/set-api-key":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"warning":{"description":"Non-fatal probe warning. Present when the key was saved but the probe round-trip failed for a non-auth reason (model access, transient error). Null when the probe cleanly authenticated.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","warning"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"warning":{"description":"Non-fatal probe warning. Present when the key was saved but the probe round-trip failed for a non-auth reason (model access, transient error). Null when the probe cleanly authenticated.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","warning"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"warning":{"description":"Non-fatal probe warning. Present when the key was saved but the probe round-trip failed for a non-auth reason (model access, transient error). Null when the probe cleanly authenticated.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","warning"]}}}}},"operationId":"postBffOrganisation-aiSet-api-key","tags":["Organisation"],"summary":"Set AI provider API key","description":"Validates the supplied API key with a minimal probe call against the provider and, on success, persists it into `cas__organisation_configuration` under the matching key (ai_gemini_api_key / ai_openai_api_key / ai_anthropic_api_key). Invalidates the in-memory provider cache for this organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider","apiKey"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]},"apiKey":{"description":"The provider API key to store. Validated by a probe call before persistence.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["provider","apiKey"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]},"apiKey":{"description":"The provider API key to store. Validated by a probe call before persistence.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["provider","apiKey"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]},"apiKey":{"description":"The provider API key to store. Validated by a probe call before persistence.","type":"string"}}}}}}}},"/bff/organisation-ai/test-connection":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}}},"operationId":"postBffOrganisation-aiTest-connection","tags":["Organisation"],"summary":"Test the stored AI provider key","description":"Runs a minimal probe call against the provider using the currently stored key so the admin can verify it still works after e.g. rotating the key upstream. Never returns the key itself.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["provider"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["provider"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]}}}}}}}},"/bff/organisation-ai/remove-api-key":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"type":"boolean"}},"required":["success","removed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"type":"boolean"}},"required":["success","removed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"removed":{"type":"boolean"}},"required":["success","removed"]}}}}},"operationId":"postBffOrganisation-aiRemove-api-key","tags":["Organisation"],"summary":"Remove AI provider API key","description":"Deletes the configured API key for the given provider. Subsequent AI calls of that provider fall back to the shared BizKitHub key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["provider"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["provider"],"properties":{"provider":{"anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"}]}}}}}}}},"/bff/organisation-ai/usage/summary":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"windows":{"type":"object","required":["day","week","month","year"],"properties":{"day":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"week":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"month":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"year":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["windows","orgCurrency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"windows":{"type":"object","required":["day","week","month","year"],"properties":{"day":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"week":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"month":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"year":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["windows","orgCurrency"]}},"text/plain":{"schema":{"type":"object","properties":{"windows":{"type":"object","required":["day","week","month","year"],"properties":{"day":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"week":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"month":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}},"year":{"type":"object","required":["tokens","cost","count"],"properties":{"tokens":{"type":"number"},"cost":{"type":"number"},"count":{"type":"number"}}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["windows","orgCurrency"]}}}}},"operationId":"getBffOrganisation-aiUsageSummary","tags":["Organisation"],"summary":"AI usage summary for this organisation","description":"Rolling-window totals of AI prompts executed for the authenticated organisation: token consumption, USD cost priced against the historical `ai__model_price` row effective on each prompt's date, and prompt count for the last 1 / 7 / 30 / 365 days. `orgCurrency` envelope carries today's USD → default currency rate so the client can convert with a single multiplication instead of round-tripping per row."}},"/bff/organisation-ai/usage/list":{"get":{"parameters":[{"description":"Page number (1-based).","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Max items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","question","model","tokens","inputTokens","outputTokens","cost","inputCost","outputCost","costOrg","orgRate","orgRateDate","payer","insertedDate"],"properties":{"id":{"description":"ai__question.id serialised as a decimal string (bigint safe).","type":"string"},"question":{"description":"Prompt text, truncated to 500 characters for grid display.","type":"string"},"model":{"description":"Model name from ai__model (e.g. \"gemini-2.5-flash\", \"gpt-4o-mini\").","type":"string"},"tokens":{"description":"Total tokens consumed (input + output).","type":"number"},"inputTokens":{"description":"Provider-reported input tokens.","type":"number"},"outputTokens":{"description":"Provider-reported output tokens.","type":"number"},"cost":{"description":"Total USD cost priced against ai__model_price effective at the prompt date.","type":"number"},"inputCost":{"description":"USD cost attributable to input tokens.","type":"number"},"outputCost":{"description":"USD cost attributable to output tokens.","type":"number"},"costOrg":{"description":"Total cost converted to the organisation default currency at the prompt-date rate.","type":"number"},"orgRate":{"description":"USD → org currency multiplier applied for this row.","type":"number"},"orgRateDate":{"description":"YYYY-MM-DD of the fixing behind orgRate.","type":"string"},"payer":{"description":"Who was billed for the underlying provider call: \"organisation\" via BYOK key, or \"bizkit\" via the shared BizKitHub key.","anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"description":"ISO 8601 timestamp of when the answer was persisted.","type":"string"}}}},"itemCount":{"type":"number"},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["items","itemCount","orgCurrency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","question","model","tokens","inputTokens","outputTokens","cost","inputCost","outputCost","costOrg","orgRate","orgRateDate","payer","insertedDate"],"properties":{"id":{"description":"ai__question.id serialised as a decimal string (bigint safe).","type":"string"},"question":{"description":"Prompt text, truncated to 500 characters for grid display.","type":"string"},"model":{"description":"Model name from ai__model (e.g. \"gemini-2.5-flash\", \"gpt-4o-mini\").","type":"string"},"tokens":{"description":"Total tokens consumed (input + output).","type":"number"},"inputTokens":{"description":"Provider-reported input tokens.","type":"number"},"outputTokens":{"description":"Provider-reported output tokens.","type":"number"},"cost":{"description":"Total USD cost priced against ai__model_price effective at the prompt date.","type":"number"},"inputCost":{"description":"USD cost attributable to input tokens.","type":"number"},"outputCost":{"description":"USD cost attributable to output tokens.","type":"number"},"costOrg":{"description":"Total cost converted to the organisation default currency at the prompt-date rate.","type":"number"},"orgRate":{"description":"USD → org currency multiplier applied for this row.","type":"number"},"orgRateDate":{"description":"YYYY-MM-DD of the fixing behind orgRate.","type":"string"},"payer":{"description":"Who was billed for the underlying provider call: \"organisation\" via BYOK key, or \"bizkit\" via the shared BizKitHub key.","anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"description":"ISO 8601 timestamp of when the answer was persisted.","type":"string"}}}},"itemCount":{"type":"number"},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["items","itemCount","orgCurrency"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","question","model","tokens","inputTokens","outputTokens","cost","inputCost","outputCost","costOrg","orgRate","orgRateDate","payer","insertedDate"],"properties":{"id":{"description":"ai__question.id serialised as a decimal string (bigint safe).","type":"string"},"question":{"description":"Prompt text, truncated to 500 characters for grid display.","type":"string"},"model":{"description":"Model name from ai__model (e.g. \"gemini-2.5-flash\", \"gpt-4o-mini\").","type":"string"},"tokens":{"description":"Total tokens consumed (input + output).","type":"number"},"inputTokens":{"description":"Provider-reported input tokens.","type":"number"},"outputTokens":{"description":"Provider-reported output tokens.","type":"number"},"cost":{"description":"Total USD cost priced against ai__model_price effective at the prompt date.","type":"number"},"inputCost":{"description":"USD cost attributable to input tokens.","type":"number"},"outputCost":{"description":"USD cost attributable to output tokens.","type":"number"},"costOrg":{"description":"Total cost converted to the organisation default currency at the prompt-date rate.","type":"number"},"orgRate":{"description":"USD → org currency multiplier applied for this row.","type":"number"},"orgRateDate":{"description":"YYYY-MM-DD of the fixing behind orgRate.","type":"string"},"payer":{"description":"Who was billed for the underlying provider call: \"organisation\" via BYOK key, or \"bizkit\" via the shared BizKitHub key.","anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"description":"ISO 8601 timestamp of when the answer was persisted.","type":"string"}}}},"itemCount":{"type":"number"},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["items","itemCount","orgCurrency"]}}}}},"operationId":"getBffOrganisation-aiUsageList","tags":["Organisation"],"summary":"List AI prompts executed by this organisation","description":"Paginated feed of ai__question rows scoped to the authenticated organisation. Each row carries the truncated prompt, model, tokens (total + input/output split), USD cost priced against the historical ai__model_price row effective on the prompt date, org-currency amount converted at that same date's FX rate, and the payer (this organisation vs. BizKitHub). Powers the AI usage grid in settings."}},"/bff/organisation-ai/usage/detail":{"get":{"parameters":[{"description":"ai__question.id serialised as a decimal string.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"question":{"description":"Full untruncated prompt text.","type":"string"},"answer":{"description":"Full untruncated model answer.","type":"string"},"model":{"type":"string"},"tokens":{"description":"Total tokens (input + output).","type":"number"},"inputTokens":{"description":"Provider-reported input tokens (0 for pre-migration rows).","type":"number"},"outputTokens":{"description":"Provider-reported output tokens (0 for pre-migration rows).","type":"number"},"cost":{"description":"Total USD cost priced against ai__model_price effective at inserted_date.","type":"number"},"inputCost":{"description":"USD attributable to input tokens (0 for pre-migration rows).","type":"number"},"outputCost":{"description":"USD attributable to output tokens (0 for pre-migration rows).","type":"number"},"costOrg":{"description":"Total cost in org default currency, converted at inserted_date rate.","type":"number"},"inputCostOrg":{"type":"number"},"outputCostOrg":{"type":"number"},"orgRate":{"type":"number"},"orgRateDate":{"type":"string"},"payer":{"anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"type":"string"},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["id","question","answer","model","tokens","inputTokens","outputTokens","cost","inputCost","outputCost","costOrg","inputCostOrg","outputCostOrg","orgRate","orgRateDate","payer","insertedDate","orgCurrency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"question":{"description":"Full untruncated prompt text.","type":"string"},"answer":{"description":"Full untruncated model answer.","type":"string"},"model":{"type":"string"},"tokens":{"description":"Total tokens (input + output).","type":"number"},"inputTokens":{"description":"Provider-reported input tokens (0 for pre-migration rows).","type":"number"},"outputTokens":{"description":"Provider-reported output tokens (0 for pre-migration rows).","type":"number"},"cost":{"description":"Total USD cost priced against ai__model_price effective at inserted_date.","type":"number"},"inputCost":{"description":"USD attributable to input tokens (0 for pre-migration rows).","type":"number"},"outputCost":{"description":"USD attributable to output tokens (0 for pre-migration rows).","type":"number"},"costOrg":{"description":"Total cost in org default currency, converted at inserted_date rate.","type":"number"},"inputCostOrg":{"type":"number"},"outputCostOrg":{"type":"number"},"orgRate":{"type":"number"},"orgRateDate":{"type":"string"},"payer":{"anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"type":"string"},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["id","question","answer","model","tokens","inputTokens","outputTokens","cost","inputCost","outputCost","costOrg","inputCostOrg","outputCostOrg","orgRate","orgRateDate","payer","insertedDate","orgCurrency"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"question":{"description":"Full untruncated prompt text.","type":"string"},"answer":{"description":"Full untruncated model answer.","type":"string"},"model":{"type":"string"},"tokens":{"description":"Total tokens (input + output).","type":"number"},"inputTokens":{"description":"Provider-reported input tokens (0 for pre-migration rows).","type":"number"},"outputTokens":{"description":"Provider-reported output tokens (0 for pre-migration rows).","type":"number"},"cost":{"description":"Total USD cost priced against ai__model_price effective at inserted_date.","type":"number"},"inputCost":{"description":"USD attributable to input tokens (0 for pre-migration rows).","type":"number"},"outputCost":{"description":"USD attributable to output tokens (0 for pre-migration rows).","type":"number"},"costOrg":{"description":"Total cost in org default currency, converted at inserted_date rate.","type":"number"},"inputCostOrg":{"type":"number"},"outputCostOrg":{"type":"number"},"orgRate":{"type":"number"},"orgRateDate":{"type":"string"},"payer":{"anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"type":"string"},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["id","question","answer","model","tokens","inputTokens","outputTokens","cost","inputCost","outputCost","costOrg","inputCostOrg","outputCostOrg","orgRate","orgRateDate","payer","insertedDate","orgCurrency"]}}}}},"operationId":"getBffOrganisation-aiUsageDetail","tags":["Organisation"],"summary":"AI prompt detail (untruncated)","description":"Returns the full prompt + answer text for a single ai__question row, scoped to the authenticated organisation. Includes input/output token split, per-side cost, and org-currency conversion at the prompt-date FX rate. Cost uses the ai__model_price row that was effective on the prompt date."}},"/bff/organisation-ai/usage/analytics":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"byModel":{"description":"Spend broken down per AI model, ordered by cost desc.","type":"array","items":{"type":"object","required":["model","promptCount","tokens","cost","avgCostPerPrompt"],"properties":{"model":{"type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"},"avgCostPerPrompt":{"description":"cost / promptCount, 0 when no prompts.","type":"number"}}}},"byPayer":{"description":"Spend split between calls billed to this organisation (BYOK) vs. subsidised by BizKitHub.","type":"object","required":["organisation","bizkit"],"properties":{"organisation":{"type":"object","required":["promptCount","tokens","cost"],"properties":{"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}},"bizkit":{"type":"object","required":["promptCount","tokens","cost"],"properties":{"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}}}},"daily":{"description":"Daily buckets for the last 30 days. Only days with at least one prompt appear.","type":"array","items":{"type":"object","required":["date","promptCount","tokens","cost"],"properties":{"date":{"description":"YYYY-MM-DD.","type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}}},"topExpensive":{"description":"Top 10 most expensive individual prompts, ordered by cost desc.","type":"array","items":{"type":"object","required":["id","question","model","tokens","cost","payer","insertedDate"],"properties":{"id":{"type":"string"},"question":{"description":"Prompt preview (truncated to 200 characters).","type":"string"},"model":{"type":"string"},"tokens":{"type":"number"},"cost":{"type":"number"},"payer":{"anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"type":"string"}}}},"promptTypes":{"description":"Top 30 prompt templates by total cost, grouped by normalised first line.","type":"array","items":{"type":"object","required":["pattern","promptCount","tokens","cost","avgCostPerPrompt","lastUsedDate","sampleId"],"properties":{"pattern":{"description":"Normalised first line of the prompt — quoted strings replaced with <STR>, ISO dates with <DATE>, 20+ char identifiers with <TOKEN>, 2+ digit numbers with #. Consolidates near-duplicate prompts that differ only in embedded data (e.g. translation prompts across target languages).","type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"},"avgCostPerPrompt":{"type":"number"},"lastUsedDate":{"type":"string"},"sampleId":{"description":"ai__question.id of one representative row in this group.","type":"string"}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["byModel","byPayer","daily","topExpensive","promptTypes","orgCurrency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"byModel":{"description":"Spend broken down per AI model, ordered by cost desc.","type":"array","items":{"type":"object","required":["model","promptCount","tokens","cost","avgCostPerPrompt"],"properties":{"model":{"type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"},"avgCostPerPrompt":{"description":"cost / promptCount, 0 when no prompts.","type":"number"}}}},"byPayer":{"description":"Spend split between calls billed to this organisation (BYOK) vs. subsidised by BizKitHub.","type":"object","required":["organisation","bizkit"],"properties":{"organisation":{"type":"object","required":["promptCount","tokens","cost"],"properties":{"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}},"bizkit":{"type":"object","required":["promptCount","tokens","cost"],"properties":{"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}}}},"daily":{"description":"Daily buckets for the last 30 days. Only days with at least one prompt appear.","type":"array","items":{"type":"object","required":["date","promptCount","tokens","cost"],"properties":{"date":{"description":"YYYY-MM-DD.","type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}}},"topExpensive":{"description":"Top 10 most expensive individual prompts, ordered by cost desc.","type":"array","items":{"type":"object","required":["id","question","model","tokens","cost","payer","insertedDate"],"properties":{"id":{"type":"string"},"question":{"description":"Prompt preview (truncated to 200 characters).","type":"string"},"model":{"type":"string"},"tokens":{"type":"number"},"cost":{"type":"number"},"payer":{"anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"type":"string"}}}},"promptTypes":{"description":"Top 30 prompt templates by total cost, grouped by normalised first line.","type":"array","items":{"type":"object","required":["pattern","promptCount","tokens","cost","avgCostPerPrompt","lastUsedDate","sampleId"],"properties":{"pattern":{"description":"Normalised first line of the prompt — quoted strings replaced with <STR>, ISO dates with <DATE>, 20+ char identifiers with <TOKEN>, 2+ digit numbers with #. Consolidates near-duplicate prompts that differ only in embedded data (e.g. translation prompts across target languages).","type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"},"avgCostPerPrompt":{"type":"number"},"lastUsedDate":{"type":"string"},"sampleId":{"description":"ai__question.id of one representative row in this group.","type":"string"}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["byModel","byPayer","daily","topExpensive","promptTypes","orgCurrency"]}},"text/plain":{"schema":{"type":"object","properties":{"byModel":{"description":"Spend broken down per AI model, ordered by cost desc.","type":"array","items":{"type":"object","required":["model","promptCount","tokens","cost","avgCostPerPrompt"],"properties":{"model":{"type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"},"avgCostPerPrompt":{"description":"cost / promptCount, 0 when no prompts.","type":"number"}}}},"byPayer":{"description":"Spend split between calls billed to this organisation (BYOK) vs. subsidised by BizKitHub.","type":"object","required":["organisation","bizkit"],"properties":{"organisation":{"type":"object","required":["promptCount","tokens","cost"],"properties":{"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}},"bizkit":{"type":"object","required":["promptCount","tokens","cost"],"properties":{"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}}}},"daily":{"description":"Daily buckets for the last 30 days. Only days with at least one prompt appear.","type":"array","items":{"type":"object","required":["date","promptCount","tokens","cost"],"properties":{"date":{"description":"YYYY-MM-DD.","type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"}}}},"topExpensive":{"description":"Top 10 most expensive individual prompts, ordered by cost desc.","type":"array","items":{"type":"object","required":["id","question","model","tokens","cost","payer","insertedDate"],"properties":{"id":{"type":"string"},"question":{"description":"Prompt preview (truncated to 200 characters).","type":"string"},"model":{"type":"string"},"tokens":{"type":"number"},"cost":{"type":"number"},"payer":{"anyOf":[{"const":"organisation","type":"string"},{"const":"bizkit","type":"string"}]},"insertedDate":{"type":"string"}}}},"promptTypes":{"description":"Top 30 prompt templates by total cost, grouped by normalised first line.","type":"array","items":{"type":"object","required":["pattern","promptCount","tokens","cost","avgCostPerPrompt","lastUsedDate","sampleId"],"properties":{"pattern":{"description":"Normalised first line of the prompt — quoted strings replaced with <STR>, ISO dates with <DATE>, 20+ char identifiers with <TOKEN>, 2+ digit numbers with #. Consolidates near-duplicate prompts that differ only in embedded data (e.g. translation prompts across target languages).","type":"string"},"promptCount":{"type":"number"},"tokens":{"type":"number"},"cost":{"type":"number"},"avgCostPerPrompt":{"type":"number"},"lastUsedDate":{"type":"string"},"sampleId":{"description":"ai__question.id of one representative row in this group.","type":"string"}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["byModel","byPayer","daily","topExpensive","promptTypes","orgCurrency"]}}}}},"operationId":"getBffOrganisation-aiUsageAnalytics","tags":["Organisation"],"summary":"AI spend analytics for this organisation","description":"Aggregated breakdowns of AI prompt spend: by model, by payer (organisation via BYOK vs. BizKitHub via shared key), daily 30-day time series, and the top 10 most expensive individual prompts. Powers the \"Analytika\" tab under settings → AI."}},"/bff/organisation-ai/pricelist":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["modelId","model","provider","status","hasPrice","inputUsdPerMillion","outputUsdPerMillion","effectiveFrom","source","note"],"properties":{"modelId":{"description":"ai__model.id — stable primary key of the model.","type":"number"},"model":{"description":"Canonical model slug (e.g. \"gemini-2.5-flash\", \"gpt-4o-mini\", \"claude-haiku-4-5-20251001\").","type":"string"},"provider":{"description":"Provider bucket derived from the model slug prefix (gemini → google, gpt/o1/o3/o4/chatgpt → openai, claude → anthropic, everything else → other).","anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"},{"const":"other","type":"string"}]},"status":{"description":"Lifecycle stage. `active` = usable, `deprecated` = still callable but scheduled for removal, `retired` = provider no longer serves it (calls will fail).","anyOf":[{"const":"active","type":"string"},{"const":"deprecated","type":"string"},{"const":"retired","type":"string"}]},"hasPrice":{"description":"True when an ai__model_price row is currently effective; false when the model has no priced row yet (UI renders \"cena nedefinována\").","type":"boolean"},"inputUsdPerMillion":{"description":"Customer-facing USD price per 1M input tokens (margin already baked in). Null when hasPrice is false.","anyOf":[{"type":"number"},{"type":"null"}]},"outputUsdPerMillion":{"description":"Customer-facing USD price per 1M output tokens (margin already baked in). Null when hasPrice is false.","anyOf":[{"type":"number"},{"type":"null"}]},"effectiveFrom":{"description":"ISO 8601 timestamp of when the currently-effective price row came into force. Null when hasPrice is false.","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"Provenance of the price row (e.g. \"manual\", \"openai-api\"). Null when hasPrice is false.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Free-text note attached to the price row by whoever wrote it.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["items","orgCurrency"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["modelId","model","provider","status","hasPrice","inputUsdPerMillion","outputUsdPerMillion","effectiveFrom","source","note"],"properties":{"modelId":{"description":"ai__model.id — stable primary key of the model.","type":"number"},"model":{"description":"Canonical model slug (e.g. \"gemini-2.5-flash\", \"gpt-4o-mini\", \"claude-haiku-4-5-20251001\").","type":"string"},"provider":{"description":"Provider bucket derived from the model slug prefix (gemini → google, gpt/o1/o3/o4/chatgpt → openai, claude → anthropic, everything else → other).","anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"},{"const":"other","type":"string"}]},"status":{"description":"Lifecycle stage. `active` = usable, `deprecated` = still callable but scheduled for removal, `retired` = provider no longer serves it (calls will fail).","anyOf":[{"const":"active","type":"string"},{"const":"deprecated","type":"string"},{"const":"retired","type":"string"}]},"hasPrice":{"description":"True when an ai__model_price row is currently effective; false when the model has no priced row yet (UI renders \"cena nedefinována\").","type":"boolean"},"inputUsdPerMillion":{"description":"Customer-facing USD price per 1M input tokens (margin already baked in). Null when hasPrice is false.","anyOf":[{"type":"number"},{"type":"null"}]},"outputUsdPerMillion":{"description":"Customer-facing USD price per 1M output tokens (margin already baked in). Null when hasPrice is false.","anyOf":[{"type":"number"},{"type":"null"}]},"effectiveFrom":{"description":"ISO 8601 timestamp of when the currently-effective price row came into force. Null when hasPrice is false.","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"Provenance of the price row (e.g. \"manual\", \"openai-api\"). Null when hasPrice is false.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Free-text note attached to the price row by whoever wrote it.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["items","orgCurrency"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["modelId","model","provider","status","hasPrice","inputUsdPerMillion","outputUsdPerMillion","effectiveFrom","source","note"],"properties":{"modelId":{"description":"ai__model.id — stable primary key of the model.","type":"number"},"model":{"description":"Canonical model slug (e.g. \"gemini-2.5-flash\", \"gpt-4o-mini\", \"claude-haiku-4-5-20251001\").","type":"string"},"provider":{"description":"Provider bucket derived from the model slug prefix (gemini → google, gpt/o1/o3/o4/chatgpt → openai, claude → anthropic, everything else → other).","anyOf":[{"const":"google","type":"string"},{"const":"openai","type":"string"},{"const":"anthropic","type":"string"},{"const":"other","type":"string"}]},"status":{"description":"Lifecycle stage. `active` = usable, `deprecated` = still callable but scheduled for removal, `retired` = provider no longer serves it (calls will fail).","anyOf":[{"const":"active","type":"string"},{"const":"deprecated","type":"string"},{"const":"retired","type":"string"}]},"hasPrice":{"description":"True when an ai__model_price row is currently effective; false when the model has no priced row yet (UI renders \"cena nedefinována\").","type":"boolean"},"inputUsdPerMillion":{"description":"Customer-facing USD price per 1M input tokens (margin already baked in). Null when hasPrice is false.","anyOf":[{"type":"number"},{"type":"null"}]},"outputUsdPerMillion":{"description":"Customer-facing USD price per 1M output tokens (margin already baked in). Null when hasPrice is false.","anyOf":[{"type":"number"},{"type":"null"}]},"effectiveFrom":{"description":"ISO 8601 timestamp of when the currently-effective price row came into force. Null when hasPrice is false.","anyOf":[{"type":"string"},{"type":"null"}]},"source":{"description":"Provenance of the price row (e.g. \"manual\", \"openai-api\"). Null when hasPrice is false.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Free-text note attached to the price row by whoever wrote it.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"orgCurrency":{"type":"object","required":["code","rate","rateDate"],"properties":{"code":{"description":"ISO 4217 code of the organisation default currency (e.g. \"CZK\").","type":"string"},"rate":{"description":"Multiplier: usd × rate = amount in `code`.","type":"number"},"rateDate":{"description":"YYYY-MM-DD of the underlying fixing.","type":"string"}}}},"required":["items","orgCurrency"]}}}}},"operationId":"getBffOrganisation-aiPricelist","tags":["Organisation"],"summary":"Current AI model pricelist","description":"One row per known ai__model with the price row that is currently effective (effective_from <= NOW()). Models with no priced row still appear (hasPrice=false) so the UI can flag them. Prices are in USD per 1M tokens (customer-facing, margin already baked in — the internal margin_multiplier column is never surfaced). `orgCurrency` envelope carries today's USD → default currency rate for client-side display."}},"/bff/firewall/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 100).","examples":["100"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Filter by rejection type code (e.g. \"tor\").","examples":["tor"],"schema":{"type":"string"},"in":"query","name":"typeCode","required":false},{"description":"Filter by category (network|identity|rate|content|fraud).","examples":["network"],"schema":{"type":"string"},"in":"query","name":"category","required":false}],"operationId":"getBffFirewallList","tags":["Firewall"],"summary":"List firewall rejections","description":"Returns a paginated list of firewall rejection events for the current organisation.","responses":{"200":{}}}},"/bff/firewall/stats":{"get":{"operationId":"getBffFirewallStats","tags":["Firewall"],"summary":"Firewall rejection statistics","description":"Returns aggregated rejection statistics (24h / 7d / 30d) by rule type and top countries.","responses":{"200":{}}}},"/bff/firewall/detail":{"get":{"parameters":[{"description":"Rejection external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffFirewallDetail","tags":["Firewall"],"summary":"Get firewall rejection detail","description":"Returns a single firewall rejection event with full context.","responses":{"200":{}}}},"/bff/form/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","active","recordCount","insertedDate","updatedDate"],"properties":{"id":{"description":"Form code (unique identifier within the organisation).","type":"string"},"name":{"description":"Form display name.","type":"string"},"description":{"description":"Form description.","type":"string"},"active":{"description":"Whether the form is active and accepting submissions.","type":"boolean"},"recordCount":{"description":"Number of submitted records.","type":"number"},"insertedDate":{"description":"When the form was created.","anyOf":[{"description":"When the form was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of forms (for pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","active","recordCount","insertedDate","updatedDate"],"properties":{"id":{"description":"Form code (unique identifier within the organisation).","type":"string"},"name":{"description":"Form display name.","type":"string"},"description":{"description":"Form description.","type":"string"},"active":{"description":"Whether the form is active and accepting submissions.","type":"boolean"},"recordCount":{"description":"Number of submitted records.","type":"number"},"insertedDate":{"description":"When the form was created.","anyOf":[{"description":"When the form was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of forms (for pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","active","recordCount","insertedDate","updatedDate"],"properties":{"id":{"description":"Form code (unique identifier within the organisation).","type":"string"},"name":{"description":"Form display name.","type":"string"},"description":{"description":"Form description.","type":"string"},"active":{"description":"Whether the form is active and accepting submissions.","type":"boolean"},"recordCount":{"description":"Number of submitted records.","type":"number"},"insertedDate":{"description":"When the form was created.","anyOf":[{"description":"When the form was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of forms (for pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffFormList","tags":["Form"],"summary":"List forms","description":"Returns a paginated list of forms for the organisation, ordered by last update. Each form includes its record count (number of submissions)."}},"/bff/form/table":{"get":{"parameters":[{"description":"Form code.","examples":["contact-form"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Form name.","type":"string"},"description":{"description":"Form description.","type":"string"},"table":{"description":"Table data with columns and rows of submitted records."}},"required":["name","table"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"description":"Form name.","type":"string"},"description":{"description":"Form description.","type":"string"},"table":{"description":"Table data with columns and rows of submitted records."}},"required":["name","table"]}},"text/plain":{"schema":{"type":"object","properties":{"name":{"description":"Form name.","type":"string"},"description":{"description":"Form description.","type":"string"},"table":{"description":"Table data with columns and rows of submitted records."}},"required":["name","table"]}}}}},"operationId":"getBffFormTable","tags":["Form"],"summary":"Get form submissions table","description":"Returns all submitted records for a form in a table format. Includes form metadata (name, description) and the full table of submissions with field values."}},"/bff/form/structure":{"get":{"parameters":[{"description":"Form code.","examples":["contact-form"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"info":{"type":"object","required":["name","code","active"],"properties":{"name":{"description":"Form name.","type":"string"},"code":{"description":"Form code (URL-friendly slug).","type":"string"},"active":{"description":"Whether the form is active.","type":"boolean"},"description":{"description":"Form description.","type":"string"}}},"fields":{"type":"array","items":{"type":"object","required":["key","type","label","required","position","active","insertedDate","updatedDate"],"properties":{"key":{"description":"Unique field key within the form.","type":"string"},"parentKey":{"description":"Parent field key (for nested fields).","type":"string"},"type":{"description":"Field input type.","anyOf":[{"const":"header","type":"string"},{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"date","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"select","type":"string"}]},"label":{"description":"Field label displayed to the user.","type":"string"},"helperText":{"description":"Additional help text below the field.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"defaultValue":{"description":"Default value for the field.","type":"string"},"options":{"description":"Options for select/radio/checkbox fields (key-value pairs)."},"position":{"description":"Display order (1-based).","type":"number"},"active":{"description":"Whether the field is active.","type":"boolean"},"insertedDate":{"description":"When the field was created.","anyOf":[{"description":"When the field was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["info","fields"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"info":{"type":"object","required":["name","code","active"],"properties":{"name":{"description":"Form name.","type":"string"},"code":{"description":"Form code (URL-friendly slug).","type":"string"},"active":{"description":"Whether the form is active.","type":"boolean"},"description":{"description":"Form description.","type":"string"}}},"fields":{"type":"array","items":{"type":"object","required":["key","type","label","required","position","active","insertedDate","updatedDate"],"properties":{"key":{"description":"Unique field key within the form.","type":"string"},"parentKey":{"description":"Parent field key (for nested fields).","type":"string"},"type":{"description":"Field input type.","anyOf":[{"const":"header","type":"string"},{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"date","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"select","type":"string"}]},"label":{"description":"Field label displayed to the user.","type":"string"},"helperText":{"description":"Additional help text below the field.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"defaultValue":{"description":"Default value for the field.","type":"string"},"options":{"description":"Options for select/radio/checkbox fields (key-value pairs)."},"position":{"description":"Display order (1-based).","type":"number"},"active":{"description":"Whether the field is active.","type":"boolean"},"insertedDate":{"description":"When the field was created.","anyOf":[{"description":"When the field was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["info","fields"]}},"text/plain":{"schema":{"type":"object","properties":{"info":{"type":"object","required":["name","code","active"],"properties":{"name":{"description":"Form name.","type":"string"},"code":{"description":"Form code (URL-friendly slug).","type":"string"},"active":{"description":"Whether the form is active.","type":"boolean"},"description":{"description":"Form description.","type":"string"}}},"fields":{"type":"array","items":{"type":"object","required":["key","type","label","required","position","active","insertedDate","updatedDate"],"properties":{"key":{"description":"Unique field key within the form.","type":"string"},"parentKey":{"description":"Parent field key (for nested fields).","type":"string"},"type":{"description":"Field input type.","anyOf":[{"const":"header","type":"string"},{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"date","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"select","type":"string"}]},"label":{"description":"Field label displayed to the user.","type":"string"},"helperText":{"description":"Additional help text below the field.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"defaultValue":{"description":"Default value for the field.","type":"string"},"options":{"description":"Options for select/radio/checkbox fields (key-value pairs)."},"position":{"description":"Display order (1-based).","type":"number"},"active":{"description":"Whether the field is active.","type":"boolean"},"insertedDate":{"description":"When the field was created.","anyOf":[{"description":"When the field was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["info","fields"]}}}}},"operationId":"getBffFormStructure","tags":["Form"],"summary":"Get form structure","description":"Returns the full form definition including metadata and all field definitions. Used by the form builder to load and edit the form layout."}},"/bff/form/add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"description":"The assigned form code (may differ from input if a conflict was resolved).","type":"string"}},"required":["code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"code":{"description":"The assigned form code (may differ from input if a conflict was resolved).","type":"string"}},"required":["code"]}},"text/plain":{"schema":{"type":"object","properties":{"code":{"description":"The assigned form code (may differ from input if a conflict was resolved).","type":"string"}},"required":["code"]}}}}},"operationId":"postBffFormAdd","tags":["Form"],"summary":"Create form","description":"Creates a new empty form. The form starts as active with no fields. If the provided code conflicts with an existing form, a numeric suffix is appended automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Form display name.","examples":["Contact Form"],"type":"string"},"code":{"description":"Custom code/slug. If not provided or if it conflicts, one is generated from the name.","examples":["contact-form"],"type":"string"},"description":{"description":"Form description.","examples":["General inquiry form for the website"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Form display name.","examples":["Contact Form"],"type":"string"},"code":{"description":"Custom code/slug. If not provided or if it conflicts, one is generated from the name.","examples":["contact-form"],"type":"string"},"description":{"description":"Form description.","examples":["General inquiry form for the website"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Form display name.","examples":["Contact Form"],"type":"string"},"code":{"description":"Custom code/slug. If not provided or if it conflicts, one is generated from the name.","examples":["contact-form"],"type":"string"},"description":{"description":"Form description.","examples":["General inquiry form for the website"],"type":"string"}}}}}}}},"/bff/form/update-structure":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffFormUpdate-structure","tags":["Form"],"summary":"Update form structure","description":"Updates form metadata and all field definitions in a single request. Only fields with matching keys are updated — unknown keys are skipped. If the new code conflicts with another form, a numeric suffix is appended automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","info","fields"],"properties":{"code":{"description":"Current form code (used to find the form).","examples":["contact-form"],"type":"string"},"info":{"type":"object","required":["name","code","active"],"properties":{"name":{"minLength":1,"description":"New form name.","examples":["Contact Form"],"type":"string"},"code":{"description":"New form code. Auto-suffixed if it conflicts with another form.","examples":["contact-form"],"type":"string"},"active":{"description":"Whether the form is active.","examples":[true],"type":"boolean"},"description":{"description":"Form description.","examples":["General inquiry form"],"type":"string"}}},"fields":{"type":"array","items":{"type":"object","required":["key","type","label","required","options","active","position"],"properties":{"key":{"description":"Field key (must match an existing field).","examples":["email"],"type":"string"},"type":{"description":"Field input type (text, textarea, select, date, etc.).","examples":["text"],"type":"string"},"label":{"description":"Field label.","examples":["Email address"],"type":"string"},"helperText":{"description":"Helper text below the field.","examples":["Enter your work email"],"type":"string"},"required":{"description":"Whether the field is required.","examples":[true],"type":"boolean"},"defaultValue":{"description":"Default value.","examples":[""],"type":"string"},"options":{"description":"Options for select/radio fields (key → label).","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"active":{"description":"Whether the field is active.","type":"boolean"},"position":{"description":"Display order (0-based).","type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","info","fields"],"properties":{"code":{"description":"Current form code (used to find the form).","examples":["contact-form"],"type":"string"},"info":{"type":"object","required":["name","code","active"],"properties":{"name":{"minLength":1,"description":"New form name.","examples":["Contact Form"],"type":"string"},"code":{"description":"New form code. Auto-suffixed if it conflicts with another form.","examples":["contact-form"],"type":"string"},"active":{"description":"Whether the form is active.","examples":[true],"type":"boolean"},"description":{"description":"Form description.","examples":["General inquiry form"],"type":"string"}}},"fields":{"type":"array","items":{"type":"object","required":["key","type","label","required","options","active","position"],"properties":{"key":{"description":"Field key (must match an existing field).","examples":["email"],"type":"string"},"type":{"description":"Field input type (text, textarea, select, date, etc.).","examples":["text"],"type":"string"},"label":{"description":"Field label.","examples":["Email address"],"type":"string"},"helperText":{"description":"Helper text below the field.","examples":["Enter your work email"],"type":"string"},"required":{"description":"Whether the field is required.","examples":[true],"type":"boolean"},"defaultValue":{"description":"Default value.","examples":[""],"type":"string"},"options":{"description":"Options for select/radio fields (key → label).","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"active":{"description":"Whether the field is active.","type":"boolean"},"position":{"description":"Display order (0-based).","type":"number"}}}}}}},"text/plain":{"schema":{"type":"object","required":["code","info","fields"],"properties":{"code":{"description":"Current form code (used to find the form).","examples":["contact-form"],"type":"string"},"info":{"type":"object","required":["name","code","active"],"properties":{"name":{"minLength":1,"description":"New form name.","examples":["Contact Form"],"type":"string"},"code":{"description":"New form code. Auto-suffixed if it conflicts with another form.","examples":["contact-form"],"type":"string"},"active":{"description":"Whether the form is active.","examples":[true],"type":"boolean"},"description":{"description":"Form description.","examples":["General inquiry form"],"type":"string"}}},"fields":{"type":"array","items":{"type":"object","required":["key","type","label","required","options","active","position"],"properties":{"key":{"description":"Field key (must match an existing field).","examples":["email"],"type":"string"},"type":{"description":"Field input type (text, textarea, select, date, etc.).","examples":["text"],"type":"string"},"label":{"description":"Field label.","examples":["Email address"],"type":"string"},"helperText":{"description":"Helper text below the field.","examples":["Enter your work email"],"type":"string"},"required":{"description":"Whether the field is required.","examples":[true],"type":"boolean"},"defaultValue":{"description":"Default value.","examples":[""],"type":"string"},"options":{"description":"Options for select/radio fields (key → label).","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"active":{"description":"Whether the field is active.","type":"boolean"},"position":{"description":"Display order (0-based).","type":"number"}}}}}}}}}}},"/bff/form/add-field":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffFormAdd-field","tags":["Form"],"summary":"Add field","description":"Adds a new empty text field at the end of the form. The field key is auto-generated. Use update-structure or rename-field-key to customize it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Form code to add the field to.","examples":["contact-form"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Form code to add the field to.","examples":["contact-form"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Form code to add the field to.","examples":["contact-form"],"type":"string"}}}}}}}},"/bff/form/duplicate-field":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffFormDuplicate-field","tags":["Form"],"summary":"Duplicate field","description":"Creates a copy of an existing field with a new auto-generated key. The duplicate is placed right after the original field. All properties (type, label, options, etc.) are copied.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["formCode","fieldCode"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Key of the field to duplicate.","examples":["email"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["formCode","fieldCode"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Key of the field to duplicate.","examples":["email"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["formCode","fieldCode"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Key of the field to duplicate.","examples":["email"],"type":"string"}}}}}}}},"/bff/form/remove-field":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffFormRemove-field","tags":["Form"],"summary":"Remove field","description":"Permanently deletes a field from the form. Existing submitted records that contain this field are not affected (values are preserved in the record data).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["formCode","fieldCode"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Key of the field to remove.","examples":["email"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["formCode","fieldCode"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Key of the field to remove.","examples":["email"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["formCode","fieldCode"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Key of the field to remove.","examples":["email"],"type":"string"}}}}}}}},"/bff/form/rename-field-key":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffFormRename-field-key","tags":["Form"],"summary":"Rename field key","description":"Renames a field key (the programmatic identifier). If the new key conflicts with an existing field, a numeric suffix is appended. Does not affect existing submitted records.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["formCode","fieldCode","fieldCodeNew"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Current field key.","examples":["field_1"],"type":"string"},"fieldCodeNew":{"description":"New field key. Auto-suffixed if it conflicts with another field.","examples":["email"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["formCode","fieldCode","fieldCodeNew"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Current field key.","examples":["field_1"],"type":"string"},"fieldCodeNew":{"description":"New field key. Auto-suffixed if it conflicts with another field.","examples":["email"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["formCode","fieldCode","fieldCodeNew"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldCode":{"description":"Current field key.","examples":["field_1"],"type":"string"},"fieldCodeNew":{"description":"New field key. Auto-suffixed if it conflicts with another field.","examples":["email"],"type":"string"}}}}}}}},"/bff/form/copy-form":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"newCode":{"description":"Code of the newly created form.","type":"string"}},"required":["success","newCode"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"newCode":{"description":"Code of the newly created form.","type":"string"}},"required":["success","newCode"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"newCode":{"description":"Code of the newly created form.","type":"string"}},"required":["success","newCode"]}}}}},"operationId":"postBffFormCopy-form","tags":["Form"],"summary":"Copy form","description":"Creates a full copy of a form including all field definitions. The new form gets a unique code and starts with zero submissions. Useful for creating seasonal variants of registration forms.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Code of the form to copy.","examples":["contact-form"],"type":"string"},"name":{"description":"Name for the new form. If not provided, the original name with a suffix is used.","examples":["Contact Form (copy)"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Code of the form to copy.","examples":["contact-form"],"type":"string"},"name":{"description":"Name for the new form. If not provided, the original name with a suffix is used.","examples":["Contact Form (copy)"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Code of the form to copy.","examples":["contact-form"],"type":"string"},"name":{"description":"Name for the new form. If not provided, the original name with a suffix is used.","examples":["Contact Form (copy)"],"type":"string"}}}}}}}},"/bff/form/delete-form":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffFormDelete-form","tags":["Form"],"summary":"Delete form","description":"Permanently deletes a form and all its data: field definitions, submitted records, and record entries. This action is irreversible.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Code of the form to delete.","examples":["contact-form"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Code of the form to delete.","examples":["contact-form"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["formCode"],"properties":{"formCode":{"description":"Code of the form to delete.","examples":["contact-form"],"type":"string"}}}}}}}},"/bff/form/record-detail":{"get":{"parameters":[{"description":"Form code.","examples":["contact-form"],"schema":{"type":"string"},"in":"query","name":"formCode","required":true},{"description":"Record ID.","examples":["42"],"schema":{"type":"string"},"in":"query","name":"recordId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"recordId":{"description":"Record ID.","type":"number"},"insertedDate":{"description":"When the record was submitted.","anyOf":[{"description":"When the record was submitted.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"entries":{"type":"array","items":{"type":"object","required":["key","label","value","type"],"properties":{"key":{"description":"Field key.","type":"string"},"label":{"description":"Field label at the time of submission.","type":"string"},"value":{"description":"Submitted value.","type":"string"},"type":{"description":"Field type.","type":"string"},"helper_text":{"description":"Field helper text.","type":"string"},"options":{"description":"Field options (for select fields)."}}}}},"required":["recordId","insertedDate","entries"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"recordId":{"description":"Record ID.","type":"number"},"insertedDate":{"description":"When the record was submitted.","anyOf":[{"description":"When the record was submitted.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"entries":{"type":"array","items":{"type":"object","required":["key","label","value","type"],"properties":{"key":{"description":"Field key.","type":"string"},"label":{"description":"Field label at the time of submission.","type":"string"},"value":{"description":"Submitted value.","type":"string"},"type":{"description":"Field type.","type":"string"},"helper_text":{"description":"Field helper text.","type":"string"},"options":{"description":"Field options (for select fields)."}}}}},"required":["recordId","insertedDate","entries"]}},"text/plain":{"schema":{"type":"object","properties":{"recordId":{"description":"Record ID.","type":"number"},"insertedDate":{"description":"When the record was submitted.","anyOf":[{"description":"When the record was submitted.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"entries":{"type":"array","items":{"type":"object","required":["key","label","value","type"],"properties":{"key":{"description":"Field key.","type":"string"},"label":{"description":"Field label at the time of submission.","type":"string"},"value":{"description":"Submitted value.","type":"string"},"type":{"description":"Field type.","type":"string"},"helper_text":{"description":"Field helper text.","type":"string"},"options":{"description":"Field options (for select fields)."}}}}},"required":["recordId","insertedDate","entries"]}}}}},"operationId":"getBffFormRecord-detail","tags":["Form"],"summary":"Get record detail","description":"Returns the full detail of a single form submission including all field values. Each entry contains the field key, label, value, type, and options."}},"/bff/form/delete-record":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffFormDelete-record","tags":["Form"],"summary":"Delete record","description":"Permanently deletes a single form submission and all its entry values. This action is irreversible.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["formCode","recordId"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"recordId":{"description":"ID of the record to delete.","examples":[42],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["formCode","recordId"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"recordId":{"description":"ID of the record to delete.","examples":[42],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["formCode","recordId"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"recordId":{"description":"ID of the record to delete.","examples":[42],"type":"number"}}}}}}}},"/bff/form/reorder-fields":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffFormReorder-fields","tags":["Form"],"summary":"Reorder fields","description":"Sets the display order of all fields in a form. Pass all field keys in the desired order — the position of each field is set by its index in the array.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["formCode","fieldKeys"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldKeys":{"description":"Ordered array of field keys. Position is assigned by index (0-based).","examples":[["name","email","message"]],"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["formCode","fieldKeys"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldKeys":{"description":"Ordered array of field keys. Position is assigned by index (0-based).","examples":[["name","email","message"]],"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["formCode","fieldKeys"],"properties":{"formCode":{"description":"Form code.","examples":["contact-form"],"type":"string"},"fieldKeys":{"description":"Ordered array of field keys. Position is assigned by index (0-based).","examples":[["name","email","message"]],"type":"array","items":{"type":"string"}}}}}}}}},"/bff/glossary/list":{"get":{"parameters":[{"examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"schema":{"type":"string"},"in":"query","name":"categoryId","required":false},{"schema":{"anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"}]},"in":"query","name":"visibility","required":false},{"schema":{"type":"string"},"in":"query","name":"includeDeleted","required":false}],"operationId":"getBffGlossaryList","tags":["Glossary"],"summary":"List glossary terms","description":"Paginated list of glossary terms for the authenticated organisation. Supports fulltext over term/abbreviation/notes, filter by category and visibility, and a deleted-inclusion toggle.","responses":{"200":{}}}},"/bff/glossary/detail":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffGlossaryDetail","tags":["Glossary"],"summary":"Get glossary term detail","description":"Full detail of a glossary term (all locales, definitions, aliases, cross references, routes).","responses":{"200":{}}}},"/bff/glossary/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}}}}},"operationId":"postBffGlossaryCreate","tags":["Glossary"],"summary":"Create a new glossary term (single-locale seed)","description":"Shortcut used by the \"New term\" modal in admin. Creates a term with one locale populated; additional locales and definitions/aliases/xrefs are filled in on the detail screen via /save.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["term","visibility","locale"],"properties":{"term":{"minLength":1,"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibility":{"anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"}]},"categoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["term","visibility","locale"],"properties":{"term":{"minLength":1,"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibility":{"anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"}]},"categoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["term","visibility","locale"],"properties":{"term":{"minLength":1,"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibility":{"anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"}]},"categoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}}}},"/bff/glossary/save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}}}}},"operationId":"postBffGlossarySave","tags":["Glossary"],"summary":"Create or update a glossary term","description":"Upserts the term identified by `id` (external id). Body carries the term data for one or more locales; each locale replaces its own definitions / aliases / cross references when the arrays are provided.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["visibility","locales"],"properties":{"id":{"type":"string"},"code":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"categoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibility":{"anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"}]},"isStar":{"type":"boolean"},"publishedDate":{"type":"string"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","term"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"term":{"minLength":1,"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitions":{"type":"array","items":{"type":"object","required":["text"],"properties":{"text":{"minLength":1,"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"aliases":{"type":"array","items":{"type":"string"}},"crossReferences":{"type":"array","items":{"type":"string"}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["visibility","locales"],"properties":{"id":{"type":"string"},"code":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"categoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibility":{"anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"}]},"isStar":{"type":"boolean"},"publishedDate":{"type":"string"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","term"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"term":{"minLength":1,"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitions":{"type":"array","items":{"type":"object","required":["text"],"properties":{"text":{"minLength":1,"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"aliases":{"type":"array","items":{"type":"string"}},"crossReferences":{"type":"array","items":{"type":"string"}}}}}}}},"text/plain":{"schema":{"type":"object","required":["visibility","locales"],"properties":{"id":{"type":"string"},"code":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"categoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibility":{"anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"}]},"isStar":{"type":"boolean"},"publishedDate":{"type":"string"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","term"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"term":{"minLength":1,"type":"string"},"abbreviation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"definitions":{"type":"array","items":{"type":"object","required":["text"],"properties":{"text":{"minLength":1,"type":"string"},"source":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"aliases":{"type":"array","items":{"type":"string"}},"crossReferences":{"type":"array","items":{"type":"string"}}}}}}}}}}}},"/bff/glossary/delete":{"post":{"parameters":[],"operationId":"postBffGlossaryDelete","tags":["Glossary"],"summary":"Soft-delete a glossary term","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/glossary/restore":{"post":{"parameters":[],"operationId":"postBffGlossaryRestore","tags":["Glossary"],"summary":"Restore a soft-deleted glossary term","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/glossary/category/list":{"get":{"parameters":[{"examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"schema":{"type":"string"},"in":"query","name":"includeDeleted","required":false}],"operationId":"getBffGlossaryCategoryList","tags":["Glossary"],"summary":"Flat list of glossary categories","responses":{"200":{}}}},"/bff/glossary/category/tree":{"get":{"parameters":[{"examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"operationId":"getBffGlossaryCategoryTree","tags":["Glossary"],"summary":"Hierarchical tree of glossary categories","responses":{"200":{}}}},"/bff/glossary/category/save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"string"}},"required":["state","id"]}}}}},"operationId":"postBffGlossaryCategorySave","tags":["Glossary"],"summary":"Create or update a glossary category","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["locale"],"properties":{"id":{"type":"string"},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"position":{"type":"number"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["locale"],"properties":{"id":{"type":"string"},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"position":{"type":"number"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["locale"],"properties":{"id":{"type":"string"},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"active":{"type":"boolean"},"position":{"type":"number"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/glossary/category/delete":{"post":{"parameters":[],"operationId":"postBffGlossaryCategoryDelete","tags":["Glossary"],"summary":"Soft-delete a glossary category","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/import/analyze":{"post":{"parameters":[],"responses":{"200":{"description":"Analysis result with preview data and import job reference.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the analysis completed successfully.","type":"boolean"},"importId":{"description":"External ID of the created import job. Use this to start the import.","type":"string"},"format":{"description":"File format recognised from the header row / XML root.","type":"object","required":["id","label"],"properties":{"id":{"description":"Recognised format id (e.g. \"shoptet-orders-xml\", \"shopify-products-csv\", \"generic-csv\").","type":"string"},"label":{"description":"Human-readable format name.","type":"string"}}},"provider":{"description":"Provider actually used (a recognised format overrides the requested one).","type":"string"},"dataType":{"description":"Data type actually used (a recognised format overrides the requested one).","type":"string"},"totalRows":{"description":"Total number of data rows detected in the source file.","type":"number"},"columns":{"description":"List of detected column names (after provider mapping if applicable).","type":"array","items":{"type":"string"}},"preview":{"description":"Preview of the first 10 rows as objects keyed by column name.","type":"array","items":{}},"errors":{"description":"Parsing errors encountered during analysis. Empty if parsing succeeded.","type":"array","items":{"type":"string"}}},"required":["success","importId","format","provider","dataType","totalRows","columns","preview","errors"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the analysis completed successfully.","type":"boolean"},"importId":{"description":"External ID of the created import job. Use this to start the import.","type":"string"},"format":{"description":"File format recognised from the header row / XML root.","type":"object","required":["id","label"],"properties":{"id":{"description":"Recognised format id (e.g. \"shoptet-orders-xml\", \"shopify-products-csv\", \"generic-csv\").","type":"string"},"label":{"description":"Human-readable format name.","type":"string"}}},"provider":{"description":"Provider actually used (a recognised format overrides the requested one).","type":"string"},"dataType":{"description":"Data type actually used (a recognised format overrides the requested one).","type":"string"},"totalRows":{"description":"Total number of data rows detected in the source file.","type":"number"},"columns":{"description":"List of detected column names (after provider mapping if applicable).","type":"array","items":{"type":"string"}},"preview":{"description":"Preview of the first 10 rows as objects keyed by column name.","type":"array","items":{}},"errors":{"description":"Parsing errors encountered during analysis. Empty if parsing succeeded.","type":"array","items":{"type":"string"}}},"required":["success","importId","format","provider","dataType","totalRows","columns","preview","errors"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the analysis completed successfully.","type":"boolean"},"importId":{"description":"External ID of the created import job. Use this to start the import.","type":"string"},"format":{"description":"File format recognised from the header row / XML root.","type":"object","required":["id","label"],"properties":{"id":{"description":"Recognised format id (e.g. \"shoptet-orders-xml\", \"shopify-products-csv\", \"generic-csv\").","type":"string"},"label":{"description":"Human-readable format name.","type":"string"}}},"provider":{"description":"Provider actually used (a recognised format overrides the requested one).","type":"string"},"dataType":{"description":"Data type actually used (a recognised format overrides the requested one).","type":"string"},"totalRows":{"description":"Total number of data rows detected in the source file.","type":"number"},"columns":{"description":"List of detected column names (after provider mapping if applicable).","type":"array","items":{"type":"string"}},"preview":{"description":"Preview of the first 10 rows as objects keyed by column name.","type":"array","items":{}},"errors":{"description":"Parsing errors encountered during analysis. Empty if parsing succeeded.","type":"array","items":{"type":"string"}}},"required":["success","importId","format","provider","dataType","totalRows","columns","preview","errors"]}}}}},"operationId":"postBffImportAnalyze","tags":["Import"],"summary":"Analyze import file","description":"Accepts a CSV/JSON/XML file upload or a remote URL, recognises the format (Shopify, Shoptet, WooCommerce, Heureka, Google Merchant, generic), maps columns to internal fields and creates an import job in \"ready\" status. A recognised format overrides the requested provider and data type. Returns a preview of the first 10 rows.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"description":"Import provider (\"shoptet\" or \"manual\"). Default: \"manual\".","type":"string"},"dataType":{"description":"Type of entity being imported (e.g. \"product\", \"contact\").","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\"). Default: \"file\".","type":"string"},"file":{"default":"File","description":"CSV/JSON/XML file upload (required when sourceType=\"file\").","type":"string","format":"binary"},"url":{"description":"Remote feed URL (required when sourceType=\"url\").","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"provider":{"description":"Import provider (\"shoptet\" or \"manual\"). Default: \"manual\".","type":"string"},"dataType":{"description":"Type of entity being imported (e.g. \"product\", \"contact\").","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\"). Default: \"file\".","type":"string"},"file":{"default":"File","description":"CSV/JSON/XML file upload (required when sourceType=\"file\").","type":"string","format":"binary"},"url":{"description":"Remote feed URL (required when sourceType=\"url\").","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"provider":{"description":"Import provider (\"shoptet\" or \"manual\"). Default: \"manual\".","type":"string"},"dataType":{"description":"Type of entity being imported (e.g. \"product\", \"contact\").","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\"). Default: \"file\".","type":"string"},"file":{"default":"File","description":"CSV/JSON/XML file upload (required when sourceType=\"file\").","type":"string","format":"binary"},"url":{"description":"Remote feed URL (required when sourceType=\"url\").","type":"string"}}}}}}}},"/bff/import/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1-500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Full-text search on source name.","examples":["products.csv"],"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false}],"responses":{"200":{"description":"Paginated list of import jobs.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of import jobs matching the query criteria.","type":"array","items":{"description":"Single import job summary.","type":"object","required":["id","externalId","provider","dataType","sourceType","sourceName","status","totalRows","importedRows","failedRows","insertedDate","updatedDate"],"properties":{"id":{"description":"External ID of the import job.","type":"string"},"externalId":{"description":"Unique external identifier of the import job.","type":"string"},"provider":{"description":"Import provider (\"shoptet\" or \"manual\").","type":"string"},"dataType":{"description":"Type of entity being imported.","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\").","type":"string"},"sourceName":{"description":"Original filename or URL used as the import source.","type":"string"},"status":{"description":"Current status of the import job.","type":"string"},"totalRows":{"description":"Total number of rows in the source file.","type":"number"},"importedRows":{"description":"Number of rows successfully imported so far.","type":"number"},"failedRows":{"description":"Number of rows that failed to import.","type":"number"},"insertedDate":{"description":"ISO timestamp when the import was created.","type":"string"},"updatedDate":{"description":"ISO timestamp of the last status update.","type":"string"}}}},"itemCount":{"description":"Total number of import jobs matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of import jobs matching the query criteria.","type":"array","items":{"description":"Single import job summary.","type":"object","required":["id","externalId","provider","dataType","sourceType","sourceName","status","totalRows","importedRows","failedRows","insertedDate","updatedDate"],"properties":{"id":{"description":"External ID of the import job.","type":"string"},"externalId":{"description":"Unique external identifier of the import job.","type":"string"},"provider":{"description":"Import provider (\"shoptet\" or \"manual\").","type":"string"},"dataType":{"description":"Type of entity being imported.","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\").","type":"string"},"sourceName":{"description":"Original filename or URL used as the import source.","type":"string"},"status":{"description":"Current status of the import job.","type":"string"},"totalRows":{"description":"Total number of rows in the source file.","type":"number"},"importedRows":{"description":"Number of rows successfully imported so far.","type":"number"},"failedRows":{"description":"Number of rows that failed to import.","type":"number"},"insertedDate":{"description":"ISO timestamp when the import was created.","type":"string"},"updatedDate":{"description":"ISO timestamp of the last status update.","type":"string"}}}},"itemCount":{"description":"Total number of import jobs matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of import jobs matching the query criteria.","type":"array","items":{"description":"Single import job summary.","type":"object","required":["id","externalId","provider","dataType","sourceType","sourceName","status","totalRows","importedRows","failedRows","insertedDate","updatedDate"],"properties":{"id":{"description":"External ID of the import job.","type":"string"},"externalId":{"description":"Unique external identifier of the import job.","type":"string"},"provider":{"description":"Import provider (\"shoptet\" or \"manual\").","type":"string"},"dataType":{"description":"Type of entity being imported.","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\").","type":"string"},"sourceName":{"description":"Original filename or URL used as the import source.","type":"string"},"status":{"description":"Current status of the import job.","type":"string"},"totalRows":{"description":"Total number of rows in the source file.","type":"number"},"importedRows":{"description":"Number of rows successfully imported so far.","type":"number"},"failedRows":{"description":"Number of rows that failed to import.","type":"number"},"insertedDate":{"description":"ISO timestamp when the import was created.","type":"string"},"updatedDate":{"description":"ISO timestamp of the last status update.","type":"string"}}}},"itemCount":{"description":"Total number of import jobs matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffImportList","tags":["Import"],"summary":"List imports","description":"Returns a paginated list of import jobs for the authenticated organisation. Imports are sorted by creation date (newest first). Supports fulltext search on source name via the filterFulltextQuery query parameter."}},"/bff/import/detail":{"get":{"parameters":[{"description":"External ID of the import job.","examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"importId","required":true}],"responses":{"200":{"description":"Full import job detail with progress and metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Internal database ID.","type":"number"},"organisationId":{"description":"Organisation that owns this import.","type":"number"},"externalId":{"description":"Unique external identifier of the import job.","type":"string"},"provider":{"description":"Import provider (\"shoptet\" or \"manual\").","type":"string"},"dataType":{"description":"Type of entity being imported.","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\").","type":"string"},"sourceName":{"description":"Original filename or URL used as the import source.","type":"string"},"sourceUrl":{"nullable":true,"anyOf":[{"description":"Remote feed URL (only for URL source type).","type":"string"},{"type":"null"}]},"blobId":{"nullable":true,"anyOf":[{"description":"Internal blob ID of the uploaded file.","type":"number"},{"type":"null"}]},"status":{"description":"Current status of the import job.","type":"string"},"totalRows":{"description":"Total number of rows in the source file.","type":"number"},"importedRows":{"description":"Number of rows successfully imported so far.","type":"number"},"failedRows":{"description":"Number of rows that failed to import.","type":"number"},"columns":{"description":"Array of detected column names."},"errors":{"description":"Array of error messages if the import failed."},"insertedDate":{"description":"ISO timestamp when the import was created.","type":"string"},"updatedDate":{"description":"ISO timestamp of the last status update.","type":"string"}},"required":["id","organisationId","externalId","provider","dataType","sourceType","sourceName","sourceUrl","blobId","status","totalRows","importedRows","failedRows","columns","errors","insertedDate","updatedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Internal database ID.","type":"number"},"organisationId":{"description":"Organisation that owns this import.","type":"number"},"externalId":{"description":"Unique external identifier of the import job.","type":"string"},"provider":{"description":"Import provider (\"shoptet\" or \"manual\").","type":"string"},"dataType":{"description":"Type of entity being imported.","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\").","type":"string"},"sourceName":{"description":"Original filename or URL used as the import source.","type":"string"},"sourceUrl":{"nullable":true,"anyOf":[{"description":"Remote feed URL (only for URL source type).","type":"string"},{"type":"null"}]},"blobId":{"nullable":true,"anyOf":[{"description":"Internal blob ID of the uploaded file.","type":"number"},{"type":"null"}]},"status":{"description":"Current status of the import job.","type":"string"},"totalRows":{"description":"Total number of rows in the source file.","type":"number"},"importedRows":{"description":"Number of rows successfully imported so far.","type":"number"},"failedRows":{"description":"Number of rows that failed to import.","type":"number"},"columns":{"description":"Array of detected column names."},"errors":{"description":"Array of error messages if the import failed."},"insertedDate":{"description":"ISO timestamp when the import was created.","type":"string"},"updatedDate":{"description":"ISO timestamp of the last status update.","type":"string"}},"required":["id","organisationId","externalId","provider","dataType","sourceType","sourceName","sourceUrl","blobId","status","totalRows","importedRows","failedRows","columns","errors","insertedDate","updatedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Internal database ID.","type":"number"},"organisationId":{"description":"Organisation that owns this import.","type":"number"},"externalId":{"description":"Unique external identifier of the import job.","type":"string"},"provider":{"description":"Import provider (\"shoptet\" or \"manual\").","type":"string"},"dataType":{"description":"Type of entity being imported.","type":"string"},"sourceType":{"description":"Source type (\"file\" or \"url\").","type":"string"},"sourceName":{"description":"Original filename or URL used as the import source.","type":"string"},"sourceUrl":{"nullable":true,"anyOf":[{"description":"Remote feed URL (only for URL source type).","type":"string"},{"type":"null"}]},"blobId":{"nullable":true,"anyOf":[{"description":"Internal blob ID of the uploaded file.","type":"number"},{"type":"null"}]},"status":{"description":"Current status of the import job.","type":"string"},"totalRows":{"description":"Total number of rows in the source file.","type":"number"},"importedRows":{"description":"Number of rows successfully imported so far.","type":"number"},"failedRows":{"description":"Number of rows that failed to import.","type":"number"},"columns":{"description":"Array of detected column names."},"errors":{"description":"Array of error messages if the import failed."},"insertedDate":{"description":"ISO timestamp when the import was created.","type":"string"},"updatedDate":{"description":"ISO timestamp of the last status update.","type":"string"}},"required":["id","organisationId","externalId","provider","dataType","sourceType","sourceName","sourceUrl","blobId","status","totalRows","importedRows","failedRows","columns","errors","insertedDate","updatedDate"]}}}}},"operationId":"getBffImportDetail","tags":["Import"],"summary":"Get import detail","description":"Returns full details of a single import job including progress counters, detected columns, and any error messages. Use this endpoint to poll import progress (recommended interval: 10 seconds)."}},"/bff/document/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Invoice status.","schema":{"anyOf":[{"const":"open","type":"string"},{"const":"sent","type":"string"},{"const":"overdue","type":"string"},{"const":"paid","type":"string"},{"const":"cancelled","type":"string"},{"const":"uncollectible","type":"string"}]},"in":"query","name":"status","required":false},{"description":"Document type.","schema":{"anyOf":[{"const":"invoice","type":"string"},{"const":"receipt","type":"string"},{"const":"proforma","type":"string"},{"const":"partialProforma","type":"string"},{"const":"correction","type":"string"},{"const":"taxDocument","type":"string"},{"const":"finalInvoice","type":"string"},{"const":"creditNote","type":"string"}]},"in":"query","name":"type","required":false},{"description":"Filter by payment status: \"true\" or \"false\".","examples":["true"],"schema":{"type":"string"},"in":"query","name":"isPaid","required":false},{"description":"External customer ID for filtering.","examples":["xK9mP2wLn4YzaB3Q"],"schema":{"type":"string"},"in":"query","name":"customerId","required":false},{"description":"External issuer contact ID for filtering (accounting entity that issued the invoice).","examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"issuerId","required":false},{"description":"Issue date from (ISO format: YYYY-MM-DD).","examples":["2026-01-01"],"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"Issue date to (ISO format: YYYY-MM-DD).","examples":["2026-03-31"],"schema":{"type":"string"},"in":"query","name":"dateTo","required":false},{"description":"Convenience shortcut for the admin Year selector — translated internally to `dateFrom`/`dateTo`. Ignored when `dateFrom`/`dateTo` are set.","examples":["2026"],"schema":{"type":"string"},"in":"query","name":"year","required":false},{"description":"Convenience shortcut for the admin Month selector (1–12). Combined with `year` when both are set; falls back to the current server year when used alone.","examples":["3"],"schema":{"type":"string"},"in":"query","name":"month","required":false},{"description":"DataGrid fulltext box; same as `search`.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Full-text search in invoice number, email, and customer name.","examples":["2024001"],"schema":{"type":"string"},"in":"query","name":"search","required":false}],"responses":{"200":{"description":"Paginated list of invoices.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"List of invoices.","type":"array","items":{"description":"Invoice item in the list.","type":"object","required":["id","sequence_number","type","status","total","currency","issuer_id","issue_date","due_date"],"properties":{"id":{"description":"Unique external invoice identifier (16 characters).","type":"string"},"sequence_number":{"description":"Invoice number (e.g., \"2024001\").","type":"string"},"order_hash":{"description":"Hash of the associated order.","type":"string"},"order_number":{"description":"Number of the associated order.","type":"string"},"type":{"description":"Document type (invoice, receipt, proforma, creditNote, ...).","type":"string"},"status":{"description":"Invoice status (open, sent, overdue, paid, cancelled, uncollectible).","type":"string"},"total":{"description":"Total invoice amount.","type":"string"},"currency":{"description":"Currency code (CZK, EUR, ...).","type":"string"},"issuer_id":{"description":"External ID of the issuer.","type":"string"},"issuer_name":{"description":"Name of the issuer.","type":"string"},"customer_id":{"description":"External ID of the customer.","type":"string"},"customer_name":{"description":"Name of the customer.","type":"string"},"recipient_id":{"description":"External ID of the recipient (if different from customer).","type":"string"},"recipient_name":{"description":"Name of the recipient.","type":"string"},"issue_date":{"description":"Invoice issue date.","anyOf":[{"description":"Invoice issue date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"due_date":{"description":"Payment due date.","anyOf":[{"description":"Payment due date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"invoice_pay_date":{"description":"Payment date. Null if unpaid.","anyOf":[{"description":"Payment date. Null if unpaid.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of invoices matching the filter.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"List of invoices.","type":"array","items":{"description":"Invoice item in the list.","type":"object","required":["id","sequence_number","type","status","total","currency","issuer_id","issue_date","due_date"],"properties":{"id":{"description":"Unique external invoice identifier (16 characters).","type":"string"},"sequence_number":{"description":"Invoice number (e.g., \"2024001\").","type":"string"},"order_hash":{"description":"Hash of the associated order.","type":"string"},"order_number":{"description":"Number of the associated order.","type":"string"},"type":{"description":"Document type (invoice, receipt, proforma, creditNote, ...).","type":"string"},"status":{"description":"Invoice status (open, sent, overdue, paid, cancelled, uncollectible).","type":"string"},"total":{"description":"Total invoice amount.","type":"string"},"currency":{"description":"Currency code (CZK, EUR, ...).","type":"string"},"issuer_id":{"description":"External ID of the issuer.","type":"string"},"issuer_name":{"description":"Name of the issuer.","type":"string"},"customer_id":{"description":"External ID of the customer.","type":"string"},"customer_name":{"description":"Name of the customer.","type":"string"},"recipient_id":{"description":"External ID of the recipient (if different from customer).","type":"string"},"recipient_name":{"description":"Name of the recipient.","type":"string"},"issue_date":{"description":"Invoice issue date.","anyOf":[{"description":"Invoice issue date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"due_date":{"description":"Payment due date.","anyOf":[{"description":"Payment due date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"invoice_pay_date":{"description":"Payment date. Null if unpaid.","anyOf":[{"description":"Payment date. Null if unpaid.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of invoices matching the filter.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"List of invoices.","type":"array","items":{"description":"Invoice item in the list.","type":"object","required":["id","sequence_number","type","status","total","currency","issuer_id","issue_date","due_date"],"properties":{"id":{"description":"Unique external invoice identifier (16 characters).","type":"string"},"sequence_number":{"description":"Invoice number (e.g., \"2024001\").","type":"string"},"order_hash":{"description":"Hash of the associated order.","type":"string"},"order_number":{"description":"Number of the associated order.","type":"string"},"type":{"description":"Document type (invoice, receipt, proforma, creditNote, ...).","type":"string"},"status":{"description":"Invoice status (open, sent, overdue, paid, cancelled, uncollectible).","type":"string"},"total":{"description":"Total invoice amount.","type":"string"},"currency":{"description":"Currency code (CZK, EUR, ...).","type":"string"},"issuer_id":{"description":"External ID of the issuer.","type":"string"},"issuer_name":{"description":"Name of the issuer.","type":"string"},"customer_id":{"description":"External ID of the customer.","type":"string"},"customer_name":{"description":"Name of the customer.","type":"string"},"recipient_id":{"description":"External ID of the recipient (if different from customer).","type":"string"},"recipient_name":{"description":"Name of the recipient.","type":"string"},"issue_date":{"description":"Invoice issue date.","anyOf":[{"description":"Invoice issue date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"due_date":{"description":"Payment due date.","anyOf":[{"description":"Payment due date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"invoice_pay_date":{"description":"Payment date. Null if unpaid.","anyOf":[{"description":"Payment date. Null if unpaid.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of invoices matching the filter.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffDocumentList","tags":["Invoice"],"summary":"List invoices","description":"Returns a paginated list of invoices for the organisation. Invoices are sorted by issue date (newest first). Supports filtering by status, type, payment state, customer, date range, and full-text search."}},"/bff/document/detail":{"get":{"parameters":[{"description":"External invoice ID (16 characters).","examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"description":"Complete invoice detail.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"External invoice ID.","type":"string"},"sequenceNumber":{"description":"Invoice number.","type":"string"},"type":{"description":"Document type.","type":"string"},"title":{"description":"Invoice title (e.g., \"Invoice 2024001\").","type":"string"},"status":{"description":"Invoice status.","type":"string"},"hasPaid":{"description":"Whether the invoice is paid.","type":"boolean"},"total":{"description":"Total amount.","type":"number"},"currency":{"description":"Currency code.","type":"string"},"supplier":{"description":"Invoice participant (supplier or customer).","type":"object","required":["name","streetAddress","city","postalCode"],"properties":{"name":{"description":"Company name or person name.","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (VAT ID).","type":"string"},"accountNumber":{"description":"Bank account number.","type":"string"},"addressDescription":{"description":"Address description.","type":"string"}}},"supplierExternalId":{"description":"External id (CuRefNo) of the issuer contact. `shop__invoice.issuer_id` is NOT NULL so this is populated for every invoice — admin surfaces use it to link the supplier block to the contact detail.","type":"string"},"customer":{"description":"Invoice participant (supplier or customer).","type":"object","required":["name","streetAddress","city","postalCode"],"properties":{"name":{"description":"Company name or person name.","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (VAT ID).","type":"string"},"accountNumber":{"description":"Bank account number.","type":"string"},"addressDescription":{"description":"Address description.","type":"string"}}},"customerExternalId":{"description":"External id (CuRefNo) of the current customer contact. Used by admin flows that need to identify the linked contact (change-customer picker, contact drill-down).","type":"string"},"variableSymbol":{"description":"Variable symbol (payment reference).","type":"string"},"constantSymbol":{"description":"Constant symbol.","type":"string"},"specificSymbol":{"description":"Specific symbol.","type":"string"},"bankName":{"description":"Bank name.","type":"string"},"iban":{"description":"IBAN.","type":"string"},"bic":{"description":"BIC/SWIFT code.","type":"string"},"dueDate":{"description":"Due date (ISO format).","type":"string"},"issueDate":{"description":"Issue date (ISO format).","type":"string"},"taxableSupplyDate":{"description":"Taxable supply date (ISO format).","type":"string"},"paymentMethod":{"description":"Payment method.","type":"string"},"publicNotice":{"description":"Public notice (displayed on invoice).","type":"string"},"internalNotice":{"description":"Internal notice (not displayed on invoice).","type":"string"},"items":{"description":"Invoice line items.","type":"array","items":{"description":"Invoice line item.","type":"object","required":["description","quantity","unitPrice","totalPrice","vatRate"],"properties":{"description":{"description":"Item description.","type":"string"},"quantity":{"description":"Quantity.","type":"number"},"unit":{"description":"Unit (pcs, hrs, ...).","type":"string"},"unitPrice":{"description":"Unit price excluding VAT.","type":"number"},"totalPrice":{"description":"Total item price.","type":"number"},"vatRate":{"description":"VAT rate in percent.","type":"number"}}}},"useVat":{"description":"Whether the organisation is VAT registered.","type":"boolean"},"logoUrl":{"description":"Organisation logo URL.","type":"string"},"snapshottedAt":{"description":"ISO timestamp when the invoice was locked into an immutable snapshot. Absent when the invoice still reflects live supplier/customer/bank data.","type":"string"},"lastReminderAt":{"description":"ISO timestamp of the most recent overdue reminder, if any.","type":"string"},"reminderCount":{"description":"Total reminders sent for this invoice.","type":"number"},"insertedDate":{"description":"ISO timestamp the document was created.","type":"string"},"paidDate":{"description":"ISO timestamp the document was paid.","type":"string"},"voidedAt":{"description":"ISO timestamp the document was voided.","type":"string"},"voidReason":{"description":"Short reason stored on void.","type":"string"},"order":{"type":"object","required":["hash","number"],"properties":{"hash":{"type":"string"},"number":{"type":"string"},"statusLabel":{"type":"string"},"statusColor":{"type":"string"}}},"parent":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"supersedes":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"replacedBy":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"children":{"description":"Documents issued against this one.","type":"array","items":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}}},"orderDocuments":{"description":"Other documents of the same order.","type":"array","items":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}}},"vatRecap":{"type":"array","items":{"type":"object","required":["rate","base","vat","total"],"properties":{"rate":{"type":"number"},"base":{"type":"number"},"vat":{"type":"number"},"total":{"type":"number"}}}},"qrPaymentUrl":{"description":"Payment QR image URL (unpaid payable documents only).","type":"string"},"deliveries":{"description":"E-mails that sent, reminded or carried this document, newest first.","type":"array","items":{"type":"object","required":["id","kind","subject","status","queuedAt"],"properties":{"id":{"type":"string"},"kind":{"anyOf":[{"const":"document","type":"string"},{"const":"reminder","type":"string"},{"const":"attachment","type":"string"}]},"subject":{"type":"string"},"status":{"type":"string"},"recipient":{"type":"string"},"queuedAt":{"type":"string"},"sentAt":{"type":"string"},"openedAt":{"type":"string"}}}},"file":{"description":"Invoice PDF file information.","type":"object","required":["token","filename","downloadUrl","size"],"properties":{"token":{"description":"Unique file token.","type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Direct download URL for the PDF file.","type":"string"},"size":{"description":"File size in bytes.","type":"number"}}}},"required":["id","sequenceNumber","type","title","status","hasPaid","total","currency","supplier","dueDate","issueDate","items","useVat","reminderCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"External invoice ID.","type":"string"},"sequenceNumber":{"description":"Invoice number.","type":"string"},"type":{"description":"Document type.","type":"string"},"title":{"description":"Invoice title (e.g., \"Invoice 2024001\").","type":"string"},"status":{"description":"Invoice status.","type":"string"},"hasPaid":{"description":"Whether the invoice is paid.","type":"boolean"},"total":{"description":"Total amount.","type":"number"},"currency":{"description":"Currency code.","type":"string"},"supplier":{"description":"Invoice participant (supplier or customer).","type":"object","required":["name","streetAddress","city","postalCode"],"properties":{"name":{"description":"Company name or person name.","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (VAT ID).","type":"string"},"accountNumber":{"description":"Bank account number.","type":"string"},"addressDescription":{"description":"Address description.","type":"string"}}},"supplierExternalId":{"description":"External id (CuRefNo) of the issuer contact. `shop__invoice.issuer_id` is NOT NULL so this is populated for every invoice — admin surfaces use it to link the supplier block to the contact detail.","type":"string"},"customer":{"description":"Invoice participant (supplier or customer).","type":"object","required":["name","streetAddress","city","postalCode"],"properties":{"name":{"description":"Company name or person name.","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (VAT ID).","type":"string"},"accountNumber":{"description":"Bank account number.","type":"string"},"addressDescription":{"description":"Address description.","type":"string"}}},"customerExternalId":{"description":"External id (CuRefNo) of the current customer contact. Used by admin flows that need to identify the linked contact (change-customer picker, contact drill-down).","type":"string"},"variableSymbol":{"description":"Variable symbol (payment reference).","type":"string"},"constantSymbol":{"description":"Constant symbol.","type":"string"},"specificSymbol":{"description":"Specific symbol.","type":"string"},"bankName":{"description":"Bank name.","type":"string"},"iban":{"description":"IBAN.","type":"string"},"bic":{"description":"BIC/SWIFT code.","type":"string"},"dueDate":{"description":"Due date (ISO format).","type":"string"},"issueDate":{"description":"Issue date (ISO format).","type":"string"},"taxableSupplyDate":{"description":"Taxable supply date (ISO format).","type":"string"},"paymentMethod":{"description":"Payment method.","type":"string"},"publicNotice":{"description":"Public notice (displayed on invoice).","type":"string"},"internalNotice":{"description":"Internal notice (not displayed on invoice).","type":"string"},"items":{"description":"Invoice line items.","type":"array","items":{"description":"Invoice line item.","type":"object","required":["description","quantity","unitPrice","totalPrice","vatRate"],"properties":{"description":{"description":"Item description.","type":"string"},"quantity":{"description":"Quantity.","type":"number"},"unit":{"description":"Unit (pcs, hrs, ...).","type":"string"},"unitPrice":{"description":"Unit price excluding VAT.","type":"number"},"totalPrice":{"description":"Total item price.","type":"number"},"vatRate":{"description":"VAT rate in percent.","type":"number"}}}},"useVat":{"description":"Whether the organisation is VAT registered.","type":"boolean"},"logoUrl":{"description":"Organisation logo URL.","type":"string"},"snapshottedAt":{"description":"ISO timestamp when the invoice was locked into an immutable snapshot. Absent when the invoice still reflects live supplier/customer/bank data.","type":"string"},"lastReminderAt":{"description":"ISO timestamp of the most recent overdue reminder, if any.","type":"string"},"reminderCount":{"description":"Total reminders sent for this invoice.","type":"number"},"insertedDate":{"description":"ISO timestamp the document was created.","type":"string"},"paidDate":{"description":"ISO timestamp the document was paid.","type":"string"},"voidedAt":{"description":"ISO timestamp the document was voided.","type":"string"},"voidReason":{"description":"Short reason stored on void.","type":"string"},"order":{"type":"object","required":["hash","number"],"properties":{"hash":{"type":"string"},"number":{"type":"string"},"statusLabel":{"type":"string"},"statusColor":{"type":"string"}}},"parent":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"supersedes":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"replacedBy":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"children":{"description":"Documents issued against this one.","type":"array","items":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}}},"orderDocuments":{"description":"Other documents of the same order.","type":"array","items":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}}},"vatRecap":{"type":"array","items":{"type":"object","required":["rate","base","vat","total"],"properties":{"rate":{"type":"number"},"base":{"type":"number"},"vat":{"type":"number"},"total":{"type":"number"}}}},"qrPaymentUrl":{"description":"Payment QR image URL (unpaid payable documents only).","type":"string"},"deliveries":{"description":"E-mails that sent, reminded or carried this document, newest first.","type":"array","items":{"type":"object","required":["id","kind","subject","status","queuedAt"],"properties":{"id":{"type":"string"},"kind":{"anyOf":[{"const":"document","type":"string"},{"const":"reminder","type":"string"},{"const":"attachment","type":"string"}]},"subject":{"type":"string"},"status":{"type":"string"},"recipient":{"type":"string"},"queuedAt":{"type":"string"},"sentAt":{"type":"string"},"openedAt":{"type":"string"}}}},"file":{"description":"Invoice PDF file information.","type":"object","required":["token","filename","downloadUrl","size"],"properties":{"token":{"description":"Unique file token.","type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Direct download URL for the PDF file.","type":"string"},"size":{"description":"File size in bytes.","type":"number"}}}},"required":["id","sequenceNumber","type","title","status","hasPaid","total","currency","supplier","dueDate","issueDate","items","useVat","reminderCount"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"External invoice ID.","type":"string"},"sequenceNumber":{"description":"Invoice number.","type":"string"},"type":{"description":"Document type.","type":"string"},"title":{"description":"Invoice title (e.g., \"Invoice 2024001\").","type":"string"},"status":{"description":"Invoice status.","type":"string"},"hasPaid":{"description":"Whether the invoice is paid.","type":"boolean"},"total":{"description":"Total amount.","type":"number"},"currency":{"description":"Currency code.","type":"string"},"supplier":{"description":"Invoice participant (supplier or customer).","type":"object","required":["name","streetAddress","city","postalCode"],"properties":{"name":{"description":"Company name or person name.","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (VAT ID).","type":"string"},"accountNumber":{"description":"Bank account number.","type":"string"},"addressDescription":{"description":"Address description.","type":"string"}}},"supplierExternalId":{"description":"External id (CuRefNo) of the issuer contact. `shop__invoice.issuer_id` is NOT NULL so this is populated for every invoice — admin surfaces use it to link the supplier block to the contact detail.","type":"string"},"customer":{"description":"Invoice participant (supplier or customer).","type":"object","required":["name","streetAddress","city","postalCode"],"properties":{"name":{"description":"Company name or person name.","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number.","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (VAT ID).","type":"string"},"accountNumber":{"description":"Bank account number.","type":"string"},"addressDescription":{"description":"Address description.","type":"string"}}},"customerExternalId":{"description":"External id (CuRefNo) of the current customer contact. Used by admin flows that need to identify the linked contact (change-customer picker, contact drill-down).","type":"string"},"variableSymbol":{"description":"Variable symbol (payment reference).","type":"string"},"constantSymbol":{"description":"Constant symbol.","type":"string"},"specificSymbol":{"description":"Specific symbol.","type":"string"},"bankName":{"description":"Bank name.","type":"string"},"iban":{"description":"IBAN.","type":"string"},"bic":{"description":"BIC/SWIFT code.","type":"string"},"dueDate":{"description":"Due date (ISO format).","type":"string"},"issueDate":{"description":"Issue date (ISO format).","type":"string"},"taxableSupplyDate":{"description":"Taxable supply date (ISO format).","type":"string"},"paymentMethod":{"description":"Payment method.","type":"string"},"publicNotice":{"description":"Public notice (displayed on invoice).","type":"string"},"internalNotice":{"description":"Internal notice (not displayed on invoice).","type":"string"},"items":{"description":"Invoice line items.","type":"array","items":{"description":"Invoice line item.","type":"object","required":["description","quantity","unitPrice","totalPrice","vatRate"],"properties":{"description":{"description":"Item description.","type":"string"},"quantity":{"description":"Quantity.","type":"number"},"unit":{"description":"Unit (pcs, hrs, ...).","type":"string"},"unitPrice":{"description":"Unit price excluding VAT.","type":"number"},"totalPrice":{"description":"Total item price.","type":"number"},"vatRate":{"description":"VAT rate in percent.","type":"number"}}}},"useVat":{"description":"Whether the organisation is VAT registered.","type":"boolean"},"logoUrl":{"description":"Organisation logo URL.","type":"string"},"snapshottedAt":{"description":"ISO timestamp when the invoice was locked into an immutable snapshot. Absent when the invoice still reflects live supplier/customer/bank data.","type":"string"},"lastReminderAt":{"description":"ISO timestamp of the most recent overdue reminder, if any.","type":"string"},"reminderCount":{"description":"Total reminders sent for this invoice.","type":"number"},"insertedDate":{"description":"ISO timestamp the document was created.","type":"string"},"paidDate":{"description":"ISO timestamp the document was paid.","type":"string"},"voidedAt":{"description":"ISO timestamp the document was voided.","type":"string"},"voidReason":{"description":"Short reason stored on void.","type":"string"},"order":{"type":"object","required":["hash","number"],"properties":{"hash":{"type":"string"},"number":{"type":"string"},"statusLabel":{"type":"string"},"statusColor":{"type":"string"}}},"parent":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"supersedes":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"replacedBy":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}},"children":{"description":"Documents issued against this one.","type":"array","items":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}}},"orderDocuments":{"description":"Other documents of the same order.","type":"array","items":{"type":"object","required":["id","sequenceNumber","type","total","issueDate"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"total":{"type":"number"},"issueDate":{"type":"string"},"voidedAt":{"type":"string"}}}},"vatRecap":{"type":"array","items":{"type":"object","required":["rate","base","vat","total"],"properties":{"rate":{"type":"number"},"base":{"type":"number"},"vat":{"type":"number"},"total":{"type":"number"}}}},"qrPaymentUrl":{"description":"Payment QR image URL (unpaid payable documents only).","type":"string"},"deliveries":{"description":"E-mails that sent, reminded or carried this document, newest first.","type":"array","items":{"type":"object","required":["id","kind","subject","status","queuedAt"],"properties":{"id":{"type":"string"},"kind":{"anyOf":[{"const":"document","type":"string"},{"const":"reminder","type":"string"},{"const":"attachment","type":"string"}]},"subject":{"type":"string"},"status":{"type":"string"},"recipient":{"type":"string"},"queuedAt":{"type":"string"},"sentAt":{"type":"string"},"openedAt":{"type":"string"}}}},"file":{"description":"Invoice PDF file information.","type":"object","required":["token","filename","downloadUrl","size"],"properties":{"token":{"description":"Unique file token.","type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Direct download URL for the PDF file.","type":"string"},"size":{"description":"File size in bytes.","type":"number"}}}},"required":["id","sequenceNumber","type","title","status","hasPaid","total","currency","supplier","dueDate","issueDate","items","useVat","reminderCount"]}}}}},"operationId":"getBffDocumentDetail","tags":["Invoice"],"summary":"Invoice detail","description":"Returns complete invoice detail including line items, supplier, customer, and payment information. This data can be used for displaying the invoice or generating PDF."}},"/bff/document/stats":{"get":{"parameters":[{"description":"Date from (ISO format: YYYY-MM-DD).","examples":["2026-01-01"],"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"Date to (ISO format: YYYY-MM-DD).","examples":["2026-03-31"],"schema":{"type":"string"},"in":"query","name":"dateTo","required":false}],"responses":{"200":{"description":"Invoice statistics.","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"description":"Summary statistics.","type":"object","required":["totalCount","paidCount","unpaidCount","overdueCount","totalAmount","paidAmount","unpaidAmount","overdueAmount"],"properties":{"totalCount":{"description":"Total number of invoices.","type":"number"},"paidCount":{"description":"Number of paid invoices.","type":"number"},"unpaidCount":{"description":"Number of unpaid invoices.","type":"number"},"overdueCount":{"description":"Number of overdue invoices.","type":"number"},"totalAmount":{"description":"Total invoiced amount.","type":"number"},"paidAmount":{"description":"Paid amount.","type":"number"},"unpaidAmount":{"description":"Unpaid amount.","type":"number"},"overdueAmount":{"description":"Overdue amount.","type":"number"}}},"byType":{"description":"Statistics by document type.","type":"array","items":{"type":"object","required":["type","count","amount"],"properties":{"type":{"description":"Document type.","type":"string"},"count":{"description":"Count.","type":"number"},"amount":{"description":"Total amount.","type":"number"}}}},"byStatus":{"description":"Statistics by status.","type":"array","items":{"type":"object","required":["status","count","amount"],"properties":{"status":{"description":"Status.","type":"string"},"count":{"description":"Count.","type":"number"},"amount":{"description":"Total amount.","type":"number"}}}}},"required":["summary","byType","byStatus"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"summary":{"description":"Summary statistics.","type":"object","required":["totalCount","paidCount","unpaidCount","overdueCount","totalAmount","paidAmount","unpaidAmount","overdueAmount"],"properties":{"totalCount":{"description":"Total number of invoices.","type":"number"},"paidCount":{"description":"Number of paid invoices.","type":"number"},"unpaidCount":{"description":"Number of unpaid invoices.","type":"number"},"overdueCount":{"description":"Number of overdue invoices.","type":"number"},"totalAmount":{"description":"Total invoiced amount.","type":"number"},"paidAmount":{"description":"Paid amount.","type":"number"},"unpaidAmount":{"description":"Unpaid amount.","type":"number"},"overdueAmount":{"description":"Overdue amount.","type":"number"}}},"byType":{"description":"Statistics by document type.","type":"array","items":{"type":"object","required":["type","count","amount"],"properties":{"type":{"description":"Document type.","type":"string"},"count":{"description":"Count.","type":"number"},"amount":{"description":"Total amount.","type":"number"}}}},"byStatus":{"description":"Statistics by status.","type":"array","items":{"type":"object","required":["status","count","amount"],"properties":{"status":{"description":"Status.","type":"string"},"count":{"description":"Count.","type":"number"},"amount":{"description":"Total amount.","type":"number"}}}}},"required":["summary","byType","byStatus"]}},"text/plain":{"schema":{"type":"object","properties":{"summary":{"description":"Summary statistics.","type":"object","required":["totalCount","paidCount","unpaidCount","overdueCount","totalAmount","paidAmount","unpaidAmount","overdueAmount"],"properties":{"totalCount":{"description":"Total number of invoices.","type":"number"},"paidCount":{"description":"Number of paid invoices.","type":"number"},"unpaidCount":{"description":"Number of unpaid invoices.","type":"number"},"overdueCount":{"description":"Number of overdue invoices.","type":"number"},"totalAmount":{"description":"Total invoiced amount.","type":"number"},"paidAmount":{"description":"Paid amount.","type":"number"},"unpaidAmount":{"description":"Unpaid amount.","type":"number"},"overdueAmount":{"description":"Overdue amount.","type":"number"}}},"byType":{"description":"Statistics by document type.","type":"array","items":{"type":"object","required":["type","count","amount"],"properties":{"type":{"description":"Document type.","type":"string"},"count":{"description":"Count.","type":"number"},"amount":{"description":"Total amount.","type":"number"}}}},"byStatus":{"description":"Statistics by status.","type":"array","items":{"type":"object","required":["status","count","amount"],"properties":{"status":{"description":"Status.","type":"string"},"count":{"description":"Count.","type":"number"},"amount":{"description":"Total amount.","type":"number"}}}}},"required":["summary","byType","byStatus"]}}}}},"operationId":"getBffDocumentStats","tags":["Invoice"],"summary":"Invoice statistics","description":"Returns aggregate invoice statistics - counts and amounts by payment status, document type, and status. Useful for dashboards and reports."}},"/bff/document/issuers":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["issuerId","issuerName","invoiceCount"],"properties":{"issuerId":{"description":"External contact id (`shop__contact.external_id`).","type":"string"},"issuerName":{"description":"Display name; falls back to the id when the contact has no first/last name.","type":"string"},"invoiceCount":{"description":"Number of invoices this contact has issued for the org.","type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["issuerId","issuerName","invoiceCount"],"properties":{"issuerId":{"description":"External contact id (`shop__contact.external_id`).","type":"string"},"issuerName":{"description":"Display name; falls back to the id when the contact has no first/last name.","type":"string"},"invoiceCount":{"description":"Number of invoices this contact has issued for the org.","type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["issuerId","issuerName","invoiceCount"],"properties":{"issuerId":{"description":"External contact id (`shop__contact.external_id`).","type":"string"},"issuerName":{"description":"Display name; falls back to the id when the contact has no first/last name.","type":"string"},"invoiceCount":{"description":"Number of invoices this contact has issued for the org.","type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffDocumentIssuers","tags":["Invoice"],"summary":"List issuers seen in the org invoices","description":"Distinct issuer contacts (accounting entities) that appear on at least one invoice in the org, sorted by descending invoice count. Used to populate the \"Vystavovatel\" selector on the invoice list and the analytics tab — never returns an issuer with zero invoices behind it."}},"/bff/document/analytics-by-issuer-and-month":{"get":{"parameters":[{"description":"Calendar year (4-digit) to restrict to.","examples":["2026"],"schema":{"type":"string"},"in":"query","name":"year","required":false},{"description":"External issuer contact id to restrict to.","examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"issuerId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"year":{"description":"The year that was applied, or null for \"all history\".","anyOf":[{"type":"number"},{"type":"null"}]},"currencies":{"description":"Distinct currency codes present in the result. Sorted alphabetically.","type":"array","items":{"type":"string"}},"byIssuer":{"type":"array","items":{"type":"object","required":["issuerId","issuerName","currency","count","totalAmount"],"properties":{"issuerId":{"type":"string"},"issuerName":{"type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}},"byMonth":{"type":"array","items":{"type":"object","required":["month","currency","count","totalAmount"],"properties":{"month":{"description":"`YYYY-MM`.","type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}},"byIssuerMonth":{"type":"array","items":{"type":"object","required":["issuerId","month","currency","count","totalAmount"],"properties":{"issuerId":{"type":"string"},"month":{"description":"`YYYY-MM`.","type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}}},"required":["year","currencies","byIssuer","byMonth","byIssuerMonth"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"year":{"description":"The year that was applied, or null for \"all history\".","anyOf":[{"type":"number"},{"type":"null"}]},"currencies":{"description":"Distinct currency codes present in the result. Sorted alphabetically.","type":"array","items":{"type":"string"}},"byIssuer":{"type":"array","items":{"type":"object","required":["issuerId","issuerName","currency","count","totalAmount"],"properties":{"issuerId":{"type":"string"},"issuerName":{"type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}},"byMonth":{"type":"array","items":{"type":"object","required":["month","currency","count","totalAmount"],"properties":{"month":{"description":"`YYYY-MM`.","type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}},"byIssuerMonth":{"type":"array","items":{"type":"object","required":["issuerId","month","currency","count","totalAmount"],"properties":{"issuerId":{"type":"string"},"month":{"description":"`YYYY-MM`.","type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}}},"required":["year","currencies","byIssuer","byMonth","byIssuerMonth"]}},"text/plain":{"schema":{"type":"object","properties":{"year":{"description":"The year that was applied, or null for \"all history\".","anyOf":[{"type":"number"},{"type":"null"}]},"currencies":{"description":"Distinct currency codes present in the result. Sorted alphabetically.","type":"array","items":{"type":"string"}},"byIssuer":{"type":"array","items":{"type":"object","required":["issuerId","issuerName","currency","count","totalAmount"],"properties":{"issuerId":{"type":"string"},"issuerName":{"type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}},"byMonth":{"type":"array","items":{"type":"object","required":["month","currency","count","totalAmount"],"properties":{"month":{"description":"`YYYY-MM`.","type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}},"byIssuerMonth":{"type":"array","items":{"type":"object","required":["issuerId","month","currency","count","totalAmount"],"properties":{"issuerId":{"type":"string"},"month":{"description":"`YYYY-MM`.","type":"string"},"currency":{"type":"string"},"count":{"type":"number"},"totalAmount":{"type":"number"}}}}},"required":["year","currencies","byIssuer","byMonth","byIssuerMonth"]}}}}},"operationId":"getBffDocumentAnalytics-by-issuer-and-month","tags":["Invoice"],"summary":"Invoice rollups by issuer and month","description":"Per-currency rollups powering the invoice Analytics tab. Sums are NEVER cross-currency — an org can invoice in multiple currencies and adding them would be misleading, so the client renders one section per currency. Returns three parallel rollups over the same filtered set: `byIssuer` (aggregated across months), `byMonth` (aggregated across issuers), and `byIssuerMonth` (the full pivot for a matrix view)."}},"/bff/document/types":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","type","label"],"properties":{"id":{"description":"Type ID.","type":"number"},"type":{"description":"Type code.","type":"string"},"label":{"description":"Human-readable label.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","type","label"],"properties":{"id":{"description":"Type ID.","type":"number"},"type":{"description":"Type code.","type":"string"},"label":{"description":"Human-readable label.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","type","label"],"properties":{"id":{"description":"Type ID.","type":"number"},"type":{"description":"Type code.","type":"string"},"label":{"description":"Human-readable label.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffDocumentTypes","tags":["Invoice"],"summary":"List invoice types","description":"Returns a list of all available invoice/document types."}},"/bff/document/mark-as-paid":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDocumentMark-as-paid","tags":["Invoice"],"summary":"Mark invoice as paid","description":"Marks the invoice as paid and changes its status to \"paid\".","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"payDate":{"description":"Payment date (ISO format). If not provided, current date is used.","examples":["2026-04-15"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"payDate":{"description":"Payment date (ISO format). If not provided, current date is used.","examples":["2026-04-15"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"payDate":{"description":"Payment date (ISO format). If not provided, current date is used.","examples":["2026-04-15"],"type":"string"}}}}}}}},"/bff/document/update-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDocumentUpdate-status","tags":["Invoice"],"summary":"Update invoice status","description":"Changes the invoice status to the specified value.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"status":{"description":"Invoice status.","anyOf":[{"const":"open","type":"string"},{"const":"sent","type":"string"},{"const":"overdue","type":"string"},{"const":"paid","type":"string"},{"const":"cancelled","type":"string"},{"const":"uncollectible","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"status":{"description":"Invoice status.","anyOf":[{"const":"open","type":"string"},{"const":"sent","type":"string"},{"const":"overdue","type":"string"},{"const":"paid","type":"string"},{"const":"cancelled","type":"string"},{"const":"uncollectible","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","status"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"status":{"description":"Invoice status.","anyOf":[{"const":"open","type":"string"},{"const":"sent","type":"string"},{"const":"overdue","type":"string"},{"const":"paid","type":"string"},{"const":"cancelled","type":"string"},{"const":"uncollectible","type":"string"}]}}}}}}}},"/bff/document/update-notes":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffDocumentUpdate-notes","tags":["Invoice"],"summary":"Update invoice notes","description":"Updates the public and/or internal notice of the invoice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"publicNotice":{"description":"Public notice (displayed on invoice).","examples":["Thank you for your business"],"type":"string"},"internalNotice":{"description":"Internal notice.","examples":["Approved by manager"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"publicNotice":{"description":"Public notice (displayed on invoice).","examples":["Thank you for your business"],"type":"string"},"internalNotice":{"description":"Internal notice.","examples":["Approved by manager"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"publicNotice":{"description":"Public notice (displayed on invoice).","examples":["Thank you for your business"],"type":"string"},"internalNotice":{"description":"Internal notice.","examples":["Approved by manager"],"type":"string"}}}}}}}},"/bff/document/export":{"get":{"parameters":[{"description":"Start date (ISO format: YYYY-MM-DD).","examples":["2026-01-01"],"schema":{"type":"string"},"in":"query","name":"dateFrom","required":true},{"description":"End date (ISO format: YYYY-MM-DD).","examples":["2026-03-31"],"schema":{"type":"string"},"in":"query","name":"dateTo","required":true},{"description":"Export format: \"csv\" for spreadsheet data, \"zip\" for PDF files archive.","schema":{"anyOf":[{"const":"csv","type":"string"},{"const":"zip","type":"string"}]},"in":"query","name":"format","required":true}],"operationId":"getBffDocumentExport","tags":["Invoice"],"summary":"Export invoices","description":"Exports invoices for the specified date range. CSV format includes invoice metadata (number, status, amounts, customer info). ZIP format includes actual PDF invoice files with a manifest.","responses":{"200":{}}}},"/bff/document/export-isdoc":{"get":{"parameters":[{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffDocumentExport-isdoc","tags":["Invoice"],"summary":"Export invoice as ISDOC 6.0.2","description":"Generates the Czech B2B invoice exchange format (ISDOC 6.0.2) for a single invoice. The DocumentType element is derived from the invoice type (invoice → 1, proforma → 2, credit/correction → 5).","responses":{"200":{}}}},"/bff/document/export-pohoda":{"get":{"parameters":[{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Pohoda předkontace code (e.g., \"311000\").","schema":{"type":"string"},"in":"query","name":"accountCode","required":false},{"description":"Pohoda středisko code.","schema":{"type":"string"},"in":"query","name":"centreCode","required":false},{"description":"Pohoda činnost code.","schema":{"type":"string"},"in":"query","name":"activityCode","required":false},{"description":"Pohoda zakázka code.","schema":{"type":"string"},"in":"query","name":"contractCode","required":false},{"description":"Pohoda číselná řada prefix prepended to the sequence number.","schema":{"type":"string"},"in":"query","name":"numericalSeries","required":false},{"description":"Set to \"true\" for reverse-charge classification (priceNone instead of priceHigh).","schema":{"type":"string"},"in":"query","name":"reverseCharge","required":false}],"operationId":"getBffDocumentExport-pohoda","tags":["Invoice"],"summary":"Export invoice as Pohoda XML (Stormware data package)","description":"Generates the Stormware Pohoda dataPack XML for direct import into the accounting software. Optional codes (account, centre, activity, contract) come from the per-organisation accounting configuration.","responses":{"200":{}}}},"/bff/document/clone":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"External ID of the new draft invoice.","type":"string"},"sequenceNumber":{"description":"Sequence number of the new draft invoice.","type":"string"}},"required":["id","sequenceNumber"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"External ID of the new draft invoice.","type":"string"},"sequenceNumber":{"description":"Sequence number of the new draft invoice.","type":"string"}},"required":["id","sequenceNumber"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"External ID of the new draft invoice.","type":"string"},"sequenceNumber":{"description":"Sequence number of the new draft invoice.","type":"string"}},"required":["id","sequenceNumber"]}}}}},"operationId":"postBffDocumentClone","tags":["Invoice"],"summary":"Clone invoice as a new draft","description":"Duplicates an invoice as a fresh draft (status `open`, today's issue date, recomputed due date). When `incrementMonth` is true (default), any \"M/YYYY\" or \"MM/YYYY\" patterns in the line descriptions are advanced by one month, supporting recurring monthly billing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID of the source invoice.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"incrementMonth":{"description":"Whether to auto-increment \"M/YYYY\" tokens in line descriptions. Defaults to true.","default":true,"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID of the source invoice.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"incrementMonth":{"description":"Whether to auto-increment \"M/YYYY\" tokens in line descriptions. Defaults to true.","default":true,"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID of the source invoice.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"incrementMonth":{"description":"Whether to auto-increment \"M/YYYY\" tokens in line descriptions. Defaults to true.","default":true,"type":"boolean"}}}}}}}},"/bff/document/lock-snapshot":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"alreadySnapshotted":{"description":"True when the invoice was already locked and `force` was not set — no change occurred.","type":"boolean"},"snapshottedAt":{"description":"ISO timestamp of the (existing or new) snapshot.","type":"string"}},"required":["alreadySnapshotted","snapshottedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"alreadySnapshotted":{"description":"True when the invoice was already locked and `force` was not set — no change occurred.","type":"boolean"},"snapshottedAt":{"description":"ISO timestamp of the (existing or new) snapshot.","type":"string"}},"required":["alreadySnapshotted","snapshottedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"alreadySnapshotted":{"description":"True when the invoice was already locked and `force` was not set — no change occurred.","type":"boolean"},"snapshottedAt":{"description":"ISO timestamp of the (existing or new) snapshot.","type":"string"}},"required":["alreadySnapshotted","snapshottedAt"]}}}}},"operationId":"postBffDocumentLock-snapshot","tags":["Invoice"],"summary":"Lock invoice immutability snapshot","description":"Freezes the supplier, customer and bank account details into JSONB columns on the invoice. Once locked, downstream renderers (PDF, detail, exports) prefer the snapshot over live data, so the invoice stays unchanged even if the contact or bank account is later edited. Idempotent unless `force: true` is passed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"force":{"description":"Re-snapshot even if the invoice is already locked. Use only when an admin explicitly accepts overwriting historical data — guard the UI with a confirm dialog.","default":false,"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"force":{"description":"Re-snapshot even if the invoice is already locked. Use only when an admin explicitly accepts overwriting historical data — guard the UI with a confirm dialog.","default":false,"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"force":{"description":"Re-snapshot even if the invoice is already locked. Use only when an admin explicitly accepts overwriting historical data — guard the UI with a confirm dialog.","default":false,"type":"boolean"}}}}}}}},"/bff/document/send-reminder":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["sent","recipient","reminderCount","sentAt","emailExternalId"],"properties":{"sent":{"const":true,"type":"boolean"},"recipient":{"description":"Email address the reminder was sent to.","type":"string"},"reminderCount":{"description":"Total number of reminders sent for this invoice (after this one).","type":"number"},"sentAt":{"description":"ISO timestamp when the reminder was queued.","type":"string"},"emailExternalId":{"description":"External ID of the queued email message.","type":"string"}}},{"type":"object","required":["sent","skippedReason"],"properties":{"sent":{"const":false,"type":"boolean"},"skippedReason":{"description":"`paid`/`cancelled` — invoice no longer needs reminding. `cooldown` — last reminder was too recent. `no-recipient` — no email found on customer/recipient.","anyOf":[{"const":"paid","type":"string"},{"const":"cooldown","type":"string"},{"const":"no-recipient","type":"string"},{"const":"cancelled","type":"string"}]},"lastReminderAt":{"description":"ISO timestamp of the previous reminder (only when reason is `cooldown`).","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["sent","recipient","reminderCount","sentAt","emailExternalId"],"properties":{"sent":{"const":true,"type":"boolean"},"recipient":{"description":"Email address the reminder was sent to.","type":"string"},"reminderCount":{"description":"Total number of reminders sent for this invoice (after this one).","type":"number"},"sentAt":{"description":"ISO timestamp when the reminder was queued.","type":"string"},"emailExternalId":{"description":"External ID of the queued email message.","type":"string"}}},{"type":"object","required":["sent","skippedReason"],"properties":{"sent":{"const":false,"type":"boolean"},"skippedReason":{"description":"`paid`/`cancelled` — invoice no longer needs reminding. `cooldown` — last reminder was too recent. `no-recipient` — no email found on customer/recipient.","anyOf":[{"const":"paid","type":"string"},{"const":"cooldown","type":"string"},{"const":"no-recipient","type":"string"},{"const":"cancelled","type":"string"}]},"lastReminderAt":{"description":"ISO timestamp of the previous reminder (only when reason is `cooldown`).","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["sent","recipient","reminderCount","sentAt","emailExternalId"],"properties":{"sent":{"const":true,"type":"boolean"},"recipient":{"description":"Email address the reminder was sent to.","type":"string"},"reminderCount":{"description":"Total number of reminders sent for this invoice (after this one).","type":"number"},"sentAt":{"description":"ISO timestamp when the reminder was queued.","type":"string"},"emailExternalId":{"description":"External ID of the queued email message.","type":"string"}}},{"type":"object","required":["sent","skippedReason"],"properties":{"sent":{"const":false,"type":"boolean"},"skippedReason":{"description":"`paid`/`cancelled` — invoice no longer needs reminding. `cooldown` — last reminder was too recent. `no-recipient` — no email found on customer/recipient.","anyOf":[{"const":"paid","type":"string"},{"const":"cooldown","type":"string"},{"const":"no-recipient","type":"string"},{"const":"cancelled","type":"string"}]},"lastReminderAt":{"description":"ISO timestamp of the previous reminder (only when reason is `cooldown`).","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["sent","recipient","reminderCount","sentAt","emailExternalId"],"properties":{"sent":{"const":true,"type":"boolean"},"recipient":{"description":"Email address the reminder was sent to.","type":"string"},"reminderCount":{"description":"Total number of reminders sent for this invoice (after this one).","type":"number"},"sentAt":{"description":"ISO timestamp when the reminder was queued.","type":"string"},"emailExternalId":{"description":"External ID of the queued email message.","type":"string"}}},{"type":"object","required":["sent","skippedReason"],"properties":{"sent":{"const":false,"type":"boolean"},"skippedReason":{"description":"`paid`/`cancelled` — invoice no longer needs reminding. `cooldown` — last reminder was too recent. `no-recipient` — no email found on customer/recipient.","anyOf":[{"const":"paid","type":"string"},{"const":"cooldown","type":"string"},{"const":"no-recipient","type":"string"},{"const":"cancelled","type":"string"}]},"lastReminderAt":{"description":"ISO timestamp of the previous reminder (only when reason is `cooldown`).","type":"string"}}}]}}}}},"operationId":"postBffDocumentSend-reminder","tags":["Invoice"],"summary":"Send overdue payment reminder for one invoice","description":"Composes and queues a reminder email with the invoice PDF attached. Uses the organisation support email as From, the customer email as To, and respects a configurable cooldown window (default 72h) so admins don't accidentally spam the same client.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"recipientEmail":{"description":"Override the auto-resolved recipient (customer email). Useful when sending to an accountant or a billing contact instead of the primary email.","examples":["accountant@client.com"],"type":"string"},"ignoreCooldown":{"description":"Send even if a reminder was already sent recently. Default false — UI should warn the user when overriding cooldown.","default":false,"type":"boolean"},"cooldownHours":{"description":"Override the default cooldown window between reminders. Default 72 (3 days).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"recipientEmail":{"description":"Override the auto-resolved recipient (customer email). Useful when sending to an accountant or a billing contact instead of the primary email.","examples":["accountant@client.com"],"type":"string"},"ignoreCooldown":{"description":"Send even if a reminder was already sent recently. Default false — UI should warn the user when overriding cooldown.","default":false,"type":"boolean"},"cooldownHours":{"description":"Override the default cooldown window between reminders. Default 72 (3 days).","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"recipientEmail":{"description":"Override the auto-resolved recipient (customer email). Useful when sending to an accountant or a billing contact instead of the primary email.","examples":["accountant@client.com"],"type":"string"},"ignoreCooldown":{"description":"Send even if a reminder was already sent recently. Default false — UI should warn the user when overriding cooldown.","default":false,"type":"boolean"},"cooldownHours":{"description":"Override the default cooldown window between reminders. Default 72 (3 days).","type":"number"}}}}}}}},"/bff/document/send-reminders-bulk":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"description":"Number of reminders actually queued.","type":"number"},"skipped":{"description":"Number of invoices skipped (paid, cancelled, cooldown, no recipient).","type":"number"},"errors":{"description":"Number of invoices that threw an error.","type":"number"},"rows":{"type":"array","items":{"type":"object","required":["id","outcome"],"properties":{"id":{"description":"External invoice ID.","type":"string"},"outcome":{"anyOf":[{"const":"sent","type":"string"},{"const":"skipped","type":"string"},{"const":"error","type":"string"}]},"reason":{"description":"Skip reason (when outcome is \"skipped\").","type":"string"},"recipient":{"description":"Email recipient (when outcome is \"sent\").","type":"string"},"error":{"description":"Error message (when outcome is \"error\").","type":"string"}}}}},"required":["sent","skipped","errors","rows"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"sent":{"description":"Number of reminders actually queued.","type":"number"},"skipped":{"description":"Number of invoices skipped (paid, cancelled, cooldown, no recipient).","type":"number"},"errors":{"description":"Number of invoices that threw an error.","type":"number"},"rows":{"type":"array","items":{"type":"object","required":["id","outcome"],"properties":{"id":{"description":"External invoice ID.","type":"string"},"outcome":{"anyOf":[{"const":"sent","type":"string"},{"const":"skipped","type":"string"},{"const":"error","type":"string"}]},"reason":{"description":"Skip reason (when outcome is \"skipped\").","type":"string"},"recipient":{"description":"Email recipient (when outcome is \"sent\").","type":"string"},"error":{"description":"Error message (when outcome is \"error\").","type":"string"}}}}},"required":["sent","skipped","errors","rows"]}},"text/plain":{"schema":{"type":"object","properties":{"sent":{"description":"Number of reminders actually queued.","type":"number"},"skipped":{"description":"Number of invoices skipped (paid, cancelled, cooldown, no recipient).","type":"number"},"errors":{"description":"Number of invoices that threw an error.","type":"number"},"rows":{"type":"array","items":{"type":"object","required":["id","outcome"],"properties":{"id":{"description":"External invoice ID.","type":"string"},"outcome":{"anyOf":[{"const":"sent","type":"string"},{"const":"skipped","type":"string"},{"const":"error","type":"string"}]},"reason":{"description":"Skip reason (when outcome is \"skipped\").","type":"string"},"recipient":{"description":"Email recipient (when outcome is \"sent\").","type":"string"},"error":{"description":"Error message (when outcome is \"error\").","type":"string"}}}}},"required":["sent","skipped","errors","rows"]}}}}},"operationId":"postBffDocumentSend-reminders-bulk","tags":["Invoice"],"summary":"Send overdue payment reminders for multiple invoices","description":"Sequential per-invoice reminder dispatch. Returns a summary plus a per-invoice row so the UI can show which invoices were sent, which were skipped (and why), and which errored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"List of external invoice IDs.","minItems":1,"type":"array","items":{"description":"External invoice IDs to remind, in any order.","type":"string"}},"ignoreCooldown":{"description":"Ignore the per-invoice cooldown.","default":false,"type":"boolean"},"cooldownHours":{"description":"Override the default cooldown window (hours).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"List of external invoice IDs.","minItems":1,"type":"array","items":{"description":"External invoice IDs to remind, in any order.","type":"string"}},"ignoreCooldown":{"description":"Ignore the per-invoice cooldown.","default":false,"type":"boolean"},"cooldownHours":{"description":"Override the default cooldown window (hours).","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"List of external invoice IDs.","minItems":1,"type":"array","items":{"description":"External invoice IDs to remind, in any order.","type":"string"}},"ignoreCooldown":{"description":"Ignore the per-invoice cooldown.","default":false,"type":"boolean"},"cooldownHours":{"description":"Override the default cooldown window (hours).","type":"number"}}}}}}}},"/bff/document/regenerate-pdf":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"file":{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"file":{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"file":{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}}},"required":["success"]}}}}},"operationId":"postBffDocumentRegenerate-pdf","tags":["Invoice"],"summary":"Regenerate invoice PDF from current data","description":"Re-renders the invoice PDF from the current `loadInvoiceDescription()` output — useful after a customer address or notice is corrected. Overwrites the file blob on `shop__invoice.blob_id` and, for order-attached invoices, appends a fresh `shop__order_file` row. Refuses to run on snapshot-locked invoices.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"}}}}}}}},"/bff/document/send-by-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"emailExternalId":{"description":"External id of the queued e-mail — null when the workflow template is missing.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","emailExternalId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"emailExternalId":{"description":"External id of the queued e-mail — null when the workflow template is missing.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","emailExternalId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"emailExternalId":{"description":"External id of the queued e-mail — null when the workflow template is missing.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","emailExternalId"]}}}}},"operationId":"postBffDocumentSend-by-email","tags":["Invoice"],"summary":"Send a stored document to a contact by e-mail","description":"Generic \"deliver this blob to this contact as a PDF attachment\" primitive. Resolves the blob + contact in the authenticated organisation, then dispatches the `document-send` workflow notification (e-mail body + attachment). The e-mail body uses the organisation's default template, which can be overridden per org under Settings → E-mail templates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["blobToken","contactId"],"properties":{"blobToken":{"description":"32-char token of the blob to attach.","examples":["abcdef0123456789abcdef0123456789"],"type":"string"},"contactId":{"description":"External contact id (CuRefNo, 16 chars) of the recipient.","examples":["aHRj9aHo9cXcTAqc"],"type":"string"},"filename":{"description":"Override the attachment filename and the body variable `{{ documentFilename }}`. Defaults to the blob's stored filename.","examples":["Doklad_2026001.PDF"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["blobToken","contactId"],"properties":{"blobToken":{"description":"32-char token of the blob to attach.","examples":["abcdef0123456789abcdef0123456789"],"type":"string"},"contactId":{"description":"External contact id (CuRefNo, 16 chars) of the recipient.","examples":["aHRj9aHo9cXcTAqc"],"type":"string"},"filename":{"description":"Override the attachment filename and the body variable `{{ documentFilename }}`. Defaults to the blob's stored filename.","examples":["Doklad_2026001.PDF"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["blobToken","contactId"],"properties":{"blobToken":{"description":"32-char token of the blob to attach.","examples":["abcdef0123456789abcdef0123456789"],"type":"string"},"contactId":{"description":"External contact id (CuRefNo, 16 chars) of the recipient.","examples":["aHRj9aHo9cXcTAqc"],"type":"string"},"filename":{"description":"Override the attachment filename and the body variable `{{ documentFilename }}`. Defaults to the blob's stored filename.","examples":["Doklad_2026001.PDF"],"type":"string"}}}}}}}},"/bff/document/reissue":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"}},"required":["id","sequenceNumber"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"}},"required":["id","sequenceNumber"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"}},"required":["id","sequenceNumber"]}}}}},"operationId":"postBffDocumentReissue","tags":["Invoice"],"summary":"Reissue document","description":"Voids the document and issues a replacement with a new number (same items and amounts, VAT rates recomputed). No customer notification.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External id of the document to void and reissue.","type":"string"},"reason":{"description":"Short reason stored on the voided document.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External id of the document to void and reissue.","type":"string"},"reason":{"description":"Short reason stored on the voided document.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External id of the document to void and reissue.","type":"string"},"reason":{"description":"Short reason stored on the voided document.","type":"string"}}}}}}}},"/bff/document/change-customer":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"file":{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"file":{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"file":{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}}},"required":["success"]}}}}},"operationId":"postBffDocumentChange-customer","tags":["Invoice"],"summary":"Change invoice customer","description":"Repoints the invoice to a different customer contact within the same organisation, then (by default) regenerates the PDF from the current invoice description. Refuses to run on snapshot-locked invoices — customer identity is legally immutable once snapshotted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","customerId"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"customerId":{"description":"External ID of the new customer contact (CuRefNo).","examples":["aHRj9aHo9cXcTAqc"],"type":"string"},"regeneratePdf":{"description":"Regenerate the invoice PDF immediately after the swap. Defaults to true.","default":true,"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","customerId"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"customerId":{"description":"External ID of the new customer contact (CuRefNo).","examples":["aHRj9aHo9cXcTAqc"],"type":"string"},"regeneratePdf":{"description":"Regenerate the invoice PDF immediately after the swap. Defaults to true.","default":true,"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","customerId"],"properties":{"id":{"description":"External invoice ID.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"customerId":{"description":"External ID of the new customer contact (CuRefNo).","examples":["aHRj9aHo9cXcTAqc"],"type":"string"},"regeneratePdf":{"description":"Regenerate the invoice PDF immediately after the swap. Defaults to true.","default":true,"type":"boolean"}}}}}}}},"/bff/iot-lock/lock-list":{"get":{"responses":{"200":{"description":"Paginated list of locks with metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of locks matching the query criteria.","type":"array","items":{"description":"Single lock item in the list.","type":"object","required":["id","alias","active","isOnline","uptimePercent","insertedDate","updatedDate"],"properties":{"id":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"modelNum":{"description":"Lock hardware model number.","type":"string"},"mac":{"description":"Bluetooth MAC address of the lock.","type":"string"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway.","type":"boolean"},"featureValue":{"description":"TTLock feature bitmask value.","type":"string"},"firmwareVersion":{"description":"Current firmware revision.","type":"string"},"autoLockTime":{"description":"Auto-lock delay in seconds (0 = disabled).","type":"number"},"active":{"description":"Whether the lock is active in the system.","type":"boolean"},"isOnline":{"description":"Whether the lock gateway is currently online (no open outage incident).","type":"boolean"},"uptimePercent":{"description":"Gateway uptime percentage over the last 30 days (0–100).","type":"number"},"lastOnlineDate":{"description":"When the gateway was last seen online. Only present when currently offline.","anyOf":[{"description":"When the gateway was last seen online. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentOutageSince":{"description":"Start of the current outage. Only present when currently offline.","anyOf":[{"description":"Start of the current outage. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"administratorContactExternalId":{"description":"External ID of the assigned administrator contact.","type":"string"},"administratorName":{"description":"Full name of the assigned administrator (or email if name is not available).","type":"string"},"insertedDate":{"description":"Date when the lock was added to the system.","anyOf":[{"description":"Date when the lock was added to the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date of the last status update from TTLock API.","anyOf":[{"description":"Date of the last status update from TTLock API.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of non-deleted locks for pagination controls.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of locks matching the query criteria.","type":"array","items":{"description":"Single lock item in the list.","type":"object","required":["id","alias","active","isOnline","uptimePercent","insertedDate","updatedDate"],"properties":{"id":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"modelNum":{"description":"Lock hardware model number.","type":"string"},"mac":{"description":"Bluetooth MAC address of the lock.","type":"string"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway.","type":"boolean"},"featureValue":{"description":"TTLock feature bitmask value.","type":"string"},"firmwareVersion":{"description":"Current firmware revision.","type":"string"},"autoLockTime":{"description":"Auto-lock delay in seconds (0 = disabled).","type":"number"},"active":{"description":"Whether the lock is active in the system.","type":"boolean"},"isOnline":{"description":"Whether the lock gateway is currently online (no open outage incident).","type":"boolean"},"uptimePercent":{"description":"Gateway uptime percentage over the last 30 days (0–100).","type":"number"},"lastOnlineDate":{"description":"When the gateway was last seen online. Only present when currently offline.","anyOf":[{"description":"When the gateway was last seen online. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentOutageSince":{"description":"Start of the current outage. Only present when currently offline.","anyOf":[{"description":"Start of the current outage. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"administratorContactExternalId":{"description":"External ID of the assigned administrator contact.","type":"string"},"administratorName":{"description":"Full name of the assigned administrator (or email if name is not available).","type":"string"},"insertedDate":{"description":"Date when the lock was added to the system.","anyOf":[{"description":"Date when the lock was added to the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date of the last status update from TTLock API.","anyOf":[{"description":"Date of the last status update from TTLock API.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of non-deleted locks for pagination controls.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of locks matching the query criteria.","type":"array","items":{"description":"Single lock item in the list.","type":"object","required":["id","alias","active","isOnline","uptimePercent","insertedDate","updatedDate"],"properties":{"id":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"modelNum":{"description":"Lock hardware model number.","type":"string"},"mac":{"description":"Bluetooth MAC address of the lock.","type":"string"},"hasGateway":{"description":"Whether the lock is connected to a Wi-Fi gateway.","type":"boolean"},"featureValue":{"description":"TTLock feature bitmask value.","type":"string"},"firmwareVersion":{"description":"Current firmware revision.","type":"string"},"autoLockTime":{"description":"Auto-lock delay in seconds (0 = disabled).","type":"number"},"active":{"description":"Whether the lock is active in the system.","type":"boolean"},"isOnline":{"description":"Whether the lock gateway is currently online (no open outage incident).","type":"boolean"},"uptimePercent":{"description":"Gateway uptime percentage over the last 30 days (0–100).","type":"number"},"lastOnlineDate":{"description":"When the gateway was last seen online. Only present when currently offline.","anyOf":[{"description":"When the gateway was last seen online. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentOutageSince":{"description":"Start of the current outage. Only present when currently offline.","anyOf":[{"description":"Start of the current outage. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"administratorContactExternalId":{"description":"External ID of the assigned administrator contact.","type":"string"},"administratorName":{"description":"Full name of the assigned administrator (or email if name is not available).","type":"string"},"insertedDate":{"description":"Date when the lock was added to the system.","anyOf":[{"description":"Date when the lock was added to the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date of the last status update from TTLock API.","anyOf":[{"description":"Date of the last status update from TTLock API.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of non-deleted locks for pagination controls.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIot-lockLock-list","tags":["IoT"],"summary":"List locks","description":"Returns a paginated list of TTLock smart locks for the authenticated organisation. Locks are ordered by active status, gateway connection, alias, and lock ID. Deleted locks are excluded. Each lock includes hardware metadata, battery level, and the assigned administrator contact (if any)."}},"/bff/iot-lock/lock-detail":{"get":{"parameters":[{"description":"TTLock lock ID (from TTLock API).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"backupPassword":{"description":"Current system-generated backup passcode for manual unlocking.","type":"string"},"backupPasswordInsertedDate":{"description":"Date when the backup password was generated.","anyOf":[{"description":"Date when the backup password was generated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the lock is active in the system.","type":"boolean"},"deleted":{"description":"Whether the lock has been soft-deleted.","type":"boolean"},"isOnline":{"description":"Whether the lock gateway is currently online (no open outage incident).","type":"boolean"},"uptimePercent":{"description":"Gateway uptime percentage over the last 30 days (0–100).","type":"number"},"lastOnlineDate":{"description":"When the gateway was last seen online. Only present when currently offline.","anyOf":[{"description":"When the gateway was last seen online. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentOutageSince":{"description":"Start of the current outage. Only present when currently offline.","anyOf":[{"description":"Start of the current outage. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"administratorContactExternalId":{"description":"External ID of the assigned administrator contact.","type":"string"},"administratorName":{"description":"Full name of the assigned administrator (or email if name is not available).","type":"string"},"insertedDate":{"description":"Date when the lock was added to the system.","anyOf":[{"description":"Date when the lock was added to the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date of the last status update from TTLock API.","anyOf":[{"description":"Date of the last status update from TTLock API.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","alias","active","deleted","isOnline","uptimePercent","insertedDate","updatedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"backupPassword":{"description":"Current system-generated backup passcode for manual unlocking.","type":"string"},"backupPasswordInsertedDate":{"description":"Date when the backup password was generated.","anyOf":[{"description":"Date when the backup password was generated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the lock is active in the system.","type":"boolean"},"deleted":{"description":"Whether the lock has been soft-deleted.","type":"boolean"},"isOnline":{"description":"Whether the lock gateway is currently online (no open outage incident).","type":"boolean"},"uptimePercent":{"description":"Gateway uptime percentage over the last 30 days (0–100).","type":"number"},"lastOnlineDate":{"description":"When the gateway was last seen online. Only present when currently offline.","anyOf":[{"description":"When the gateway was last seen online. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentOutageSince":{"description":"Start of the current outage. Only present when currently offline.","anyOf":[{"description":"Start of the current outage. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"administratorContactExternalId":{"description":"External ID of the assigned administrator contact.","type":"string"},"administratorName":{"description":"Full name of the assigned administrator (or email if name is not available).","type":"string"},"insertedDate":{"description":"Date when the lock was added to the system.","anyOf":[{"description":"Date when the lock was added to the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date of the last status update from TTLock API.","anyOf":[{"description":"Date of the last status update from TTLock API.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","alias","active","deleted","isOnline","uptimePercent","insertedDate","updatedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"alias":{"description":"Display name of the lock.","type":"string"},"electricQuantity":{"description":"Battery level percentage (0–100).","type":"number"},"backupPassword":{"description":"Current system-generated backup passcode for manual unlocking.","type":"string"},"backupPasswordInsertedDate":{"description":"Date when the backup password was generated.","anyOf":[{"description":"Date when the backup password was generated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the lock is active in the system.","type":"boolean"},"deleted":{"description":"Whether the lock has been soft-deleted.","type":"boolean"},"isOnline":{"description":"Whether the lock gateway is currently online (no open outage incident).","type":"boolean"},"uptimePercent":{"description":"Gateway uptime percentage over the last 30 days (0–100).","type":"number"},"lastOnlineDate":{"description":"When the gateway was last seen online. Only present when currently offline.","anyOf":[{"description":"When the gateway was last seen online. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"currentOutageSince":{"description":"Start of the current outage. Only present when currently offline.","anyOf":[{"description":"Start of the current outage. Only present when currently offline.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"administratorContactExternalId":{"description":"External ID of the assigned administrator contact.","type":"string"},"administratorName":{"description":"Full name of the assigned administrator (or email if name is not available).","type":"string"},"insertedDate":{"description":"Date when the lock was added to the system.","anyOf":[{"description":"Date when the lock was added to the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date of the last status update from TTLock API.","anyOf":[{"description":"Date of the last status update from TTLock API.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","alias","active","deleted","isOnline","uptimePercent","insertedDate","updatedDate"]}}}}},"operationId":"getBffIot-lockLock-detail","tags":["IoT"],"summary":"Get lock detail","description":"Returns full detail of a specific TTLock smart lock including battery level, backup password, active/deleted status, and the assigned administrator contact information."}},"/bff/iot-lock/lock-detail-refresh":{"get":{"parameters":[{"description":"TTLock lock ID (from TTLock API).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"lockId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful refresh.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful refresh.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful refresh.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffIot-lockLock-detail-refresh","tags":["IoT"],"summary":"Refresh lock status","description":"Fetches the latest lock status from the TTLock API and updates the local database. This includes battery level, gateway connection status, firmware version, and other hardware metadata. If the gateway connection changes, a system log entry is created and email notifications are sent. If battery drops below 25%, a critical notification is triggered. Also auto-generates a new backup password when gateway reconnects."}},"/bff/iot-lock/lock-electric-quantity-list":{"get":{"parameters":[{"description":"TTLock lock ID (from TTLock API).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of battery level readings ordered by date.","type":"array","items":{"description":"Single battery level measurement.","type":"object","required":["id","quantity","insertedDate"],"properties":{"id":{"description":"Record ID.","type":"number"},"quantity":{"description":"Battery level percentage (0–100) at the time of measurement.","type":"number"},"insertedDate":{"description":"Date when the measurement was recorded.","anyOf":[{"description":"Date when the measurement was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of battery level records.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of battery level readings ordered by date.","type":"array","items":{"description":"Single battery level measurement.","type":"object","required":["id","quantity","insertedDate"],"properties":{"id":{"description":"Record ID.","type":"number"},"quantity":{"description":"Battery level percentage (0–100) at the time of measurement.","type":"number"},"insertedDate":{"description":"Date when the measurement was recorded.","anyOf":[{"description":"Date when the measurement was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of battery level records.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of battery level readings ordered by date.","type":"array","items":{"description":"Single battery level measurement.","type":"object","required":["id","quantity","insertedDate"],"properties":{"id":{"description":"Record ID.","type":"number"},"quantity":{"description":"Battery level percentage (0–100) at the time of measurement.","type":"number"},"insertedDate":{"description":"Date when the measurement was recorded.","anyOf":[{"description":"Date when the measurement was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of battery level records.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIot-lockLock-electric-quantity-list","tags":["IoT"],"summary":"List battery level history","description":"Returns the history of battery level (electric quantity) readings for a specific lock. Each entry records the battery percentage at a given point in time. Useful for monitoring battery health trends and predicting when replacement is needed."}},"/bff/iot-lock/unlock-now":{"get":{"parameters":[{"description":"TTLock lock ID (from TTLock API).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"lockId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"True if the unlock command was sent successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"True if the unlock command was sent successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"True if the unlock command was sent successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffIot-lockUnlock-now","tags":["IoT"],"summary":"Unlock lock remotely","description":"Sends an immediate remote unlock command to the lock via the TTLock API. Requires that the lock is connected to a Wi-Fi gateway. The lock must be active and not deleted."}},"/bff/iot-lock/unlock-record-list":{"get":{"parameters":[{"description":"TTLock lock ID (from TTLock API).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"description":"Paginated list of unlock/lock history records.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of unlock/lock records.","type":"array","items":{"description":"Single unlock/lock history record.","type":"object","required":["id","success","serverDate","recordType","recordTypeFromLock","insertedDate"],"properties":{"id":{"description":"TTLock record ID.","type":"number"},"success":{"description":"Whether the unlock/lock action was successful.","type":"boolean"},"lockDate":{"description":"Timestamp of the action from the lock device.","anyOf":[{"description":"Timestamp of the action from the lock device.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"serverDate":{"description":"Timestamp of the action from the TTLock server.","anyOf":[{"description":"Timestamp of the action from the TTLock server.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"recordType":{"description":"Translated record type label (e.g. \"Unlock via app\").","type":"string"},"recordTypeFromLock":{"description":"Translated record type from the lock hardware.","type":"string"},"keyboardPassword":{"description":"Keyboard password used for the action (if applicable).","type":"string"},"insertedDate":{"description":"Date when the record was stored locally.","anyOf":[{"description":"Date when the record was stored locally.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of records for pagination.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of unlock/lock records.","type":"array","items":{"description":"Single unlock/lock history record.","type":"object","required":["id","success","serverDate","recordType","recordTypeFromLock","insertedDate"],"properties":{"id":{"description":"TTLock record ID.","type":"number"},"success":{"description":"Whether the unlock/lock action was successful.","type":"boolean"},"lockDate":{"description":"Timestamp of the action from the lock device.","anyOf":[{"description":"Timestamp of the action from the lock device.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"serverDate":{"description":"Timestamp of the action from the TTLock server.","anyOf":[{"description":"Timestamp of the action from the TTLock server.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"recordType":{"description":"Translated record type label (e.g. \"Unlock via app\").","type":"string"},"recordTypeFromLock":{"description":"Translated record type from the lock hardware.","type":"string"},"keyboardPassword":{"description":"Keyboard password used for the action (if applicable).","type":"string"},"insertedDate":{"description":"Date when the record was stored locally.","anyOf":[{"description":"Date when the record was stored locally.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of records for pagination.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of unlock/lock records.","type":"array","items":{"description":"Single unlock/lock history record.","type":"object","required":["id","success","serverDate","recordType","recordTypeFromLock","insertedDate"],"properties":{"id":{"description":"TTLock record ID.","type":"number"},"success":{"description":"Whether the unlock/lock action was successful.","type":"boolean"},"lockDate":{"description":"Timestamp of the action from the lock device.","anyOf":[{"description":"Timestamp of the action from the lock device.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"serverDate":{"description":"Timestamp of the action from the TTLock server.","anyOf":[{"description":"Timestamp of the action from the TTLock server.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"recordType":{"description":"Translated record type label (e.g. \"Unlock via app\").","type":"string"},"recordTypeFromLock":{"description":"Translated record type from the lock hardware.","type":"string"},"keyboardPassword":{"description":"Keyboard password used for the action (if applicable).","type":"string"},"insertedDate":{"description":"Date when the record was stored locally.","anyOf":[{"description":"Date when the record was stored locally.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of records for pagination.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIot-lockUnlock-record-list","tags":["IoT"],"summary":"List unlock records","description":"Returns a paginated list of unlock/lock history records for a specific lock. Each record includes the action type (unlock, lock, auto-lock, etc.), success status, timestamp, and the keyboard password used (if applicable). Record type labels are translated based on the provided locale."}},"/bff/iot-lock/lock-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful registration.","type":"boolean"},"lockId":{"description":"The TTLock lock ID that was registered.","type":"number"}},"required":["success","lockId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful registration.","type":"boolean"},"lockId":{"description":"The TTLock lock ID that was registered.","type":"number"}},"required":["success","lockId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful registration.","type":"boolean"},"lockId":{"description":"The TTLock lock ID that was registered.","type":"number"}},"required":["success","lockId"]}}}}},"operationId":"postBffIot-lockLock-add","tags":["IoT"],"summary":"Add new lock","description":"Registers a new TTLock smart lock for the authenticated organisation. The lock ID must be obtained from the TTLock API or mobile app. After adding, the lock status is fetched from the TTLock API to populate initial metadata.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lockId"],"properties":{"lockId":{"description":"TTLock lock ID to add (from the TTLock API/app).","examples":["12345"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["lockId"],"properties":{"lockId":{"description":"TTLock lock ID to add (from the TTLock API/app).","examples":["12345"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["lockId"],"properties":{"lockId":{"description":"TTLock lock ID to add (from the TTLock API/app).","examples":["12345"],"type":"string"}}}}}}}},"/bff/iot-lock/password-list":{"get":{"parameters":[{"description":"TTLock lock ID (from TTLock API).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Page number, 1-based. Default 1.","examples":["2"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Page size. Default 50.","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"0-based row offset. When set, it takes precedence over `page`.","examples":["100"],"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"description":"Paginated list of keyboard passcodes.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of keyboard passcodes.","type":"array","items":{"description":"Single keyboard passcode item.","type":"object","required":["id","active","deleted","eventList","sendDate","insertedDate"],"properties":{"id":{"description":"TTLock keyboard password ID.","type":"number"},"active":{"description":"Whether the passcode is currently active (not deleted, within date range).","type":"boolean"},"deleted":{"description":"Whether the passcode has been soft-deleted.","type":"boolean"},"password":{"description":"The keyboard passcode digits.","type":"string"},"eventList":{"description":"Calendar events linked to this passcode.","type":"array","items":{"type":"object","required":["title","calendarCode","eventCode"],"properties":{"title":{"description":"Calendar event title.","type":"string"},"calendarCode":{"description":"Calendar external code.","type":"string"},"eventCode":{"description":"Calendar event external code.","type":"string"}}}},"startDate":{"description":"Date when the passcode becomes active.","anyOf":[{"description":"Date when the passcode becomes active.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"Date when the passcode expires.","anyOf":[{"description":"Date when the passcode expires.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"sendDate":{"description":"Date when the passcode was sent to the lock.","anyOf":[{"description":"Date when the passcode was sent to the lock.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the passcode was created in the system.","anyOf":[{"description":"Date when the passcode was created in the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of passcodes for pagination.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of keyboard passcodes.","type":"array","items":{"description":"Single keyboard passcode item.","type":"object","required":["id","active","deleted","eventList","sendDate","insertedDate"],"properties":{"id":{"description":"TTLock keyboard password ID.","type":"number"},"active":{"description":"Whether the passcode is currently active (not deleted, within date range).","type":"boolean"},"deleted":{"description":"Whether the passcode has been soft-deleted.","type":"boolean"},"password":{"description":"The keyboard passcode digits.","type":"string"},"eventList":{"description":"Calendar events linked to this passcode.","type":"array","items":{"type":"object","required":["title","calendarCode","eventCode"],"properties":{"title":{"description":"Calendar event title.","type":"string"},"calendarCode":{"description":"Calendar external code.","type":"string"},"eventCode":{"description":"Calendar event external code.","type":"string"}}}},"startDate":{"description":"Date when the passcode becomes active.","anyOf":[{"description":"Date when the passcode becomes active.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"Date when the passcode expires.","anyOf":[{"description":"Date when the passcode expires.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"sendDate":{"description":"Date when the passcode was sent to the lock.","anyOf":[{"description":"Date when the passcode was sent to the lock.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the passcode was created in the system.","anyOf":[{"description":"Date when the passcode was created in the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of passcodes for pagination.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of keyboard passcodes.","type":"array","items":{"description":"Single keyboard passcode item.","type":"object","required":["id","active","deleted","eventList","sendDate","insertedDate"],"properties":{"id":{"description":"TTLock keyboard password ID.","type":"number"},"active":{"description":"Whether the passcode is currently active (not deleted, within date range).","type":"boolean"},"deleted":{"description":"Whether the passcode has been soft-deleted.","type":"boolean"},"password":{"description":"The keyboard passcode digits.","type":"string"},"eventList":{"description":"Calendar events linked to this passcode.","type":"array","items":{"type":"object","required":["title","calendarCode","eventCode"],"properties":{"title":{"description":"Calendar event title.","type":"string"},"calendarCode":{"description":"Calendar external code.","type":"string"},"eventCode":{"description":"Calendar event external code.","type":"string"}}}},"startDate":{"description":"Date when the passcode becomes active.","anyOf":[{"description":"Date when the passcode becomes active.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endDate":{"description":"Date when the passcode expires.","anyOf":[{"description":"Date when the passcode expires.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"sendDate":{"description":"Date when the passcode was sent to the lock.","anyOf":[{"description":"Date when the passcode was sent to the lock.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the passcode was created in the system.","anyOf":[{"description":"Date when the passcode was created in the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of passcodes for pagination.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIot-lockPassword-list","tags":["IoT"],"summary":"List lock passcodes","description":"Returns a paginated list of keyboard passcodes for a specific lock. Each passcode includes its validity period, active/deleted status, and linked calendar events (if the passcode was generated for a booking)."}},"/bff/iot-lock/password-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful passcode creation.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful passcode creation.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful passcode creation.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIot-lockPassword-add","tags":["IoT"],"summary":"Create new passcode","description":"Creates a new keyboard passcode for a specific lock and sends it to the lock via the TTLock API. If no password is provided, a unique random 8-digit code is generated (retries up to 50 times to avoid duplicates). Start and end dates define the validity window; the system applies configured time offsets automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lockId"],"properties":{"lockId":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"password":{"description":"Custom passcode digits. If not provided, a random 8-digit code is generated.","type":"string"},"passwordName":{"maxLength":250,"description":"Human-readable label for the passcode (max 250 chars, ASCII only).","type":"string"},"startDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 date-time when the passcode becomes active. Defaults to now.","type":"string"},"endDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 date-time when the passcode expires. If not set, the passcode is permanent.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["lockId"],"properties":{"lockId":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"password":{"description":"Custom passcode digits. If not provided, a random 8-digit code is generated.","type":"string"},"passwordName":{"maxLength":250,"description":"Human-readable label for the passcode (max 250 chars, ASCII only).","type":"string"},"startDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 date-time when the passcode becomes active. Defaults to now.","type":"string"},"endDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 date-time when the passcode expires. If not set, the passcode is permanent.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["lockId"],"properties":{"lockId":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"password":{"description":"Custom passcode digits. If not provided, a random 8-digit code is generated.","type":"string"},"passwordName":{"maxLength":250,"description":"Human-readable label for the passcode (max 250 chars, ASCII only).","type":"string"},"startDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 date-time when the passcode becomes active. Defaults to now.","type":"string"},"endDate":{"format":"date-time","examples":["2024-05-01T10:00:00.000Z"],"description":"ISO 8601 date-time when the passcode expires. If not set, the passcode is permanent.","type":"string"}}}}}}}},"/bff/iot-lock/password-delete":{"get":{"parameters":[{"description":"TTLock keyboard password ID to delete.","examples":["98765"],"schema":{"type":"string"},"in":"query","name":"keyboardPwdId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful deletion.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful deletion.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful deletion.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffIot-lockPassword-delete","tags":["IoT"],"summary":"Delete passcode","description":"Deletes a keyboard passcode from the lock via the TTLock API and marks it as deleted locally. The passcode is verified to belong to the authenticated organisation before deletion."}},"/bff/iot-lock/save-settings":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful update.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful update.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on successful update.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIot-lockSave-settings","tags":["IoT"],"summary":"Update lock settings","description":"Updates the active/deleted status and administrator assignment for a specific lock. The administrator contact is resolved by external ID and must belong to the same organisation. When an administrator is set, they receive CC on all system notification emails triggered by this lock.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["lockId","active","deleted"],"properties":{"lockId":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"active":{"description":"Whether the lock should be active. Inactive locks are excluded from status checks and notifications.","type":"boolean"},"deleted":{"description":"Whether to soft-delete the lock. Deleted locks are hidden from the list.","type":"boolean"},"administratorContactExternalId":{"description":"External ID of the contact to assign as lock administrator. The administrator receives email notifications for all critical lock events (gateway offline, battery critical, API errors). Pass empty or omit to remove the administrator.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["lockId","active","deleted"],"properties":{"lockId":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"active":{"description":"Whether the lock should be active. Inactive locks are excluded from status checks and notifications.","type":"boolean"},"deleted":{"description":"Whether to soft-delete the lock. Deleted locks are hidden from the list.","type":"boolean"},"administratorContactExternalId":{"description":"External ID of the contact to assign as lock administrator. The administrator receives email notifications for all critical lock events (gateway offline, battery critical, API errors). Pass empty or omit to remove the administrator.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["lockId","active","deleted"],"properties":{"lockId":{"description":"TTLock lock ID (from TTLock API).","type":"number"},"active":{"description":"Whether the lock should be active. Inactive locks are excluded from status checks and notifications.","type":"boolean"},"deleted":{"description":"Whether to soft-delete the lock. Deleted locks are hidden from the list.","type":"boolean"},"administratorContactExternalId":{"description":"External ID of the contact to assign as lock administrator. The administrator receives email notifications for all critical lock events (gateway offline, battery critical, API errors). Pass empty or omit to remove the administrator.","type":"string"}}}}}}}},"/bff/iot-lock/credentials-detail":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"description":"TTLock OAuth2 client ID (app identifier issued by TTLock). Empty string when not set.","type":"string"},"clientSecretIsSet":{"description":"True when a non-empty ttlock_client_secret is stored. The value itself is never returned.","type":"boolean"},"username":{"description":"TTLock account username / e-mail. Empty string when not set.","type":"string"},"passwordIsSet":{"description":"True when a non-empty ttlock_password (MD5) is stored. The value itself is never returned.","type":"boolean"}},"required":["clientId","clientSecretIsSet","username","passwordIsSet"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"clientId":{"description":"TTLock OAuth2 client ID (app identifier issued by TTLock). Empty string when not set.","type":"string"},"clientSecretIsSet":{"description":"True when a non-empty ttlock_client_secret is stored. The value itself is never returned.","type":"boolean"},"username":{"description":"TTLock account username / e-mail. Empty string when not set.","type":"string"},"passwordIsSet":{"description":"True when a non-empty ttlock_password (MD5) is stored. The value itself is never returned.","type":"boolean"}},"required":["clientId","clientSecretIsSet","username","passwordIsSet"]}},"text/plain":{"schema":{"type":"object","properties":{"clientId":{"description":"TTLock OAuth2 client ID (app identifier issued by TTLock). Empty string when not set.","type":"string"},"clientSecretIsSet":{"description":"True when a non-empty ttlock_client_secret is stored. The value itself is never returned.","type":"boolean"},"username":{"description":"TTLock account username / e-mail. Empty string when not set.","type":"string"},"passwordIsSet":{"description":"True when a non-empty ttlock_password (MD5) is stored. The value itself is never returned.","type":"boolean"}},"required":["clientId","clientSecretIsSet","username","passwordIsSet"]}}}}},"operationId":"getBffIot-lockCredentials-detail","tags":["IoT"],"summary":"Get TTLock credentials status","description":"Returns the TTLock OAuth2 credentials currently configured for the authenticated organisation. Non-secret values (clientId, username) are returned in full so the frontend can display and pre-fill them. Secret values (clientSecret, password) are never returned — instead the response contains boolean flags (clientSecretIsSet, passwordIsSet) indicating whether each secret is configured. The auto-managed access and refresh tokens are never exposed by this endpoint."}},"/bff/iot-lock/credentials-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"True if TTLock accepted the credentials and they were persisted.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"True if TTLock accepted the credentials and they were persisted.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"True if TTLock accepted the credentials and they were persisted.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIot-lockCredentials-update","tags":["IoT"],"summary":"Update TTLock account credentials","description":"Verifies a new TTLock OAuth2 credential set against euapi.ttlock.com/oauth2/token and, on success, persists it. Only `password` is required in the body — the other three fields (clientId, clientSecret, username) are optional and fall back to the values already stored in the organisation configuration. This makes the common case of \"my TTLock app password was reset\" a single-field call, without needing to re-enter the clientSecret (which is only obtainable from the TTLock developer portal). Fields that were actually supplied (non-empty) are written back to the config; fields left out are kept as-is. The plain-text password is always MD5-hashed server-side. After a successful OAuth response the new MD5 password plus fresh access and refresh tokens are persisted atomically. Any TTLock-side failure (invalid credentials, invalid client, etc.) is thrown as an Error and surfaced by the standard API error-logging layer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["password"],"properties":{"clientId":{"description":"TTLock OAuth2 client ID (app-level identifier issued by TTLock developer portal). Optional — when omitted or empty, the previously stored value is used. Only send when rotating app credentials; day-to-day password resets do not need it.","type":"string"},"clientSecret":{"description":"TTLock OAuth2 client secret. Optional — when omitted or empty, the previously stored value is used. Only obtainable from the TTLock developer portal, not from the TTLock mobile app, so regular users should not need to enter it.","type":"string"},"username":{"description":"TTLock account username (the e-mail used in the TTLock mobile app). Optional — when omitted or empty, the previously stored value is used. Send only when the TTLock account itself changes.","examples":["alexander.dioszeghy@gmail.com"],"type":"string"},"password":{"description":"TTLock account password in plain text. Required. MD5-hashed server-side before being sent to TTLock and before being stored. Primary field for the common case of recovering after a password change in the TTLock mobile app.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["password"],"properties":{"clientId":{"description":"TTLock OAuth2 client ID (app-level identifier issued by TTLock developer portal). Optional — when omitted or empty, the previously stored value is used. Only send when rotating app credentials; day-to-day password resets do not need it.","type":"string"},"clientSecret":{"description":"TTLock OAuth2 client secret. Optional — when omitted or empty, the previously stored value is used. Only obtainable from the TTLock developer portal, not from the TTLock mobile app, so regular users should not need to enter it.","type":"string"},"username":{"description":"TTLock account username (the e-mail used in the TTLock mobile app). Optional — when omitted or empty, the previously stored value is used. Send only when the TTLock account itself changes.","examples":["alexander.dioszeghy@gmail.com"],"type":"string"},"password":{"description":"TTLock account password in plain text. Required. MD5-hashed server-side before being sent to TTLock and before being stored. Primary field for the common case of recovering after a password change in the TTLock mobile app.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["password"],"properties":{"clientId":{"description":"TTLock OAuth2 client ID (app-level identifier issued by TTLock developer portal). Optional — when omitted or empty, the previously stored value is used. Only send when rotating app credentials; day-to-day password resets do not need it.","type":"string"},"clientSecret":{"description":"TTLock OAuth2 client secret. Optional — when omitted or empty, the previously stored value is used. Only obtainable from the TTLock developer portal, not from the TTLock mobile app, so regular users should not need to enter it.","type":"string"},"username":{"description":"TTLock account username (the e-mail used in the TTLock mobile app). Optional — when omitted or empty, the previously stored value is used. Send only when the TTLock account itself changes.","examples":["alexander.dioszeghy@gmail.com"],"type":"string"},"password":{"description":"TTLock account password in plain text. Required. MD5-hashed server-side before being sent to TTLock and before being stored. Primary field for the common case of recovering after a password change in the TTLock mobile app.","type":"string"}}}}}}}},"/bff/iot-lock/queue-stats":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"depth":{"description":"Unprocessed rows still eligible for retry (ttl > 0).","type":"number"},"dead":{"description":"Unprocessed rows that exhausted retries (ttl = 0). Manual action required.","type":"number"},"calls24h":{"description":"All queue rows inserted in the last 24 hours.","type":"number"},"retries24h":{"description":"Rows in the last 24 hours retried at least once.","type":"number"},"errors24h":{"description":"Rows in the last 24 hours with a non-null error_response.","type":"number"}},"required":["depth","dead","calls24h","retries24h","errors24h"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"depth":{"description":"Unprocessed rows still eligible for retry (ttl > 0).","type":"number"},"dead":{"description":"Unprocessed rows that exhausted retries (ttl = 0). Manual action required.","type":"number"},"calls24h":{"description":"All queue rows inserted in the last 24 hours.","type":"number"},"retries24h":{"description":"Rows in the last 24 hours retried at least once.","type":"number"},"errors24h":{"description":"Rows in the last 24 hours with a non-null error_response.","type":"number"}},"required":["depth","dead","calls24h","retries24h","errors24h"]}},"text/plain":{"schema":{"type":"object","properties":{"depth":{"description":"Unprocessed rows still eligible for retry (ttl > 0).","type":"number"},"dead":{"description":"Unprocessed rows that exhausted retries (ttl = 0). Manual action required.","type":"number"},"calls24h":{"description":"All queue rows inserted in the last 24 hours.","type":"number"},"retries24h":{"description":"Rows in the last 24 hours retried at least once.","type":"number"},"errors24h":{"description":"Rows in the last 24 hours with a non-null error_response.","type":"number"}},"required":["depth","dead","calls24h","retries24h","errors24h"]}}}}},"operationId":"getBffIot-lockQueue-stats","tags":["IoT"],"summary":"TTLock API queue health","description":"Aggregate counters over `iot__ttlock_queue` scoped to the caller organisation. Powers the small \"API: 12 calls/min, 2 retry, 0 dead\" widget in admin. Values are point-in-time; the queue itself is drained by the medium-priority cron worker `processTTLockQueue`."}},"/bff/iot-lock/activity-timeline":{"get":{"parameters":[{"description":"TTLock lock ID (from TTLock API).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"lockId","required":true},{"description":"ISO timestamp. Defaults to 7 days ago.","schema":{"type":"string"},"in":"query","name":"since","required":false},{"description":"ISO timestamp. Defaults to now.","schema":{"type":"string"},"in":"query","name":"until","required":false},{"description":"Comma-separated activity kinds. One of: unlock_attempt, api_call, passcode_op, gateway_event, battery_event, system_log.","schema":{"type":"string"},"in":"query","name":"kinds","required":false},{"description":"Comma-separated severity levels. One of: info, success, error, warning, critical.","schema":{"type":"string"},"in":"query","name":"levels","required":false},{"description":"Page size, default 100, max 500.","schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Offset for pagination, default 0.","schema":{"type":"string"},"in":"query","name":"offset","required":false}],"operationId":"getBffIot-lockActivity-timeline","tags":["IoT"],"summary":"Per-lock activity timeline","description":"Unified time-ordered feed of everything that has happened with a given lock: unlock attempts, TTLock API calls (failed only), passcode operations (create / delete), gateway online/offline transitions, battery readings, and system log entries scoped to TTLock components. Powers the Activity log tab on the lock detail page. Result is paginated; default window is the last 7 days.","responses":{"200":{}}}},"/bff/iot-lock/lock-reliability-detail":{"get":{"parameters":[{"description":"TTLock lock ID (from TTLock API).","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"lockId","required":true},{"description":"Reliability window in days — one of 7, 30, 90. Defaults to 30.","examples":["30"],"schema":{"type":"string"},"in":"query","name":"windowDays","required":false}],"operationId":"getBffIot-lockLock-reliability-detail","tags":["IoT"],"summary":"Per-lock reliability detail","description":"Returns aggregated reliability metrics for a single lock scoped to the requested window (7/30/90 days). Includes 30-day (or windowed) uptime %, current outage state, outage episodes, per-day availability bars, longest outage, MTBF, MTTR, battery time-series and organisation-wide TTLock API hourly load for the last 24 h. Powers the Reliability tab of the lock detail page in admin.","responses":{"200":{}}}},"/bff/iot-lock/health-overview":{"get":{"operationId":"getBffIot-lockHealth-overview","tags":["IoT"],"summary":"Organisation-wide lock health","description":"Counters and small \"top-N worst\" subsets across all active, non-deleted locks of the caller organisation: total/online/offline, backup status buckets (ok / expiring_soon / missing / expired / ignored), low and critical battery lists, currently open outages, worst 5 uptime locks, plus 24h TTLock API health.","responses":{"200":{}}}},"/bff/member/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Full-text search across member name and email.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false}],"operationId":"getBffMemberList","tags":["Member"],"summary":"List organisation members","description":"Returns a paginated list of organisation members with their roles, activity status and avatar info. Includes pending invitations (members with `isPending: true` and `id` prefixed with `pending-`).","responses":{"200":{}}}},"/bff/member/detail":{"get":{"parameters":[{"description":"Identifier of the member. For active members it is `shop__contact.external_id`; for pending invitations it is `pending-<token>`.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffMemberDetail","tags":["Member"],"summary":"Get member detail","description":"Returns detailed information about a specific organisation member. Includes user profile data, contact information, activity status, and timezone settings. Pending invitations are also supported — pass `pending-<token>` as the `id`.","responses":{"200":{}}}},"/bff/member/profile-overview":{"get":{"parameters":[{"description":"Member wire id (`shop__contact.external_id`).","schema":{"type":"string","maxLength":32},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isSelf":{"type":"boolean"},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentPath":{"type":"array","items":{"type":"object","required":["id","name","color","leadMemberId","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"chatRoomId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"departmentLead":{"nullable":true,"anyOf":[{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"managerChain":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"directReports":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"totalReportCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"peers":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"peerCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ledDepartments":{"type":"array","items":{"type":"object","required":["id","name","color","leadMemberId","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"chatRoomId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","userId","isSelf","headline","bio","location","workingHours","skills","awayUntil","awayMessage","timezone","departmentPath","departmentLead","managerChain","directReports","totalReportCount","peers","peerCount","ledDepartments"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isSelf":{"type":"boolean"},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentPath":{"type":"array","items":{"type":"object","required":["id","name","color","leadMemberId","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"chatRoomId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"departmentLead":{"nullable":true,"anyOf":[{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"managerChain":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"directReports":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"totalReportCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"peers":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"peerCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ledDepartments":{"type":"array","items":{"type":"object","required":["id","name","color","leadMemberId","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"chatRoomId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","userId","isSelf","headline","bio","location","workingHours","skills","awayUntil","awayMessage","timezone","departmentPath","departmentLead","managerChain","directReports","totalReportCount","peers","peerCount","ledDepartments"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isSelf":{"type":"boolean"},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentPath":{"type":"array","items":{"type":"object","required":["id","name","color","leadMemberId","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"chatRoomId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"departmentLead":{"nullable":true,"anyOf":[{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"managerChain":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"directReports":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"totalReportCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"peers":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentName"],"properties":{"id":{"type":"string"},"userId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"peerCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ledDepartments":{"type":"array","items":{"type":"object","required":["id","name","color","leadMemberId","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"chatRoomId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","userId","isSelf","headline","bio","location","workingHours","skills","awayUntil","awayMessage","timezone","departmentPath","departmentLead","managerChain","directReports","totalReportCount","peers","peerCount","ledDepartments"]}}}}},"operationId":"getBffMemberProfile-overview","tags":["Member"],"summary":"Intranet profile of a member","description":"Public profile (headline, bio, location, working hours, skills), away period, timezone and the organisation neighbourhood (department path + lead, manager chain, direct reports, peers, led departments)."}},"/bff/member/shared":{"get":{"parameters":[{"description":"Member wire id (`shop__contact.external_id`).","schema":{"type":"string","maxLength":32},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"rooms":{"type":"array","items":{"type":"object","required":["id","type","title","participantCount","lastMessageDate","unreadCount","isDepartmentChannel"],"properties":{"id":{"type":"string"},"type":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participantCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDepartmentChannel":{"type":"boolean"}}}},"files":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage","insertedDate","source","fromThem"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"insertedDate":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["kind","roomId","roomTitle","position"],"properties":{"kind":{"const":"chat","type":"string"},"roomId":{"type":"string"},"roomTitle":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["kind","postId"],"properties":{"kind":{"const":"post","type":"string"},"postId":{"type":"string"}}}]},"fromThem":{"type":"boolean"}}}}},"required":["rooms","files"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"rooms":{"type":"array","items":{"type":"object","required":["id","type","title","participantCount","lastMessageDate","unreadCount","isDepartmentChannel"],"properties":{"id":{"type":"string"},"type":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participantCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDepartmentChannel":{"type":"boolean"}}}},"files":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage","insertedDate","source","fromThem"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"insertedDate":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["kind","roomId","roomTitle","position"],"properties":{"kind":{"const":"chat","type":"string"},"roomId":{"type":"string"},"roomTitle":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["kind","postId"],"properties":{"kind":{"const":"post","type":"string"},"postId":{"type":"string"}}}]},"fromThem":{"type":"boolean"}}}}},"required":["rooms","files"]}},"text/plain":{"schema":{"type":"object","properties":{"rooms":{"type":"array","items":{"type":"object","required":["id","type","title","participantCount","lastMessageDate","unreadCount","isDepartmentChannel"],"properties":{"id":{"type":"string"},"type":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participantCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDepartmentChannel":{"type":"boolean"}}}},"files":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage","insertedDate","source","fromThem"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"insertedDate":{"type":"string"},"source":{"anyOf":[{"type":"object","required":["kind","roomId","roomTitle","position"],"properties":{"kind":{"const":"chat","type":"string"},"roomId":{"type":"string"},"roomTitle":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"object","required":["kind","postId"],"properties":{"kind":{"const":"post","type":"string"},"postId":{"type":"string"}}}]},"fromThem":{"type":"boolean"}}}}},"required":["rooms","files"]}}}}},"operationId":"getBffMemberShared","tags":["Member"],"summary":"What I share with a colleague","description":"Team chat rooms where both people are active participants, files exchanged there and attachments of the colleague's wall posts (newest 60)."}},"/bff/member/kudos":{"get":{"parameters":[{"description":"Member wire id.","schema":{"type":"string","maxLength":32},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"byValue":{"type":"array","items":{"type":"object","required":["value","count"],"properties":{"value":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"items":{"type":"array","items":{"type":"object","required":["id","value","message","insertedDate","from","postId","canDelete"],"properties":{"id":{"type":"string"},"value":{"type":"string"},"message":{"type":"string"},"insertedDate":{"type":"string"},"from":{"type":"object","required":["id","fullName","jobTitle","avatarUrl"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"postId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canDelete":{"type":"boolean"}}}}},"required":["total","byValue","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"byValue":{"type":"array","items":{"type":"object","required":["value","count"],"properties":{"value":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"items":{"type":"array","items":{"type":"object","required":["id","value","message","insertedDate","from","postId","canDelete"],"properties":{"id":{"type":"string"},"value":{"type":"string"},"message":{"type":"string"},"insertedDate":{"type":"string"},"from":{"type":"object","required":["id","fullName","jobTitle","avatarUrl"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"postId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canDelete":{"type":"boolean"}}}}},"required":["total","byValue","items"]}},"text/plain":{"schema":{"type":"object","properties":{"total":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"byValue":{"type":"array","items":{"type":"object","required":["value","count"],"properties":{"value":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"items":{"type":"array","items":{"type":"object","required":["id","value","message","insertedDate","from","postId","canDelete"],"properties":{"id":{"type":"string"},"value":{"type":"string"},"message":{"type":"string"},"insertedDate":{"type":"string"},"from":{"type":"object","required":["id","fullName","jobTitle","avatarUrl"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"postId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canDelete":{"type":"boolean"}}}}},"required":["total","byValue","items"]}}}}},"operationId":"getBffMemberKudos","tags":["Member"],"summary":"Kudos received by a member"}},"/bff/member/kudos-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffMemberKudos-create","tags":["Member"],"summary":"Give kudos to a colleague (optionally announced on the wall)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["memberId","value","message"],"properties":{"memberId":{"maxLength":32,"type":"string"},"value":{"maxLength":32,"type":"string"},"message":{"minLength":1,"maxLength":500,"type":"string"},"shareToWall":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["memberId","value","message"],"properties":{"memberId":{"maxLength":32,"type":"string"},"value":{"maxLength":32,"type":"string"},"message":{"minLength":1,"maxLength":500,"type":"string"},"shareToWall":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["memberId","value","message"],"properties":{"memberId":{"maxLength":32,"type":"string"},"value":{"maxLength":32,"type":"string"},"message":{"minLength":1,"maxLength":500,"type":"string"},"shareToWall":{"type":"boolean"}}}}}}}},"/bff/member/kudos-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberKudos-delete","tags":["Member"],"summary":"Delete kudos (author or people manager)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"maxLength":16,"type":"string"}}}}}}}},"/bff/member/invite-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"status":{"const":"pending","type":"string"},"memberId":{"description":"Pending member id (`pending-<token>`) — for routing to detail.","type":"string"},"userExists":{"description":"True when the invitee already had a `cas__user` and received the accept-flavoured e-mail.","type":"boolean"},"replacedExistingToken":{"description":"True when a previous pending invite for the same (org, email) was overwritten; the old token is now invalid.","type":"boolean"}},"required":["success","status","memberId","userExists","replacedExistingToken"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"status":{"const":"pending","type":"string"},"memberId":{"description":"Pending member id (`pending-<token>`) — for routing to detail.","type":"string"},"userExists":{"description":"True when the invitee already had a `cas__user` and received the accept-flavoured e-mail.","type":"boolean"},"replacedExistingToken":{"description":"True when a previous pending invite for the same (org, email) was overwritten; the old token is now invalid.","type":"boolean"}},"required":["success","status","memberId","userExists","replacedExistingToken"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"status":{"const":"pending","type":"string"},"memberId":{"description":"Pending member id (`pending-<token>`) — for routing to detail.","type":"string"},"userExists":{"description":"True when the invitee already had a `cas__user` and received the accept-flavoured e-mail.","type":"boolean"},"replacedExistingToken":{"description":"True when a previous pending invite for the same (org, email) was overwritten; the old token is now invalid.","type":"boolean"}},"required":["success","status","memberId","userExists","replacedExistingToken"]}}}}},"operationId":"postBffMemberInvite-email","tags":["Member"],"summary":"Invite member by email","description":"Sends an invitation e-mail to join the organisation. Every invite becomes a pending row in `cas__user_request_member` and is only materialised into an active member once the invitee explicitly accepts (via /signup/member?token=… if new to the platform, or /onboarding if they already have a BKH account). Pre-granted permissions / roles ride on the pending row and are applied at acceptance; the admin may still edit them in the meantime.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Optional first name pre-filled on the registration form.","maxLength":128,"type":"string"},"lastName":{"description":"Optional last name pre-filled on the registration form.","maxLength":128,"type":"string"},"permissionCodes":{"description":"Permission codes to grant when the invitation is accepted.","type":"array","items":{"type":"string"}},"roleCodes":{"description":"Role codes to grant when the invitation is accepted.","type":"array","items":{"type":"string"}},"description":{"description":"Internal note about this invitation.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Optional first name pre-filled on the registration form.","maxLength":128,"type":"string"},"lastName":{"description":"Optional last name pre-filled on the registration form.","maxLength":128,"type":"string"},"permissionCodes":{"description":"Permission codes to grant when the invitation is accepted.","type":"array","items":{"type":"string"}},"roleCodes":{"description":"Role codes to grant when the invitation is accepted.","type":"array","items":{"type":"string"}},"description":{"description":"Internal note about this invitation.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Optional first name pre-filled on the registration form.","maxLength":128,"type":"string"},"lastName":{"description":"Optional last name pre-filled on the registration form.","maxLength":128,"type":"string"},"permissionCodes":{"description":"Permission codes to grant when the invitation is accepted.","type":"array","items":{"type":"string"}},"roleCodes":{"description":"Role codes to grant when the invitation is accepted.","type":"array","items":{"type":"string"}},"description":{"description":"Internal note about this invitation.","type":"string"}}}}}}}},"/bff/member/resend-invite":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberResend-invite","tags":["Member"],"summary":"Resend a pending invitation","description":"Sends the invitation e-mail again and resets its expiration timer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Pending invitation id (`pending-<token>`).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Pending invitation id (`pending-<token>`).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Pending invitation id (`pending-<token>`).","type":"string"}}}}}}}},"/bff/member/cancel-invite":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberCancel-invite","tags":["Member"],"summary":"Cancel a pending invitation","description":"Deletes the pending invitation, invalidating the registration link in the e-mail that was sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Pending invitation id (`pending-<token>`).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Pending invitation id (`pending-<token>`).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Pending invitation id (`pending-<token>`).","type":"string"}}}}}}}},"/bff/member/confirm-invite":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberConfirm-invite","tags":["Member"],"summary":"Confirm member invitation","description":"Completes the member invitation flow — creates the user account and links them to the organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token","locale","firstName","lastName","password","checkboxTerms","checkboxMarketing"],"properties":{"token":{"description":"Invitation token from the email link.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"firstName":{"description":"New member first name.","examples":["Jan"],"type":"string"},"lastName":{"description":"New member last name.","examples":["Novák"],"type":"string"},"password":{"description":"Account password (min 8 chars).","minLength":8,"type":"string"},"checkboxTerms":{"description":"Accepted terms of service.","type":"boolean"},"checkboxMarketing":{"description":"Accepted marketing communications.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["token","locale","firstName","lastName","password","checkboxTerms","checkboxMarketing"],"properties":{"token":{"description":"Invitation token from the email link.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"firstName":{"description":"New member first name.","examples":["Jan"],"type":"string"},"lastName":{"description":"New member last name.","examples":["Novák"],"type":"string"},"password":{"description":"Account password (min 8 chars).","minLength":8,"type":"string"},"checkboxTerms":{"description":"Accepted terms of service.","type":"boolean"},"checkboxMarketing":{"description":"Accepted marketing communications.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["token","locale","firstName","lastName","password","checkboxTerms","checkboxMarketing"],"properties":{"token":{"description":"Invitation token from the email link.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"firstName":{"description":"New member first name.","examples":["Jan"],"type":"string"},"lastName":{"description":"New member last name.","examples":["Novák"],"type":"string"},"password":{"description":"Account password (min 8 chars).","minLength":8,"type":"string"},"checkboxTerms":{"description":"Accepted terms of service.","type":"boolean"},"checkboxMarketing":{"description":"Accepted marketing communications.","type":"boolean"}}}}}}}},"/bff/member/invite-detail":{"get":{"parameters":[{"description":"Invitation token from the email link.","schema":{"type":"string"},"in":"query","name":"token","required":true}],"operationId":"getBffMemberInvite-detail","tags":["Member"],"summary":"Get invitation details","description":"Returns details about a pending member invitation — organisation name, invitee email, etc.","responses":{"200":{}}}},"/bff/member/permissions":{"get":{"parameters":[{"description":"Identifier of the member (`shop__contact.external_id` for active members, `pending-<token>` for pending invitations).","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffMemberPermissions","tags":["Member"],"summary":"Get member permissions","description":"Returns all permissions assigned to a specific member. Includes both direct permissions and role-based permissions. Each permission shows its source (direct assignment or via role). For pending invitations, returns the pre-granted permissions stored on the invitation row.","responses":{"200":{}}}},"/bff/member/available-permissions":{"get":{"parameters":[{"examples":["en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"operationId":"getBffMemberAvailable-permissions","tags":["Member"],"summary":"Get available permissions and roles","description":"Returns all available permissions and roles in the system that can be assigned to members. Use this to populate permission/role selection UI when editing member permissions. The optional `locale` query param translates permission labels; unrecognised locales fall back to the DB label.","responses":{"200":{}}}},"/bff/member/save-permissions":{"post":{"parameters":[],"responses":{"200":{"description":"Permissions saved successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberSave-permissions","tags":["Member"],"summary":"Save member permissions","description":"Updates the permissions and roles assigned to a member. For active members this replaces all existing direct permissions and role assignments. For pending invitations the values are stored on the invitation row and applied when the invitee confirms.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Identifier of the member (`shop__contact.external_id` for active members, `pending-<token>` for pending invitations).","type":"string"},"permissionCodes":{"description":"Legacy array of permission codes (no expiry). Ignored if `permissionGrants` is set.","type":"array","items":{"description":"Permission code.","type":"string"}},"roleCodes":{"description":"Legacy array of role codes (no expiry). Ignored if `roleGrants` is set.","type":"array","items":{"description":"Role code.","type":"string"}},"permissionGrants":{"description":"Granular permission grants with optional per-code expiry.","type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"validTo":{"anyOf":[{"description":"ISO timestamp when the grant expires.","type":"string"},{"type":"null"}]}}}},"roleGrants":{"description":"Granular role grants with optional per-code expiry.","type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Identifier of the member (`shop__contact.external_id` for active members, `pending-<token>` for pending invitations).","type":"string"},"permissionCodes":{"description":"Legacy array of permission codes (no expiry). Ignored if `permissionGrants` is set.","type":"array","items":{"description":"Permission code.","type":"string"}},"roleCodes":{"description":"Legacy array of role codes (no expiry). Ignored if `roleGrants` is set.","type":"array","items":{"description":"Role code.","type":"string"}},"permissionGrants":{"description":"Granular permission grants with optional per-code expiry.","type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"validTo":{"anyOf":[{"description":"ISO timestamp when the grant expires.","type":"string"},{"type":"null"}]}}}},"roleGrants":{"description":"Granular role grants with optional per-code expiry.","type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Identifier of the member (`shop__contact.external_id` for active members, `pending-<token>` for pending invitations).","type":"string"},"permissionCodes":{"description":"Legacy array of permission codes (no expiry). Ignored if `permissionGrants` is set.","type":"array","items":{"description":"Permission code.","type":"string"}},"roleCodes":{"description":"Legacy array of role codes (no expiry). Ignored if `roleGrants` is set.","type":"array","items":{"description":"Role code.","type":"string"}},"permissionGrants":{"description":"Granular permission grants with optional per-code expiry.","type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"validTo":{"anyOf":[{"description":"ISO timestamp when the grant expires.","type":"string"},{"type":"null"}]}}}},"roleGrants":{"description":"Granular role grants with optional per-code expiry.","type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}}}},"/bff/member/block":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberBlock","tags":["Member"],"summary":"Block/unblock member","description":"Toggles the blocked state of a member. Blocked members cannot access the organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"}}}}}}}},"/bff/member/activity":{"get":{"parameters":[{"description":"External member id (shop__contact.external_id) of the timeline owner.","schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"ISO timestamp; rows strictly older than this are returned.","schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"description":"Page size, 1..100, default 30.","schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Comma-separated component filter (security,order,…).","schema":{"type":"string"},"in":"query","name":"components","required":false},{"description":"Minimum severity: info | success | warning | error | critical.","schema":{"type":"string"},"in":"query","name":"minLevel","required":false}],"operationId":"getBffMemberActivity","tags":["Member"],"summary":"Member activity timeline","responses":{"200":{}}}},"/bff/member/bff-usage":{"get":{"parameters":[{"description":"Identifier of the member. For active members it is `shop__contact.external_id`; for pending invitations it is `pending-<token>`.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"isPending":{"description":"True when the id refers to a pending invitation (no usage history exists).","type":"boolean"},"usageList":{"description":"Daily usage rows for the last 90 days, ordered by date ascending.","type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"description":"Calendar day (organisation-local date).","anyOf":[{"description":"Calendar day (organisation-local date).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"count":{"description":"BFF requests attributed to the member on that day.","type":"number"}}}},"totalRequests":{"description":"Sum of `count` over the 90-day window.","type":"number"},"todayCount":{"description":"BFF requests attributed to the member today (up to the last flush).","type":"number"},"avgDaily":{"description":"Average requests per observed day in the window.","type":"number"},"peakCount":{"description":"Highest single-day count in the window.","type":"number"},"peakDate":{"description":"Date of the peak day, or null when there is no usage.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"last7DaysTotal":{"description":"Sum for the newest 7 days in the window.","type":"number"},"previous7DaysTotal":{"description":"Sum for the 7 days preceding the newest 7.","type":"number"}},"required":["isPending","usageList","totalRequests","todayCount","avgDaily","peakCount","peakDate","last7DaysTotal","previous7DaysTotal"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"isPending":{"description":"True when the id refers to a pending invitation (no usage history exists).","type":"boolean"},"usageList":{"description":"Daily usage rows for the last 90 days, ordered by date ascending.","type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"description":"Calendar day (organisation-local date).","anyOf":[{"description":"Calendar day (organisation-local date).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"count":{"description":"BFF requests attributed to the member on that day.","type":"number"}}}},"totalRequests":{"description":"Sum of `count` over the 90-day window.","type":"number"},"todayCount":{"description":"BFF requests attributed to the member today (up to the last flush).","type":"number"},"avgDaily":{"description":"Average requests per observed day in the window.","type":"number"},"peakCount":{"description":"Highest single-day count in the window.","type":"number"},"peakDate":{"description":"Date of the peak day, or null when there is no usage.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"last7DaysTotal":{"description":"Sum for the newest 7 days in the window.","type":"number"},"previous7DaysTotal":{"description":"Sum for the 7 days preceding the newest 7.","type":"number"}},"required":["isPending","usageList","totalRequests","todayCount","avgDaily","peakCount","peakDate","last7DaysTotal","previous7DaysTotal"]}},"text/plain":{"schema":{"type":"object","properties":{"isPending":{"description":"True when the id refers to a pending invitation (no usage history exists).","type":"boolean"},"usageList":{"description":"Daily usage rows for the last 90 days, ordered by date ascending.","type":"array","items":{"type":"object","required":["date","count"],"properties":{"date":{"description":"Calendar day (organisation-local date).","anyOf":[{"description":"Calendar day (organisation-local date).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"count":{"description":"BFF requests attributed to the member on that day.","type":"number"}}}},"totalRequests":{"description":"Sum of `count` over the 90-day window.","type":"number"},"todayCount":{"description":"BFF requests attributed to the member today (up to the last flush).","type":"number"},"avgDaily":{"description":"Average requests per observed day in the window.","type":"number"},"peakCount":{"description":"Highest single-day count in the window.","type":"number"},"peakDate":{"description":"Date of the peak day, or null when there is no usage.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"last7DaysTotal":{"description":"Sum for the newest 7 days in the window.","type":"number"},"previous7DaysTotal":{"description":"Sum for the 7 days preceding the newest 7.","type":"number"}},"required":["isPending","usageList","totalRequests","todayCount","avgDaily","peakCount","peakDate","last7DaysTotal","previous7DaysTotal"]}}}}},"operationId":"getBffMemberBff-usage","tags":["Member"],"summary":"Per-day BFF request counts for one member","description":"Returns the daily count of authenticated /bff/* requests this member has made over the last 90 days, sourced from `cas__member_usage_daily` (buffered in Redis, drained by `flushMemberBffUsageToDb`). Pending invitations always return an empty response. Powers the chart on the member Activity tab."}},"/bff/member/presence-summary":{"get":{"parameters":[{"description":"External member id (or `pending-<token>` for invitations — returns empty).","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffMemberPresence-summary","tags":["Member"],"summary":"Member presence summary (hero + 90d aggregates)","description":"One-shot payload for the member Aktivita tab: current status + last-known geo (hero card), 90-day daily active minutes, 30/90-day city+country distincts and top-5 lists, connection-type breakdown (wired/mobile/proxy/tor), and hour-of-day × day-of-week heatmap. Sourced from cas__organisation_member_presence_session with geo joins. Polled every ~30 s by admin.","responses":{"200":{}}}},"/bff/member/presence-sessions":{"get":{"parameters":[{"description":"External member id.","schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"ISO opened_at from the previous page; rows strictly older are returned.","schema":{"type":"string"},"in":"query","name":"cursor","required":false},{"description":"Page size, 1..100, default 30.","schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffMemberPresence-sessions","tags":["Member"],"summary":"Paginated presence-session timeline for one member","description":"Returns cursor-paginated rows from cas__organisation_member_presence_session for the audit trail on the member Aktivita tab (one row = a contiguous burst of heartbeats from a single geo location).","responses":{"200":{}}}},"/bff/member/assigned-work":{"get":{"parameters":[{"description":"External member id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffMemberAssigned-work","tags":["Member"],"summary":"Open work assigned to one member (counts + 3 examples per surface)","responses":{"200":{}}}},"/bff/member/tags":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberTags","tags":["Member"],"summary":"Replace the free-form tag list on a member","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","tags"],"properties":{"id":{"description":"External member id.","type":"string"},"tags":{"description":"Replacement tag list; pass [] to clear.","type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","tags"],"properties":{"id":{"description":"External member id.","type":"string"},"tags":{"description":"Replacement tag list; pass [] to clear.","type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["id","tags"],"properties":{"id":{"description":"External member id.","type":"string"},"tags":{"description":"Replacement tag list; pass [] to clear.","type":"array","items":{"type":"string"}}}}}}}}},"/bff/member/ai-settings-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","required":["id","fullName","email","defaultRole","aiDescription","jobTitle"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"email":{"type":"string"},"defaultRole":{"nullable":true,"anyOf":[{"anyOf":[{"const":"ceo","type":"string"},{"const":"cto","type":"string"},{"const":"marketing","type":"string"},{"const":"support","type":"string"},{"const":"it","type":"string"},{"const":"sales","type":"string"}]},{"type":"null"}]},"aiDescription":{"type":"string"},"jobTitle":{"type":"string"}}}}},"required":["members"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","required":["id","fullName","email","defaultRole","aiDescription","jobTitle"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"email":{"type":"string"},"defaultRole":{"nullable":true,"anyOf":[{"anyOf":[{"const":"ceo","type":"string"},{"const":"cto","type":"string"},{"const":"marketing","type":"string"},{"const":"support","type":"string"},{"const":"it","type":"string"},{"const":"sales","type":"string"}]},{"type":"null"}]},"aiDescription":{"type":"string"},"jobTitle":{"type":"string"}}}}},"required":["members"]}},"text/plain":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","required":["id","fullName","email","defaultRole","aiDescription","jobTitle"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"email":{"type":"string"},"defaultRole":{"nullable":true,"anyOf":[{"anyOf":[{"const":"ceo","type":"string"},{"const":"cto","type":"string"},{"const":"marketing","type":"string"},{"const":"support","type":"string"},{"const":"it","type":"string"},{"const":"sales","type":"string"}]},{"type":"null"}]},"aiDescription":{"type":"string"},"jobTitle":{"type":"string"}}}}},"required":["members"]}}}}},"operationId":"getBffMemberAi-settings-list","tags":["Member"],"summary":"List active members with their AI-triage settings","description":"Compact list for the /issue AI-settings modal — one row per active (non-blocked) member with the two fields the issue-triage classifier reads: `defaultRole` and `aiDescription`. Members with an empty `aiDescription` are still returned so the operator can fill one in."}},"/bff/member/issue-notification-opt-out":{"get":{"parameters":[{"description":"External member id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"optOut":{"type":"array","items":{"anyOf":[{"const":"issue_created","type":"string"},{"const":"issue_assigned","type":"string"},{"const":"customer_reply","type":"string"},{"const":"operator_reply","type":"string"}]}},"canEdit":{"type":"boolean"}},"required":["optOut","canEdit"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"optOut":{"type":"array","items":{"anyOf":[{"const":"issue_created","type":"string"},{"const":"issue_assigned","type":"string"},{"const":"customer_reply","type":"string"},{"const":"operator_reply","type":"string"}]}},"canEdit":{"type":"boolean"}},"required":["optOut","canEdit"]}},"text/plain":{"schema":{"type":"object","properties":{"optOut":{"type":"array","items":{"anyOf":[{"const":"issue_created","type":"string"},{"const":"issue_assigned","type":"string"},{"const":"customer_reply","type":"string"},{"const":"operator_reply","type":"string"}]}},"canEdit":{"type":"boolean"}},"required":["optOut","canEdit"]}}}}},"operationId":"getBffMemberIssue-notification-opt-out","tags":["Member"],"summary":"Get personal issue e-mail opt-outs of a member","description":"BIZKIT-124: events the member does not want internal ticket e-mails for. `canEdit` = the caller is the member themself or holds `module-members`."},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberIssue-notification-opt-out","tags":["Member"],"summary":"Save personal issue e-mail opt-outs of a member","description":"BIZKIT-124: the member stops getting internal ticket e-mails for the listed events. It can only narrow what the organisation rules send. Allowed for the member themself or with `module-members`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","optOut"],"properties":{"id":{"description":"External member id.","type":"string"},"optOut":{"maxItems":10,"type":"array","items":{"anyOf":[{"const":"issue_created","type":"string"},{"const":"issue_assigned","type":"string"},{"const":"customer_reply","type":"string"},{"const":"operator_reply","type":"string"}]}}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","optOut"],"properties":{"id":{"description":"External member id.","type":"string"},"optOut":{"maxItems":10,"type":"array","items":{"anyOf":[{"const":"issue_created","type":"string"},{"const":"issue_assigned","type":"string"},{"const":"customer_reply","type":"string"},{"const":"operator_reply","type":"string"}]}}}}},"text/plain":{"schema":{"type":"object","required":["id","optOut"],"properties":{"id":{"description":"External member id.","type":"string"},"optOut":{"maxItems":10,"type":"array","items":{"anyOf":[{"const":"issue_created","type":"string"},{"const":"issue_assigned","type":"string"},{"const":"customer_reply","type":"string"},{"const":"operator_reply","type":"string"}]}}}}}}}}},"/bff/member/save-ai-settings":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberSave-ai-settings","tags":["Member"],"summary":"Update AI-triage settings on a member (role, description, job title)","description":"Persists the three per-member fields on `cas__organisation_member` edited together from the /issue AI-settings modal: `defaultRole` and `aiDescription` (consumed by `selectMemberAssigneeCandidates` when the AI issue-triage agent decides who owns a new ticket) plus `jobTitle` (customer-facing label rendered on outbound e-mails). The modal batches all three because the operator typically curates the whole member profile in one pass; the standalone inline edit on the member profile uses `/save-job-title` instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","defaultRole","jobTitle"],"properties":{"id":{"description":"External member id.","type":"string"},"defaultRole":{"nullable":true,"anyOf":[{"description":"Loose organisational role the AI issue-triage agent uses when picking an assignee. Pass `null` to clear.","anyOf":[{"const":"ceo","type":"string"},{"const":"cto","type":"string"},{"const":"marketing","type":"string"},{"const":"support","type":"string"},{"const":"it","type":"string"},{"const":"sales","type":"string"}]},{"type":"null"}]},"aiDescription":{"maxLength":2000,"description":"Free-form description of what this member does. Fed to the AI agent alongside the role. Pass an empty string / omit to clear.","type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"maxLength":64,"description":"Human-facing job title rendered in reporter-visible e-mails and the sidebar member widget. Empty string / null clears the field. Required on this endpoint (the issue AI-settings modal always sends all three fields together); use `/save-job-title` for standalone edits.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","defaultRole","jobTitle"],"properties":{"id":{"description":"External member id.","type":"string"},"defaultRole":{"nullable":true,"anyOf":[{"description":"Loose organisational role the AI issue-triage agent uses when picking an assignee. Pass `null` to clear.","anyOf":[{"const":"ceo","type":"string"},{"const":"cto","type":"string"},{"const":"marketing","type":"string"},{"const":"support","type":"string"},{"const":"it","type":"string"},{"const":"sales","type":"string"}]},{"type":"null"}]},"aiDescription":{"maxLength":2000,"description":"Free-form description of what this member does. Fed to the AI agent alongside the role. Pass an empty string / omit to clear.","type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"maxLength":64,"description":"Human-facing job title rendered in reporter-visible e-mails and the sidebar member widget. Empty string / null clears the field. Required on this endpoint (the issue AI-settings modal always sends all three fields together); use `/save-job-title` for standalone edits.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","defaultRole","jobTitle"],"properties":{"id":{"description":"External member id.","type":"string"},"defaultRole":{"nullable":true,"anyOf":[{"description":"Loose organisational role the AI issue-triage agent uses when picking an assignee. Pass `null` to clear.","anyOf":[{"const":"ceo","type":"string"},{"const":"cto","type":"string"},{"const":"marketing","type":"string"},{"const":"support","type":"string"},{"const":"it","type":"string"},{"const":"sales","type":"string"}]},{"type":"null"}]},"aiDescription":{"maxLength":2000,"description":"Free-form description of what this member does. Fed to the AI agent alongside the role. Pass an empty string / omit to clear.","type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"maxLength":64,"description":"Human-facing job title rendered in reporter-visible e-mails and the sidebar member widget. Empty string / null clears the field. Required on this endpoint (the issue AI-settings modal always sends all three fields together); use `/save-job-title` for standalone edits.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/member/save-job-title":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberSave-job-title","tags":["Member"],"summary":"Update the human-facing job title on a member","description":"Sets `cas__organisation_member.job_title`. Independent from the AI-triage `defaultRole` — that one is a controlled enum for the assign-agent, this one is free-form and shown to humans (sidebar member widget, member detail).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External member id.","type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"maxLength":64,"description":"Human-facing job title inside the org. Pass an empty string or null to clear.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External member id.","type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"maxLength":64,"description":"Human-facing job title inside the org. Pass an empty string or null to clear.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External member id.","type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"maxLength":64,"description":"Human-facing job title inside the org. Pass an empty string or null to clear.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/member/save-description":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberSave-description","tags":["Member"],"summary":"Update the internal + public description on a member","description":"Sets `cas__organisation_member.description` (internal, admin-only) and `description_public` (short bio shown to teammates). Both are optional; passing null or an empty string clears the respective field.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External member id.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"description":"Internal member description — visible only to organisation admins. Pass empty string / null to clear.","type":"string"},{"type":"null"}]},"descriptionPublic":{"nullable":true,"anyOf":[{"maxLength":500,"description":"Short public bio — visible to teammates on the member profile. Pass empty string / null to clear.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External member id.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"description":"Internal member description — visible only to organisation admins. Pass empty string / null to clear.","type":"string"},{"type":"null"}]},"descriptionPublic":{"nullable":true,"anyOf":[{"maxLength":500,"description":"Short public bio — visible to teammates on the member profile. Pass empty string / null to clear.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External member id.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"description":"Internal member description — visible only to organisation admins. Pass empty string / null to clear.","type":"string"},{"type":"null"}]},"descriptionPublic":{"nullable":true,"anyOf":[{"maxLength":500,"description":"Short public bio — visible to teammates on the member profile. Pass empty string / null to clear.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/member/notes":{"get":{"parameters":[{"description":"External member id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffMemberNotes","tags":["Member"],"summary":"List internal notes pinned to a member","responses":{"200":{}}}},"/bff/member/notes/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}}},"operationId":"postBffMemberNotesCreate","tags":["Member"],"summary":"Create a new internal note","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","bodyMd"],"properties":{"id":{"description":"External member id whose profile the note belongs to.","type":"string"},"bodyMd":{"description":"Markdown body. May contain @mentions which are parsed server-side.","type":"string"},"pinned":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","bodyMd"],"properties":{"id":{"description":"External member id whose profile the note belongs to.","type":"string"},"bodyMd":{"description":"Markdown body. May contain @mentions which are parsed server-side.","type":"string"},"pinned":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","bodyMd"],"properties":{"id":{"description":"External member id whose profile the note belongs to.","type":"string"},"bodyMd":{"description":"Markdown body. May contain @mentions which are parsed server-side.","type":"string"},"pinned":{"type":"boolean"}}}}}}}},"/bff/member/notes/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberNotesUpdate","tags":["Member"],"summary":"Update / pin / unpin an internal note","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["noteId"],"properties":{"noteId":{"description":"Internal note id.","type":"number"},"bodyMd":{"type":"string"},"pinned":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["noteId"],"properties":{"noteId":{"description":"Internal note id.","type":"number"},"bodyMd":{"type":"string"},"pinned":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["noteId"],"properties":{"noteId":{"description":"Internal note id.","type":"number"},"bodyMd":{"type":"string"},"pinned":{"type":"boolean"}}}}}}}},"/bff/member/notes/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberNotesDelete","tags":["Member"],"summary":"Soft-delete an internal note","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["noteId"],"properties":{"noteId":{"description":"Internal note id.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["noteId"],"properties":{"noteId":{"description":"Internal note id.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["noteId"],"properties":{"noteId":{"description":"Internal note id.","type":"number"}}}}}}}},"/bff/member/permission-templates":{"get":{"operationId":"getBffMemberPermission-templates","tags":["Member"],"summary":"List permission templates for the organisation","responses":{"200":{}}}},"/bff/member/permission-templates/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}}},"operationId":"postBffMemberPermission-templatesCreate","tags":["Member"],"summary":"Create a permission template","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Display name; unique within the organisation.","type":"string"},"description":{"type":"string"},"color":{"description":"Hex like \"#ec6c50\" for chip styling.","type":"string"},"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Display name; unique within the organisation.","type":"string"},"description":{"type":"string"},"color":{"description":"Hex like \"#ec6c50\" for chip styling.","type":"string"},"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Display name; unique within the organisation.","type":"string"},"description":{"type":"string"},"color":{"description":"Hex like \"#ec6c50\" for chip styling.","type":"string"},"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}}}}}}}},"/bff/member/permission-templates/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberPermission-templatesUpdate","tags":["Member"],"summary":"Update a permission template","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}}}}}}}},"/bff/member/permission-templates/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMemberPermission-templatesDelete","tags":["Member"],"summary":"Hard-delete a permission template","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}}}},"/bff/member/clone-permissions-source":{"get":{"parameters":[{"description":"External id of the member to clone from.","schema":{"type":"string"},"in":"query","name":"sourceId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}},"required":["permissionCodes","roleCodes"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}},"required":["permissionCodes","roleCodes"]}},"text/plain":{"schema":{"type":"object","properties":{"permissionCodes":{"type":"array","items":{"type":"string"}},"roleCodes":{"type":"array","items":{"type":"string"}}},"required":["permissionCodes","roleCodes"]}}}}},"operationId":"getBffMemberClone-permissions-source","tags":["Member"],"summary":"Read a source member’s current permissions for a clone-to flow"}},"/bff/organisation-structure/detail":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"departments":{"type":"array","items":{"type":"object","required":["id","name","description","parentId","leadMemberId","color","position","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"chatRoomId":{"nullable":true,"anyOf":[{"description":"Live department channel (team chat room id).","type":"string"},{"type":"null"}]}}}},"members":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentId","managerId"],"properties":{"id":{"description":"Member wire id (contact external id, as /team/{id}).","type":"string"},"userId":{"nullable":true,"anyOf":[{"description":"Global user id (team chat).","type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"managerId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["departments","members"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"departments":{"type":"array","items":{"type":"object","required":["id","name","description","parentId","leadMemberId","color","position","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"chatRoomId":{"nullable":true,"anyOf":[{"description":"Live department channel (team chat room id).","type":"string"},{"type":"null"}]}}}},"members":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentId","managerId"],"properties":{"id":{"description":"Member wire id (contact external id, as /team/{id}).","type":"string"},"userId":{"nullable":true,"anyOf":[{"description":"Global user id (team chat).","type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"managerId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["departments","members"]}},"text/plain":{"schema":{"type":"object","properties":{"departments":{"type":"array","items":{"type":"object","required":["id","name","description","parentId","leadMemberId","color","position","chatRoomId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"chatRoomId":{"nullable":true,"anyOf":[{"description":"Live department channel (team chat room id).","type":"string"},{"type":"null"}]}}}},"members":{"type":"array","items":{"type":"object","required":["id","userId","fullName","jobTitle","avatarUrl","departmentId","managerId"],"properties":{"id":{"description":"Member wire id (contact external id, as /team/{id}).","type":"string"},"userId":{"nullable":true,"anyOf":[{"description":"Global user id (team chat).","type":"string"},{"type":"null"}]},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"departmentId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"managerId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["departments","members"]}}}}},"operationId":"getBffOrganisation-structureDetail","tags":["Organisation structure"],"summary":"Departments + members with department and manager"}},"/bff/organisation-structure/department-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"operationId":"postBffOrganisation-structureDepartment-create","tags":["Organisation structure"],"summary":"Create a department (requires module-members)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":10000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":10000,"type":"integer"}]},"chatEnabled":{"description":"Department channel in team chat (managed membership).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":10000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":10000,"type":"integer"}]},"chatEnabled":{"description":"Department channel in team chat (managed membership).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":10000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":10000,"type":"integer"}]},"chatEnabled":{"description":"Department channel in team chat (managed membership).","type":"boolean"}}}}}}}},"/bff/organisation-structure/department-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisation-structureDepartment-update","tags":["Organisation structure"],"summary":"Update a department (cycle-safe re-parenting)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","name"],"properties":{"id":{"minLength":1,"maxLength":32,"type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":10000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":10000,"type":"integer"}]},"chatEnabled":{"description":"Department channel in team chat (managed membership).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","name"],"properties":{"id":{"minLength":1,"maxLength":32,"type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":10000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":10000,"type":"integer"}]},"chatEnabled":{"description":"Department channel in team chat (managed membership).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","name"],"properties":{"id":{"minLength":1,"maxLength":32,"type":"string"},"name":{"minLength":1,"maxLength":128,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"leadMemberId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"color":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":10000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":10000,"type":"integer"}]},"chatEnabled":{"description":"Department channel in team chat (managed membership).","type":"boolean"}}}}}}}},"/bff/organisation-structure/department-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisation-structureDepartment-delete","tags":["Organisation structure"],"summary":"Delete a department","description":"Soft delete. Sub-departments and members move to the parent department (or top level).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":32,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":32,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":32,"type":"string"}}}}}}}},"/bff/organisation-structure/member-assign":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisation-structureMember-assign","tags":["Organisation structure"],"summary":"Set a member's department and / or manager","description":"Omitted field = unchanged, `null` = cleared. The \"reports to\" chain must stay acyclic.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["memberId"],"properties":{"memberId":{"minLength":1,"maxLength":32,"type":"string"},"departmentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"managerId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["memberId"],"properties":{"memberId":{"minLength":1,"maxLength":32,"type":"string"},"departmentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"managerId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["memberId"],"properties":{"memberId":{"minLength":1,"maxLength":32,"type":"string"},"departmentId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]},"managerId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/my-note/":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","bodyMd","insertedDate","updatedDate"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"bodyMd":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","bodyMd","insertedDate","updatedDate"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"bodyMd":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","bodyMd","insertedDate","updatedDate"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"bodyMd":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffMy-note","tags":["My"],"summary":"List the current member's personal notes","description":"Returns the personal-note collection for the authenticated member, newest edit first. Empty list if the caller has no member record in the current organisation (e.g. a pure API-key session)."}},"/bff/my-note/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"minLength":16,"maxLength":16,"description":"The final 16-char `external_id` — client should keep this in state.","type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"minLength":16,"maxLength":16,"description":"The final 16-char `external_id` — client should keep this in state.","type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"minLength":16,"maxLength":16,"description":"The final 16-char `external_id` — client should keep this in state.","type":"string"}},"required":["id"]}}}}},"operationId":"postBffMy-noteCreate","tags":["My"],"summary":"Create a new personal note","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["idPrefix"],"properties":{"idPrefix":{"minLength":8,"maxLength":8,"description":"Client-generated 8-char lowercase-alphanumeric prefix (from the composer state). The server appends its own 8-char suffix to form the final 16-char `id` that the client should adopt for subsequent updates.","type":"string"},"bodyMd":{"description":"Initial markdown body. Usually the first non-empty snapshot from the client.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["idPrefix"],"properties":{"idPrefix":{"minLength":8,"maxLength":8,"description":"Client-generated 8-char lowercase-alphanumeric prefix (from the composer state). The server appends its own 8-char suffix to form the final 16-char `id` that the client should adopt for subsequent updates.","type":"string"},"bodyMd":{"description":"Initial markdown body. Usually the first non-empty snapshot from the client.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["idPrefix"],"properties":{"idPrefix":{"minLength":8,"maxLength":8,"description":"Client-generated 8-char lowercase-alphanumeric prefix (from the composer state). The server appends its own 8-char suffix to form the final 16-char `id` that the client should adopt for subsequent updates.","type":"string"},"bodyMd":{"description":"Initial markdown body. Usually the first non-empty snapshot from the client.","type":"string"}}}}}}}},"/bff/my-note/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMy-noteUpdate","tags":["My"],"summary":"Update the body of a personal note","description":"Overwrites `body_md` and bumps `updated_date`. WHERE is scoped to the caller’s `member_id`, so a tampered `id` can never reach another member’s row.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","bodyMd"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Full 16-char note id returned by `/create` (or from `/`).","type":"string"},"bodyMd":{"description":"Full markdown body — always sent whole, last-write-wins.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","bodyMd"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Full 16-char note id returned by `/create` (or from `/`).","type":"string"},"bodyMd":{"description":"Full markdown body — always sent whole, last-write-wins.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","bodyMd"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Full 16-char note id returned by `/create` (or from `/`).","type":"string"},"bodyMd":{"description":"Full markdown body — always sent whole, last-write-wins.","type":"string"}}}}}}}},"/bff/my-note/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffMy-noteDelete","tags":["My"],"summary":"Soft-delete a personal note","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Full 16-char note id to soft-delete.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Full 16-char note id to soft-delete.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"description":"Full 16-char note id to soft-delete.","type":"string"}}}}}}}},"/bff/newsletter/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffNewsletterList","tags":["Newsletter"],"summary":"List newsletter subscribers","description":"Returns a paginated list of newsletter subscribers with their authorization and cancellation status.","responses":{"200":{}}}},"/bff/newsletter/job-list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"External ID of a contact segment to filter by. When set, only jobs that were fired from this segment are returned. Internal numeric IDs are resolved server-side.","schema":{"type":"string"},"in":"query","name":"segmentId","required":false}],"operationId":"getBffNewsletterJob-list","tags":["Newsletter"],"summary":"List newsletter jobs","description":"Returns a paginated list of newsletter sending jobs with their progress and speed limits. Pass `segmentId` to scope the list to a specific contact segment (used by the segment detail \"history\" tab).","responses":{"200":{}}}},"/bff/newsletter/job-contact-list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Newsletter job ID.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffNewsletterJob-contact-list","tags":["bff"],"responses":{"200":{}}}},"/bff/newsletter/job-statistics":{"get":{"parameters":[{"description":"Newsletter job ID.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffNewsletterJob-statistics","tags":["Newsletter"],"summary":"Get job sending statistics","description":"Returns delivery statistics (sent, pending, failed) for a specific newsletter job.","responses":{"200":{}}}},"/bff/newsletter/job-preview":{"get":{"parameters":[{"description":"Newsletter job ID.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffNewsletterJob-preview","tags":["Newsletter"],"summary":"Preview newsletter job email","description":"Returns the subject and HTML body that recipients will receive for the given newsletter job. The body includes a representative unsubscribe footer but omits the per-recipient tracking pixel. The admin UI wraps the response in the organisation's emailer layout (logo + footer template).","responses":{"200":{}}}},"/bff/newsletter/job-update-content":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffNewsletterJob-update-content","tags":["Newsletter"],"summary":"Edit newsletter job content","description":"Updates the subject and body of the post backing a newsletter job. The runner reloads the post each cron tick, so the new content reaches every contact not yet delivered.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","subject","content"],"properties":{"id":{"description":"Newsletter job ID.","type":"string"},"subject":{"description":"New email subject. Stored normalised (single-line, max 300 chars).","type":"string"},"content":{"description":"New email body. Stored verbatim as HTML.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","subject","content"],"properties":{"id":{"description":"Newsletter job ID.","type":"string"},"subject":{"description":"New email subject. Stored normalised (single-line, max 300 chars).","type":"string"},"content":{"description":"New email body. Stored verbatim as HTML.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","subject","content"],"properties":{"id":{"description":"Newsletter job ID.","type":"string"},"subject":{"description":"New email subject. Stored normalised (single-line, max 300 chars).","type":"string"},"content":{"description":"New email body. Stored verbatim as HTML.","type":"string"}}}}}}}},"/bff/newsletter/job-run-action":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffNewsletterJob-run-action","tags":["Newsletter"],"summary":"Run action on newsletter job","description":"Executes a control action (start, pause, resume, cancel) on a newsletter sending job.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","action"],"properties":{"id":{"description":"Newsletter job ID.","type":"string"},"action":{"description":"Action to run: start, pause, resume, cancel.","examples":["start"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","action"],"properties":{"id":{"description":"Newsletter job ID.","type":"string"},"action":{"description":"Action to run: start, pause, resume, cancel.","examples":["start"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","action"],"properties":{"id":{"description":"Newsletter job ID.","type":"string"},"action":{"description":"Action to run: start, pause, resume, cancel.","examples":["start"],"type":"string"}}}}}}}},"/bff/newsletter/bulk-import":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"subscribed":{"description":"Brand-new subscriptions — onboarding e-mail was sent.","type":"number"},"alreadyOnList":{"description":"Contact was already on the list; no e-mail sent, no flag change.","type":"number"},"reactivatedFromOptOut":{"description":"Contact had a prior opt-out; `ignore_bulk_mail` was reset (only when `respectOptOut = false`).","type":"number"},"respectedOptOut":{"description":"Contact had a prior opt-out and was skipped (only when `respectOptOut = true`).","type":"number"},"invalidEmail":{"description":"Address was empty or unparseable.","type":"number"}},"required":["success","subscribed","alreadyOnList","reactivatedFromOptOut","respectedOptOut","invalidEmail"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"subscribed":{"description":"Brand-new subscriptions — onboarding e-mail was sent.","type":"number"},"alreadyOnList":{"description":"Contact was already on the list; no e-mail sent, no flag change.","type":"number"},"reactivatedFromOptOut":{"description":"Contact had a prior opt-out; `ignore_bulk_mail` was reset (only when `respectOptOut = false`).","type":"number"},"respectedOptOut":{"description":"Contact had a prior opt-out and was skipped (only when `respectOptOut = true`).","type":"number"},"invalidEmail":{"description":"Address was empty or unparseable.","type":"number"}},"required":["success","subscribed","alreadyOnList","reactivatedFromOptOut","respectedOptOut","invalidEmail"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"subscribed":{"description":"Brand-new subscriptions — onboarding e-mail was sent.","type":"number"},"alreadyOnList":{"description":"Contact was already on the list; no e-mail sent, no flag change.","type":"number"},"reactivatedFromOptOut":{"description":"Contact had a prior opt-out; `ignore_bulk_mail` was reset (only when `respectOptOut = false`).","type":"number"},"respectedOptOut":{"description":"Contact had a prior opt-out and was skipped (only when `respectOptOut = true`).","type":"number"},"invalidEmail":{"description":"Address was empty or unparseable.","type":"number"}},"required":["success","subscribed","alreadyOnList","reactivatedFromOptOut","respectedOptOut","invalidEmail"]}}}}},"operationId":"postBffNewsletterBulk-import","tags":["Newsletter"],"summary":"Bulk import newsletter subscribers (double opt-in with opt-out respect)","description":"Iterates each address, calls addNewsletterContact() and aggregates per-outcome stats. Every newly-subscribed address receives a `newsletter-onboarding-contact` template e-mail (real transactional send). Existing subscribers are left alone; opt-outs are either respected (default) or silently reactivated (when `respectOptOut = false`). Invalid e-mails are counted, not skipped silently.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contactList","respectOptOut"],"properties":{"contactList":{"maxItems":1000,"description":"List of email addresses to import (max 1000 per request — chunk larger lists).","type":"array","items":{"maxLength":320,"examples":["jan@example.com"],"type":"string"}},"source":{"description":"Source label for tracking.","examples":["csv import"],"type":"string"},"respectOptOut":{"description":"When true, contacts with a prior opt-out (`shop__contact.ignore_bulk_mail = true` or any `core__newsletter.canceled = true` row) are skipped completely — no e-mail sent, no flag reset. Operator-facing UIs must default this to true so a bulk paste cannot silently override GDPR / CAN-SPAM opt-outs. Set false only for explicit re-engagement campaigns where the operator accepts the risk.","type":"boolean"},"groupList":{"description":"Groups (tags) to additively attach to every imported contact. Never removes existing group joins.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["contactList","respectOptOut"],"properties":{"contactList":{"maxItems":1000,"description":"List of email addresses to import (max 1000 per request — chunk larger lists).","type":"array","items":{"maxLength":320,"examples":["jan@example.com"],"type":"string"}},"source":{"description":"Source label for tracking.","examples":["csv import"],"type":"string"},"respectOptOut":{"description":"When true, contacts with a prior opt-out (`shop__contact.ignore_bulk_mail = true` or any `core__newsletter.canceled = true` row) are skipped completely — no e-mail sent, no flag reset. Operator-facing UIs must default this to true so a bulk paste cannot silently override GDPR / CAN-SPAM opt-outs. Set false only for explicit re-engagement campaigns where the operator accepts the risk.","type":"boolean"},"groupList":{"description":"Groups (tags) to additively attach to every imported contact. Never removes existing group joins.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}}}},"text/plain":{"schema":{"type":"object","required":["contactList","respectOptOut"],"properties":{"contactList":{"maxItems":1000,"description":"List of email addresses to import (max 1000 per request — chunk larger lists).","type":"array","items":{"maxLength":320,"examples":["jan@example.com"],"type":"string"}},"source":{"description":"Source label for tracking.","examples":["csv import"],"type":"string"},"respectOptOut":{"description":"When true, contacts with a prior opt-out (`shop__contact.ignore_bulk_mail = true` or any `core__newsletter.canceled = true` row) are skipped completely — no e-mail sent, no flag reset. Operator-facing UIs must default this to true so a bulk paste cannot silently override GDPR / CAN-SPAM opt-outs. Set false only for explicit re-engagement campaigns where the operator accepts the risk.","type":"boolean"},"groupList":{"description":"Groups (tags) to additively attach to every imported contact. Never removes existing group joins.","type":"array","items":{"type":"object","required":["slug","name","color"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"count":{"type":"number"}}}}}}}}}}},"/bff/newsletter/resend-confirm":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffNewsletterResend-confirm","tags":["Newsletter"],"summary":"Resend newsletter opt-in confirmation (admin bypass)","description":"Operator-driven re-send of the double opt-in e-mail for a pending `core__newsletter` row. Bypasses the cooldown enforced on the public `/api/v1/newsletter/register-contact` endpoint — intended for the \"subscriber reports they never got the confirmation e-mail\" support flow. Reuses the existing hash so a late click on the original e-mail still works. Returns an error if the subscription is already authorized, canceled, missing an e-mail address, or does not belong to the caller's organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Newsletter subscription hash (16-char token from `/bff/newsletter/list`).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Newsletter subscription hash (16-char token from `/bff/newsletter/list`).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Newsletter subscription hash (16-char token from `/bff/newsletter/list`).","type":"string"}}}}}}}},"/bff/newsroom/shortlist":{"get":{"parameters":[{"description":"YYYY-MM-DD shortlist date filter.","schema":{"type":"string"},"in":"query","name":"date","required":false},{"description":"Status filter: pending, generating, generated, dismissed.","schema":{"type":"string"},"in":"query","name":"status","required":false},{"description":"Maximum number of items to return.","schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","shortlistDate","rank","title","hotnessScore","czRelevanceScore","cctvFitScore","totalScore","status","insertedDate"],"properties":{"id":{"type":"string"},"shortlistDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"rank":{"type":"number"},"title":{"type":"string"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"},"hotnessScore":{"type":"number"},"czRelevanceScore":{"type":"number"},"cctvFitScore":{"type":"number"},"totalScore":{"type":"number"},"reason":{"type":"string"},"status":{"type":"string"},"draftId":{"type":"string"},"draftStatus":{"type":"string"},"topicType":{"type":"string"},"severity":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","shortlistDate","rank","title","hotnessScore","czRelevanceScore","cctvFitScore","totalScore","status","insertedDate"],"properties":{"id":{"type":"string"},"shortlistDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"rank":{"type":"number"},"title":{"type":"string"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"},"hotnessScore":{"type":"number"},"czRelevanceScore":{"type":"number"},"cctvFitScore":{"type":"number"},"totalScore":{"type":"number"},"reason":{"type":"string"},"status":{"type":"string"},"draftId":{"type":"string"},"draftStatus":{"type":"string"},"topicType":{"type":"string"},"severity":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","shortlistDate","rank","title","hotnessScore","czRelevanceScore","cctvFitScore","totalScore","status","insertedDate"],"properties":{"id":{"type":"string"},"shortlistDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"rank":{"type":"number"},"title":{"type":"string"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"},"hotnessScore":{"type":"number"},"czRelevanceScore":{"type":"number"},"cctvFitScore":{"type":"number"},"totalScore":{"type":"number"},"reason":{"type":"string"},"status":{"type":"string"},"draftId":{"type":"string"},"draftStatus":{"type":"string"},"topicType":{"type":"string"},"severity":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffNewsroomShortlist","tags":["Newsroom"],"summary":"List newsroom shortlist","description":"Returns the daily TOP-N candidate articles for the authenticated organisation, ranked by score. Each item exposes scores, source, status and (if generated) draft reference."}},"/bff/newsroom/run-pipeline":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","required":["organisationId","enrichment","shortlist"],"properties":{"organisationId":{"type":"number"},"rssSync":{"type":"object","required":["updatedFeeds","errors"],"properties":{"updatedFeeds":{"type":"number"},"errors":{"type":"number"}}},"enrichment":{"type":"object","required":["attempted","succeeded","failed"],"properties":{"attempted":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"}}},"shortlist":{"type":"object","required":["shortlistDate","itemCount"],"properties":{"shortlistDate":{"type":"string"},"itemCount":{"type":"number"}}}}}}},"required":["success","results"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","required":["organisationId","enrichment","shortlist"],"properties":{"organisationId":{"type":"number"},"rssSync":{"type":"object","required":["updatedFeeds","errors"],"properties":{"updatedFeeds":{"type":"number"},"errors":{"type":"number"}}},"enrichment":{"type":"object","required":["attempted","succeeded","failed"],"properties":{"attempted":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"}}},"shortlist":{"type":"object","required":["shortlistDate","itemCount"],"properties":{"shortlistDate":{"type":"string"},"itemCount":{"type":"number"}}}}}}},"required":["success","results"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","required":["organisationId","enrichment","shortlist"],"properties":{"organisationId":{"type":"number"},"rssSync":{"type":"object","required":["updatedFeeds","errors"],"properties":{"updatedFeeds":{"type":"number"},"errors":{"type":"number"}}},"enrichment":{"type":"object","required":["attempted","succeeded","failed"],"properties":{"attempted":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"}}},"shortlist":{"type":"object","required":["shortlistDate","itemCount"],"properties":{"shortlistDate":{"type":"string"},"itemCount":{"type":"number"}}}}}}},"required":["success","results"]}}}}},"operationId":"postBffNewsroomRun-pipeline","tags":["Newsroom"],"summary":"Run newsroom daily pipeline","description":"Synchronises RSS feeds, enriches new articles via AI, and rebuilds the shortlist for the authenticated organisation. Safe to run repeatedly.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"skipRssSync":{"description":"Skip the RSS feed sync step before enrichment.","type":"boolean"},"size":{"minimum":1,"maximum":20,"description":"Override default shortlist size (default 5).","type":"number"},"shortlistDate":{"description":"YYYY-MM-DD date for the shortlist (default today).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"skipRssSync":{"description":"Skip the RSS feed sync step before enrichment.","type":"boolean"},"size":{"minimum":1,"maximum":20,"description":"Override default shortlist size (default 5).","type":"number"},"shortlistDate":{"description":"YYYY-MM-DD date for the shortlist (default today).","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"skipRssSync":{"description":"Skip the RSS feed sync step before enrichment.","type":"boolean"},"size":{"minimum":1,"maximum":20,"description":"Override default shortlist size (default 5).","type":"number"},"shortlistDate":{"description":"YYYY-MM-DD date for the shortlist (default today).","type":"string"}}}}}}}},"/bff/newsroom/enrich":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"attempted":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"}},"required":["success","attempted","succeeded","failed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"attempted":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"}},"required":["success","attempted","succeeded","failed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"attempted":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"}},"required":["success","attempted","succeeded","failed"]}}}}},"operationId":"postBffNewsroomEnrich","tags":["Newsroom"],"summary":"Enrich pending RSS articles","description":"Runs AI enrichment on RSS articles that have not been analysed yet. Safe to call manually to backfill enrichment without rebuilding the shortlist."}},"/bff/newsroom/rebuild-shortlist":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"shortlistDate":{"type":"string"},"itemCount":{"type":"number"}},"required":["success","shortlistDate","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"shortlistDate":{"type":"string"},"itemCount":{"type":"number"}},"required":["success","shortlistDate","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"shortlistDate":{"type":"string"},"itemCount":{"type":"number"}},"required":["success","shortlistDate","itemCount"]}}}}},"operationId":"postBffNewsroomRebuild-shortlist","tags":["Newsroom"],"summary":"Rebuild newsroom shortlist","description":"Recomputes the daily TOP-N selection from existing enrichment data, without re-running AI.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"size":{"type":"number"},"shortlistDate":{"description":"YYYY-MM-DD date for the shortlist (default today).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"size":{"type":"number"},"shortlistDate":{"description":"YYYY-MM-DD date for the shortlist (default today).","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"size":{"type":"number"},"shortlistDate":{"description":"YYYY-MM-DD date for the shortlist (default today).","type":"string"}}}}}}}},"/bff/newsroom/shortlist/{shortlistId}/generate-draft":{"post":{"parameters":[{"description":"External ID of the shortlist item.","schema":{"type":"string"},"in":"path","name":"shortlistId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"draftId":{"description":"External ID of the generated draft.","type":"string"},"status":{"description":"ready | error","type":"string"}},"required":["success","draftId","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"draftId":{"description":"External ID of the generated draft.","type":"string"},"status":{"description":"ready | error","type":"string"}},"required":["success","draftId","status"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"draftId":{"description":"External ID of the generated draft.","type":"string"},"status":{"description":"ready | error","type":"string"}},"required":["success","draftId","status"]}}}}},"operationId":"postBffNewsroomShortlistByShortlistIdGenerate-draft","tags":["Newsroom"],"summary":"Generate article draft","description":"Runs the 3-pass AI writing pipeline (digest, article, fact-check) for a shortlist item. The resulting draft is saved as a private record and can be reviewed before being published as a Post."}},"/bff/newsroom/shortlist/{shortlistId}/dismiss":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"shortlistId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffNewsroomShortlistByShortlistIdDismiss","tags":["Newsroom"],"summary":"Dismiss shortlist item","description":"Marks a shortlist item as dismissed; it will not be re-included in subsequent rebuilds for the same date."}},"/bff/newsroom/draft/{draftId}":{"get":{"parameters":[{"description":"External ID of the draft.","schema":{"type":"string"},"in":"path","name":"draftId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"shortlistId":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"perex":{"type":"string"},"articleMarkdown":{"type":"string"},"thumbnail169":{"type":"object","properties":{"prompt":{"type":"string"},"description":{"type":"string"}}},"thumbnail916":{"type":"object","properties":{"prompt":{"type":"string"},"description":{"type":"string"}}},"linkedinText":{"type":"string"},"instagramText":{"type":"string"},"factCheckNotes":{"type":"object","required":["isClean","summary","findings"],"properties":{"isClean":{"type":"boolean"},"summary":{"type":"string"},"findings":{"type":"array","items":{"type":"object","required":["category","severity","excerpt","issue","justification","suggestedFix"],"properties":{"category":{"anyOf":[{"const":"error","type":"string"},{"const":"falsehood","type":"string"},{"const":"recommendation","type":"string"}]},"severity":{"anyOf":[{"const":"low","type":"string"},{"const":"medium","type":"string"},{"const":"high","type":"string"}]},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"issue":{"type":"string"},"justification":{"type":"string"},"suggestedFix":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"postId":{"type":"number"},"errorMessage":{"type":"string"},"modelWriter":{"type":"string"},"modelFactCheck":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"}},"required":["id","shortlistId","status","insertedDate","updatedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"shortlistId":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"perex":{"type":"string"},"articleMarkdown":{"type":"string"},"thumbnail169":{"type":"object","properties":{"prompt":{"type":"string"},"description":{"type":"string"}}},"thumbnail916":{"type":"object","properties":{"prompt":{"type":"string"},"description":{"type":"string"}}},"linkedinText":{"type":"string"},"instagramText":{"type":"string"},"factCheckNotes":{"type":"object","required":["isClean","summary","findings"],"properties":{"isClean":{"type":"boolean"},"summary":{"type":"string"},"findings":{"type":"array","items":{"type":"object","required":["category","severity","excerpt","issue","justification","suggestedFix"],"properties":{"category":{"anyOf":[{"const":"error","type":"string"},{"const":"falsehood","type":"string"},{"const":"recommendation","type":"string"}]},"severity":{"anyOf":[{"const":"low","type":"string"},{"const":"medium","type":"string"},{"const":"high","type":"string"}]},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"issue":{"type":"string"},"justification":{"type":"string"},"suggestedFix":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"postId":{"type":"number"},"errorMessage":{"type":"string"},"modelWriter":{"type":"string"},"modelFactCheck":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"}},"required":["id","shortlistId","status","insertedDate","updatedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"shortlistId":{"type":"string"},"status":{"type":"string"},"title":{"type":"string"},"perex":{"type":"string"},"articleMarkdown":{"type":"string"},"thumbnail169":{"type":"object","properties":{"prompt":{"type":"string"},"description":{"type":"string"}}},"thumbnail916":{"type":"object","properties":{"prompt":{"type":"string"},"description":{"type":"string"}}},"linkedinText":{"type":"string"},"instagramText":{"type":"string"},"factCheckNotes":{"type":"object","required":["isClean","summary","findings"],"properties":{"isClean":{"type":"boolean"},"summary":{"type":"string"},"findings":{"type":"array","items":{"type":"object","required":["category","severity","excerpt","issue","justification","suggestedFix"],"properties":{"category":{"anyOf":[{"const":"error","type":"string"},{"const":"falsehood","type":"string"},{"const":"recommendation","type":"string"}]},"severity":{"anyOf":[{"const":"low","type":"string"},{"const":"medium","type":"string"},{"const":"high","type":"string"}]},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"issue":{"type":"string"},"justification":{"type":"string"},"suggestedFix":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"postId":{"type":"number"},"errorMessage":{"type":"string"},"modelWriter":{"type":"string"},"modelFactCheck":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"}},"required":["id","shortlistId","status","insertedDate","updatedDate"]}}}}},"operationId":"getBffNewsroomDraftByDraftId","tags":["Newsroom"],"summary":"Get draft detail","description":"Returns the generated article markdown plus thumbnail prompts and social media texts."}},"/bff/newsroom/draft/{draftId}/publish-as-post":{"post":{"parameters":[{"description":"External ID of the draft.","schema":{"type":"string"},"in":"path","name":"draftId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"postId":{"type":"number"},"postExternalId":{"type":"string"}},"required":["success","postId","postExternalId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"postId":{"type":"number"},"postExternalId":{"type":"string"}},"required":["success","postId","postExternalId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"postId":{"type":"number"},"postExternalId":{"type":"string"}},"required":["success","postId","postExternalId"]}}}}},"operationId":"postBffNewsroomDraftByDraftIdPublish-as-post","tags":["Newsroom"],"summary":"Publish draft as Post","description":"Materialises a ready draft into a content__post record using the standard addPost flow. By default the post is created as \"unlisted\" so the editor can review before going public.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"visibility":{"description":"public | private | unlisted | subscribe (default unlisted).","type":"string"},"mainCategory":{"description":"External ID of the post category (defaults to first active).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"visibility":{"description":"public | private | unlisted | subscribe (default unlisted).","type":"string"},"mainCategory":{"description":"External ID of the post category (defaults to first active).","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"visibility":{"description":"public | private | unlisted | subscribe (default unlisted).","type":"string"},"mainCategory":{"description":"External ID of the post category (defaults to first active).","type":"string"}}}}}}}},"/bff/notification/inbox":{"get":{"parameters":[{"description":"ISO timestamp. Defaults to 30 days ago.","schema":{"type":"string"},"in":"query","name":"since","required":false},{"description":"Minimum level (info, success, error, warning, critical). Default: error.","schema":{"type":"string"},"in":"query","name":"minLevel","required":false},{"description":"Comma-separated component allowlist.","schema":{"type":"string"},"in":"query","name":"components","required":false},{"description":"Pass \"true\" to return only unread items.","schema":{"type":"string"},"in":"query","name":"unreadOnly","required":false},{"description":"Page size, default 50, max 200.","schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Offset for pagination, default 0.","schema":{"type":"string"},"in":"query","name":"offset","required":false}],"operationId":"getBffNotificationInbox","tags":["Notification"],"summary":"Notification inbox","description":"Paginated, filterable feed of `core__system_log` entries with per-member read state. Default filter: severity >= error in the last 30 days. Powers the in-app bell + drawer.","responses":{"200":{}}}},"/bff/notification/unread-count":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"unreadCount":{"description":"Number of unread notifications for the current member.","type":"number"}},"required":["unreadCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"unreadCount":{"description":"Number of unread notifications for the current member.","type":"number"}},"required":["unreadCount"]}},"text/plain":{"schema":{"type":"object","properties":{"unreadCount":{"description":"Number of unread notifications for the current member.","type":"number"}},"required":["unreadCount"]}}}}},"operationId":"getBffNotificationUnread-count","tags":["Notification"],"summary":"Unread notification count","description":"Lightweight endpoint for the header bell badge. Returns only the unread count under the default filters (>= error in the last 30 days)."}},"/bff/notification/mark-read":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"marked":{"description":"Number of log IDs accepted (already-read ones are silently no-op).","type":"number"}},"required":["success","marked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"marked":{"description":"Number of log IDs accepted (already-read ones are silently no-op).","type":"number"}},"required":["success","marked"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"marked":{"description":"Number of log IDs accepted (already-read ones are silently no-op).","type":"number"}},"required":["success","marked"]}}}}},"operationId":"postBffNotificationMark-read","tags":["Notification"],"summary":"Mark notifications as read","description":"Idempotent — inserts into `core__system_log_read_state` with ON CONFLICT DO NOTHING. Existing rows keep their original `read_at`; the timestamp is \"first time seen\", not \"last time seen\".","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["logIds"],"properties":{"logIds":{"description":"System log IDs to mark as read for the current member.","type":"array","items":{"type":"number"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["logIds"],"properties":{"logIds":{"description":"System log IDs to mark as read for the current member.","type":"array","items":{"type":"number"}}}}},"text/plain":{"schema":{"type":"object","required":["logIds"],"properties":{"logIds":{"description":"System log IDs to mark as read for the current member.","type":"array","items":{"type":"number"}}}}}}}}},"/bff/ip-info/detail":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"asn":{"type":"object","required":["id","title"],"properties":{"id":{"description":"Autonomous System Number.","examples":["AS12709"],"type":"string"},"title":{"description":"ASN organization name.","examples":["Melita Limited"],"type":"string"}}},"hostname":{"description":"Reverse DNS hostname.","examples":["c56-75.i05-15.onvol.net"],"type":"string"},"range":{"description":"IP CIDR range.","examples":["88.203.56.0/21"],"type":"string"},"company":{"description":"Company name of IP owner.","examples":["Melita plc"],"type":"string"},"hostedDomains":{"description":"Number of domains hosted on this IP.","type":"number"},"privacy":{"description":"Whether the IP is behind a privacy service (VPN/proxy).","type":"boolean"},"anycast":{"description":"Whether the IP is an anycast address.","type":"boolean"},"asnType":{"description":"ASN type: ISP, hosting, business or education.","examples":["ISP"],"type":"string"},"abuseContact":{"description":"Abuse contact email.","examples":["abuse@melitacable.com"],"type":"string"},"geoIp":{"type":"object","required":["city","state","country","postal","localTime","timezone","coordinates"],"properties":{"city":{"description":"City name.","examples":["Qormi"],"type":"string"},"state":{"description":"State or region.","examples":["Qormi"],"type":"string"},"country":{"description":"Country name.","examples":["Malta"],"type":"string"},"postal":{"description":"Postal code.","examples":["QRM"],"type":"string"},"localTime":{"description":"Local time at the IP location.","examples":["01:16 PM, Monday, November 25, 2024"],"type":"string"},"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Malta"],"type":"string"},"coordinates":{"description":"GPS coordinates [latitude, longitude].","examples":[[35.876,14.472]],"type":"array","items":{"type":"number"}}}}},"required":["asn","hostname","range","company","hostedDomains","privacy","anycast","asnType","abuseContact","geoIp"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"asn":{"type":"object","required":["id","title"],"properties":{"id":{"description":"Autonomous System Number.","examples":["AS12709"],"type":"string"},"title":{"description":"ASN organization name.","examples":["Melita Limited"],"type":"string"}}},"hostname":{"description":"Reverse DNS hostname.","examples":["c56-75.i05-15.onvol.net"],"type":"string"},"range":{"description":"IP CIDR range.","examples":["88.203.56.0/21"],"type":"string"},"company":{"description":"Company name of IP owner.","examples":["Melita plc"],"type":"string"},"hostedDomains":{"description":"Number of domains hosted on this IP.","type":"number"},"privacy":{"description":"Whether the IP is behind a privacy service (VPN/proxy).","type":"boolean"},"anycast":{"description":"Whether the IP is an anycast address.","type":"boolean"},"asnType":{"description":"ASN type: ISP, hosting, business or education.","examples":["ISP"],"type":"string"},"abuseContact":{"description":"Abuse contact email.","examples":["abuse@melitacable.com"],"type":"string"},"geoIp":{"type":"object","required":["city","state","country","postal","localTime","timezone","coordinates"],"properties":{"city":{"description":"City name.","examples":["Qormi"],"type":"string"},"state":{"description":"State or region.","examples":["Qormi"],"type":"string"},"country":{"description":"Country name.","examples":["Malta"],"type":"string"},"postal":{"description":"Postal code.","examples":["QRM"],"type":"string"},"localTime":{"description":"Local time at the IP location.","examples":["01:16 PM, Monday, November 25, 2024"],"type":"string"},"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Malta"],"type":"string"},"coordinates":{"description":"GPS coordinates [latitude, longitude].","examples":[[35.876,14.472]],"type":"array","items":{"type":"number"}}}}},"required":["asn","hostname","range","company","hostedDomains","privacy","anycast","asnType","abuseContact","geoIp"]}},"text/plain":{"schema":{"type":"object","properties":{"asn":{"type":"object","required":["id","title"],"properties":{"id":{"description":"Autonomous System Number.","examples":["AS12709"],"type":"string"},"title":{"description":"ASN organization name.","examples":["Melita Limited"],"type":"string"}}},"hostname":{"description":"Reverse DNS hostname.","examples":["c56-75.i05-15.onvol.net"],"type":"string"},"range":{"description":"IP CIDR range.","examples":["88.203.56.0/21"],"type":"string"},"company":{"description":"Company name of IP owner.","examples":["Melita plc"],"type":"string"},"hostedDomains":{"description":"Number of domains hosted on this IP.","type":"number"},"privacy":{"description":"Whether the IP is behind a privacy service (VPN/proxy).","type":"boolean"},"anycast":{"description":"Whether the IP is an anycast address.","type":"boolean"},"asnType":{"description":"ASN type: ISP, hosting, business or education.","examples":["ISP"],"type":"string"},"abuseContact":{"description":"Abuse contact email.","examples":["abuse@melitacable.com"],"type":"string"},"geoIp":{"type":"object","required":["city","state","country","postal","localTime","timezone","coordinates"],"properties":{"city":{"description":"City name.","examples":["Qormi"],"type":"string"},"state":{"description":"State or region.","examples":["Qormi"],"type":"string"},"country":{"description":"Country name.","examples":["Malta"],"type":"string"},"postal":{"description":"Postal code.","examples":["QRM"],"type":"string"},"localTime":{"description":"Local time at the IP location.","examples":["01:16 PM, Monday, November 25, 2024"],"type":"string"},"timezone":{"description":"IANA timezone identifier.","examples":["Europe/Malta"],"type":"string"},"coordinates":{"description":"GPS coordinates [latitude, longitude].","examples":[[35.876,14.472]],"type":"array","items":{"type":"number"}}}}},"required":["asn","hostname","range","company","hostedDomains","privacy","anycast","asnType","abuseContact","geoIp"]}}}}},"operationId":"getBffIp-infoDetail","tags":["IP Info"],"summary":"Get IP address information","description":"Returns detailed information about the requesting IP address including ASN, geolocation and privacy data."}},"/bff/issue/list":{"get":{"parameters":[{"description":"Filter by project key (e.g. \"PROJ\").","examples":["PROJ"],"schema":{"type":"string"},"in":"query","name":"projectCode","required":false},{"description":"Filter by status category id.","examples":[1],"schema":{"type":"number"},"in":"query","name":"statusCategoryId","required":false},{"description":"Technical context: browser name / version substring (`Safari`, `Chrome 131`).","examples":["Safari"],"schema":{"type":"string","maxLength":200},"in":"query","name":"techBrowser","required":false},{"description":"Technical context: OS name / version substring (`iOS`, `Windows`).","examples":["iOS"],"schema":{"type":"string","maxLength":200},"in":"query","name":"techOs","required":false},{"description":"Technical context: device type (`desktop`, `mobile`, `tablet`).","examples":["mobile"],"schema":{"type":"string","maxLength":20},"in":"query","name":"techDevice","required":false},{"description":"Technical context: page URL or route substring.","examples":["/invoice/"],"schema":{"type":"string","maxLength":200},"in":"query","name":"techUrl","required":false},{"description":"Technical context: app name / version / build / commit substring.","examples":["4.12"],"schema":{"type":"string","maxLength":200},"in":"query","name":"techAppVersion","required":false},{"description":"Filter by canonical status bucket — `new`, `progress`, `waiting`, `done`. Preferred over `statusCategoryId`. Admin-facing sentinels: `active` (everything except `done` — the operator default) and `all` (no status filter, used when searching history).","examples":["active"],"schema":{"type":"string"},"in":"query","name":"statusCategoryCode","required":false},{"description":"Filter by a specific status id (a custom org status inside a category).","examples":[42],"schema":{"type":"number"},"in":"query","name":"statusId","required":false},{"description":"Filter by assignee contact ID.","examples":[10],"schema":{"type":"number"},"in":"query","name":"assigneeId","required":false},{"description":"When true, restrict to issues with no primary assignee. Takes precedence over `assigneeId` when both are supplied.","schema":{"type":"boolean"},"in":"query","name":"unassigned","required":false},{"description":"Convenience shortcut used by the admin grid: `me` resolves to the caller's own contact id (server-side lookup, no client round-trip), `unassigned` maps to `unassigned=true`, and any other value is interpreted as a `shop__contact.external_id` (16-char slug) and resolved to that assignee — scoped to the caller organisation so a leaked id from another tenant simply returns no rows. Ignored when `assigneeId` or `unassigned` is set explicitly.","examples":["me","unassigned","1JfEq22KdM3B456i"],"schema":{"type":"string"},"in":"query","name":"assigneeFilter","required":false},{"description":"Filter by reporter contact ID.","examples":[5],"schema":{"type":"number"},"in":"query","name":"reporterId","required":false},{"description":"Admin grid shortcut: the reporter's `shop__contact.external_id` (16-char slug), resolved inside the caller organisation (a foreign id returns no rows). Ignored when `reporterId` is set.","examples":["1JfEq22KdM3B456i"],"schema":{"type":"string","maxLength":32},"in":"query","name":"reporterFilter","required":false},{"description":"Filter by priority (1=low..5=blocker). Rows with a NULL priority column are treated as `2` (the display fallback), matching what the operator sees in the grid.","examples":[3],"schema":{"type":"number","minimum":1,"maximum":5},"in":"query","name":"priority","required":false},{"description":"Spam scope: `true` = only rows classified as spam (`is_spam = true`), `false` = only non-spam (`is_spam IS NULL OR is_spam = false`), omitted = the same as `false` — the default hides spam so the operator inbox stays focused on actionable tickets. Pass `true` explicitly (the \"Zobrazit spam\" chip) to review spam.","schema":{"type":"boolean"},"in":"query","name":"isSpam","required":false},{"description":"Advanced filter — `true` narrows the list to rows where `pm__issue.secured_ticket = true`. Only meaningful for ORG ROOT viewers (non-root callers already have secured rows hidden by the confidentiality gate, so passing this from a non-root session just yields an empty list). Omitted = no explicit filter (the gate still hides secured rows from non-root viewers).","schema":{"type":"boolean"},"in":"query","name":"securedOnly","required":false},{"description":"Restrict to issues where a specific contact has *any* recorded interaction — reporter, assignee, commenter, watcher or mentioned. Value is the 16-char `shop__contact.external_id`. Used by the \"Úkoly\" tab on the contact detail; callers filtering by role instead should keep using `reporterId` / `assigneeId`.","examples":["1JfEq22KdM3B456i"],"schema":{"type":"string"},"in":"query","name":"contactExternalId","required":false},{"description":"Only issues carrying this organisation tag (`pm__tag.code`).","examples":["billing"],"schema":{"type":"string"},"in":"query","name":"tagCode","required":false},{"description":"Only issues of this type (`pm__issue_type.code`).","examples":["bug"],"schema":{"type":"string"},"in":"query","name":"typeCode","required":false},{"description":"BIZKIT-116: only issues linked to this branch (`shop__branch.slug`) of the organisation.","examples":["skvrnany"],"schema":{"type":"string"},"in":"query","name":"branchSlug","required":false},{"description":"When true, only open issues whose wall-clock age (since creation) exceeds the per-org SLA target of their priority.","schema":{"type":"boolean"},"in":"query","name":"overSla","required":false},{"description":"Fulltext box of the admin grid: case-insensitive substring match on subject or issue key.","examples":["faktura"],"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Sort key in `field:direction` format (matches the admin DataGrid wire contract). Supported fields: `smart` (composite scrum-backlog order — progress > waiting > new > done, then priority DESC, then velocity ASC, then type sort_order ASC, then last-activity DESC — DEFAULT when omitted), `insertedDate`, `updatedDate`, `priority`, `velocity`, `status`, `subject`, `issueKey`. Unknown fields silently fall back to `smart`. Direction is ignored for `smart` (it is a fixed composite).","examples":["smart:asc","insertedDate:desc","priority:desc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Page number (1-based).","examples":[1],"schema":{"type":"number","default":1},"in":"query","name":"page","required":false},{"description":"Items per page.","examples":[50],"schema":{"type":"number","default":50},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","velocity","type","status","assignee","reporter","isSpam","securedTicket","branch","tags","commentsCount","hasAttachments","isStale","insertedDate","updatedDate","ip","geo"],"properties":{"id":{"description":"Issue key (e.g. \"PROJ-123\"), used as public identifier.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"description":"Priority number (1=low, 2=normal, 3=high, 4=critical, 5=blocker).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25. Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear. Used as the 3rd sort tier in the operator smart backlog (priority → status → velocity).","type":"number"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"securedTicket":{"description":"`pm__issue.secured_ticket`. Only ever `true` in a payload delivered to a ROOT viewer — non-root callers already have the row filtered out. Surface for a \"Důvěrné\" chip / lock-icon renderer in the grid; never appears alongside a value that non-root operators are allowed to see.","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name","hidden"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"hidden":{"description":"Hidden from the branch technicians (`pm__issue.branch_hidden`).","type":"boolean"}}},{"type":"null"}]},"tags":{"description":"Organisation tags attached to the issue (label-sorted). Empty array when untagged.","type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"commentsCount":{"description":"Total comments on the issue across all author kinds. Zero when there are none — the UI should hide the badge for 0 rather than render \"0\".","type":"number"},"hasAttachments":{"description":"True when the issue has at least one file attached via `pm__issue_attachment`. Excludes the source-e-mail relation (`brj__emailer_received_email.issue_id`) — the paperclip icon in the grid must only reflect real file attachments, not the virtual pointer to the inbound mail that lifted the ticket.","type":"boolean"},"isStale":{"description":"True when the issue sits in `progress` or `waiting` and has not moved in 7+ days (no updated_date bump, no comment). Never true for `new` or `done`. Meant as a soft nudge in the grid — not a hard alert.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ip":{"nullable":true,"anyOf":[{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address (IPv4 or IPv6) or `null` when the origin request has no captured client IP.\n\n**When null:** the record was created by a server-internal actor (cron, workflow tick, manual admin backfill, mail pipeline) rather than a real HTTP visitor, so no forwarded header was available. UI should treat `null` as \"unknown origin\" (typically hide the `vikitron.com` deep-link and any geolocation badges), not as loopback.\n\nWhen non-null, the value is the canonicalized form described by `API_IP` — lowercase IPv6, IPv4-mapped IPv6 unwrapped to plain IPv4, junk collapsed to `127.0.0.1`.","type":"string"},{"type":"null"}]},"geo":{"description":"Reporter-IP geolocation (city + country) joined through `brj__geo_ip.city_id → brj__geo_ip_city`. `null` when the IP has no city record yet (cron backfill in flight) or the row is loopback.","nullable":true,"anyOf":[{"type":"object","required":["city","countryName","countryCode"],"properties":{"city":{"nullable":true,"anyOf":[{"description":"City name (`brj__geo_ip_city.city`).","type":"string"},{"type":"null"}]},"countryName":{"nullable":true,"anyOf":[{"description":"Country name (`brj__geo_ip_city.country`).","type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"description":"ISO-3166-1 alpha-2 country code derived from `countryName` via `formatCountryCode`. Kept on the wire so the admin grid can pick a flag emoji without shipping a name→code map to the client.","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"itemCount":{"description":"Total matching issues (for pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","velocity","type","status","assignee","reporter","isSpam","securedTicket","branch","tags","commentsCount","hasAttachments","isStale","insertedDate","updatedDate","ip","geo"],"properties":{"id":{"description":"Issue key (e.g. \"PROJ-123\"), used as public identifier.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"description":"Priority number (1=low, 2=normal, 3=high, 4=critical, 5=blocker).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25. Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear. Used as the 3rd sort tier in the operator smart backlog (priority → status → velocity).","type":"number"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"securedTicket":{"description":"`pm__issue.secured_ticket`. Only ever `true` in a payload delivered to a ROOT viewer — non-root callers already have the row filtered out. Surface for a \"Důvěrné\" chip / lock-icon renderer in the grid; never appears alongside a value that non-root operators are allowed to see.","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name","hidden"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"hidden":{"description":"Hidden from the branch technicians (`pm__issue.branch_hidden`).","type":"boolean"}}},{"type":"null"}]},"tags":{"description":"Organisation tags attached to the issue (label-sorted). Empty array when untagged.","type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"commentsCount":{"description":"Total comments on the issue across all author kinds. Zero when there are none — the UI should hide the badge for 0 rather than render \"0\".","type":"number"},"hasAttachments":{"description":"True when the issue has at least one file attached via `pm__issue_attachment`. Excludes the source-e-mail relation (`brj__emailer_received_email.issue_id`) — the paperclip icon in the grid must only reflect real file attachments, not the virtual pointer to the inbound mail that lifted the ticket.","type":"boolean"},"isStale":{"description":"True when the issue sits in `progress` or `waiting` and has not moved in 7+ days (no updated_date bump, no comment). Never true for `new` or `done`. Meant as a soft nudge in the grid — not a hard alert.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ip":{"nullable":true,"anyOf":[{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address (IPv4 or IPv6) or `null` when the origin request has no captured client IP.\n\n**When null:** the record was created by a server-internal actor (cron, workflow tick, manual admin backfill, mail pipeline) rather than a real HTTP visitor, so no forwarded header was available. UI should treat `null` as \"unknown origin\" (typically hide the `vikitron.com` deep-link and any geolocation badges), not as loopback.\n\nWhen non-null, the value is the canonicalized form described by `API_IP` — lowercase IPv6, IPv4-mapped IPv6 unwrapped to plain IPv4, junk collapsed to `127.0.0.1`.","type":"string"},{"type":"null"}]},"geo":{"description":"Reporter-IP geolocation (city + country) joined through `brj__geo_ip.city_id → brj__geo_ip_city`. `null` when the IP has no city record yet (cron backfill in flight) or the row is loopback.","nullable":true,"anyOf":[{"type":"object","required":["city","countryName","countryCode"],"properties":{"city":{"nullable":true,"anyOf":[{"description":"City name (`brj__geo_ip_city.city`).","type":"string"},{"type":"null"}]},"countryName":{"nullable":true,"anyOf":[{"description":"Country name (`brj__geo_ip_city.country`).","type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"description":"ISO-3166-1 alpha-2 country code derived from `countryName` via `formatCountryCode`. Kept on the wire so the admin grid can pick a flag emoji without shipping a name→code map to the client.","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"itemCount":{"description":"Total matching issues (for pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","velocity","type","status","assignee","reporter","isSpam","securedTicket","branch","tags","commentsCount","hasAttachments","isStale","insertedDate","updatedDate","ip","geo"],"properties":{"id":{"description":"Issue key (e.g. \"PROJ-123\"), used as public identifier.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"description":"Priority number (1=low, 2=normal, 3=high, 4=critical, 5=blocker).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25. Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear. Used as the 3rd sort tier in the operator smart backlog (priority → status → velocity).","type":"number"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"securedTicket":{"description":"`pm__issue.secured_ticket`. Only ever `true` in a payload delivered to a ROOT viewer — non-root callers already have the row filtered out. Surface for a \"Důvěrné\" chip / lock-icon renderer in the grid; never appears alongside a value that non-root operators are allowed to see.","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name","hidden"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"hidden":{"description":"Hidden from the branch technicians (`pm__issue.branch_hidden`).","type":"boolean"}}},{"type":"null"}]},"tags":{"description":"Organisation tags attached to the issue (label-sorted). Empty array when untagged.","type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"commentsCount":{"description":"Total comments on the issue across all author kinds. Zero when there are none — the UI should hide the badge for 0 rather than render \"0\".","type":"number"},"hasAttachments":{"description":"True when the issue has at least one file attached via `pm__issue_attachment`. Excludes the source-e-mail relation (`brj__emailer_received_email.issue_id`) — the paperclip icon in the grid must only reflect real file attachments, not the virtual pointer to the inbound mail that lifted the ticket.","type":"boolean"},"isStale":{"description":"True when the issue sits in `progress` or `waiting` and has not moved in 7+ days (no updated_date bump, no comment). Never true for `new` or `done`. Meant as a soft nudge in the grid — not a hard alert.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ip":{"nullable":true,"anyOf":[{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address (IPv4 or IPv6) or `null` when the origin request has no captured client IP.\n\n**When null:** the record was created by a server-internal actor (cron, workflow tick, manual admin backfill, mail pipeline) rather than a real HTTP visitor, so no forwarded header was available. UI should treat `null` as \"unknown origin\" (typically hide the `vikitron.com` deep-link and any geolocation badges), not as loopback.\n\nWhen non-null, the value is the canonicalized form described by `API_IP` — lowercase IPv6, IPv4-mapped IPv6 unwrapped to plain IPv4, junk collapsed to `127.0.0.1`.","type":"string"},{"type":"null"}]},"geo":{"description":"Reporter-IP geolocation (city + country) joined through `brj__geo_ip.city_id → brj__geo_ip_city`. `null` when the IP has no city record yet (cron backfill in flight) or the row is loopback.","nullable":true,"anyOf":[{"type":"object","required":["city","countryName","countryCode"],"properties":{"city":{"nullable":true,"anyOf":[{"description":"City name (`brj__geo_ip_city.city`).","type":"string"},{"type":"null"}]},"countryName":{"nullable":true,"anyOf":[{"description":"Country name (`brj__geo_ip_city.country`).","type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"description":"ISO-3166-1 alpha-2 country code derived from `countryName` via `formatCountryCode`. Kept on the wire so the admin grid can pick a flag emoji without shipping a name→code map to the client.","type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"itemCount":{"description":"Total matching issues (for pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssueList","tags":["Issue"],"summary":"List issues","description":"Returns a paginated list of issues for the organisation. Supports filtering by project, status category, assignee, reporter, and spam status. The default order is `smart` — a scrum-backlog composite that surfaces in-progress work first, then waiting, then new, and finally done, breaking ties by priority (higher first) and last activity (fresher first). Clients can override via `orderBy=field:direction`."}},"/bff/issue/my-list":{"get":{"parameters":[{"description":"Filter by canonical status bucket — `new`, `progress`, `waiting`, `done`. Admin-facing sentinels: `active` (everything except `done` — the operator default) and `all` (no status filter).","examples":["active"],"schema":{"type":"string"},"in":"query","name":"statusCategoryCode","required":false},{"description":"Filter by priority (1=low..5=blocker). Rows with a NULL priority column are treated as `2` (the display fallback).","examples":[3],"schema":{"type":"number","minimum":1,"maximum":5},"in":"query","name":"priority","required":false},{"description":"Spam scope: `true` = only rows classified as spam, omitted = hide spam (`is_spam IS NULL OR false`). Same policy as `/list` — the default keeps the personal focus view clean.","schema":{"type":"boolean"},"in":"query","name":"isSpam","required":false},{"description":"Sort key in `field:direction` format. Same whitelist as `/list` (`smart`, `insertedDate`, `updatedDate`, `priority`, `velocity`, `status`, `subject`, `issueKey`). Unknown fields fall back to `smart`.","examples":["smart:asc","updatedDate:desc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Page number (1-based).","examples":[1],"schema":{"type":"number","default":1},"in":"query","name":"page","required":false},{"description":"Items per page.","examples":[50],"schema":{"type":"number","default":50},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","velocity","type","status","assignee","reporter","isSpam","securedTicket","branch","tags","commentsCount","hasAttachments","isStale","insertedDate","updatedDate","ip","geo","organisation"],"properties":{"id":{"description":"Issue key (e.g. \"PROJ-123\"), used as public identifier.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"description":"Priority number (1=low, 2=normal, 3=high, 4=critical, 5=blocker).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25.","type":"number"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"securedTicket":{"description":"`pm__issue.secured_ticket`. Only ever `true` for rows in orgs where the viewer is root (per-org filter in `selectMyIssueList`).","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name","hidden"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"hidden":{"description":"Hidden from the branch technicians (`pm__issue.branch_hidden`).","type":"boolean"}}},{"type":"null"}]},"tags":{"description":"Organisation tags attached to the issue (label-sorted). Empty array when untagged.","type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"commentsCount":{"description":"Total comments across all author kinds.","type":"number"},"hasAttachments":{"description":"True when the issue has at least one file attached via `pm__issue_attachment`. Excludes the source-e-mail relation.","type":"boolean"},"isStale":{"description":"True when the issue is `progress`/`waiting` and has not moved in 7+ days.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ip":{"nullable":true,"anyOf":[{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address (IPv4 or IPv6) or `null` when the origin request has no captured client IP.\n\n**When null:** the record was created by a server-internal actor (cron, workflow tick, manual admin backfill, mail pipeline) rather than a real HTTP visitor, so no forwarded header was available. UI should treat `null` as \"unknown origin\" (typically hide the `vikitron.com` deep-link and any geolocation badges), not as loopback.\n\nWhen non-null, the value is the canonicalized form described by `API_IP` — lowercase IPv6, IPv4-mapped IPv6 unwrapped to plain IPv4, junk collapsed to `127.0.0.1`.","type":"string"},{"type":"null"}]},"geo":{"nullable":true,"anyOf":[{"type":"object","required":["city","countryName","countryCode"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"organisation":{"description":"Owning organisation of the issue. Present only on the cross-org endpoint — the admin grid uses it to disambiguate issue keys across tenants.","type":"object","required":["id","name","slug","emoji"],"properties":{"id":{"description":"`cas__organisation.id` — internal, useful for cross-checks.","type":"number"},"name":{"description":"Display name of the organisation.","type":"string"},"slug":{"description":"URL slug of the organisation.","type":"string"},"emoji":{"nullable":true,"anyOf":[{"description":"Optional emoji chosen by the org owner (`cas__organisation.emoji`). The admin grid renders it as a compact prefix in the \"Organisation\" chip; falls back to a text-only chip when absent.","type":"string"},{"type":"null"}]}}}}}},"itemCount":{"description":"Total matching issues (for pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","velocity","type","status","assignee","reporter","isSpam","securedTicket","branch","tags","commentsCount","hasAttachments","isStale","insertedDate","updatedDate","ip","geo","organisation"],"properties":{"id":{"description":"Issue key (e.g. \"PROJ-123\"), used as public identifier.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"description":"Priority number (1=low, 2=normal, 3=high, 4=critical, 5=blocker).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25.","type":"number"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"securedTicket":{"description":"`pm__issue.secured_ticket`. Only ever `true` for rows in orgs where the viewer is root (per-org filter in `selectMyIssueList`).","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name","hidden"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"hidden":{"description":"Hidden from the branch technicians (`pm__issue.branch_hidden`).","type":"boolean"}}},{"type":"null"}]},"tags":{"description":"Organisation tags attached to the issue (label-sorted). Empty array when untagged.","type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"commentsCount":{"description":"Total comments across all author kinds.","type":"number"},"hasAttachments":{"description":"True when the issue has at least one file attached via `pm__issue_attachment`. Excludes the source-e-mail relation.","type":"boolean"},"isStale":{"description":"True when the issue is `progress`/`waiting` and has not moved in 7+ days.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ip":{"nullable":true,"anyOf":[{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address (IPv4 or IPv6) or `null` when the origin request has no captured client IP.\n\n**When null:** the record was created by a server-internal actor (cron, workflow tick, manual admin backfill, mail pipeline) rather than a real HTTP visitor, so no forwarded header was available. UI should treat `null` as \"unknown origin\" (typically hide the `vikitron.com` deep-link and any geolocation badges), not as loopback.\n\nWhen non-null, the value is the canonicalized form described by `API_IP` — lowercase IPv6, IPv4-mapped IPv6 unwrapped to plain IPv4, junk collapsed to `127.0.0.1`.","type":"string"},{"type":"null"}]},"geo":{"nullable":true,"anyOf":[{"type":"object","required":["city","countryName","countryCode"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"organisation":{"description":"Owning organisation of the issue. Present only on the cross-org endpoint — the admin grid uses it to disambiguate issue keys across tenants.","type":"object","required":["id","name","slug","emoji"],"properties":{"id":{"description":"`cas__organisation.id` — internal, useful for cross-checks.","type":"number"},"name":{"description":"Display name of the organisation.","type":"string"},"slug":{"description":"URL slug of the organisation.","type":"string"},"emoji":{"nullable":true,"anyOf":[{"description":"Optional emoji chosen by the org owner (`cas__organisation.emoji`). The admin grid renders it as a compact prefix in the \"Organisation\" chip; falls back to a text-only chip when absent.","type":"string"},{"type":"null"}]}}}}}},"itemCount":{"description":"Total matching issues (for pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","velocity","type","status","assignee","reporter","isSpam","securedTicket","branch","tags","commentsCount","hasAttachments","isStale","insertedDate","updatedDate","ip","geo","organisation"],"properties":{"id":{"description":"Issue key (e.g. \"PROJ-123\"), used as public identifier.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"description":"Priority number (1=low, 2=normal, 3=high, 4=critical, 5=blocker).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25.","type":"number"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"securedTicket":{"description":"`pm__issue.secured_ticket`. Only ever `true` for rows in orgs where the viewer is root (per-org filter in `selectMyIssueList`).","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name","hidden"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"hidden":{"description":"Hidden from the branch technicians (`pm__issue.branch_hidden`).","type":"boolean"}}},{"type":"null"}]},"tags":{"description":"Organisation tags attached to the issue (label-sorted). Empty array when untagged.","type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"commentsCount":{"description":"Total comments across all author kinds.","type":"number"},"hasAttachments":{"description":"True when the issue has at least one file attached via `pm__issue_attachment`. Excludes the source-e-mail relation.","type":"boolean"},"isStale":{"description":"True when the issue is `progress`/`waiting` and has not moved in 7+ days.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"ip":{"nullable":true,"anyOf":[{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address (IPv4 or IPv6) or `null` when the origin request has no captured client IP.\n\n**When null:** the record was created by a server-internal actor (cron, workflow tick, manual admin backfill, mail pipeline) rather than a real HTTP visitor, so no forwarded header was available. UI should treat `null` as \"unknown origin\" (typically hide the `vikitron.com` deep-link and any geolocation badges), not as loopback.\n\nWhen non-null, the value is the canonicalized form described by `API_IP` — lowercase IPv6, IPv4-mapped IPv6 unwrapped to plain IPv4, junk collapsed to `127.0.0.1`.","type":"string"},{"type":"null"}]},"geo":{"nullable":true,"anyOf":[{"type":"object","required":["city","countryName","countryCode"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"organisation":{"description":"Owning organisation of the issue. Present only on the cross-org endpoint — the admin grid uses it to disambiguate issue keys across tenants.","type":"object","required":["id","name","slug","emoji"],"properties":{"id":{"description":"`cas__organisation.id` — internal, useful for cross-checks.","type":"number"},"name":{"description":"Display name of the organisation.","type":"string"},"slug":{"description":"URL slug of the organisation.","type":"string"},"emoji":{"nullable":true,"anyOf":[{"description":"Optional emoji chosen by the org owner (`cas__organisation.emoji`). The admin grid renders it as a compact prefix in the \"Organisation\" chip; falls back to a text-only chip when absent.","type":"string"},{"type":"null"}]}}}}}},"itemCount":{"description":"Total matching issues (for pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssueMy-list","tags":["Issue"],"summary":"List issues assigned to or reported by the viewer, across all their organisations","description":"Returns issues where the currently authenticated user is either the primary assignee OR the reporter, resolved across every active membership of the viewer via `cas__organisation_member.user_id`. This is the documented second exception to the per-org WHERE invariant (after `/bff/calendar/my-overlay`). Each row carries an `organisation` block so the admin can disambiguate issue keys that would otherwise collide across tenants (two orgs can each have a \"PROJ\" project independently). Filters are intentionally narrower than `/list` — no project / assignee / reporter / contact filters, since they conflict with the cross-org \"mine\" semantics."}},"/bff/issue/branch-options":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffIssueBranch-options","tags":["Issue"],"summary":"Branches selectable on an issue","description":"BIZKIT-116: active branches of the organisation for the issue-detail branch picker (slug + name only, no branch-module permission needed). Empty list = the organisation has no branches; admin hides the picker."}},"/bff/issue/set-branch":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"branch":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"branchSource":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"branchHidden":{"type":"boolean"},"branchActionRequired":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"branchActionSource":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","branch","branchSource","branchHidden","branchActionRequired","branchActionSource"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"branch":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"branchSource":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"branchHidden":{"type":"boolean"},"branchActionRequired":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"branchActionSource":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","branch","branchSource","branchHidden","branchActionRequired","branchActionSource"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"branch":{"nullable":true,"anyOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"branchSource":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"branchHidden":{"type":"boolean"},"branchActionRequired":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"branchActionSource":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","branch","branchSource","branchHidden","branchActionRequired","branchActionSource"]}}}}},"operationId":"postBffIssueSet-branch","tags":["Issue"],"summary":"Link an issue to a branch","description":"BIZKIT-116: sets the branch the ticket is about. Technicians of that branch see it through `/api/v1/support/my-issue-*` unless it is confidential (`securedTicket`) or `branchHidden`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["GYMRO-844"],"type":"string"},"branchSlug":{"nullable":true,"anyOf":[{"description":"Branch slug to link; `null` (or empty) unlinks; omit to keep. Re-linking clears a previous hand-over.","examples":["skvrnany"],"type":"string"},{"type":"null"}]},"branchHidden":{"description":"Hide the ticket from the branch technicians although it is linked to their branch (complaint about the operator, payments, legal, security).","type":"boolean"},"branchActionRequired":{"description":"BIZKIT-124: the branch must act on this ticket. Stored as a manual decision (the AI never overrides it). Branches with involvement `flagged` / `manual` only see and get e-mails about flagged tickets.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["GYMRO-844"],"type":"string"},"branchSlug":{"nullable":true,"anyOf":[{"description":"Branch slug to link; `null` (or empty) unlinks; omit to keep. Re-linking clears a previous hand-over.","examples":["skvrnany"],"type":"string"},{"type":"null"}]},"branchHidden":{"description":"Hide the ticket from the branch technicians although it is linked to their branch (complaint about the operator, payments, legal, security).","type":"boolean"},"branchActionRequired":{"description":"BIZKIT-124: the branch must act on this ticket. Stored as a manual decision (the AI never overrides it). Branches with involvement `flagged` / `manual` only see and get e-mails about flagged tickets.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["GYMRO-844"],"type":"string"},"branchSlug":{"nullable":true,"anyOf":[{"description":"Branch slug to link; `null` (or empty) unlinks; omit to keep. Re-linking clears a previous hand-over.","examples":["skvrnany"],"type":"string"},{"type":"null"}]},"branchHidden":{"description":"Hide the ticket from the branch technicians although it is linked to their branch (complaint about the operator, payments, legal, security).","type":"boolean"},"branchActionRequired":{"description":"BIZKIT-124: the branch must act on this ticket. Stored as a manual decision (the AI never overrides it). Branches with involvement `flagged` / `manual` only see and get e-mails about flagged tickets.","type":"boolean"}}}}}}}},"/bff/issue/detail":{"get":{"parameters":[{"description":"Issue key (e.g. \"PROJ-123\").","examples":["PROJ-123"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["id","internalId","externalId","issueKey","subject","description","internalDescription","aiSummary","priority","priorityLabel","velocity","projectId","projectExternalId","projectKey","projectName","type","status","assignee","reporter","isSpam","parentId","parent","dueDate","testUrl","documentationUrl","humanOnly","securedTicket","branch","branchSource","branchHidden","branchHandoverDate","branchActionRequired","branchActionSource","insertedDate","updatedDate","attachments","sourceEmails","ip","originChannel","locale"],"properties":{"id":{"description":"Issue key.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"externalId":{"description":"Immutable 16-char alphanumeric public identifier (`pm__issue.external_id`). Used in customer-facing URLs (support portal, e-mail deep links, `[BKH-ISSUE:xxxxxxxxxxxxxxxx]` tokens) and for cross-system references — never changes across the ticket's lifetime, unlike `issueKey` which is tied to the project prefix and could theoretically re-key on a merge.","type":"string"},"issueKey":{"description":"Issue key (e.g. \"PROJ-123\").","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"description":{"description":"Issue description (HTML).","type":"string"},"internalDescription":{"nullable":true,"anyOf":[{"description":"Internal notes visible only to team members.","type":"string"},{"type":"null"}]},"aiSummary":{"nullable":true,"anyOf":[{"description":"LLM-produced short paraphrase of the description in the reporter's language (~400 chars). Read-only in the admin UI — writes only originate from the inbound-mail classifier, `updateIssue` regen when the description is edited, or the explicit `/bff/issue/generate-summary` button. `null` when no summary has been generated yet.","type":"string"},{"type":"null"}]},"priority":{"description":"Priority (1-5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25. Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear.","type":"number"},"projectId":{"description":"Internal project id.","type":"number"},"projectExternalId":{"description":"Project URL handle, admin links the breadcrumb to `/project/{projectExternalId}`.","type":"string"},"projectKey":{"description":"Project key (e.g. \"PROJ\").","type":"string"},"projectName":{"description":"Project display name.","type":"string"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"description":"Internal ID of the parent issue (for sub-tasks or merged children).","type":"number"},{"type":"null"}]},"parent":{"description":"Populated when this issue has been merged into another via `/bff/issue/merge` (or filed as a sub-task with a parent). The admin renders a prominent \"merged into\" callout linking here. `null` for regular top-level issues.","nullable":true,"anyOf":[{"type":"object","required":["issueKey","subject","statusCategoryCode"],"properties":{"issueKey":{"description":"Parent issue key — use in `/issue/{issueKey}` for the FE link.","type":"string"},"subject":{"description":"Parent subject, rendered inline in the \"merged into\" callout.","type":"string"},"statusCategoryCode":{"description":"Canonical bucket code (`new` / `progress` / `waiting` / `done`) so the FE can dot-color the callout.","type":"string"}}},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"description":"Due date.","anyOf":[{"description":"Due date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"testUrl":{"nullable":true,"anyOf":[{"description":"URL to test environment.","type":"string"},{"type":"null"}]},"documentationUrl":{"nullable":true,"anyOf":[{"description":"URL to documentation.","type":"string"},{"type":"null"}]},"humanOnly":{"description":"When `true`, the AI orchestrator (and any future automated agent) aborts and never touches this ticket. Set by operators for tickets that need human judgement (legal escalation, incident, VIP).","type":"boolean"},"securedTicket":{"description":"When `true`, the ticket is marked confidential (`pm__issue.secured_ticket`) and only ORG ROOT members can see it. Regular members receive `{ exist: false }` from `/bff/issue/detail` for this issue and never see it in lists or counts. Written by the AI classifiers (mail + triage) on the way in — a Comgate payment-status mail auto-flags the issue as secured — and toggled by root operators from the sidebar.","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"branchSource":{"nullable":true,"anyOf":[{"description":"Who linked the branch: `manual` (admin), `caller` (API / contact form), `ai` (triage).","type":"string"},{"type":"null"}]},"branchHidden":{"description":"Hidden from the branch technicians (franchisee API) although linked to their branch: complaint about the operator, payments, legal, security.","type":"boolean"},"branchHandoverDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp when a branch technician handed the ticket back to the head office; null otherwise.","type":"string"},{"type":"null"}]},"branchActionRequired":{"nullable":true,"anyOf":[{"description":"BIZKIT-124: the branch must act on this ticket; null = not evaluated.","type":"boolean"},{"type":"null"}]},"branchActionSource":{"nullable":true,"anyOf":[{"description":"Who set `branchActionRequired`: `ai` or `manual`.","type":"string"},{"type":"null"}]},"subjectIsPlaceholder":{"description":"`true` while the subject is a server-derived stand-in (reporter filed via \"Napsat podpoře\" without a subject) awaiting the AI triage rewrite.","type":"boolean"},"reporterPageUrl":{"nullable":true,"anyOf":[{"description":"Admin page URL the reporter was on when they opened \"Napsat podpoře\". `null` for tickets from other channels.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"attachments":{"description":"Files linked to the issue via `pm__issue_attachment`. Empty when the issue has none.","type":"array","items":{"type":"object","required":["blobToken","filename","size","downloadUrl","position"],"properties":{"blobToken":{"description":"core__blob.token — pass to <FileViewer> for inline preview.","type":"string"},"filename":{"description":"Original filename as stored on the blob. Never null — when the blob was ingested without a filename (e.g. an inbound e-mail attachment with a missing `Content-Disposition: filename=…`), the endpoint substitutes a `priloha.<ext>` placeholder derived from the MIME type.","type":"string"},"contentType":{"description":"MIME type.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"downloadUrl":{"description":"Signed direct-download URL to the storage bucket.","type":"string"},"position":{"description":"Display order within the issue (1-based).","type":"number"}}}},"sourceEmails":{"description":"Inbound-mail rows linked via `brj__emailer_received_email.issue_id`. Ordered oldest first — the first entry is the originating mail that lifted the ticket. Empty when the issue was not created from mail.","type":"array","items":{"type":"object","required":["externalId","subject","fromAddress","receivedAt"],"properties":{"externalId":{"description":"Public 16-char identifier of the inbound mail — use in `/emailer/received/:externalId` for the admin link.","type":"string"},"subject":{"description":"Subject as received from Resend.","type":"string"},"fromAddress":{"description":"Envelope From address.","type":"string"},"receivedAt":{"description":"When Resend received the message.","anyOf":[{"description":"When Resend received the message.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"ip":{"description":"Reporter geolocation snapshot resolved from the request IP at ticket creation. Same shape as the order-detail `ip` block so the admin can reuse the same rendering component. `null` for tickets created without request-time IP context (cron, mail pipeline, manual admin entry). Admin hides the block for `127.0.0.1`.","anyOf":[{"type":"null"},{"type":"object","required":["ip","city","country","countryRegion","latitude","longitude","hostname","timezone","mobile","proxy","hosting","tor"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"description":"City name (`brj__geo_ip_city.city`).","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"Country name (`brj__geo_ip_city.country`).","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"ISO 3166-2 country subdivision (`brj__geo_ip_city.country_region`).","type":"string"},{"type":"null"}]},"latitude":{"nullable":true,"anyOf":[{"description":"City-center latitude (`brj__geo_ip_city.latitude`).","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"City-center longitude (`brj__geo_ip_city.longitude`).","type":"number"},{"type":"null"}]},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse-DNS hostname (`brj__geo_ip.hostname`), when resolved.","type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"description":"IANA timezone (`cas__timezone.timezone`) resolved via `brj__geo_ip.timezone_id`.","type":"string"},{"type":"null"}]},"mobile":{"description":"`true` when ip-api flagged the IP as a mobile carrier network. Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"proxy":{"description":"`true` when ip-api flagged the IP as an anonymising proxy / VPN. Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"hosting":{"description":"`true` when ip-api flagged the IP as hosting infrastructure (data-center, cloud provider). Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"tor":{"nullable":true,"anyOf":[{"description":"`true` when the IP is on the TOR exit-node list at the time the ticket was created. `null` when TOR classification has not yet been resolved (distinct from a known non-TOR `false`).","type":"boolean"},{"type":"null"}]},"asn":{"nullable":true,"anyOf":[{"description":"Autonomous system number (`AS13335`). `null` until ip-api enrichment ran.","type":"string"},{"type":"null"}]},"asName":{"nullable":true,"anyOf":[{"description":"Autonomous system name.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"Internet service provider.","type":"string"},{"type":"null"}]}}}]},"originChannel":{"description":"Entry point that created the issue, resolved via `pm__issue.origin_channel_id` → `pm__issue_origin_channel`. `null` for pre-migration rows and paths that do not yet pass a channel code. Rendered as \"Zdroj: …\" in the admin sidebar Details card.","anyOf":[{"type":"null"},{"type":"object","required":["code","label"],"properties":{"code":{"description":"Stable machine identifier of the entry point (`contact_form`, `mail_in`, `admin`, `api`, `cron`, `agent`) from `pm__issue_origin_channel.code`. Opaque to the admin — used as a lookup key into the FE i18n dictionary.","type":"string"},"label":{"description":"Canonical Czech label from `pm__issue_origin_channel.label`. Used as a fallback when the admin has no translation for the code.","type":"string"}}}]},"technicalContext":{"nullable":true,"anyOf":[{"description":"Reporter environment captured at submit time (`TechnicalContext`: page, client, session, network, app, correlation, diagnostics, custom). INTERNAL: only the organisation owning the issue project receives it; the originating (reporter) organisation of a support ticket always gets `null`. The admin renders it collapsed at the end of the ticket.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"locale":{"description":"ISO 639-1 code (e.g. `\"cs\"`, `\"en\"`) of the language this issue is conducted in — the value of `pm__issue.locale_id` joined to `core__localization_locale.locale`. Populated deterministically at INSERT (reporter → org fallback) and refined by AI during triage; NOT NULL invariant, so every issue has a real code. The admin renders it as `\"EN — angličtina\"` (short code + `Intl.DisplayNames` full name in the operator's UI locale) in the sidebar Details card.","type":"string"}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["id","internalId","externalId","issueKey","subject","description","internalDescription","aiSummary","priority","priorityLabel","velocity","projectId","projectExternalId","projectKey","projectName","type","status","assignee","reporter","isSpam","parentId","parent","dueDate","testUrl","documentationUrl","humanOnly","securedTicket","branch","branchSource","branchHidden","branchHandoverDate","branchActionRequired","branchActionSource","insertedDate","updatedDate","attachments","sourceEmails","ip","originChannel","locale"],"properties":{"id":{"description":"Issue key.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"externalId":{"description":"Immutable 16-char alphanumeric public identifier (`pm__issue.external_id`). Used in customer-facing URLs (support portal, e-mail deep links, `[BKH-ISSUE:xxxxxxxxxxxxxxxx]` tokens) and for cross-system references — never changes across the ticket's lifetime, unlike `issueKey` which is tied to the project prefix and could theoretically re-key on a merge.","type":"string"},"issueKey":{"description":"Issue key (e.g. \"PROJ-123\").","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"description":{"description":"Issue description (HTML).","type":"string"},"internalDescription":{"nullable":true,"anyOf":[{"description":"Internal notes visible only to team members.","type":"string"},{"type":"null"}]},"aiSummary":{"nullable":true,"anyOf":[{"description":"LLM-produced short paraphrase of the description in the reporter's language (~400 chars). Read-only in the admin UI — writes only originate from the inbound-mail classifier, `updateIssue` regen when the description is edited, or the explicit `/bff/issue/generate-summary` button. `null` when no summary has been generated yet.","type":"string"},{"type":"null"}]},"priority":{"description":"Priority (1-5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25. Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear.","type":"number"},"projectId":{"description":"Internal project id.","type":"number"},"projectExternalId":{"description":"Project URL handle, admin links the breadcrumb to `/project/{projectExternalId}`.","type":"string"},"projectKey":{"description":"Project key (e.g. \"PROJ\").","type":"string"},"projectName":{"description":"Project display name.","type":"string"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"description":"Internal ID of the parent issue (for sub-tasks or merged children).","type":"number"},{"type":"null"}]},"parent":{"description":"Populated when this issue has been merged into another via `/bff/issue/merge` (or filed as a sub-task with a parent). The admin renders a prominent \"merged into\" callout linking here. `null` for regular top-level issues.","nullable":true,"anyOf":[{"type":"object","required":["issueKey","subject","statusCategoryCode"],"properties":{"issueKey":{"description":"Parent issue key — use in `/issue/{issueKey}` for the FE link.","type":"string"},"subject":{"description":"Parent subject, rendered inline in the \"merged into\" callout.","type":"string"},"statusCategoryCode":{"description":"Canonical bucket code (`new` / `progress` / `waiting` / `done`) so the FE can dot-color the callout.","type":"string"}}},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"description":"Due date.","anyOf":[{"description":"Due date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"testUrl":{"nullable":true,"anyOf":[{"description":"URL to test environment.","type":"string"},{"type":"null"}]},"documentationUrl":{"nullable":true,"anyOf":[{"description":"URL to documentation.","type":"string"},{"type":"null"}]},"humanOnly":{"description":"When `true`, the AI orchestrator (and any future automated agent) aborts and never touches this ticket. Set by operators for tickets that need human judgement (legal escalation, incident, VIP).","type":"boolean"},"securedTicket":{"description":"When `true`, the ticket is marked confidential (`pm__issue.secured_ticket`) and only ORG ROOT members can see it. Regular members receive `{ exist: false }` from `/bff/issue/detail` for this issue and never see it in lists or counts. Written by the AI classifiers (mail + triage) on the way in — a Comgate payment-status mail auto-flags the issue as secured — and toggled by root operators from the sidebar.","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"branchSource":{"nullable":true,"anyOf":[{"description":"Who linked the branch: `manual` (admin), `caller` (API / contact form), `ai` (triage).","type":"string"},{"type":"null"}]},"branchHidden":{"description":"Hidden from the branch technicians (franchisee API) although linked to their branch: complaint about the operator, payments, legal, security.","type":"boolean"},"branchHandoverDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp when a branch technician handed the ticket back to the head office; null otherwise.","type":"string"},{"type":"null"}]},"branchActionRequired":{"nullable":true,"anyOf":[{"description":"BIZKIT-124: the branch must act on this ticket; null = not evaluated.","type":"boolean"},{"type":"null"}]},"branchActionSource":{"nullable":true,"anyOf":[{"description":"Who set `branchActionRequired`: `ai` or `manual`.","type":"string"},{"type":"null"}]},"subjectIsPlaceholder":{"description":"`true` while the subject is a server-derived stand-in (reporter filed via \"Napsat podpoře\" without a subject) awaiting the AI triage rewrite.","type":"boolean"},"reporterPageUrl":{"nullable":true,"anyOf":[{"description":"Admin page URL the reporter was on when they opened \"Napsat podpoře\". `null` for tickets from other channels.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"attachments":{"description":"Files linked to the issue via `pm__issue_attachment`. Empty when the issue has none.","type":"array","items":{"type":"object","required":["blobToken","filename","size","downloadUrl","position"],"properties":{"blobToken":{"description":"core__blob.token — pass to <FileViewer> for inline preview.","type":"string"},"filename":{"description":"Original filename as stored on the blob. Never null — when the blob was ingested without a filename (e.g. an inbound e-mail attachment with a missing `Content-Disposition: filename=…`), the endpoint substitutes a `priloha.<ext>` placeholder derived from the MIME type.","type":"string"},"contentType":{"description":"MIME type.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"downloadUrl":{"description":"Signed direct-download URL to the storage bucket.","type":"string"},"position":{"description":"Display order within the issue (1-based).","type":"number"}}}},"sourceEmails":{"description":"Inbound-mail rows linked via `brj__emailer_received_email.issue_id`. Ordered oldest first — the first entry is the originating mail that lifted the ticket. Empty when the issue was not created from mail.","type":"array","items":{"type":"object","required":["externalId","subject","fromAddress","receivedAt"],"properties":{"externalId":{"description":"Public 16-char identifier of the inbound mail — use in `/emailer/received/:externalId` for the admin link.","type":"string"},"subject":{"description":"Subject as received from Resend.","type":"string"},"fromAddress":{"description":"Envelope From address.","type":"string"},"receivedAt":{"description":"When Resend received the message.","anyOf":[{"description":"When Resend received the message.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"ip":{"description":"Reporter geolocation snapshot resolved from the request IP at ticket creation. Same shape as the order-detail `ip` block so the admin can reuse the same rendering component. `null` for tickets created without request-time IP context (cron, mail pipeline, manual admin entry). Admin hides the block for `127.0.0.1`.","anyOf":[{"type":"null"},{"type":"object","required":["ip","city","country","countryRegion","latitude","longitude","hostname","timezone","mobile","proxy","hosting","tor"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"description":"City name (`brj__geo_ip_city.city`).","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"Country name (`brj__geo_ip_city.country`).","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"ISO 3166-2 country subdivision (`brj__geo_ip_city.country_region`).","type":"string"},{"type":"null"}]},"latitude":{"nullable":true,"anyOf":[{"description":"City-center latitude (`brj__geo_ip_city.latitude`).","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"City-center longitude (`brj__geo_ip_city.longitude`).","type":"number"},{"type":"null"}]},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse-DNS hostname (`brj__geo_ip.hostname`), when resolved.","type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"description":"IANA timezone (`cas__timezone.timezone`) resolved via `brj__geo_ip.timezone_id`.","type":"string"},{"type":"null"}]},"mobile":{"description":"`true` when ip-api flagged the IP as a mobile carrier network. Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"proxy":{"description":"`true` when ip-api flagged the IP as an anonymising proxy / VPN. Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"hosting":{"description":"`true` when ip-api flagged the IP as hosting infrastructure (data-center, cloud provider). Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"tor":{"nullable":true,"anyOf":[{"description":"`true` when the IP is on the TOR exit-node list at the time the ticket was created. `null` when TOR classification has not yet been resolved (distinct from a known non-TOR `false`).","type":"boolean"},{"type":"null"}]},"asn":{"nullable":true,"anyOf":[{"description":"Autonomous system number (`AS13335`). `null` until ip-api enrichment ran.","type":"string"},{"type":"null"}]},"asName":{"nullable":true,"anyOf":[{"description":"Autonomous system name.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"Internet service provider.","type":"string"},{"type":"null"}]}}}]},"originChannel":{"description":"Entry point that created the issue, resolved via `pm__issue.origin_channel_id` → `pm__issue_origin_channel`. `null` for pre-migration rows and paths that do not yet pass a channel code. Rendered as \"Zdroj: …\" in the admin sidebar Details card.","anyOf":[{"type":"null"},{"type":"object","required":["code","label"],"properties":{"code":{"description":"Stable machine identifier of the entry point (`contact_form`, `mail_in`, `admin`, `api`, `cron`, `agent`) from `pm__issue_origin_channel.code`. Opaque to the admin — used as a lookup key into the FE i18n dictionary.","type":"string"},"label":{"description":"Canonical Czech label from `pm__issue_origin_channel.label`. Used as a fallback when the admin has no translation for the code.","type":"string"}}}]},"technicalContext":{"nullable":true,"anyOf":[{"description":"Reporter environment captured at submit time (`TechnicalContext`: page, client, session, network, app, correlation, diagnostics, custom). INTERNAL: only the organisation owning the issue project receives it; the originating (reporter) organisation of a support ticket always gets `null`. The admin renders it collapsed at the end of the ticket.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"locale":{"description":"ISO 639-1 code (e.g. `\"cs\"`, `\"en\"`) of the language this issue is conducted in — the value of `pm__issue.locale_id` joined to `core__localization_locale.locale`. Populated deterministically at INSERT (reporter → org fallback) and refined by AI during triage; NOT NULL invariant, so every issue has a real code. The admin renders it as `\"EN — angličtina\"` (short code + `Intl.DisplayNames` full name in the operator's UI locale) in the sidebar Details card.","type":"string"}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["id","internalId","externalId","issueKey","subject","description","internalDescription","aiSummary","priority","priorityLabel","velocity","projectId","projectExternalId","projectKey","projectName","type","status","assignee","reporter","isSpam","parentId","parent","dueDate","testUrl","documentationUrl","humanOnly","securedTicket","branch","branchSource","branchHidden","branchHandoverDate","branchActionRequired","branchActionSource","insertedDate","updatedDate","attachments","sourceEmails","ip","originChannel","locale"],"properties":{"id":{"description":"Issue key.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"externalId":{"description":"Immutable 16-char alphanumeric public identifier (`pm__issue.external_id`). Used in customer-facing URLs (support portal, e-mail deep links, `[BKH-ISSUE:xxxxxxxxxxxxxxxx]` tokens) and for cross-system references — never changes across the ticket's lifetime, unlike `issueKey` which is tied to the project prefix and could theoretically re-key on a merge.","type":"string"},"issueKey":{"description":"Issue key (e.g. \"PROJ-123\").","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"description":{"description":"Issue description (HTML).","type":"string"},"internalDescription":{"nullable":true,"anyOf":[{"description":"Internal notes visible only to team members.","type":"string"},{"type":"null"}]},"aiSummary":{"nullable":true,"anyOf":[{"description":"LLM-produced short paraphrase of the description in the reporter's language (~400 chars). Read-only in the admin UI — writes only originate from the inbound-mail classifier, `updateIssue` regen when the description is edited, or the explicit `/bff/issue/generate-summary` button. `null` when no summary has been generated yet.","type":"string"},{"type":"null"}]},"priority":{"description":"Priority (1-5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25. Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear.","type":"number"},"projectId":{"description":"Internal project id.","type":"number"},"projectExternalId":{"description":"Project URL handle, admin links the breadcrumb to `/project/{projectExternalId}`.","type":"string"},"projectKey":{"description":"Project key (e.g. \"PROJ\").","type":"string"},"projectName":{"description":"Project display name.","type":"string"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"description":"Internal ID of the parent issue (for sub-tasks or merged children).","type":"number"},{"type":"null"}]},"parent":{"description":"Populated when this issue has been merged into another via `/bff/issue/merge` (or filed as a sub-task with a parent). The admin renders a prominent \"merged into\" callout linking here. `null` for regular top-level issues.","nullable":true,"anyOf":[{"type":"object","required":["issueKey","subject","statusCategoryCode"],"properties":{"issueKey":{"description":"Parent issue key — use in `/issue/{issueKey}` for the FE link.","type":"string"},"subject":{"description":"Parent subject, rendered inline in the \"merged into\" callout.","type":"string"},"statusCategoryCode":{"description":"Canonical bucket code (`new` / `progress` / `waiting` / `done`) so the FE can dot-color the callout.","type":"string"}}},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"description":"Due date.","anyOf":[{"description":"Due date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"testUrl":{"nullable":true,"anyOf":[{"description":"URL to test environment.","type":"string"},{"type":"null"}]},"documentationUrl":{"nullable":true,"anyOf":[{"description":"URL to documentation.","type":"string"},{"type":"null"}]},"humanOnly":{"description":"When `true`, the AI orchestrator (and any future automated agent) aborts and never touches this ticket. Set by operators for tickets that need human judgement (legal escalation, incident, VIP).","type":"boolean"},"securedTicket":{"description":"When `true`, the ticket is marked confidential (`pm__issue.secured_ticket`) and only ORG ROOT members can see it. Regular members receive `{ exist: false }` from `/bff/issue/detail` for this issue and never see it in lists or counts. Written by the AI classifiers (mail + triage) on the way in — a Comgate payment-status mail auto-flags the issue as secured — and toggled by root operators from the sidebar.","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"branchSource":{"nullable":true,"anyOf":[{"description":"Who linked the branch: `manual` (admin), `caller` (API / contact form), `ai` (triage).","type":"string"},{"type":"null"}]},"branchHidden":{"description":"Hidden from the branch technicians (franchisee API) although linked to their branch: complaint about the operator, payments, legal, security.","type":"boolean"},"branchHandoverDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp when a branch technician handed the ticket back to the head office; null otherwise.","type":"string"},{"type":"null"}]},"branchActionRequired":{"nullable":true,"anyOf":[{"description":"BIZKIT-124: the branch must act on this ticket; null = not evaluated.","type":"boolean"},{"type":"null"}]},"branchActionSource":{"nullable":true,"anyOf":[{"description":"Who set `branchActionRequired`: `ai` or `manual`.","type":"string"},{"type":"null"}]},"subjectIsPlaceholder":{"description":"`true` while the subject is a server-derived stand-in (reporter filed via \"Napsat podpoře\" without a subject) awaiting the AI triage rewrite.","type":"boolean"},"reporterPageUrl":{"nullable":true,"anyOf":[{"description":"Admin page URL the reporter was on when they opened \"Napsat podpoře\". `null` for tickets from other channels.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"attachments":{"description":"Files linked to the issue via `pm__issue_attachment`. Empty when the issue has none.","type":"array","items":{"type":"object","required":["blobToken","filename","size","downloadUrl","position"],"properties":{"blobToken":{"description":"core__blob.token — pass to <FileViewer> for inline preview.","type":"string"},"filename":{"description":"Original filename as stored on the blob. Never null — when the blob was ingested without a filename (e.g. an inbound e-mail attachment with a missing `Content-Disposition: filename=…`), the endpoint substitutes a `priloha.<ext>` placeholder derived from the MIME type.","type":"string"},"contentType":{"description":"MIME type.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"downloadUrl":{"description":"Signed direct-download URL to the storage bucket.","type":"string"},"position":{"description":"Display order within the issue (1-based).","type":"number"}}}},"sourceEmails":{"description":"Inbound-mail rows linked via `brj__emailer_received_email.issue_id`. Ordered oldest first — the first entry is the originating mail that lifted the ticket. Empty when the issue was not created from mail.","type":"array","items":{"type":"object","required":["externalId","subject","fromAddress","receivedAt"],"properties":{"externalId":{"description":"Public 16-char identifier of the inbound mail — use in `/emailer/received/:externalId` for the admin link.","type":"string"},"subject":{"description":"Subject as received from Resend.","type":"string"},"fromAddress":{"description":"Envelope From address.","type":"string"},"receivedAt":{"description":"When Resend received the message.","anyOf":[{"description":"When Resend received the message.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"ip":{"description":"Reporter geolocation snapshot resolved from the request IP at ticket creation. Same shape as the order-detail `ip` block so the admin can reuse the same rendering component. `null` for tickets created without request-time IP context (cron, mail pipeline, manual admin entry). Admin hides the block for `127.0.0.1`.","anyOf":[{"type":"null"},{"type":"object","required":["ip","city","country","countryRegion","latitude","longitude","hostname","timezone","mobile","proxy","hosting","tor"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"description":"City name (`brj__geo_ip_city.city`).","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"Country name (`brj__geo_ip_city.country`).","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"ISO 3166-2 country subdivision (`brj__geo_ip_city.country_region`).","type":"string"},{"type":"null"}]},"latitude":{"nullable":true,"anyOf":[{"description":"City-center latitude (`brj__geo_ip_city.latitude`).","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"City-center longitude (`brj__geo_ip_city.longitude`).","type":"number"},{"type":"null"}]},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse-DNS hostname (`brj__geo_ip.hostname`), when resolved.","type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"description":"IANA timezone (`cas__timezone.timezone`) resolved via `brj__geo_ip.timezone_id`.","type":"string"},{"type":"null"}]},"mobile":{"description":"`true` when ip-api flagged the IP as a mobile carrier network. Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"proxy":{"description":"`true` when ip-api flagged the IP as an anonymising proxy / VPN. Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"hosting":{"description":"`true` when ip-api flagged the IP as hosting infrastructure (data-center, cloud provider). Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"tor":{"nullable":true,"anyOf":[{"description":"`true` when the IP is on the TOR exit-node list at the time the ticket was created. `null` when TOR classification has not yet been resolved (distinct from a known non-TOR `false`).","type":"boolean"},{"type":"null"}]},"asn":{"nullable":true,"anyOf":[{"description":"Autonomous system number (`AS13335`). `null` until ip-api enrichment ran.","type":"string"},{"type":"null"}]},"asName":{"nullable":true,"anyOf":[{"description":"Autonomous system name.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"Internet service provider.","type":"string"},{"type":"null"}]}}}]},"originChannel":{"description":"Entry point that created the issue, resolved via `pm__issue.origin_channel_id` → `pm__issue_origin_channel`. `null` for pre-migration rows and paths that do not yet pass a channel code. Rendered as \"Zdroj: …\" in the admin sidebar Details card.","anyOf":[{"type":"null"},{"type":"object","required":["code","label"],"properties":{"code":{"description":"Stable machine identifier of the entry point (`contact_form`, `mail_in`, `admin`, `api`, `cron`, `agent`) from `pm__issue_origin_channel.code`. Opaque to the admin — used as a lookup key into the FE i18n dictionary.","type":"string"},"label":{"description":"Canonical Czech label from `pm__issue_origin_channel.label`. Used as a fallback when the admin has no translation for the code.","type":"string"}}}]},"technicalContext":{"nullable":true,"anyOf":[{"description":"Reporter environment captured at submit time (`TechnicalContext`: page, client, session, network, app, correlation, diagnostics, custom). INTERNAL: only the organisation owning the issue project receives it; the originating (reporter) organisation of a support ticket always gets `null`. The admin renders it collapsed at the end of the ticket.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"locale":{"description":"ISO 639-1 code (e.g. `\"cs\"`, `\"en\"`) of the language this issue is conducted in — the value of `pm__issue.locale_id` joined to `core__localization_locale.locale`. Populated deterministically at INSERT (reporter → org fallback) and refined by AI during triage; NOT NULL invariant, so every issue has a real code. The admin renders it as `\"EN — angličtina\"` (short code + `Intl.DisplayNames` full name in the operator's UI locale) in the sidebar Details card.","type":"string"}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["id","internalId","externalId","issueKey","subject","description","internalDescription","aiSummary","priority","priorityLabel","velocity","projectId","projectExternalId","projectKey","projectName","type","status","assignee","reporter","isSpam","parentId","parent","dueDate","testUrl","documentationUrl","humanOnly","securedTicket","branch","branchSource","branchHidden","branchHandoverDate","branchActionRequired","branchActionSource","insertedDate","updatedDate","attachments","sourceEmails","ip","originChannel","locale"],"properties":{"id":{"description":"Issue key.","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"externalId":{"description":"Immutable 16-char alphanumeric public identifier (`pm__issue.external_id`). Used in customer-facing URLs (support portal, e-mail deep links, `[BKH-ISSUE:xxxxxxxxxxxxxxxx]` tokens) and for cross-system references — never changes across the ticket's lifetime, unlike `issueKey` which is tied to the project prefix and could theoretically re-key on a merge.","type":"string"},"issueKey":{"description":"Issue key (e.g. \"PROJ-123\").","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"description":{"description":"Issue description (HTML).","type":"string"},"internalDescription":{"nullable":true,"anyOf":[{"description":"Internal notes visible only to team members.","type":"string"},{"type":"null"}]},"aiSummary":{"nullable":true,"anyOf":[{"description":"LLM-produced short paraphrase of the description in the reporter's language (~400 chars). Read-only in the admin UI — writes only originate from the inbound-mail classifier, `updateIssue` regen when the description is edited, or the explicit `/bff/issue/generate-summary` button. `null` when no summary has been generated yet.","type":"string"},{"type":"null"}]},"priority":{"description":"Priority (1-5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). DB default 25. Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear.","type":"number"},"projectId":{"description":"Internal project id.","type":"number"},"projectExternalId":{"description":"Project URL handle, admin links the breadcrumb to `/project/{projectExternalId}`.","type":"string"},"projectKey":{"description":"Project key (e.g. \"PROJ\").","type":"string"},"projectName":{"description":"Project display name.","type":"string"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"parentId":{"nullable":true,"anyOf":[{"description":"Internal ID of the parent issue (for sub-tasks or merged children).","type":"number"},{"type":"null"}]},"parent":{"description":"Populated when this issue has been merged into another via `/bff/issue/merge` (or filed as a sub-task with a parent). The admin renders a prominent \"merged into\" callout linking here. `null` for regular top-level issues.","nullable":true,"anyOf":[{"type":"object","required":["issueKey","subject","statusCategoryCode"],"properties":{"issueKey":{"description":"Parent issue key — use in `/issue/{issueKey}` for the FE link.","type":"string"},"subject":{"description":"Parent subject, rendered inline in the \"merged into\" callout.","type":"string"},"statusCategoryCode":{"description":"Canonical bucket code (`new` / `progress` / `waiting` / `done`) so the FE can dot-color the callout.","type":"string"}}},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"description":"Due date.","anyOf":[{"description":"Due date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"testUrl":{"nullable":true,"anyOf":[{"description":"URL to test environment.","type":"string"},{"type":"null"}]},"documentationUrl":{"nullable":true,"anyOf":[{"description":"URL to documentation.","type":"string"},{"type":"null"}]},"humanOnly":{"description":"When `true`, the AI orchestrator (and any future automated agent) aborts and never touches this ticket. Set by operators for tickets that need human judgement (legal escalation, incident, VIP).","type":"boolean"},"securedTicket":{"description":"When `true`, the ticket is marked confidential (`pm__issue.secured_ticket`) and only ORG ROOT members can see it. Regular members receive `{ exist: false }` from `/bff/issue/detail` for this issue and never see it in lists or counts. Written by the AI classifiers (mail + triage) on the way in — a Comgate payment-status mail auto-flags the issue as secured — and toggled by root operators from the sidebar.","type":"boolean"},"branch":{"nullable":true,"anyOf":[{"description":"BIZKIT-116 branch the ticket is about; null when none.","type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"branchSource":{"nullable":true,"anyOf":[{"description":"Who linked the branch: `manual` (admin), `caller` (API / contact form), `ai` (triage).","type":"string"},{"type":"null"}]},"branchHidden":{"description":"Hidden from the branch technicians (franchisee API) although linked to their branch: complaint about the operator, payments, legal, security.","type":"boolean"},"branchHandoverDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp when a branch technician handed the ticket back to the head office; null otherwise.","type":"string"},{"type":"null"}]},"branchActionRequired":{"nullable":true,"anyOf":[{"description":"BIZKIT-124: the branch must act on this ticket; null = not evaluated.","type":"boolean"},{"type":"null"}]},"branchActionSource":{"nullable":true,"anyOf":[{"description":"Who set `branchActionRequired`: `ai` or `manual`.","type":"string"},{"type":"null"}]},"subjectIsPlaceholder":{"description":"`true` while the subject is a server-derived stand-in (reporter filed via \"Napsat podpoře\" without a subject) awaiting the AI triage rewrite.","type":"boolean"},"reporterPageUrl":{"nullable":true,"anyOf":[{"description":"Admin page URL the reporter was on when they opened \"Napsat podpoře\". `null` for tickets from other channels.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"attachments":{"description":"Files linked to the issue via `pm__issue_attachment`. Empty when the issue has none.","type":"array","items":{"type":"object","required":["blobToken","filename","size","downloadUrl","position"],"properties":{"blobToken":{"description":"core__blob.token — pass to <FileViewer> for inline preview.","type":"string"},"filename":{"description":"Original filename as stored on the blob. Never null — when the blob was ingested without a filename (e.g. an inbound e-mail attachment with a missing `Content-Disposition: filename=…`), the endpoint substitutes a `priloha.<ext>` placeholder derived from the MIME type.","type":"string"},"contentType":{"description":"MIME type.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"downloadUrl":{"description":"Signed direct-download URL to the storage bucket.","type":"string"},"position":{"description":"Display order within the issue (1-based).","type":"number"}}}},"sourceEmails":{"description":"Inbound-mail rows linked via `brj__emailer_received_email.issue_id`. Ordered oldest first — the first entry is the originating mail that lifted the ticket. Empty when the issue was not created from mail.","type":"array","items":{"type":"object","required":["externalId","subject","fromAddress","receivedAt"],"properties":{"externalId":{"description":"Public 16-char identifier of the inbound mail — use in `/emailer/received/:externalId` for the admin link.","type":"string"},"subject":{"description":"Subject as received from Resend.","type":"string"},"fromAddress":{"description":"Envelope From address.","type":"string"},"receivedAt":{"description":"When Resend received the message.","anyOf":[{"description":"When Resend received the message.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"ip":{"description":"Reporter geolocation snapshot resolved from the request IP at ticket creation. Same shape as the order-detail `ip` block so the admin can reuse the same rendering component. `null` for tickets created without request-time IP context (cron, mail pipeline, manual admin entry). Admin hides the block for `127.0.0.1`.","anyOf":[{"type":"null"},{"type":"object","required":["ip","city","country","countryRegion","latitude","longitude","hostname","timezone","mobile","proxy","hosting","tor"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"description":"City name (`brj__geo_ip_city.city`).","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"Country name (`brj__geo_ip_city.country`).","type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"ISO 3166-2 country subdivision (`brj__geo_ip_city.country_region`).","type":"string"},{"type":"null"}]},"latitude":{"nullable":true,"anyOf":[{"description":"City-center latitude (`brj__geo_ip_city.latitude`).","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"City-center longitude (`brj__geo_ip_city.longitude`).","type":"number"},{"type":"null"}]},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse-DNS hostname (`brj__geo_ip.hostname`), when resolved.","type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"description":"IANA timezone (`cas__timezone.timezone`) resolved via `brj__geo_ip.timezone_id`.","type":"string"},{"type":"null"}]},"mobile":{"description":"`true` when ip-api flagged the IP as a mobile carrier network. Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"proxy":{"description":"`true` when ip-api flagged the IP as an anonymising proxy / VPN. Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"hosting":{"description":"`true` when ip-api flagged the IP as hosting infrastructure (data-center, cloud provider). Defaults to `false` when the enrichment has not yet run.","type":"boolean"},"tor":{"nullable":true,"anyOf":[{"description":"`true` when the IP is on the TOR exit-node list at the time the ticket was created. `null` when TOR classification has not yet been resolved (distinct from a known non-TOR `false`).","type":"boolean"},{"type":"null"}]},"asn":{"nullable":true,"anyOf":[{"description":"Autonomous system number (`AS13335`). `null` until ip-api enrichment ran.","type":"string"},{"type":"null"}]},"asName":{"nullable":true,"anyOf":[{"description":"Autonomous system name.","type":"string"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"Internet service provider.","type":"string"},{"type":"null"}]}}}]},"originChannel":{"description":"Entry point that created the issue, resolved via `pm__issue.origin_channel_id` → `pm__issue_origin_channel`. `null` for pre-migration rows and paths that do not yet pass a channel code. Rendered as \"Zdroj: …\" in the admin sidebar Details card.","anyOf":[{"type":"null"},{"type":"object","required":["code","label"],"properties":{"code":{"description":"Stable machine identifier of the entry point (`contact_form`, `mail_in`, `admin`, `api`, `cron`, `agent`) from `pm__issue_origin_channel.code`. Opaque to the admin — used as a lookup key into the FE i18n dictionary.","type":"string"},"label":{"description":"Canonical Czech label from `pm__issue_origin_channel.label`. Used as a fallback when the admin has no translation for the code.","type":"string"}}}]},"technicalContext":{"nullable":true,"anyOf":[{"description":"Reporter environment captured at submit time (`TechnicalContext`: page, client, session, network, app, correlation, diagnostics, custom). INTERNAL: only the organisation owning the issue project receives it; the originating (reporter) organisation of a support ticket always gets `null`. The admin renders it collapsed at the end of the ticket.","type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"locale":{"description":"ISO 639-1 code (e.g. `\"cs\"`, `\"en\"`) of the language this issue is conducted in — the value of `pm__issue.locale_id` joined to `core__localization_locale.locale`. Populated deterministically at INSERT (reporter → org fallback) and refined by AI during triage; NOT NULL invariant, so every issue has a real code. The admin renders it as `\"EN — angličtina\"` (short code + `Intl.DisplayNames` full name in the operator's UI locale) in the sidebar Details card.","type":"string"}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}}}}},"operationId":"getBffIssueDetail","tags":["Issue"],"summary":"Get issue detail","description":"Returns full issue detail including description, project info, assignee, reporter, parent issue, due date, and linked URLs. Returns `{ exist: false }` if the issue is not found."}},"/bff/issue/preview":{"get":{"parameters":[{"description":"Issue key (e.g. \"PROJ-123\").","examples":["PROJ-123"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["issueKey","subject","description","aiSummary","priority","priorityLabel","status","assignee","reporter","isSpam","commentsCount","isStale","insertedDate","updatedDate","dueDate","lastComment"],"properties":{"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"description":{"description":"Raw markdown as stored. The renderer runs client-side (matches `CmsMarkdownPreview`). Empty string when the issue has no description.","type":"string"},"aiSummary":{"nullable":true,"anyOf":[{"description":"LLM-produced short brief of the description (~2-4 sentences). Rendered above the description in hover cards so a reader sees the point of the ticket first. `null` when no summary has been generated yet.","type":"string"},{"type":"null"}]},"priority":{"description":"Priority (1..5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"commentsCount":{"description":"Total comments across all author kinds.","type":"number"},"isStale":{"description":"True when the issue is `progress`/`waiting` and has not moved in 7+ days. Mirrors the flag in `/list`.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"description":"Due date, when set.","anyOf":[{"description":"Due date, when set.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastComment":{"description":"Most recent comment on the issue, or `null` if there are no comments yet.","nullable":true,"anyOf":[{"type":"object","required":["authorKind","authorName","message","insertedDate"],"properties":{"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorName":{"description":"Ready-to-render display name. For ai/system this is a synthetic label (\"Kit\" / \"System\"), NOT the FK contact's name.","type":"string"},"message":{"description":"Comment text (raw markdown).","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},{"type":"null"}]}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["issueKey","subject","description","aiSummary","priority","priorityLabel","status","assignee","reporter","isSpam","commentsCount","isStale","insertedDate","updatedDate","dueDate","lastComment"],"properties":{"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"description":{"description":"Raw markdown as stored. The renderer runs client-side (matches `CmsMarkdownPreview`). Empty string when the issue has no description.","type":"string"},"aiSummary":{"nullable":true,"anyOf":[{"description":"LLM-produced short brief of the description (~2-4 sentences). Rendered above the description in hover cards so a reader sees the point of the ticket first. `null` when no summary has been generated yet.","type":"string"},{"type":"null"}]},"priority":{"description":"Priority (1..5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"commentsCount":{"description":"Total comments across all author kinds.","type":"number"},"isStale":{"description":"True when the issue is `progress`/`waiting` and has not moved in 7+ days. Mirrors the flag in `/list`.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"description":"Due date, when set.","anyOf":[{"description":"Due date, when set.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastComment":{"description":"Most recent comment on the issue, or `null` if there are no comments yet.","nullable":true,"anyOf":[{"type":"object","required":["authorKind","authorName","message","insertedDate"],"properties":{"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorName":{"description":"Ready-to-render display name. For ai/system this is a synthetic label (\"Kit\" / \"System\"), NOT the FK contact's name.","type":"string"},"message":{"description":"Comment text (raw markdown).","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},{"type":"null"}]}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["issueKey","subject","description","aiSummary","priority","priorityLabel","status","assignee","reporter","isSpam","commentsCount","isStale","insertedDate","updatedDate","dueDate","lastComment"],"properties":{"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"description":{"description":"Raw markdown as stored. The renderer runs client-side (matches `CmsMarkdownPreview`). Empty string when the issue has no description.","type":"string"},"aiSummary":{"nullable":true,"anyOf":[{"description":"LLM-produced short brief of the description (~2-4 sentences). Rendered above the description in hover cards so a reader sees the point of the ticket first. `null` when no summary has been generated yet.","type":"string"},{"type":"null"}]},"priority":{"description":"Priority (1..5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"commentsCount":{"description":"Total comments across all author kinds.","type":"number"},"isStale":{"description":"True when the issue is `progress`/`waiting` and has not moved in 7+ days. Mirrors the flag in `/list`.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"description":"Due date, when set.","anyOf":[{"description":"Due date, when set.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastComment":{"description":"Most recent comment on the issue, or `null` if there are no comments yet.","nullable":true,"anyOf":[{"type":"object","required":["authorKind","authorName","message","insertedDate"],"properties":{"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorName":{"description":"Ready-to-render display name. For ai/system this is a synthetic label (\"Kit\" / \"System\"), NOT the FK contact's name.","type":"string"},"message":{"description":"Comment text (raw markdown).","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},{"type":"null"}]}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["issueKey","subject","description","aiSummary","priority","priorityLabel","status","assignee","reporter","isSpam","commentsCount","isStale","insertedDate","updatedDate","dueDate","lastComment"],"properties":{"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"description":{"description":"Raw markdown as stored. The renderer runs client-side (matches `CmsMarkdownPreview`). Empty string when the issue has no description.","type":"string"},"aiSummary":{"nullable":true,"anyOf":[{"description":"LLM-produced short brief of the description (~2-4 sentences). Rendered above the description in hover cards so a reader sees the point of the ticket first. `null` when no summary has been generated yet.","type":"string"},{"type":"null"}]},"priority":{"description":"Priority (1..5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"assignee":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","externalId","name","email"],"properties":{"id":{"description":"Contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public contact identifier used in admin URLs (`/contact/{externalId}`) and in `/bff/contact/detail?customerId=...`. `null` for legacy rows that predate the external-id backfill; the UI should render the name without a link in that case.","type":"string"},{"type":"null"}]},"name":{"description":"Full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail. `null` for phone-only contacts (no e-mail registered) and for contacts anonymised via GDPR. UI should fall back to `name` or the contact ID.","type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Avatar image URL resolved via `core__blob`. Canonical person rule: a contact linked to a `cas__user` shows only `cas__user.avatar_blob_id`, an unlinked contact its own `avatar_blob_id`. Omitted when unset.","type":"string"}}},{"type":"null"}]},"isSpam":{"nullable":true,"anyOf":[{"description":"Spam classification. Null = not yet classified.","type":"boolean"},{"type":"null"}]},"commentsCount":{"description":"Total comments across all author kinds.","type":"number"},"isStale":{"description":"True when the issue is `progress`/`waiting` and has not moved in 7+ days. Mirrors the flag in `/list`.","type":"boolean"},"insertedDate":{"description":"When the issue was created.","anyOf":[{"description":"When the issue was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"dueDate":{"nullable":true,"anyOf":[{"description":"Due date, when set.","anyOf":[{"description":"Due date, when set.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastComment":{"description":"Most recent comment on the issue, or `null` if there are no comments yet.","nullable":true,"anyOf":[{"type":"object","required":["authorKind","authorName","message","insertedDate"],"properties":{"authorKind":{"anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"authorName":{"description":"Ready-to-render display name. For ai/system this is a synthetic label (\"Kit\" / \"System\"), NOT the FK contact's name.","type":"string"},"message":{"description":"Comment text (raw markdown).","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}},{"type":"null"}]}}},{"type":"object","required":["exist"],"properties":{"exist":{"const":false,"type":"boolean"}}}]}}}}},"operationId":"getBffIssuePreview","tags":["Issue"],"summary":"Compact issue preview for hover cards","description":"Lightweight version of `/detail` for use inside hover popovers on the issue grid. Skips attachments, internal notes and project chrome; collapses the comment thread to just the most recent row. Intended to be fetched lazily on first hover — the grid caches by issueKey."}},"/bff/issue/related":{"get":{"parameters":[{"description":"Issue key (e.g. \"PROJ-123\") whose neighbours to list.","examples":["PROJ-123"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","priority","status","reason","insertedDate"],"properties":{"externalId":{"description":"Public 16-char identifier of the related issue.","type":"string"},"issueKey":{"description":"Human-readable issue key (e.g. \"PROJ-123\").","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"nullable":true,"anyOf":[{"description":"Priority (1..5); `null` when unclassified.","type":"number"},{"type":"null"}]},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"reason":{"nullable":true,"anyOf":[{"description":"Origin of the link. Known values: `mail_closed_issue` (inbound-mail pipeline forked a fresh ticket because the matched issue was already closed). `null` for manual links written without a reason.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the link was created (UTC timestamp).","type":"string"}}}},"itemCount":{"description":"Number of returned rows (equals items.length).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","priority","status","reason","insertedDate"],"properties":{"externalId":{"description":"Public 16-char identifier of the related issue.","type":"string"},"issueKey":{"description":"Human-readable issue key (e.g. \"PROJ-123\").","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"nullable":true,"anyOf":[{"description":"Priority (1..5); `null` when unclassified.","type":"number"},{"type":"null"}]},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"reason":{"nullable":true,"anyOf":[{"description":"Origin of the link. Known values: `mail_closed_issue` (inbound-mail pipeline forked a fresh ticket because the matched issue was already closed). `null` for manual links written without a reason.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the link was created (UTC timestamp).","type":"string"}}}},"itemCount":{"description":"Number of returned rows (equals items.length).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","issueKey","subject","priority","status","reason","insertedDate"],"properties":{"externalId":{"description":"Public 16-char identifier of the related issue.","type":"string"},"issueKey":{"description":"Human-readable issue key (e.g. \"PROJ-123\").","type":"string"},"subject":{"description":"Issue subject/title.","type":"string"},"priority":{"nullable":true,"anyOf":[{"description":"Priority (1..5); `null` when unclassified.","type":"number"},{"type":"null"}]},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the viewing organisation).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"reason":{"nullable":true,"anyOf":[{"description":"Origin of the link. Known values: `mail_closed_issue` (inbound-mail pipeline forked a fresh ticket because the matched issue was already closed). `null` for manual links written without a reason.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the link was created (UTC timestamp).","type":"string"}}}},"itemCount":{"description":"Number of returned rows (equals items.length).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssueRelated","tags":["Issue"],"summary":"List related issues","description":"Returns the issues linked to the given anchor issue via `pm__issue_related`. Links are stored symmetrically (both directions written on each `linkRelatedIssues` call), so a single-direction query surfaces every neighbour. Filtered to the caller`s organisation on BOTH sides (anchor + target) as a defence-in-depth check on top of the write-time same-org invariant. Ordered by link creation time (newest first) and then by internal issue id for stability. The primary today writer is the inbound-mail closed-fork pipeline (`reason=\"mail_closed_issue\"`); the admin sidebar renders the list only when non-empty."}},"/bff/issue/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the issue was created successfully.","type":"boolean"},"issueKey":{"description":"Generated issue key.","examples":["PROJ-124"],"type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"}},"required":["success","issueKey","internalId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the issue was created successfully.","type":"boolean"},"issueKey":{"description":"Generated issue key.","examples":["PROJ-124"],"type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"}},"required":["success","issueKey","internalId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the issue was created successfully.","type":"boolean"},"issueKey":{"description":"Generated issue key.","examples":["PROJ-124"],"type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"}},"required":["success","issueKey","internalId"]}}}}},"operationId":"postBffIssueCreate","tags":["Issue"],"summary":"Create issue","description":"Creates a new issue in the default project. The AI workflow is triggered automatically to classify and process the issue.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"minLength":1,"description":"Issue subject/title.","examples":["Login page returns 500 error"],"type":"string"},"description":{"description":"Issue description (supports HTML).","type":"string"},"internalDescription":{"description":"Internal notes visible only to team members.","type":"string"},"priority":{"minimum":1,"maximum":5,"default":2,"description":"Priority: 1=low, 2=normal, 3=high, 4=critical, 5=blocker.","type":"number"},"assigneeContactId":{"description":"Assignee contact ID.","examples":[10],"type":"number"},"reporterContactId":{"description":"Reporter contact ID.","examples":[5],"type":"number"},"parentIssueKey":{"description":"Parent issue key for sub-tasks (e.g. \"PROJ-100\").","examples":["PROJ-100"],"type":"string"},"issueTypeCode":{"description":"Issue type slug from `pm__issue_type.code` (`story`, `epic`, `task`, `sub_task`, `bug`, `incident`, `feature_request`, `change_request`, `question`, `service_request`). Defaults to `story`.","examples":["story","bug"],"type":"string"},"attachmentBlobTokens":{"maxItems":50,"description":"Blob tokens returned by `POST /bff/blob/upload` (with `tag: \"issue\"`) for files picked in the create modal. Linked to the new issue via `pm__issue_attachment` in the given order, before notifications go out, so the assignee mail carries them (10 MB total cap, smallest first). Unknown tokens reject the whole request.","type":"array","items":{"minLength":1,"type":"string"}},"source":{"description":"Set by the admin when the operator creates an issue that Kit drafted in the chat (`prepareOrganisationTicket`). Recorded in the activity log only.","const":"kit-chat","type":"string"},"chatRoomId":{"maxLength":64,"description":"Kit chat room the draft came from (with `source: \"kit-chat\"`). Activity-log reference only.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"minLength":1,"description":"Issue subject/title.","examples":["Login page returns 500 error"],"type":"string"},"description":{"description":"Issue description (supports HTML).","type":"string"},"internalDescription":{"description":"Internal notes visible only to team members.","type":"string"},"priority":{"minimum":1,"maximum":5,"default":2,"description":"Priority: 1=low, 2=normal, 3=high, 4=critical, 5=blocker.","type":"number"},"assigneeContactId":{"description":"Assignee contact ID.","examples":[10],"type":"number"},"reporterContactId":{"description":"Reporter contact ID.","examples":[5],"type":"number"},"parentIssueKey":{"description":"Parent issue key for sub-tasks (e.g. \"PROJ-100\").","examples":["PROJ-100"],"type":"string"},"issueTypeCode":{"description":"Issue type slug from `pm__issue_type.code` (`story`, `epic`, `task`, `sub_task`, `bug`, `incident`, `feature_request`, `change_request`, `question`, `service_request`). Defaults to `story`.","examples":["story","bug"],"type":"string"},"attachmentBlobTokens":{"maxItems":50,"description":"Blob tokens returned by `POST /bff/blob/upload` (with `tag: \"issue\"`) for files picked in the create modal. Linked to the new issue via `pm__issue_attachment` in the given order, before notifications go out, so the assignee mail carries them (10 MB total cap, smallest first). Unknown tokens reject the whole request.","type":"array","items":{"minLength":1,"type":"string"}},"source":{"description":"Set by the admin when the operator creates an issue that Kit drafted in the chat (`prepareOrganisationTicket`). Recorded in the activity log only.","const":"kit-chat","type":"string"},"chatRoomId":{"maxLength":64,"description":"Kit chat room the draft came from (with `source: \"kit-chat\"`). Activity-log reference only.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"minLength":1,"description":"Issue subject/title.","examples":["Login page returns 500 error"],"type":"string"},"description":{"description":"Issue description (supports HTML).","type":"string"},"internalDescription":{"description":"Internal notes visible only to team members.","type":"string"},"priority":{"minimum":1,"maximum":5,"default":2,"description":"Priority: 1=low, 2=normal, 3=high, 4=critical, 5=blocker.","type":"number"},"assigneeContactId":{"description":"Assignee contact ID.","examples":[10],"type":"number"},"reporterContactId":{"description":"Reporter contact ID.","examples":[5],"type":"number"},"parentIssueKey":{"description":"Parent issue key for sub-tasks (e.g. \"PROJ-100\").","examples":["PROJ-100"],"type":"string"},"issueTypeCode":{"description":"Issue type slug from `pm__issue_type.code` (`story`, `epic`, `task`, `sub_task`, `bug`, `incident`, `feature_request`, `change_request`, `question`, `service_request`). Defaults to `story`.","examples":["story","bug"],"type":"string"},"attachmentBlobTokens":{"maxItems":50,"description":"Blob tokens returned by `POST /bff/blob/upload` (with `tag: \"issue\"`) for files picked in the create modal. Linked to the new issue via `pm__issue_attachment` in the given order, before notifications go out, so the assignee mail carries them (10 MB total cap, smallest first). Unknown tokens reject the whole request.","type":"array","items":{"minLength":1,"type":"string"}},"source":{"description":"Set by the admin when the operator creates an issue that Kit drafted in the chat (`prepareOrganisationTicket`). Recorded in the activity log only.","const":"kit-chat","type":"string"},"chatRoomId":{"maxLength":64,"description":"Kit chat room the draft came from (with `source: \"kit-chat\"`). Activity-log reference only.","type":"string"}}}}}}}},"/bff/issue/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the issue was updated successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the issue was updated successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the issue was updated successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIssueUpdate","tags":["Issue"],"summary":"Update issue","description":"Updates an existing issue. Only provided fields are changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to update.","examples":["PROJ-123"],"type":"string"},"subject":{"description":"New subject.","examples":["Updated issue title"],"type":"string"},"description":{"description":"New description.","type":"string"},"internalDescription":{"description":"New internal description.","type":"string"},"priority":{"minimum":1,"maximum":5,"description":"New priority (1-5).","examples":[3],"type":"number"},"velocity":{"minimum":0,"maximum":100,"description":"New velocity / effort score (0..100). Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split into subtasks, 100 unsolvable/unclear. Any explicit write also stamps the [AI velocity] marker so future AI re-runs will not overwrite it.","examples":[25],"type":"number"},"statusId":{"description":"New status ID.","examples":[2],"type":"number"},"issueTypeCode":{"description":"New issue type slug (see `/bff/issue/type/list`).","examples":["bug","sub_task"],"type":"string"},"assigneeContactId":{"description":"New assignee contact ID (0 to unassign).","examples":[10],"type":"number"},"reporterContactId":{"description":"New reporter (submitter) contact ID.","examples":[7],"type":"number"},"dueDate":{"format":"date-time","description":"Due date (ISO timestamp).","examples":["2026-06-01T00:00:00Z"],"type":"string"},"testUrl":{"description":"Test URL.","examples":["https://test.example.com/feature"],"type":"string"},"documentationUrl":{"description":"Documentation URL.","examples":["https://docs.example.com/guide"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to update.","examples":["PROJ-123"],"type":"string"},"subject":{"description":"New subject.","examples":["Updated issue title"],"type":"string"},"description":{"description":"New description.","type":"string"},"internalDescription":{"description":"New internal description.","type":"string"},"priority":{"minimum":1,"maximum":5,"description":"New priority (1-5).","examples":[3],"type":"number"},"velocity":{"minimum":0,"maximum":100,"description":"New velocity / effort score (0..100). Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split into subtasks, 100 unsolvable/unclear. Any explicit write also stamps the [AI velocity] marker so future AI re-runs will not overwrite it.","examples":[25],"type":"number"},"statusId":{"description":"New status ID.","examples":[2],"type":"number"},"issueTypeCode":{"description":"New issue type slug (see `/bff/issue/type/list`).","examples":["bug","sub_task"],"type":"string"},"assigneeContactId":{"description":"New assignee contact ID (0 to unassign).","examples":[10],"type":"number"},"reporterContactId":{"description":"New reporter (submitter) contact ID.","examples":[7],"type":"number"},"dueDate":{"format":"date-time","description":"Due date (ISO timestamp).","examples":["2026-06-01T00:00:00Z"],"type":"string"},"testUrl":{"description":"Test URL.","examples":["https://test.example.com/feature"],"type":"string"},"documentationUrl":{"description":"Documentation URL.","examples":["https://docs.example.com/guide"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to update.","examples":["PROJ-123"],"type":"string"},"subject":{"description":"New subject.","examples":["Updated issue title"],"type":"string"},"description":{"description":"New description.","type":"string"},"internalDescription":{"description":"New internal description.","type":"string"},"priority":{"minimum":1,"maximum":5,"description":"New priority (1-5).","examples":[3],"type":"number"},"velocity":{"minimum":0,"maximum":100,"description":"New velocity / effort score (0..100). Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split into subtasks, 100 unsolvable/unclear. Any explicit write also stamps the [AI velocity] marker so future AI re-runs will not overwrite it.","examples":[25],"type":"number"},"statusId":{"description":"New status ID.","examples":[2],"type":"number"},"issueTypeCode":{"description":"New issue type slug (see `/bff/issue/type/list`).","examples":["bug","sub_task"],"type":"string"},"assigneeContactId":{"description":"New assignee contact ID (0 to unassign).","examples":[10],"type":"number"},"reporterContactId":{"description":"New reporter (submitter) contact ID.","examples":[7],"type":"number"},"dueDate":{"format":"date-time","description":"Due date (ISO timestamp).","examples":["2026-06-01T00:00:00Z"],"type":"string"},"testUrl":{"description":"Test URL.","examples":["https://test.example.com/feature"],"type":"string"},"documentationUrl":{"description":"Documentation URL.","examples":["https://docs.example.com/guide"],"type":"string"}}}}}}}},"/bff/issue/link-blob":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"linked":{"description":"True when the row was inserted; false when the blob was already linked.","type":"boolean"}},"required":["success","linked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"linked":{"description":"True when the row was inserted; false when the blob was already linked.","type":"boolean"}},"required":["success","linked"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"linked":{"description":"True when the row was inserted; false when the blob was already linked.","type":"boolean"}},"required":["success","linked"]}}}}},"operationId":"postBffIssueLink-blob","tags":["Issue"],"summary":"Attach an uploaded blob to an issue","description":"Links a previously-uploaded blob to an existing issue via `pm__issue_attachment`. Idempotent — a repeated call for the same (blob, issue) pair short-circuits with `linked: false` instead of erroring. Called by the admin sidebar uploader after `POST /bff/blob/upload` returns a token.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","blobToken"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"blobToken":{"description":"Token of the blob (file) to attach — returned by `POST /bff/blob/upload`.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","blobToken"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"blobToken":{"description":"Token of the blob (file) to attach — returned by `POST /bff/blob/upload`.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","blobToken"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"blobToken":{"description":"Token of the blob (file) to attach — returned by `POST /bff/blob/upload`.","type":"string"}}}}}}}},"/bff/issue/export-pdf":{"get":{"parameters":[{"description":"Issue key to export (e.g. `PROJ-123`).","examples":["BANDZ-50"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"operationId":"getBffIssueExport-pdf","tags":["Issue"],"summary":"Export issue as PDF snapshot","description":"Renders the issue as a printable A4 PDF snapshot intended for external readers (customers, auditors, third parties). Includes: issue key, subject, status, priority, type, project, reporter and assignee names, key timestamps, description, AI summary, and customer-visible timeline (`email_out` + `email_in` comments only). Deliberately EXCLUDES internal notes, internal-channel comments, spam / human-only flags, IP/geo, test/documentation URLs, and any e-mail addresses. Footer carries a public verification URL back to `support.bizkithub.com/ticket/{externalId}`. Returns the binary inline so the browser previews it in a new tab; not persisted to blob storage.","responses":{"200":{}}}},"/bff/issue/comments":{"get":{"parameters":[{"description":"Issue key.","examples":["PROJ-123"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true},{"description":"Page number.","examples":[1],"schema":{"type":"number","default":1},"in":"query","name":"page","required":false},{"description":"Items per page.","examples":[100],"schema":{"type":"number","default":100},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","authorId","authorKind","channel","authorName","authorEmail","message","insertedDate","updatedDate","isSpam","spamReason","geoIp","authorExternalId","isMember","jobTitle","canEdit","paymentRequest"],"properties":{"id":{"description":"Comment ID (format: \"PROJ-123_c456\").","type":"string"},"authorId":{"description":"Author contact ID (FK; not necessarily who the UI shows for ai/system).","type":"number"},"authorKind":{"description":"Who wrote the comment. `human` = staff / reporter, `ai` = Kit, the AI agent (authorName is rewritten server-side to \"Kit\" and authorEmail is empty), `system` = workflow / audit.","anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"channel":{"description":"Timeline channel: `internal` = staff-only note (no e-mail was sent), `email_out` = comment sent to the customer as an e-mail, `email_in` = inbound customer reply lifted from an e-mail or the public support portal.","anyOf":[{"const":"internal","type":"string"},{"const":"email_out","type":"string"},{"const":"email_in","type":"string"}]},"authorName":{"description":"Ready-to-render display name. For ai/system this is a synthetic label (\"Kit\" / \"System\"), NOT the FK contact's name.","type":"string"},"authorEmail":{"description":"Author email — empty string for ai/system comments.","type":"string"},"message":{"description":"Comment text.","type":"string"},"insertedDate":{"description":"When the comment was created.","anyOf":[{"description":"When the comment was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isSpam":{"description":"True when the LLM classifier flagged this comment as spam at insert time. Populated on public-portal replies (`channel = email_in`) — inbound e-mails, staff notes, and AI/system entries always report `false`.","type":"boolean"},"spamReason":{"description":"Short human-readable reason from the classifier (≤200 chars). Null for non-spam rows or when the classifier declined to explain. Render as the tooltip on the spam badge — never surface to the customer.","anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Uploaded avatar URL for human authors, resolved via the canonical person rule (linked user avatar only; own avatar for unlinked contacts). Absent for ai/system rows (the admin renders their dedicated icon) and for human authors without an uploaded blob (the UI falls back to name initials).","type":"string"},"geoIp":{"description":"Geo snapshot of the caller that produced this comment. Populated for every writer that has request context: admin BFF (`add-comment` / `add-email` / `promote-comment-to-email`), public support portal (`apiSupport /issue/:externalId/comment`), and inbound mail with a parseable sender-IP header (`X-Originating-IP` / first `Received:` hop). Null for AI/system writers, historical rows written before the wiring, and loopback traffic. Rendered as a single-line strip in the admin timeline — never surfaced to the customer.","anyOf":[{"type":"null"},{"type":"object","required":["ip","city","country","countryRegion","hostname"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"hostname":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]},"authorExternalId":{"description":"`shop__contact.external_id` of the author — the opaque 16-char id used in admin URLs. Admin renders the author name as `/team/<id>` (member) or `/contact/<id>` (customer). Null for ai/system rows and for the extremely rare legacy row whose contact predates the external-id backfill.","anyOf":[{"type":"string"},{"type":"null"}]},"isMember":{"description":"`true` when the author has a `cas__organisation_member` row in the issue's organisation (blocked or not). Lets admin pick the team-member profile link vs the plain contact-detail link without a second round-trip.","type":"boolean"},"jobTitle":{"description":"Free-form job title from `cas__organisation_member.job_title` — rendered next to the author name as their role in the organisation. Null when the author isn't a member or when the member row has no job title.","anyOf":[{"type":"string"},{"type":"null"}]},"canEdit":{"description":"`true` when the authenticated caller is the original human author of this comment and the entry is editable (not AI/system, not inbound e-mail, not spam-flagged). The admin UI uses this to hide the pencil button when `POST /bff/issue/update-comment` would reject the write anyway.","type":"boolean"},"paymentRequest":{"description":"Payment request (technical order) linked to this comment, or null.","anyOf":[{"type":"null"},{"type":"object","required":["orderNumber","orderHash","price","currency","isPaid","isStorno"],"properties":{"orderNumber":{"examples":["26000123"],"type":"string"},"orderHash":{"description":"Order hash; admin deep-links to `/order/<hash>`.","type":"string"},"price":{"description":"Order total in `currency`.","type":"number"},"currency":{"examples":["CZK"],"type":"string"},"isPaid":{"type":"boolean"},"isStorno":{"type":"boolean"}}}]}}}},"itemCount":{"description":"Total comment count.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","authorId","authorKind","channel","authorName","authorEmail","message","insertedDate","updatedDate","isSpam","spamReason","geoIp","authorExternalId","isMember","jobTitle","canEdit","paymentRequest"],"properties":{"id":{"description":"Comment ID (format: \"PROJ-123_c456\").","type":"string"},"authorId":{"description":"Author contact ID (FK; not necessarily who the UI shows for ai/system).","type":"number"},"authorKind":{"description":"Who wrote the comment. `human` = staff / reporter, `ai` = Kit, the AI agent (authorName is rewritten server-side to \"Kit\" and authorEmail is empty), `system` = workflow / audit.","anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"channel":{"description":"Timeline channel: `internal` = staff-only note (no e-mail was sent), `email_out` = comment sent to the customer as an e-mail, `email_in` = inbound customer reply lifted from an e-mail or the public support portal.","anyOf":[{"const":"internal","type":"string"},{"const":"email_out","type":"string"},{"const":"email_in","type":"string"}]},"authorName":{"description":"Ready-to-render display name. For ai/system this is a synthetic label (\"Kit\" / \"System\"), NOT the FK contact's name.","type":"string"},"authorEmail":{"description":"Author email — empty string for ai/system comments.","type":"string"},"message":{"description":"Comment text.","type":"string"},"insertedDate":{"description":"When the comment was created.","anyOf":[{"description":"When the comment was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isSpam":{"description":"True when the LLM classifier flagged this comment as spam at insert time. Populated on public-portal replies (`channel = email_in`) — inbound e-mails, staff notes, and AI/system entries always report `false`.","type":"boolean"},"spamReason":{"description":"Short human-readable reason from the classifier (≤200 chars). Null for non-spam rows or when the classifier declined to explain. Render as the tooltip on the spam badge — never surface to the customer.","anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Uploaded avatar URL for human authors, resolved via the canonical person rule (linked user avatar only; own avatar for unlinked contacts). Absent for ai/system rows (the admin renders their dedicated icon) and for human authors without an uploaded blob (the UI falls back to name initials).","type":"string"},"geoIp":{"description":"Geo snapshot of the caller that produced this comment. Populated for every writer that has request context: admin BFF (`add-comment` / `add-email` / `promote-comment-to-email`), public support portal (`apiSupport /issue/:externalId/comment`), and inbound mail with a parseable sender-IP header (`X-Originating-IP` / first `Received:` hop). Null for AI/system writers, historical rows written before the wiring, and loopback traffic. Rendered as a single-line strip in the admin timeline — never surfaced to the customer.","anyOf":[{"type":"null"},{"type":"object","required":["ip","city","country","countryRegion","hostname"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"hostname":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]},"authorExternalId":{"description":"`shop__contact.external_id` of the author — the opaque 16-char id used in admin URLs. Admin renders the author name as `/team/<id>` (member) or `/contact/<id>` (customer). Null for ai/system rows and for the extremely rare legacy row whose contact predates the external-id backfill.","anyOf":[{"type":"string"},{"type":"null"}]},"isMember":{"description":"`true` when the author has a `cas__organisation_member` row in the issue's organisation (blocked or not). Lets admin pick the team-member profile link vs the plain contact-detail link without a second round-trip.","type":"boolean"},"jobTitle":{"description":"Free-form job title from `cas__organisation_member.job_title` — rendered next to the author name as their role in the organisation. Null when the author isn't a member or when the member row has no job title.","anyOf":[{"type":"string"},{"type":"null"}]},"canEdit":{"description":"`true` when the authenticated caller is the original human author of this comment and the entry is editable (not AI/system, not inbound e-mail, not spam-flagged). The admin UI uses this to hide the pencil button when `POST /bff/issue/update-comment` would reject the write anyway.","type":"boolean"},"paymentRequest":{"description":"Payment request (technical order) linked to this comment, or null.","anyOf":[{"type":"null"},{"type":"object","required":["orderNumber","orderHash","price","currency","isPaid","isStorno"],"properties":{"orderNumber":{"examples":["26000123"],"type":"string"},"orderHash":{"description":"Order hash; admin deep-links to `/order/<hash>`.","type":"string"},"price":{"description":"Order total in `currency`.","type":"number"},"currency":{"examples":["CZK"],"type":"string"},"isPaid":{"type":"boolean"},"isStorno":{"type":"boolean"}}}]}}}},"itemCount":{"description":"Total comment count.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","authorId","authorKind","channel","authorName","authorEmail","message","insertedDate","updatedDate","isSpam","spamReason","geoIp","authorExternalId","isMember","jobTitle","canEdit","paymentRequest"],"properties":{"id":{"description":"Comment ID (format: \"PROJ-123_c456\").","type":"string"},"authorId":{"description":"Author contact ID (FK; not necessarily who the UI shows for ai/system).","type":"number"},"authorKind":{"description":"Who wrote the comment. `human` = staff / reporter, `ai` = Kit, the AI agent (authorName is rewritten server-side to \"Kit\" and authorEmail is empty), `system` = workflow / audit.","anyOf":[{"const":"human","type":"string"},{"const":"ai","type":"string"},{"const":"system","type":"string"}]},"channel":{"description":"Timeline channel: `internal` = staff-only note (no e-mail was sent), `email_out` = comment sent to the customer as an e-mail, `email_in` = inbound customer reply lifted from an e-mail or the public support portal.","anyOf":[{"const":"internal","type":"string"},{"const":"email_out","type":"string"},{"const":"email_in","type":"string"}]},"authorName":{"description":"Ready-to-render display name. For ai/system this is a synthetic label (\"Kit\" / \"System\"), NOT the FK contact's name.","type":"string"},"authorEmail":{"description":"Author email — empty string for ai/system comments.","type":"string"},"message":{"description":"Comment text.","type":"string"},"insertedDate":{"description":"When the comment was created.","anyOf":[{"description":"When the comment was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isSpam":{"description":"True when the LLM classifier flagged this comment as spam at insert time. Populated on public-portal replies (`channel = email_in`) — inbound e-mails, staff notes, and AI/system entries always report `false`.","type":"boolean"},"spamReason":{"description":"Short human-readable reason from the classifier (≤200 chars). Null for non-spam rows or when the classifier declined to explain. Render as the tooltip on the spam badge — never surface to the customer.","anyOf":[{"type":"string"},{"type":"null"}]},"avatarUrl":{"description":"Uploaded avatar URL for human authors, resolved via the canonical person rule (linked user avatar only; own avatar for unlinked contacts). Absent for ai/system rows (the admin renders their dedicated icon) and for human authors without an uploaded blob (the UI falls back to name initials).","type":"string"},"geoIp":{"description":"Geo snapshot of the caller that produced this comment. Populated for every writer that has request context: admin BFF (`add-comment` / `add-email` / `promote-comment-to-email`), public support portal (`apiSupport /issue/:externalId/comment`), and inbound mail with a parseable sender-IP header (`X-Originating-IP` / first `Received:` hop). Null for AI/system writers, historical rows written before the wiring, and loopback traffic. Rendered as a single-line strip in the admin timeline — never surfaced to the customer.","anyOf":[{"type":"null"},{"type":"object","required":["ip","city","country","countryRegion","hostname"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"hostname":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}]},"authorExternalId":{"description":"`shop__contact.external_id` of the author — the opaque 16-char id used in admin URLs. Admin renders the author name as `/team/<id>` (member) or `/contact/<id>` (customer). Null for ai/system rows and for the extremely rare legacy row whose contact predates the external-id backfill.","anyOf":[{"type":"string"},{"type":"null"}]},"isMember":{"description":"`true` when the author has a `cas__organisation_member` row in the issue's organisation (blocked or not). Lets admin pick the team-member profile link vs the plain contact-detail link without a second round-trip.","type":"boolean"},"jobTitle":{"description":"Free-form job title from `cas__organisation_member.job_title` — rendered next to the author name as their role in the organisation. Null when the author isn't a member or when the member row has no job title.","anyOf":[{"type":"string"},{"type":"null"}]},"canEdit":{"description":"`true` when the authenticated caller is the original human author of this comment and the entry is editable (not AI/system, not inbound e-mail, not spam-flagged). The admin UI uses this to hide the pencil button when `POST /bff/issue/update-comment` would reject the write anyway.","type":"boolean"},"paymentRequest":{"description":"Payment request (technical order) linked to this comment, or null.","anyOf":[{"type":"null"},{"type":"object","required":["orderNumber","orderHash","price","currency","isPaid","isStorno"],"properties":{"orderNumber":{"examples":["26000123"],"type":"string"},"orderHash":{"description":"Order hash; admin deep-links to `/order/<hash>`.","type":"string"},"price":{"description":"Order total in `currency`.","type":"number"},"currency":{"examples":["CZK"],"type":"string"},"isPaid":{"type":"boolean"},"isStorno":{"type":"boolean"}}}]}}}},"itemCount":{"description":"Total comment count.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssueComments","tags":["Issue"],"summary":"List issue comments","description":"Returns a paginated list of comments for a specific issue, ordered by creation date (oldest first)."}},"/bff/issue/payment-request-options":{"get":{"parameters":[{"description":"Issue key the payment request will be attached to.","examples":["PROJ-123"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"currencies":{"type":"array","items":{"type":"object","required":["code","symbol","decimals","isDefault","qrAvailable"],"properties":{"code":{"examples":["CZK"],"type":"string"},"symbol":{"examples":["Kč"],"type":"string"},"decimals":{"examples":[2],"type":"number"},"isDefault":{"description":"Organisation default currency.","type":"boolean"},"qrAvailable":{"description":"A bank-transfer QR code can be rendered (CZK/EUR + active bank account in this currency).","type":"boolean"}}}},"groups":{"type":"array","items":{"type":"object","required":["code","name","isDefault","cardAvailable"],"properties":{"code":{"examples":["default"],"type":"string"},"name":{"examples":["Default"],"type":"string"},"isDefault":{"type":"boolean"},"cardAvailable":{"description":"An active online payment gateway serves this group, so the e-mail gets a \"Pay by card\" button.","type":"boolean"}}}},"defaultCurrencyCode":{"examples":["CZK"],"type":"string"},"defaultGroupCode":{"examples":["default"],"type":"string"},"defaultItemLabel":{"examples":["Platba k požadavku PROJ-123"],"type":"string"},"customer":{"type":"object","required":["name","email","phone"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"canCreate":{"description":"False when the reporter has neither e-mail nor phone, so no order customer can be resolved.","type":"boolean"}},"required":["currencies","groups","defaultCurrencyCode","defaultGroupCode","defaultItemLabel","customer","canCreate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"currencies":{"type":"array","items":{"type":"object","required":["code","symbol","decimals","isDefault","qrAvailable"],"properties":{"code":{"examples":["CZK"],"type":"string"},"symbol":{"examples":["Kč"],"type":"string"},"decimals":{"examples":[2],"type":"number"},"isDefault":{"description":"Organisation default currency.","type":"boolean"},"qrAvailable":{"description":"A bank-transfer QR code can be rendered (CZK/EUR + active bank account in this currency).","type":"boolean"}}}},"groups":{"type":"array","items":{"type":"object","required":["code","name","isDefault","cardAvailable"],"properties":{"code":{"examples":["default"],"type":"string"},"name":{"examples":["Default"],"type":"string"},"isDefault":{"type":"boolean"},"cardAvailable":{"description":"An active online payment gateway serves this group, so the e-mail gets a \"Pay by card\" button.","type":"boolean"}}}},"defaultCurrencyCode":{"examples":["CZK"],"type":"string"},"defaultGroupCode":{"examples":["default"],"type":"string"},"defaultItemLabel":{"examples":["Platba k požadavku PROJ-123"],"type":"string"},"customer":{"type":"object","required":["name","email","phone"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"canCreate":{"description":"False when the reporter has neither e-mail nor phone, so no order customer can be resolved.","type":"boolean"}},"required":["currencies","groups","defaultCurrencyCode","defaultGroupCode","defaultItemLabel","customer","canCreate"]}},"text/plain":{"schema":{"type":"object","properties":{"currencies":{"type":"array","items":{"type":"object","required":["code","symbol","decimals","isDefault","qrAvailable"],"properties":{"code":{"examples":["CZK"],"type":"string"},"symbol":{"examples":["Kč"],"type":"string"},"decimals":{"examples":[2],"type":"number"},"isDefault":{"description":"Organisation default currency.","type":"boolean"},"qrAvailable":{"description":"A bank-transfer QR code can be rendered (CZK/EUR + active bank account in this currency).","type":"boolean"}}}},"groups":{"type":"array","items":{"type":"object","required":["code","name","isDefault","cardAvailable"],"properties":{"code":{"examples":["default"],"type":"string"},"name":{"examples":["Default"],"type":"string"},"isDefault":{"type":"boolean"},"cardAvailable":{"description":"An active online payment gateway serves this group, so the e-mail gets a \"Pay by card\" button.","type":"boolean"}}}},"defaultCurrencyCode":{"examples":["CZK"],"type":"string"},"defaultGroupCode":{"examples":["default"],"type":"string"},"defaultItemLabel":{"examples":["Platba k požadavku PROJ-123"],"type":"string"},"customer":{"type":"object","required":["name","email","phone"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"canCreate":{"description":"False when the reporter has neither e-mail nor phone, so no order customer can be resolved.","type":"boolean"}},"required":["currencies","groups","defaultCurrencyCode","defaultGroupCode","defaultItemLabel","customer","canCreate"]}}}}},"operationId":"getBffIssuePayment-request-options","tags":["Issue"],"summary":"Payment request composer options","description":"Everything the issue composer needs to attach a payment request: enabled currencies (org default + active bank-account currencies + currencies of recent orders) with QR availability, ACTIVE order groups with online-card availability, the pre-filled first item label in the issue language, and the customer (= reporter). Bootstraps the default order group when the organisation has none. Requires `module-order`."}},"/bff/issue/add-comment":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the comment was added successfully.","type":"boolean"},"commentId":{"description":"Generated comment ID.","examples":["PROJ-123_c456"],"type":"string"},"orderNumber":{"description":"Number of the payment request order, when `paymentRequest` was sent.","examples":["26000123"],"type":"string"},"orderHash":{"description":"Hash of the payment request order (admin link `/order/<hash>`).","type":"string"}},"required":["success","commentId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the comment was added successfully.","type":"boolean"},"commentId":{"description":"Generated comment ID.","examples":["PROJ-123_c456"],"type":"string"},"orderNumber":{"description":"Number of the payment request order, when `paymentRequest` was sent.","examples":["26000123"],"type":"string"},"orderHash":{"description":"Hash of the payment request order (admin link `/order/<hash>`).","type":"string"}},"required":["success","commentId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the comment was added successfully.","type":"boolean"},"commentId":{"description":"Generated comment ID.","examples":["PROJ-123_c456"],"type":"string"},"orderNumber":{"description":"Number of the payment request order, when `paymentRequest` was sent.","examples":["26000123"],"type":"string"},"orderHash":{"description":"Hash of the payment request order (admin link `/order/<hash>`).","type":"string"}},"required":["success","commentId"]}}}}},"operationId":"postBffIssueAdd-comment","tags":["Issue"],"summary":"Add internal comment","description":"Adds an internal comment (channel = `internal`) to an issue. The author is derived from the authenticated user. The comment is visible only to staff in the admin timeline; **no e-mail is sent** to the reporter or the assignee. Use `/add-email` when the operator wants the message to reach the customer. Optionally accepts `targetStatusId` to apply a status change atomically with the comment (used by the \"Send and close\" composer button).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"description":"Issue key to comment on.","examples":["PROJ-123"],"type":"string"},"message":{"minLength":1,"description":"Comment message text.","examples":["Talked to Petr, he agreed to a 20% discount."],"type":"string"},"paymentRequest":{"description":"Attach a payment request: a technical order is created via `createOrder()` (customer = reporter, no order notification e-mail) and linked to the comment. The outbound e-mail then carries a pay button (when an online gateway serves the group), a bank-transfer QR code (CZK/EUR account in the request currency), or an info-only block. Requires `module-order`.","type":"object","required":["orderGroupCode","currency","items"],"properties":{"orderGroupCode":{"minLength":1,"description":"Code of an ACTIVE order group of the organisation (see `/payment-request-options`).","examples":["default"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of a currency enabled for the organisation (see `/payment-request-options`).","examples":["CZK"],"type":"string"},"items":{"minItems":1,"maxItems":20,"description":"Virtual line items of the technical order (1 to 20).","type":"array","items":{"type":"object","required":["label","price"],"properties":{"label":{"minLength":1,"maxLength":255,"description":"Line item label shown to the customer.","examples":["Konzultace"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Line amount incl. VAT in the request currency. Must be > 0.","examples":[1500],"type":"number"}}}}}},"targetStatusId":{"description":"Optional status id to apply BEFORE the comment is inserted. Used by the \"Send and close\" composer to bundle a status change with the reply in a single BFF call; the activity feed and timeline observe the final status. Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"description":"Issue key to comment on.","examples":["PROJ-123"],"type":"string"},"message":{"minLength":1,"description":"Comment message text.","examples":["Talked to Petr, he agreed to a 20% discount."],"type":"string"},"paymentRequest":{"description":"Attach a payment request: a technical order is created via `createOrder()` (customer = reporter, no order notification e-mail) and linked to the comment. The outbound e-mail then carries a pay button (when an online gateway serves the group), a bank-transfer QR code (CZK/EUR account in the request currency), or an info-only block. Requires `module-order`.","type":"object","required":["orderGroupCode","currency","items"],"properties":{"orderGroupCode":{"minLength":1,"description":"Code of an ACTIVE order group of the organisation (see `/payment-request-options`).","examples":["default"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of a currency enabled for the organisation (see `/payment-request-options`).","examples":["CZK"],"type":"string"},"items":{"minItems":1,"maxItems":20,"description":"Virtual line items of the technical order (1 to 20).","type":"array","items":{"type":"object","required":["label","price"],"properties":{"label":{"minLength":1,"maxLength":255,"description":"Line item label shown to the customer.","examples":["Konzultace"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Line amount incl. VAT in the request currency. Must be > 0.","examples":[1500],"type":"number"}}}}}},"targetStatusId":{"description":"Optional status id to apply BEFORE the comment is inserted. Used by the \"Send and close\" composer to bundle a status change with the reply in a single BFF call; the activity feed and timeline observe the final status. Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"description":"Issue key to comment on.","examples":["PROJ-123"],"type":"string"},"message":{"minLength":1,"description":"Comment message text.","examples":["Talked to Petr, he agreed to a 20% discount."],"type":"string"},"paymentRequest":{"description":"Attach a payment request: a technical order is created via `createOrder()` (customer = reporter, no order notification e-mail) and linked to the comment. The outbound e-mail then carries a pay button (when an online gateway serves the group), a bank-transfer QR code (CZK/EUR account in the request currency), or an info-only block. Requires `module-order`.","type":"object","required":["orderGroupCode","currency","items"],"properties":{"orderGroupCode":{"minLength":1,"description":"Code of an ACTIVE order group of the organisation (see `/payment-request-options`).","examples":["default"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of a currency enabled for the organisation (see `/payment-request-options`).","examples":["CZK"],"type":"string"},"items":{"minItems":1,"maxItems":20,"description":"Virtual line items of the technical order (1 to 20).","type":"array","items":{"type":"object","required":["label","price"],"properties":{"label":{"minLength":1,"maxLength":255,"description":"Line item label shown to the customer.","examples":["Konzultace"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Line amount incl. VAT in the request currency. Must be > 0.","examples":[1500],"type":"number"}}}}}},"targetStatusId":{"description":"Optional status id to apply BEFORE the comment is inserted. Used by the \"Send and close\" composer to bundle a status change with the reply in a single BFF call; the activity feed and timeline observe the final status. Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"}}}}}}}},"/bff/issue/reply-recipients":{"get":{"parameters":[{"examples":["PROJ-123"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"object","required":["email","name","roles","internal"],"properties":{"email":{"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"}},"internal":{"description":"BIZKIT-124: an internal copy (not the customer side).","type":"boolean"}}}},"internal":{"description":"BIZKIT-124: internal people who may get a copy, for the composer check-boxes.","type":"array","items":{"type":"object","required":["contactId","email","name","audience","selected","exclusion"],"properties":{"contactId":{"description":"Contact external id, send it back in `internalRecipientContactIds`.","type":"string"},"email":{"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"assignee","type":"string"},{"const":"branch","type":"string"},{"const":"participants","type":"string"}]},"selected":{"description":"Ticked by default (organisation rules, personal opt-out, branch involvement).","type":"boolean"},"exclusion":{"nullable":true,"anyOf":[{"anyOf":[{"const":"rule_off","type":"string"},{"const":"opt_out","type":"string"},{"const":"branch_not_involved","type":"string"},{"const":"not_participant","type":"string"}]},{"type":"null"}]}}}},"blockedReason":{"nullable":true,"anyOf":[{"anyOf":[{"const":"notifications_disabled","type":"string"},{"const":"author_is_only_participant","type":"string"},{"const":"no_recipients","type":"string"}]},{"type":"null"}]}},"required":["recipients","internal","blockedReason"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"object","required":["email","name","roles","internal"],"properties":{"email":{"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"}},"internal":{"description":"BIZKIT-124: an internal copy (not the customer side).","type":"boolean"}}}},"internal":{"description":"BIZKIT-124: internal people who may get a copy, for the composer check-boxes.","type":"array","items":{"type":"object","required":["contactId","email","name","audience","selected","exclusion"],"properties":{"contactId":{"description":"Contact external id, send it back in `internalRecipientContactIds`.","type":"string"},"email":{"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"assignee","type":"string"},{"const":"branch","type":"string"},{"const":"participants","type":"string"}]},"selected":{"description":"Ticked by default (organisation rules, personal opt-out, branch involvement).","type":"boolean"},"exclusion":{"nullable":true,"anyOf":[{"anyOf":[{"const":"rule_off","type":"string"},{"const":"opt_out","type":"string"},{"const":"branch_not_involved","type":"string"},{"const":"not_participant","type":"string"}]},{"type":"null"}]}}}},"blockedReason":{"nullable":true,"anyOf":[{"anyOf":[{"const":"notifications_disabled","type":"string"},{"const":"author_is_only_participant","type":"string"},{"const":"no_recipients","type":"string"}]},{"type":"null"}]}},"required":["recipients","internal","blockedReason"]}},"text/plain":{"schema":{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"object","required":["email","name","roles","internal"],"properties":{"email":{"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"roles":{"type":"array","items":{"type":"string"}},"internal":{"description":"BIZKIT-124: an internal copy (not the customer side).","type":"boolean"}}}},"internal":{"description":"BIZKIT-124: internal people who may get a copy, for the composer check-boxes.","type":"array","items":{"type":"object","required":["contactId","email","name","audience","selected","exclusion"],"properties":{"contactId":{"description":"Contact external id, send it back in `internalRecipientContactIds`.","type":"string"},"email":{"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"assignee","type":"string"},{"const":"branch","type":"string"},{"const":"participants","type":"string"}]},"selected":{"description":"Ticked by default (organisation rules, personal opt-out, branch involvement).","type":"boolean"},"exclusion":{"nullable":true,"anyOf":[{"anyOf":[{"const":"rule_off","type":"string"},{"const":"opt_out","type":"string"},{"const":"branch_not_involved","type":"string"},{"const":"not_participant","type":"string"}]},{"type":"null"}]}}}},"blockedReason":{"nullable":true,"anyOf":[{"anyOf":[{"const":"notifications_disabled","type":"string"},{"const":"author_is_only_participant","type":"string"},{"const":"no_recipients","type":"string"}]},{"type":"null"}]}},"required":["recipients","internal","blockedReason"]}}}}},"operationId":"getBffIssueReply-recipients","tags":["Issue"],"summary":"Who would receive an e-mail reply (BIZKIT-75)","description":"Recipients of an outbound reply written by the current member, resolved exactly like the dispatcher (author excluded, muted / e-mail-less participants dropped, organisation preference respected). `blockedReason` is set when nobody would receive it; `/add-email` and `/promote-comment-to-email` then answer 422."}},"/bff/issue/add-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the reply was sent successfully.","type":"boolean"},"commentId":{"description":"Generated comment ID.","examples":["PROJ-123_c456"],"type":"string"},"recipients":{"description":"E-mail addresses the reply was queued for (BIZKIT-75).","type":"array","items":{"type":"string"}},"orderNumber":{"description":"Number of the payment request order, when `paymentRequest` was sent.","examples":["26000123"],"type":"string"},"orderHash":{"description":"Hash of the payment request order (admin link `/order/<hash>`).","type":"string"}},"required":["success","commentId","recipients"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the reply was sent successfully.","type":"boolean"},"commentId":{"description":"Generated comment ID.","examples":["PROJ-123_c456"],"type":"string"},"recipients":{"description":"E-mail addresses the reply was queued for (BIZKIT-75).","type":"array","items":{"type":"string"}},"orderNumber":{"description":"Number of the payment request order, when `paymentRequest` was sent.","examples":["26000123"],"type":"string"},"orderHash":{"description":"Hash of the payment request order (admin link `/order/<hash>`).","type":"string"}},"required":["success","commentId","recipients"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the reply was sent successfully.","type":"boolean"},"commentId":{"description":"Generated comment ID.","examples":["PROJ-123_c456"],"type":"string"},"recipients":{"description":"E-mail addresses the reply was queued for (BIZKIT-75).","type":"array","items":{"type":"string"}},"orderNumber":{"description":"Number of the payment request order, when `paymentRequest` was sent.","examples":["26000123"],"type":"string"},"orderHash":{"description":"Hash of the payment request order (admin link `/order/<hash>`).","type":"string"}},"required":["success","commentId","recipients"]}}}}},"operationId":"postBffIssueAdd-email","tags":["Issue"],"summary":"Send e-mail reply from issue","description":"Adds a customer-visible reply (channel = `email_out`) and sends it as an e-mail to the reporter and assignee via `sendIssueCommentToEmail`. Use `/add-comment` for staff-only notes. Optionally accepts `targetStatusId` to apply a status change atomically before the e-mail is rendered (used by the \"Send and close\" composer button so the outbound e-mail carries the post-close status badge).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"description":"Issue key to reply on.","examples":["PROJ-123"],"type":"string"},"message":{"minLength":1,"description":"E-mail body text.","examples":["Dobrý den, faktura byla opravena a přeposlána na Vaši adresu."],"type":"string"},"paymentRequest":{"description":"Attach a payment request: a technical order is created via `createOrder()` (customer = reporter, no order notification e-mail) and linked to the comment. The outbound e-mail then carries a pay button (when an online gateway serves the group), a bank-transfer QR code (CZK/EUR account in the request currency), or an info-only block. Requires `module-order`.","type":"object","required":["orderGroupCode","currency","items"],"properties":{"orderGroupCode":{"minLength":1,"description":"Code of an ACTIVE order group of the organisation (see `/payment-request-options`).","examples":["default"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of a currency enabled for the organisation (see `/payment-request-options`).","examples":["CZK"],"type":"string"},"items":{"minItems":1,"maxItems":20,"description":"Virtual line items of the technical order (1 to 20).","type":"array","items":{"type":"object","required":["label","price"],"properties":{"label":{"minLength":1,"maxLength":255,"description":"Line item label shown to the customer.","examples":["Konzultace"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Line amount incl. VAT in the request currency. Must be > 0.","examples":[1500],"type":"number"}}}}}},"internalRecipientContactIds":{"maxItems":100,"description":"BIZKIT-124: contact external ids of the INTERNAL people (assignee, branch, other members) who get a copy, as ticked in the composer. Omit to use the organisation notification rules. The customer side always gets the reply.","type":"array","items":{"type":"string"}},"targetStatusId":{"description":"Optional status id to apply BEFORE the outbound e-mail is dispatched. Used by the \"Send and close\" composer to bundle a status change with the reply in a single BFF call so the customer's e-mail carries the final status badge (e.g. `Stav: Dokončeno` when closing the ticket). Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"description":"Issue key to reply on.","examples":["PROJ-123"],"type":"string"},"message":{"minLength":1,"description":"E-mail body text.","examples":["Dobrý den, faktura byla opravena a přeposlána na Vaši adresu."],"type":"string"},"paymentRequest":{"description":"Attach a payment request: a technical order is created via `createOrder()` (customer = reporter, no order notification e-mail) and linked to the comment. The outbound e-mail then carries a pay button (when an online gateway serves the group), a bank-transfer QR code (CZK/EUR account in the request currency), or an info-only block. Requires `module-order`.","type":"object","required":["orderGroupCode","currency","items"],"properties":{"orderGroupCode":{"minLength":1,"description":"Code of an ACTIVE order group of the organisation (see `/payment-request-options`).","examples":["default"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of a currency enabled for the organisation (see `/payment-request-options`).","examples":["CZK"],"type":"string"},"items":{"minItems":1,"maxItems":20,"description":"Virtual line items of the technical order (1 to 20).","type":"array","items":{"type":"object","required":["label","price"],"properties":{"label":{"minLength":1,"maxLength":255,"description":"Line item label shown to the customer.","examples":["Konzultace"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Line amount incl. VAT in the request currency. Must be > 0.","examples":[1500],"type":"number"}}}}}},"internalRecipientContactIds":{"maxItems":100,"description":"BIZKIT-124: contact external ids of the INTERNAL people (assignee, branch, other members) who get a copy, as ticked in the composer. Omit to use the organisation notification rules. The customer side always gets the reply.","type":"array","items":{"type":"string"}},"targetStatusId":{"description":"Optional status id to apply BEFORE the outbound e-mail is dispatched. Used by the \"Send and close\" composer to bundle a status change with the reply in a single BFF call so the customer's e-mail carries the final status badge (e.g. `Stav: Dokončeno` when closing the ticket). Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"description":"Issue key to reply on.","examples":["PROJ-123"],"type":"string"},"message":{"minLength":1,"description":"E-mail body text.","examples":["Dobrý den, faktura byla opravena a přeposlána na Vaši adresu."],"type":"string"},"paymentRequest":{"description":"Attach a payment request: a technical order is created via `createOrder()` (customer = reporter, no order notification e-mail) and linked to the comment. The outbound e-mail then carries a pay button (when an online gateway serves the group), a bank-transfer QR code (CZK/EUR account in the request currency), or an info-only block. Requires `module-order`.","type":"object","required":["orderGroupCode","currency","items"],"properties":{"orderGroupCode":{"minLength":1,"description":"Code of an ACTIVE order group of the organisation (see `/payment-request-options`).","examples":["default"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of a currency enabled for the organisation (see `/payment-request-options`).","examples":["CZK"],"type":"string"},"items":{"minItems":1,"maxItems":20,"description":"Virtual line items of the technical order (1 to 20).","type":"array","items":{"type":"object","required":["label","price"],"properties":{"label":{"minLength":1,"maxLength":255,"description":"Line item label shown to the customer.","examples":["Konzultace"],"type":"string"},"price":{"exclusiveMinimum":0,"description":"Line amount incl. VAT in the request currency. Must be > 0.","examples":[1500],"type":"number"}}}}}},"internalRecipientContactIds":{"maxItems":100,"description":"BIZKIT-124: contact external ids of the INTERNAL people (assignee, branch, other members) who get a copy, as ticked in the composer. Omit to use the organisation notification rules. The customer side always gets the reply.","type":"array","items":{"type":"string"}},"targetStatusId":{"description":"Optional status id to apply BEFORE the outbound e-mail is dispatched. Used by the \"Send and close\" composer to bundle a status change with the reply in a single BFF call so the customer's e-mail carries the final status badge (e.g. `Stav: Dokončeno` when closing the ticket). Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"}}}}}}}},"/bff/issue/promote-comment-to-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the comment was promoted successfully.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"}},"required":["success","commentId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the comment was promoted successfully.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"}},"required":["success","commentId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the comment was promoted successfully.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"}},"required":["success","commentId"]}}}}},"operationId":"postBffIssuePromote-comment-to-email","tags":["Issue"],"summary":"Promote internal comment to customer e-mail","description":"Takes an existing internal comment (`channel = internal`) and re-classifies it as an outbound customer reply (`channel = email_out`), then dispatches the same e-mail `add-email` would have sent (reporter + assignee, subject-threaded, org sender identity). The comment id is preserved so the timeline entry stays the same row instead of appearing as a duplicate. Fails when the comment is not internal, is spam-flagged, or does not belong to the given issue. Optionally accepts `targetStatusId` to apply a status change atomically before the e-mail is rendered.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","commentId"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"},"targetStatusId":{"description":"Optional status id to apply BEFORE the outbound e-mail is dispatched. Used when the operator promotes-and-closes in one click so the customer's e-mail carries the final status badge. Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"},"internalRecipientContactIds":{"maxItems":100,"description":"BIZKIT-124: contact external ids of the INTERNAL people (assignee, branch, other members) who get a copy, as ticked in the composer. Omit to use the organisation notification rules. The customer side always gets the reply.","type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","commentId"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"},"targetStatusId":{"description":"Optional status id to apply BEFORE the outbound e-mail is dispatched. Used when the operator promotes-and-closes in one click so the customer's e-mail carries the final status badge. Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"},"internalRecipientContactIds":{"maxItems":100,"description":"BIZKIT-124: contact external ids of the INTERNAL people (assignee, branch, other members) who get a copy, as ticked in the composer. Omit to use the organisation notification rules. The customer side always gets the reply.","type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","commentId"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"},"targetStatusId":{"description":"Optional status id to apply BEFORE the outbound e-mail is dispatched. Used when the operator promotes-and-closes in one click so the customer's e-mail carries the final status badge. Must be a system status or belong to the caller organisation.","examples":[4],"type":"number"},"internalRecipientContactIds":{"maxItems":100,"description":"BIZKIT-124: contact external ids of the INTERNAL people (assignee, branch, other members) who get a copy, as ticked in the composer. Omit to use the organisation notification rules. The customer side always gets the reply.","type":"array","items":{"type":"string"}}}}}}}}},"/bff/issue/update-comment":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the edit was applied.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"},"changed":{"description":"True when the message content actually changed (false on a save with no modifications).","type":"boolean"},"resent":{"description":"True when the edit triggered a customer e-mail re-dispatch.","type":"boolean"}},"required":["success","commentId","changed","resent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the edit was applied.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"},"changed":{"description":"True when the message content actually changed (false on a save with no modifications).","type":"boolean"},"resent":{"description":"True when the edit triggered a customer e-mail re-dispatch.","type":"boolean"}},"required":["success","commentId","changed","resent"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the edit was applied.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"},"changed":{"description":"True when the message content actually changed (false on a save with no modifications).","type":"boolean"},"resent":{"description":"True when the edit triggered a customer e-mail re-dispatch.","type":"boolean"}},"required":["success","commentId","changed","resent"]}}}}},"operationId":"postBffIssueUpdate-comment","tags":["Issue"],"summary":"Edit an existing comment","description":"Updates the body of an existing comment and stores a diff in the activity log via `formatActivityFieldDiff`. Edits are restricted to the original human author (AI/system/inbound-mail entries are immutable). When the comment was previously sent as an e-mail (`channel = email_out`), the caller can opt in to a re-dispatch via `resend: true`; the admin UI surfaces a confirm dialog for this choice. Internal comments always skip the dispatch regardless of `resend`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","commentId","message"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"},"message":{"minLength":1,"description":"New comment body.","examples":["Updated — I spoke with the customer again."],"type":"string"},"resend":{"description":"Only honoured when the edited comment is channel `email_out`. True → re-dispatch the e-mail to the reporter + assignee with the new body; false (default) → persist the edit silently.","examples":[false],"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","commentId","message"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"},"message":{"minLength":1,"description":"New comment body.","examples":["Updated — I spoke with the customer again."],"type":"string"},"resend":{"description":"Only honoured when the edited comment is channel `email_out`. True → re-dispatch the e-mail to the reporter + assignee with the new body; false (default) → persist the edit silently.","examples":[false],"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","commentId","message"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"},"message":{"minLength":1,"description":"New comment body.","examples":["Updated — I spoke with the customer again."],"type":"string"},"resend":{"description":"Only honoured when the edited comment is channel `email_out`. True → re-dispatch the e-mail to the reporter + assignee with the new body; false (default) → persist the edit silently.","examples":[false],"type":"boolean"}}}}}}}},"/bff/issue/delete-comment":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the entry was removed.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"}},"required":["success","commentId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the entry was removed.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"}},"required":["success","commentId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the entry was removed.","type":"boolean"},"commentId":{"description":"Comment ID (unchanged from input).","examples":["PROJ-123_c456"],"type":"string"}},"required":["success","commentId"]}}}}},"operationId":"postBffIssueDelete-comment","tags":["Issue"],"summary":"Soft-delete a timeline entry","description":"Removes an operator-visible timeline entry (internal note, outbound e-mail, inbound e-mail or AI reply) from the issue by setting `pm__issue_comment.deleted_date = NOW()`. Readers filter deleted rows out; the row itself stays on disk so `writeMemberActivity` + system log `ISS_CMNT_DEL` can trace who removed what. Idempotent — re-deleting a row returns success without a second audit event. Does NOT recall an already-sent outbound e-mail from the customer's inbox; it only hides the entry from the timeline.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","commentId"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","commentId"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","commentId"],"properties":{"issueKey":{"description":"Issue key that owns the comment.","examples":["PROJ-123"],"type":"string"},"commentId":{"description":"Full wire-format comment id from `IssueCommentItem.id` — `${issueKey}_c${dbId}`.","examples":["PROJ-123_c456"],"type":"string"}}}}}}}},"/bff/issue/run-ai-workflow":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the orchestrator run completed successfully.","type":"boolean"},"skipped":{"nullable":true,"anyOf":[{"anyOf":[{"description":"Skipped because the issue is classified as spam.","const":"spam","type":"string"},{"description":"Skipped because the issue is flagged as human-only (pm__issue.human_only = true).","const":"human_only","type":"string"},{"description":"Skipped because the issue is already in the `done` status category. The orchestrator intentionally never drafts on closed tickets to avoid reopening resolved conversations.","const":"closed","type":"string"},{"description":"Skipped because the issue has neither an assignee nor a linked reporter — the draft comment needs a valid shop__contact FK for authorship.","const":"no_author","type":"string"},{"description":"Skipped because the issue row was not resolvable (deleted or raced).","const":"not_found","type":"string"}]},{"type":"null"}]},"actions":{"description":"The orchestrator writes at most one `draft_reply` action; mapped here to the legacy `comment` shape so the admin UI can invalidate the comment list. Internal dispatch events (KB / order specialist) are not surfaced through this endpoint — see /ai-agent-run/:externalId for the full trace.","type":"array","items":{"type":"object","required":["kind","commentId","message"],"properties":{"kind":{"const":"comment","type":"string"},"commentId":{"description":"Server-side comment id (matches selectIssueCommentList item.id).","type":"string"},"message":{"description":"Draft reply preview (first ~180 chars of the full body).","type":"string"}}}},"runExternalId":{"nullable":true,"anyOf":[{"description":"ai__agent_run.external_id of this orchestrator run — null when the run was short-circuited before insert.","type":"string"},{"type":"null"}]},"draftPreview":{"nullable":true,"anyOf":[{"description":"First ~180 chars of the draft reply body — mirrors actions[0].message when a draft was produced.","type":"string"},{"type":"null"}]}},"required":["success","skipped","actions","runExternalId","draftPreview"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the orchestrator run completed successfully.","type":"boolean"},"skipped":{"nullable":true,"anyOf":[{"anyOf":[{"description":"Skipped because the issue is classified as spam.","const":"spam","type":"string"},{"description":"Skipped because the issue is flagged as human-only (pm__issue.human_only = true).","const":"human_only","type":"string"},{"description":"Skipped because the issue is already in the `done` status category. The orchestrator intentionally never drafts on closed tickets to avoid reopening resolved conversations.","const":"closed","type":"string"},{"description":"Skipped because the issue has neither an assignee nor a linked reporter — the draft comment needs a valid shop__contact FK for authorship.","const":"no_author","type":"string"},{"description":"Skipped because the issue row was not resolvable (deleted or raced).","const":"not_found","type":"string"}]},{"type":"null"}]},"actions":{"description":"The orchestrator writes at most one `draft_reply` action; mapped here to the legacy `comment` shape so the admin UI can invalidate the comment list. Internal dispatch events (KB / order specialist) are not surfaced through this endpoint — see /ai-agent-run/:externalId for the full trace.","type":"array","items":{"type":"object","required":["kind","commentId","message"],"properties":{"kind":{"const":"comment","type":"string"},"commentId":{"description":"Server-side comment id (matches selectIssueCommentList item.id).","type":"string"},"message":{"description":"Draft reply preview (first ~180 chars of the full body).","type":"string"}}}},"runExternalId":{"nullable":true,"anyOf":[{"description":"ai__agent_run.external_id of this orchestrator run — null when the run was short-circuited before insert.","type":"string"},{"type":"null"}]},"draftPreview":{"nullable":true,"anyOf":[{"description":"First ~180 chars of the draft reply body — mirrors actions[0].message when a draft was produced.","type":"string"},{"type":"null"}]}},"required":["success","skipped","actions","runExternalId","draftPreview"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the orchestrator run completed successfully.","type":"boolean"},"skipped":{"nullable":true,"anyOf":[{"anyOf":[{"description":"Skipped because the issue is classified as spam.","const":"spam","type":"string"},{"description":"Skipped because the issue is flagged as human-only (pm__issue.human_only = true).","const":"human_only","type":"string"},{"description":"Skipped because the issue is already in the `done` status category. The orchestrator intentionally never drafts on closed tickets to avoid reopening resolved conversations.","const":"closed","type":"string"},{"description":"Skipped because the issue has neither an assignee nor a linked reporter — the draft comment needs a valid shop__contact FK for authorship.","const":"no_author","type":"string"},{"description":"Skipped because the issue row was not resolvable (deleted or raced).","const":"not_found","type":"string"}]},{"type":"null"}]},"actions":{"description":"The orchestrator writes at most one `draft_reply` action; mapped here to the legacy `comment` shape so the admin UI can invalidate the comment list. Internal dispatch events (KB / order specialist) are not surfaced through this endpoint — see /ai-agent-run/:externalId for the full trace.","type":"array","items":{"type":"object","required":["kind","commentId","message"],"properties":{"kind":{"const":"comment","type":"string"},"commentId":{"description":"Server-side comment id (matches selectIssueCommentList item.id).","type":"string"},"message":{"description":"Draft reply preview (first ~180 chars of the full body).","type":"string"}}}},"runExternalId":{"nullable":true,"anyOf":[{"description":"ai__agent_run.external_id of this orchestrator run — null when the run was short-circuited before insert.","type":"string"},{"type":"null"}]},"draftPreview":{"nullable":true,"anyOf":[{"description":"First ~180 chars of the draft reply body — mirrors actions[0].message when a draft was produced.","type":"string"},{"type":"null"}]}},"required":["success","skipped","actions","runExternalId","draftPreview"]}}}}},"operationId":"postBffIssueRun-ai-workflow","tags":["Issue"],"summary":"Run issue orchestrator (operator-triggered)","description":"Manually triggers the Phase 4+ ISSUE ORCHESTRATOR on a single issue. The orchestrator pre-screens the ticket body for prompt-injection, loads a hard-scoped reporter context (contact + own orders + prior tickets), optionally dispatches to the KB specialist and the Order specialist, and writes ONE internal draft-reply comment that the operator can edit and send. The customer NEVER sees it directly; ticket status / priority / assignee / deadline are deliberately untouched. Bypasses the org `experimental_ai_agents_enabled` flag — operator intent is explicit by clicking the button. Spam / human_only tickets still short-circuit. The response surfaces the orchestrator run id so the admin can deep-link into `/ai-agent-run/:externalId`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to process.","examples":["PROJ-123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to process.","examples":["PROJ-123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to process.","examples":["PROJ-123"],"type":"string"}}}}}}}},"/bff/issue/retriage-pending":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"processed":{"description":"Total unassigned issues considered (capped at 500).","type":"number"},"assigned":{"description":"Issues that gained a new AI-picked assignee.","type":"number"},"skippedNoCandidates":{"description":"Issues skipped because the organisation has no members with an `aiDescription` — nothing for the classifier to reason about.","type":"number"},"skippedNoDecision":{"description":"Issues where the classifier saw candidates but did not confidently pick any.","type":"number"},"skippedOther":{"description":"Issues skipped for other reasons (assigned in the meantime by another operator, re-classified as spam).","type":"number"},"failed":{"description":"Issues where the classifier or DB write threw.","type":"number"}},"required":["processed","assigned","skippedNoCandidates","skippedNoDecision","skippedOther","failed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"processed":{"description":"Total unassigned issues considered (capped at 500).","type":"number"},"assigned":{"description":"Issues that gained a new AI-picked assignee.","type":"number"},"skippedNoCandidates":{"description":"Issues skipped because the organisation has no members with an `aiDescription` — nothing for the classifier to reason about.","type":"number"},"skippedNoDecision":{"description":"Issues where the classifier saw candidates but did not confidently pick any.","type":"number"},"skippedOther":{"description":"Issues skipped for other reasons (assigned in the meantime by another operator, re-classified as spam).","type":"number"},"failed":{"description":"Issues where the classifier or DB write threw.","type":"number"}},"required":["processed","assigned","skippedNoCandidates","skippedNoDecision","skippedOther","failed"]}},"text/plain":{"schema":{"type":"object","properties":{"processed":{"description":"Total unassigned issues considered (capped at 500).","type":"number"},"assigned":{"description":"Issues that gained a new AI-picked assignee.","type":"number"},"skippedNoCandidates":{"description":"Issues skipped because the organisation has no members with an `aiDescription` — nothing for the classifier to reason about.","type":"number"},"skippedNoDecision":{"description":"Issues where the classifier saw candidates but did not confidently pick any.","type":"number"},"skippedOther":{"description":"Issues skipped for other reasons (assigned in the meantime by another operator, re-classified as spam).","type":"number"},"failed":{"description":"Issues where the classifier or DB write threw.","type":"number"}},"required":["processed","assigned","skippedNoCandidates","skippedNoDecision","skippedOther","failed"]}}}}},"operationId":"postBffIssueRetriage-pending","tags":["Issue"],"summary":"Re-triage unassigned issues","description":"Runs the AI assignee classifier again over every unassigned, non-spam, non-done issue in the organisation. Meant to be invoked after an operator edits the per-member AI descriptions (see `Nastavení AI přidělování požadavků` in the admin) — tickets that landed without an assignee because no member had a description at creation time get a fresh look. Does NOT re-run spam / priority / type / velocity classification (one-shot decisions), and does NOT re-send the \"new issue\" internal e-mail (would spam the team). Sends the standard \"assigned to you\" notification for every ticket that gains an assignee. Capped at 500 issues per invocation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectCode":{"description":"Narrow the re-triage to a single project (by `projectKey`, e.g. \"PROJ\"). Omit to sweep every project in the organisation.","examples":["PROJ"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"projectCode":{"description":"Narrow the re-triage to a single project (by `projectKey`, e.g. \"PROJ\"). Omit to sweep every project in the organisation.","examples":["PROJ"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"projectCode":{"description":"Narrow the re-triage to a single project (by `projectKey`, e.g. \"PROJ\"). Omit to sweep every project in the organisation.","examples":["PROJ"],"type":"string"}}}}}}}},"/bff/issue/generate-summary":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the request completed.","type":"boolean"},"aiSummary":{"nullable":true,"anyOf":[{"description":"Newly-generated summary, or `null` when the description was empty or the LLM produced nothing usable.","type":"string"},{"type":"null"}]}},"required":["success","aiSummary"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the request completed.","type":"boolean"},"aiSummary":{"nullable":true,"anyOf":[{"description":"Newly-generated summary, or `null` when the description was empty or the LLM produced nothing usable.","type":"string"},{"type":"null"}]}},"required":["success","aiSummary"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the request completed.","type":"boolean"},"aiSummary":{"nullable":true,"anyOf":[{"description":"Newly-generated summary, or `null` when the description was empty or the LLM produced nothing usable.","type":"string"},{"type":"null"}]}},"required":["success","aiSummary"]}}}}},"operationId":"postBffIssueGenerate-summary","tags":["Issue"],"summary":"Generate or refresh the AI summary","description":"Runs the summarizer on the current `description` and stores the result into `pm__issue.ai_summary`. Idempotent — safe to call repeatedly. Returns `aiSummary: null` when the description is empty or the LLM failed to produce output (in which case the column is nulled out).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to summarize.","examples":["PROJ-123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to summarize.","examples":["PROJ-123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"description":"Issue key to summarize.","examples":["PROJ-123"],"type":"string"}}}}}}}},"/bff/issue/set-spam":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the spam status was updated successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the spam status was updated successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the spam status was updated successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIssueSet-spam","tags":["Issue"],"summary":"Set spam status","description":"Manually marks or unmarks an issue as spam. When marking (`isSpam=true`) the ticket is additionally transitioned to the org-default `done` status (a specific done-status the operator may have picked, e.g. Wontfix, is preserved). Never sends any outbound mail — the reporter must never learn we flagged their message as spam; we only record it internally.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","isSpam"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"isSpam":{"description":"Mark as spam (true) or not spam (false).","examples":[true],"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","isSpam"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"isSpam":{"description":"Mark as spam (true) or not spam (false).","examples":[true],"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","isSpam"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"isSpam":{"description":"Mark as spam (true) or not spam (false).","examples":[true],"type":"boolean"}}}}}}}},"/bff/issue/save-human-only":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the flag was updated successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the flag was updated successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the flag was updated successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIssueSave-human-only","tags":["Issue"],"summary":"Toggle the human-only flag on an issue","description":"Sets `pm__issue.human_only`. Used for tickets where the operator wants to guarantee no AI action — legal escalation, incident response, VIP customer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","humanOnly"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"humanOnly":{"description":"When `true`, the AI orchestrator (and any future automated agent) will refuse to touch this ticket on any future run — no draft reply, no status/priority change, no reassignment.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","humanOnly"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"humanOnly":{"description":"When `true`, the AI orchestrator (and any future automated agent) will refuse to touch this ticket on any future run — no draft reply, no status/priority change, no reassignment.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","humanOnly"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"humanOnly":{"description":"When `true`, the AI orchestrator (and any future automated agent) will refuse to touch this ticket on any future run — no draft reply, no status/priority change, no reassignment.","type":"boolean"}}}}}}}},"/bff/issue/save-secured-ticket":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the flag was updated successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the flag was updated successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the flag was updated successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIssueSave-secured-ticket","tags":["Issue"],"summary":"Toggle the confidentiality flag on an issue","description":"Sets `pm__issue.secured_ticket`. ROOT-ONLY endpoint — non-root callers receive the same \"not found\" response as if the issue did not exist. Written as an event on `core__activity` so audit tooling can reconstruct who toggled the flag when.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","securedTicket"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"securedTicket":{"description":"When `true`, the ticket becomes visible ONLY to ORG ROOT members — regular operators receive `{ exist: false }` from `/bff/issue/detail` and never see it in lists or counts. Reserved for confidential financial / legal / internal content (Comgate mails, bank statements, GDPR / legal correspondence, HR).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","securedTicket"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"securedTicket":{"description":"When `true`, the ticket becomes visible ONLY to ORG ROOT members — regular operators receive `{ exist: false }` from `/bff/issue/detail` and never see it in lists or counts. Reserved for confidential financial / legal / internal content (Comgate mails, bank statements, GDPR / legal correspondence, HR).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","securedTicket"],"properties":{"issueKey":{"description":"Issue key.","examples":["PROJ-123"],"type":"string"},"securedTicket":{"description":"When `true`, the ticket becomes visible ONLY to ORG ROOT members — regular operators receive `{ exist: false }` from `/bff/issue/detail` and never see it in lists or counts. Reserved for confidential financial / legal / internal content (Comgate mails, bank statements, GDPR / legal correspondence, HR).","type":"boolean"}}}}}}}},"/bff/issue/type/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","icon","isSubtask","sortOrder"],"properties":{"id":{"description":"Issue type ID.","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, `incident`, `feature_request`, `change_request`, `question`, `service_request`).","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name.","type":"string"},{"type":"null"}]},"isSubtask":{"description":"True for types that require a parent issue (sub_task).","type":"boolean"},"sortOrder":{"description":"UI ordering hint (ascending).","type":"number"}}}},"itemCount":{"description":"Total number of returned rows (equals items.length; DataGrid-compatible).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","icon","isSubtask","sortOrder"],"properties":{"id":{"description":"Issue type ID.","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, `incident`, `feature_request`, `change_request`, `question`, `service_request`).","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name.","type":"string"},{"type":"null"}]},"isSubtask":{"description":"True for types that require a parent issue (sub_task).","type":"boolean"},"sortOrder":{"description":"UI ordering hint (ascending).","type":"number"}}}},"itemCount":{"description":"Total number of returned rows (equals items.length; DataGrid-compatible).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","icon","isSubtask","sortOrder"],"properties":{"id":{"description":"Issue type ID.","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, `incident`, `feature_request`, `change_request`, `question`, `service_request`).","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name.","type":"string"},{"type":"null"}]},"isSubtask":{"description":"True for types that require a parent issue (sub_task).","type":"boolean"},"sortOrder":{"description":"UI ordering hint (ascending).","type":"number"}}}},"itemCount":{"description":"Total number of returned rows (equals items.length; DataGrid-compatible).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssueTypeList","tags":["Issue"],"summary":"List issue types","description":"Returns the fixed catalogue of issue kinds (story, epic, task, sub_task, bug, incident, feature_request, change_request, question, service_request) with icon + sort order for admin dropdowns. Labels are not returned — the admin dictionary resolves them by `code`."}},"/bff/issue/statuses":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","categoryId","categoryCode","isSystem","sortOrder"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the organisation primary locale).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"},"isSystem":{"description":"True for the canonical system status of the category (seeded, read-only, always present in every organisation). False for org-defined refinement rows.","type":"boolean"},"sortOrder":{"description":"UI ordering hint within the category (ascending; system rows are always rendered first).","type":"number"}}}},"itemCount":{"description":"Total number of returned rows (equals items.length; DataGrid-compatible).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","categoryId","categoryCode","isSystem","sortOrder"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the organisation primary locale).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"},"isSystem":{"description":"True for the canonical system status of the category (seeded, read-only, always present in every organisation). False for org-defined refinement rows.","type":"boolean"},"sortOrder":{"description":"UI ordering hint within the category (ascending; system rows are always rendered first).","type":"number"}}}},"itemCount":{"description":"Total number of returned rows (equals items.length; DataGrid-compatible).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","label","categoryId","categoryCode","isSystem","sortOrder"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status display label (localized to the organisation primary locale).","type":"string"},"categoryId":{"description":"Status category ID (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"},"isSystem":{"description":"True for the canonical system status of the category (seeded, read-only, always present in every organisation). False for org-defined refinement rows.","type":"boolean"},"sortOrder":{"description":"UI ordering hint within the category (ascending; system rows are always rendered first).","type":"number"}}}},"itemCount":{"description":"Total number of returned rows (equals items.length; DataGrid-compatible).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssueStatuses","tags":["Issue"],"summary":"List statuses","description":"Returns every issue status visible to the organisation: the four canonical system rows (seeded, read-only, always present) plus any org-defined refinement rows. Ordering is category → system-first → sort_order → label. Labels are localized to the organisation`s primary locale."}},"/bff/issue/status/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"ID of the newly created status.","type":"number"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"ID of the newly created status.","type":"number"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"ID of the newly created status.","type":"number"}},"required":["success","id"]}}}}},"operationId":"postBffIssueStatusCreate","tags":["Issue"],"summary":"Create custom status","description":"Add an organisation-scoped refinement status inside one of the four canonical categories. System rows are seeded automatically and cannot be created here.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["statusCategoryId","label"],"properties":{"statusCategoryId":{"minimum":1,"maximum":4,"description":"Category bucket (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"label":{"minLength":1,"maxLength":48,"description":"Custom label (unique within category for the organisation).","type":"string"},"sortOrder":{"description":"UI ordering hint within the category (default 0).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["statusCategoryId","label"],"properties":{"statusCategoryId":{"minimum":1,"maximum":4,"description":"Category bucket (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"label":{"minLength":1,"maxLength":48,"description":"Custom label (unique within category for the organisation).","type":"string"},"sortOrder":{"description":"UI ordering hint within the category (default 0).","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["statusCategoryId","label"],"properties":{"statusCategoryId":{"minimum":1,"maximum":4,"description":"Category bucket (1=new, 2=progress, 3=waiting, 4=done).","type":"number"},"label":{"minLength":1,"maxLength":48,"description":"Custom label (unique within category for the organisation).","type":"string"},"sortOrder":{"description":"UI ordering hint within the category (default 0).","type":"number"}}}}}}}},"/bff/issue/status/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIssueStatusUpdate","tags":["Issue"],"summary":"Update custom status","description":"Rename or reorder a custom status. System rows are read-only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"minLength":1,"maxLength":48,"description":"New label.","type":"string"},"sortOrder":{"description":"New UI ordering hint.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"minLength":1,"maxLength":48,"description":"New label.","type":"string"},"sortOrder":{"description":"New UI ordering hint.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"minLength":1,"maxLength":48,"description":"New label.","type":"string"},"sortOrder":{"description":"New UI ordering hint.","type":"number"}}}}}}}},"/bff/issue/status/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIssueStatusDelete","tags":["Issue"],"summary":"Delete custom status","description":"Remove a custom status. System rows cannot be deleted. Callers must repoint any issues currently using the status before deleting; otherwise the delete fails on the FK constraint.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Status ID to delete.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Status ID to delete.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Status ID to delete.","type":"number"}}}}}}}},"/bff/issue/support-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the support ticket was created successfully.","type":"boolean"},"issueKey":{"description":"Generated ticket key.","examples":["BIZKIT-42"],"type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"}},"required":["success","issueKey","internalId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the support ticket was created successfully.","type":"boolean"},"issueKey":{"description":"Generated ticket key.","examples":["BIZKIT-42"],"type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"}},"required":["success","issueKey","internalId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the support ticket was created successfully.","type":"boolean"},"issueKey":{"description":"Generated ticket key.","examples":["BIZKIT-42"],"type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"}},"required":["success","issueKey","internalId"]}}}}},"operationId":"postBffIssueSupport-create","tags":["Issue"],"summary":"Create support ticket against BizKitHub","description":"Files an internal support ticket against BizKitHub on behalf of the authenticated organisation. The issue is created inside BizKitHub`s SUPPORT project but the originating organisation can also see and comment on it via /detail, /comments and /add-comment or /add-email. A confirmation email is sent automatically (existing issue notification flow), and any subsequent comment from BizKitHub is delivered back to the reporter`s mailbox.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"maxLength":200,"description":"Optional subject/title. The admin \"Napsat podpoře\" modal omits it: the server derives a stand-in from the first line of `description` (flagged `subject_is_placeholder`) and the AI triage pass writes a proper subject within seconds.","examples":["Cannot connect TTLock device to gateway"],"type":"string"},"description":{"maxLength":50000,"description":"Detailed description of the issue (Markdown or HTML). Required in practice when `subject` is omitted; the server rejects a ticket with neither.","examples":["<p>The device shows blue blinking after pairing but never reaches the cloud.</p>"],"type":"string"},"pageUrl":{"maxLength":2000,"description":"Admin page URL the reporter was on when they opened the modal. Stored in `pm__issue.reporter_page_url` (http(s) only, fragment dropped) so the support team sees where the problem happened without asking.","examples":["https://admin.bizkithub.com/invoice/2026-0042"],"type":"string"},"urgent":{"default":false,"description":"Reporter's felt-urgency flag. `true` when the person filing the ticket explicitly ticked an 'urgent for me' checkbox. Persisted to `pm__issue.user_urgency_hint` (orthogonal to `priority` — the AI triage classifier owns priority) and passed as a soft input to the classifier. Never authoritative on its own: content still decides the final priority.","type":"boolean"},"technicalContext":{"description":"Technical context collected by the admin at submit time (page, browser, display, network, performance, app build, correlation ids, recent console errors / failed requests). Shape: `TechnicalContext` (`src/lib/issue/technicalContext/types.ts`); normalised server-side, enriched with the session identity, IP / geo and parsed User-Agent, stored in `pm__issue.technical_context`. Never part of the description, never shown to the reporter. A malformed value is ignored, it never blocks the ticket."},"source":{"description":"Set by the admin when the operator sends a ticket that Kit drafted in the chat (`prepareSupportTicket`). Recorded in the activity log only.","const":"kit-chat","type":"string"},"chatRoomId":{"maxLength":64,"description":"Kit chat room the draft came from (with `source: \"kit-chat\"`). Activity-log reference only.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"subject":{"maxLength":200,"description":"Optional subject/title. The admin \"Napsat podpoře\" modal omits it: the server derives a stand-in from the first line of `description` (flagged `subject_is_placeholder`) and the AI triage pass writes a proper subject within seconds.","examples":["Cannot connect TTLock device to gateway"],"type":"string"},"description":{"maxLength":50000,"description":"Detailed description of the issue (Markdown or HTML). Required in practice when `subject` is omitted; the server rejects a ticket with neither.","examples":["<p>The device shows blue blinking after pairing but never reaches the cloud.</p>"],"type":"string"},"pageUrl":{"maxLength":2000,"description":"Admin page URL the reporter was on when they opened the modal. Stored in `pm__issue.reporter_page_url` (http(s) only, fragment dropped) so the support team sees where the problem happened without asking.","examples":["https://admin.bizkithub.com/invoice/2026-0042"],"type":"string"},"urgent":{"default":false,"description":"Reporter's felt-urgency flag. `true` when the person filing the ticket explicitly ticked an 'urgent for me' checkbox. Persisted to `pm__issue.user_urgency_hint` (orthogonal to `priority` — the AI triage classifier owns priority) and passed as a soft input to the classifier. Never authoritative on its own: content still decides the final priority.","type":"boolean"},"technicalContext":{"description":"Technical context collected by the admin at submit time (page, browser, display, network, performance, app build, correlation ids, recent console errors / failed requests). Shape: `TechnicalContext` (`src/lib/issue/technicalContext/types.ts`); normalised server-side, enriched with the session identity, IP / geo and parsed User-Agent, stored in `pm__issue.technical_context`. Never part of the description, never shown to the reporter. A malformed value is ignored, it never blocks the ticket."},"source":{"description":"Set by the admin when the operator sends a ticket that Kit drafted in the chat (`prepareSupportTicket`). Recorded in the activity log only.","const":"kit-chat","type":"string"},"chatRoomId":{"maxLength":64,"description":"Kit chat room the draft came from (with `source: \"kit-chat\"`). Activity-log reference only.","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"subject":{"maxLength":200,"description":"Optional subject/title. The admin \"Napsat podpoře\" modal omits it: the server derives a stand-in from the first line of `description` (flagged `subject_is_placeholder`) and the AI triage pass writes a proper subject within seconds.","examples":["Cannot connect TTLock device to gateway"],"type":"string"},"description":{"maxLength":50000,"description":"Detailed description of the issue (Markdown or HTML). Required in practice when `subject` is omitted; the server rejects a ticket with neither.","examples":["<p>The device shows blue blinking after pairing but never reaches the cloud.</p>"],"type":"string"},"pageUrl":{"maxLength":2000,"description":"Admin page URL the reporter was on when they opened the modal. Stored in `pm__issue.reporter_page_url` (http(s) only, fragment dropped) so the support team sees where the problem happened without asking.","examples":["https://admin.bizkithub.com/invoice/2026-0042"],"type":"string"},"urgent":{"default":false,"description":"Reporter's felt-urgency flag. `true` when the person filing the ticket explicitly ticked an 'urgent for me' checkbox. Persisted to `pm__issue.user_urgency_hint` (orthogonal to `priority` — the AI triage classifier owns priority) and passed as a soft input to the classifier. Never authoritative on its own: content still decides the final priority.","type":"boolean"},"technicalContext":{"description":"Technical context collected by the admin at submit time (page, browser, display, network, performance, app build, correlation ids, recent console errors / failed requests). Shape: `TechnicalContext` (`src/lib/issue/technicalContext/types.ts`); normalised server-side, enriched with the session identity, IP / geo and parsed User-Agent, stored in `pm__issue.technical_context`. Never part of the description, never shown to the reporter. A malformed value is ignored, it never blocks the ticket."},"source":{"description":"Set by the admin when the operator sends a ticket that Kit drafted in the chat (`prepareSupportTicket`). Recorded in the activity log only.","const":"kit-chat","type":"string"},"chatRoomId":{"maxLength":64,"description":"Kit chat room the draft came from (with `source: \"kit-chat\"`). Activity-log reference only.","type":"string"}}}}}}}},"/bff/issue/support-list":{"get":{"parameters":[{"description":"Filter by status category (1=new, 2=progress, 3=waiting, 4=done).","examples":[1],"schema":{"type":"number"},"in":"query","name":"statusCategoryId","required":false},{"description":"Page number (1-based).","examples":[1],"schema":{"type":"number","default":1},"in":"query","name":"page","required":false},{"description":"Items per page.","examples":[50],"schema":{"type":"number","default":50},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","type","status","reporter","insertedDate","updatedDate"],"properties":{"id":{"description":"Issue key (e.g. \"BIZKIT-42\").","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Ticket subject.","type":"string"},"priority":{"description":"Priority (1-5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status label.","type":"string"},"categoryId":{"description":"Status category ID.","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"description":"Reporter contact ID.","type":"number"},"name":{"description":"Reporter full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Reporter e-mail. `null` for phone-only contacts and anonymised contacts.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"insertedDate":{"description":"When the ticket was created.","anyOf":[{"description":"When the ticket was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}},"itemCount":{"description":"Total matching tickets.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","type","status","reporter","insertedDate","updatedDate"],"properties":{"id":{"description":"Issue key (e.g. \"BIZKIT-42\").","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Ticket subject.","type":"string"},"priority":{"description":"Priority (1-5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status label.","type":"string"},"categoryId":{"description":"Status category ID.","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"description":"Reporter contact ID.","type":"number"},"name":{"description":"Reporter full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Reporter e-mail. `null` for phone-only contacts and anonymised contacts.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"insertedDate":{"description":"When the ticket was created.","anyOf":[{"description":"When the ticket was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}},"itemCount":{"description":"Total matching tickets.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","internalId","issueKey","subject","priority","priorityLabel","type","status","reporter","insertedDate","updatedDate"],"properties":{"id":{"description":"Issue key (e.g. \"BIZKIT-42\").","type":"string"},"internalId":{"description":"Internal numeric ID.","type":"number"},"issueKey":{"description":"Issue key.","type":"string"},"subject":{"description":"Ticket subject.","type":"string"},"priority":{"description":"Priority (1-5).","type":"number"},"priorityLabel":{"description":"Human-readable priority label.","type":"string"},"type":{"type":"object","required":["id","code","icon"],"properties":{"id":{"description":"Issue type ID (`pm__issue_type.id`).","type":"number"},"code":{"description":"Stable slug (`story`, `epic`, `task`, `sub_task`, `bug`, ...). Admin resolves the localized label from its dictionary.","type":"string"},"icon":{"nullable":true,"anyOf":[{"description":"Lucide icon name to render alongside the subject.","type":"string"},{"type":"null"}]}}},"status":{"type":"object","required":["id","label","categoryId","categoryCode"],"properties":{"id":{"description":"Status ID.","type":"number"},"label":{"description":"Status label.","type":"string"},"categoryId":{"description":"Status category ID.","type":"number"},"categoryCode":{"description":"Status category code.","type":"string"}}},"reporter":{"nullable":true,"anyOf":[{"type":"object","required":["id","name","email"],"properties":{"id":{"description":"Reporter contact ID.","type":"number"},"name":{"description":"Reporter full name.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Reporter e-mail. `null` for phone-only contacts and anonymised contacts.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"insertedDate":{"description":"When the ticket was created.","anyOf":[{"description":"When the ticket was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"nullable":true,"anyOf":[{"description":"Last update timestamp.","anyOf":[{"description":"Last update timestamp.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}},"itemCount":{"description":"Total matching tickets.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssueSupport-list","tags":["Issue"],"summary":"List support tickets filed by current organisation","description":"Returns support tickets that the authenticated organisation has filed against BizKitHub. These tickets live inside BizKitHub`s SUPPORT project but are visible to the originating organisation thanks to the originatingOrganisationId column on the issue. For BizKitHub itself this endpoint returns an empty list — internal staff should use /list instead."}},"/bff/issue/statistics":{"get":{"parameters":[{"description":"Filter by project key.","examples":["PROJ"],"schema":{"type":"string"},"in":"query","name":"projectCode","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"byCategory":{"description":"Issue count per status category code (e.g. { \"new\": 5, \"progress\": 3 }).","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"spamCount":{"description":"Total spam issues.","type":"number"},"totalCount":{"description":"Total non-spam issues.","type":"number"},"byAssignee":{"description":"Per-assignee issue counts across all statuses (spam excluded). Sorted by count DESC, then by last-name / first-name ASC. Used by the admin grid to render the Assignee filter with counts.","type":"array","items":{"type":"object","required":["contactExternalId","name","count"],"properties":{"contactExternalId":{"description":"16-char `shop__contact.external_id` of the assignee.","type":"string"},"avatarUrl":{"description":"Uploaded avatar URL (person-avatar rule). Absent = render the initials fallback.","type":"string"},"name":{"description":"Display name (company name, resolved full name, e-mail, or external id fallback).","type":"string"},"count":{"description":"Total non-spam issues assigned to this contact across all statuses.","type":"number"}}}},"byReporter":{"description":"Most frequent reporters (top 500) with their issue counts across all statuses (spam excluded). Sorted by count DESC, then by name. Drives the Reporter filter of the admin grid.","type":"array","items":{"type":"object","required":["contactExternalId","name","count"],"properties":{"contactExternalId":{"description":"16-char `shop__contact.external_id` of the reporter.","type":"string"},"avatarUrl":{"description":"Uploaded avatar URL (person-avatar rule). Absent = render the initials fallback.","type":"string"},"name":{"description":"Display name (company name, resolved full name, e-mail, or external id fallback).","type":"string"},"count":{"description":"Non-spam issues this contact reported, across all statuses.","type":"number"}}}},"unassignedCount":{"description":"Total non-spam issues with no primary assignee. Used by the \"Nepřiřazené\" option in the Assignee filter.","type":"number"},"myOpenCount":{"description":"Open (non-done, non-spam) issues assigned to the caller. Drives the \"Moje\" view tab.","type":"number"},"unassignedOpenCount":{"description":"Open (non-done, non-spam) issues with no primary assignee. Drives the \"Nepřiřazené\" view tab.","type":"number"},"overSlaOpenCount":{"description":"Open (non-done, non-spam) issues whose wall-clock age exceeds the per-org SLA target of their priority. Drives the \"Po SLA\" view tab.","type":"number"},"resolutionSpeed":{"description":"Rolling 90-day resolution-speed metric. Active time subtracts backlog (`waiting`) and re-open gaps (`done` → other → `done`). Priority-aware SLA ratio uses per-org configuration.","type":"object","required":["windowDays","sampleSize","medianActiveSeconds","medianSlaRatio","perPriority"],"properties":{"windowDays":{"description":"Rolling window used for the calculation (currently 90).","type":"number"},"sampleSize":{"description":"Number of closed tickets that contributed to the aggregate median.","type":"number"},"medianActiveSeconds":{"nullable":true,"anyOf":[{"description":"Aggregate median of the wall-clock time from creation to final close, minus time spent in `waiting` (backlog) and any `done` re-open gaps. Null when the sample is empty.","type":"number"},{"type":"null"}]},"medianSlaRatio":{"nullable":true,"anyOf":[{"description":"Aggregate median of `active_time / sla_target(priority)`. Values < 1 mean the team beats its SLA on typical tickets. Null when the sample is empty. Priority-normalised so the mix of closed priorities does not skew the number.","type":"number"},{"type":"null"}]},"perPriority":{"description":"Per-priority breakdown, ordered blocker → low, for a tooltip / drilldown.","type":"array","items":{"type":"object","required":["priority","sampleSize","medianActiveSeconds","medianSlaRatio","slaTargetSeconds"],"properties":{"priority":{"anyOf":[{"const":"blocker","type":"string"},{"const":"critical","type":"string"},{"const":"high","type":"string"},{"const":"normal","type":"string"},{"const":"low","type":"string"}]},"sampleSize":{"type":"number"},"medianActiveSeconds":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"medianSlaRatio":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"slaTargetSeconds":{"description":"Per-org SLA target for this priority in seconds (from `cas__organisation_configuration.issue_sla_target_seconds` with platform defaults).","type":"number"}}}}}}},"required":["byCategory","spamCount","totalCount","byAssignee","byReporter","unassignedCount","myOpenCount","unassignedOpenCount","overSlaOpenCount","resolutionSpeed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"byCategory":{"description":"Issue count per status category code (e.g. { \"new\": 5, \"progress\": 3 }).","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"spamCount":{"description":"Total spam issues.","type":"number"},"totalCount":{"description":"Total non-spam issues.","type":"number"},"byAssignee":{"description":"Per-assignee issue counts across all statuses (spam excluded). Sorted by count DESC, then by last-name / first-name ASC. Used by the admin grid to render the Assignee filter with counts.","type":"array","items":{"type":"object","required":["contactExternalId","name","count"],"properties":{"contactExternalId":{"description":"16-char `shop__contact.external_id` of the assignee.","type":"string"},"avatarUrl":{"description":"Uploaded avatar URL (person-avatar rule). Absent = render the initials fallback.","type":"string"},"name":{"description":"Display name (company name, resolved full name, e-mail, or external id fallback).","type":"string"},"count":{"description":"Total non-spam issues assigned to this contact across all statuses.","type":"number"}}}},"byReporter":{"description":"Most frequent reporters (top 500) with their issue counts across all statuses (spam excluded). Sorted by count DESC, then by name. Drives the Reporter filter of the admin grid.","type":"array","items":{"type":"object","required":["contactExternalId","name","count"],"properties":{"contactExternalId":{"description":"16-char `shop__contact.external_id` of the reporter.","type":"string"},"avatarUrl":{"description":"Uploaded avatar URL (person-avatar rule). Absent = render the initials fallback.","type":"string"},"name":{"description":"Display name (company name, resolved full name, e-mail, or external id fallback).","type":"string"},"count":{"description":"Non-spam issues this contact reported, across all statuses.","type":"number"}}}},"unassignedCount":{"description":"Total non-spam issues with no primary assignee. Used by the \"Nepřiřazené\" option in the Assignee filter.","type":"number"},"myOpenCount":{"description":"Open (non-done, non-spam) issues assigned to the caller. Drives the \"Moje\" view tab.","type":"number"},"unassignedOpenCount":{"description":"Open (non-done, non-spam) issues with no primary assignee. Drives the \"Nepřiřazené\" view tab.","type":"number"},"overSlaOpenCount":{"description":"Open (non-done, non-spam) issues whose wall-clock age exceeds the per-org SLA target of their priority. Drives the \"Po SLA\" view tab.","type":"number"},"resolutionSpeed":{"description":"Rolling 90-day resolution-speed metric. Active time subtracts backlog (`waiting`) and re-open gaps (`done` → other → `done`). Priority-aware SLA ratio uses per-org configuration.","type":"object","required":["windowDays","sampleSize","medianActiveSeconds","medianSlaRatio","perPriority"],"properties":{"windowDays":{"description":"Rolling window used for the calculation (currently 90).","type":"number"},"sampleSize":{"description":"Number of closed tickets that contributed to the aggregate median.","type":"number"},"medianActiveSeconds":{"nullable":true,"anyOf":[{"description":"Aggregate median of the wall-clock time from creation to final close, minus time spent in `waiting` (backlog) and any `done` re-open gaps. Null when the sample is empty.","type":"number"},{"type":"null"}]},"medianSlaRatio":{"nullable":true,"anyOf":[{"description":"Aggregate median of `active_time / sla_target(priority)`. Values < 1 mean the team beats its SLA on typical tickets. Null when the sample is empty. Priority-normalised so the mix of closed priorities does not skew the number.","type":"number"},{"type":"null"}]},"perPriority":{"description":"Per-priority breakdown, ordered blocker → low, for a tooltip / drilldown.","type":"array","items":{"type":"object","required":["priority","sampleSize","medianActiveSeconds","medianSlaRatio","slaTargetSeconds"],"properties":{"priority":{"anyOf":[{"const":"blocker","type":"string"},{"const":"critical","type":"string"},{"const":"high","type":"string"},{"const":"normal","type":"string"},{"const":"low","type":"string"}]},"sampleSize":{"type":"number"},"medianActiveSeconds":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"medianSlaRatio":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"slaTargetSeconds":{"description":"Per-org SLA target for this priority in seconds (from `cas__organisation_configuration.issue_sla_target_seconds` with platform defaults).","type":"number"}}}}}}},"required":["byCategory","spamCount","totalCount","byAssignee","byReporter","unassignedCount","myOpenCount","unassignedOpenCount","overSlaOpenCount","resolutionSpeed"]}},"text/plain":{"schema":{"type":"object","properties":{"byCategory":{"description":"Issue count per status category code (e.g. { \"new\": 5, \"progress\": 3 }).","type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"spamCount":{"description":"Total spam issues.","type":"number"},"totalCount":{"description":"Total non-spam issues.","type":"number"},"byAssignee":{"description":"Per-assignee issue counts across all statuses (spam excluded). Sorted by count DESC, then by last-name / first-name ASC. Used by the admin grid to render the Assignee filter with counts.","type":"array","items":{"type":"object","required":["contactExternalId","name","count"],"properties":{"contactExternalId":{"description":"16-char `shop__contact.external_id` of the assignee.","type":"string"},"avatarUrl":{"description":"Uploaded avatar URL (person-avatar rule). Absent = render the initials fallback.","type":"string"},"name":{"description":"Display name (company name, resolved full name, e-mail, or external id fallback).","type":"string"},"count":{"description":"Total non-spam issues assigned to this contact across all statuses.","type":"number"}}}},"byReporter":{"description":"Most frequent reporters (top 500) with their issue counts across all statuses (spam excluded). Sorted by count DESC, then by name. Drives the Reporter filter of the admin grid.","type":"array","items":{"type":"object","required":["contactExternalId","name","count"],"properties":{"contactExternalId":{"description":"16-char `shop__contact.external_id` of the reporter.","type":"string"},"avatarUrl":{"description":"Uploaded avatar URL (person-avatar rule). Absent = render the initials fallback.","type":"string"},"name":{"description":"Display name (company name, resolved full name, e-mail, or external id fallback).","type":"string"},"count":{"description":"Non-spam issues this contact reported, across all statuses.","type":"number"}}}},"unassignedCount":{"description":"Total non-spam issues with no primary assignee. Used by the \"Nepřiřazené\" option in the Assignee filter.","type":"number"},"myOpenCount":{"description":"Open (non-done, non-spam) issues assigned to the caller. Drives the \"Moje\" view tab.","type":"number"},"unassignedOpenCount":{"description":"Open (non-done, non-spam) issues with no primary assignee. Drives the \"Nepřiřazené\" view tab.","type":"number"},"overSlaOpenCount":{"description":"Open (non-done, non-spam) issues whose wall-clock age exceeds the per-org SLA target of their priority. Drives the \"Po SLA\" view tab.","type":"number"},"resolutionSpeed":{"description":"Rolling 90-day resolution-speed metric. Active time subtracts backlog (`waiting`) and re-open gaps (`done` → other → `done`). Priority-aware SLA ratio uses per-org configuration.","type":"object","required":["windowDays","sampleSize","medianActiveSeconds","medianSlaRatio","perPriority"],"properties":{"windowDays":{"description":"Rolling window used for the calculation (currently 90).","type":"number"},"sampleSize":{"description":"Number of closed tickets that contributed to the aggregate median.","type":"number"},"medianActiveSeconds":{"nullable":true,"anyOf":[{"description":"Aggregate median of the wall-clock time from creation to final close, minus time spent in `waiting` (backlog) and any `done` re-open gaps. Null when the sample is empty.","type":"number"},{"type":"null"}]},"medianSlaRatio":{"nullable":true,"anyOf":[{"description":"Aggregate median of `active_time / sla_target(priority)`. Values < 1 mean the team beats its SLA on typical tickets. Null when the sample is empty. Priority-normalised so the mix of closed priorities does not skew the number.","type":"number"},{"type":"null"}]},"perPriority":{"description":"Per-priority breakdown, ordered blocker → low, for a tooltip / drilldown.","type":"array","items":{"type":"object","required":["priority","sampleSize","medianActiveSeconds","medianSlaRatio","slaTargetSeconds"],"properties":{"priority":{"anyOf":[{"const":"blocker","type":"string"},{"const":"critical","type":"string"},{"const":"high","type":"string"},{"const":"normal","type":"string"},{"const":"low","type":"string"}]},"sampleSize":{"type":"number"},"medianActiveSeconds":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"medianSlaRatio":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"slaTargetSeconds":{"description":"Per-org SLA target for this priority in seconds (from `cas__organisation_configuration.issue_sla_target_seconds` with platform defaults).","type":"number"}}}}}}},"required":["byCategory","spamCount","totalCount","byAssignee","byReporter","unassignedCount","myOpenCount","unassignedOpenCount","overSlaOpenCount","resolutionSpeed"]}}}}},"operationId":"getBffIssueStatistics","tags":["Issue"],"summary":"Get statistics","description":"Returns issue counts grouped by status category, total non-spam count, spam count, and the \"resolution speed\" block (median active time to close + median SLA ratio over the last 90 days, per priority + aggregate). Backlog / waiting time and re-open gaps are subtracted from the wall-clock total so the number reflects team-controlled work only. Useful for dashboard widgets and overview panels."}},"/bff/issue/flow-analytics":{"get":{"parameters":[{"description":"Filter by project key.","examples":["PROJ"],"schema":{"type":"string"},"in":"query","name":"projectCode","required":false},{"description":"Only issues of this priority (1=low..5=blocker; NULL counts as 2).","schema":{"type":"number","minimum":1,"maximum":5},"in":"query","name":"priority","required":false},{"description":"Same shortcut as on `/list`: `me`, `unassigned`, or a 16-char `shop__contact.external_id`.","examples":["me"],"schema":{"type":"string"},"in":"query","name":"assigneeFilter","required":false},{"description":"Same shortcut as on `/list`: the reporter's 16-char `shop__contact.external_id`.","schema":{"type":"string","maxLength":32},"in":"query","name":"reporterFilter","required":false},{"description":"Only issues carrying this organisation tag (`pm__tag.code`).","schema":{"type":"string"},"in":"query","name":"tagCode","required":false},{"description":"Only issues of this type (`pm__issue_type.code`).","schema":{"type":"string"},"in":"query","name":"typeCode","required":false},{"description":"Case-insensitive substring match on subject or issue key.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Inclusive start of the analytics window, ISO-8601 date (`YYYY-MM-DD`) or ISO datetime. Defaults to 30 days before `dateTo`.","examples":["2026-09-07"],"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"Exclusive end of the analytics window, ISO-8601 date or datetime. Defaults to tomorrow (midnight UTC) so the last displayed day is today.","examples":["2026-10-07"],"schema":{"type":"string"},"in":"query","name":"dateTo","required":false}],"operationId":"getBffIssueFlow-analytics","tags":["Issue"],"summary":"Issue flow analytics (CFD + daily arrival/throughput + priority heatmap)","description":"Returns a single aggregated bundle for the /issue flow panel: daily arrival (new issues) and throughput (status→done events) counts and velocity sums, backlog EOD reconstructed from the current open-count snapshot by rolling back daily net flow, cumulative done within the window (the CFD other half), a priority×day heatmap of arrival, the current open backlog grouped by status category (new/progress/waiting/done), and the window p50/p90/avg wall-clock cycle time of issues closed in the window. The bundle also carries a previous-window mirror of the KPI totals for trend arrows. Accepts the same scope filters as `/list` (project, priority, assignee, tag, type, fulltext) so the insights panel follows the grid. Spam and secured tickets are excluded from every count for non-root viewers so the numbers match /statistics.","responses":{"200":{}}}},"/bff/issue/sla-config":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}},"defaults":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}}},"required":["targets","defaults"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}},"defaults":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}}},"required":["targets","defaults"]}},"text/plain":{"schema":{"type":"object","properties":{"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}},"defaults":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}}},"required":["targets","defaults"]}}}}},"operationId":"getBffIssueSla-config","tags":["Issue"],"summary":"Get SLA targets","description":"Returns the per-priority SLA targets (in seconds) used by the /issue resolution-speed chip, together with the platform defaults for reference. Any missing key in the per-org override falls back to the default of the same priority."},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}}},"required":["success","targets"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}}},"required":["success","targets"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"type":"number"},"critical":{"type":"number"},"high":{"type":"number"},"normal":{"type":"number"},"low":{"type":"number"}}}},"required":["success","targets"]}}}}},"operationId":"postBffIssueSla-config","tags":["Issue"],"summary":"Set SLA targets","description":"Overwrites the per-priority SLA targets (in seconds). Root-only. The value is persisted as a JSON blob in `cas__organisation_configuration.issue_sla_target_seconds` and read by the resolution-speed metric on the next `/statistics` call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targets"],"properties":{"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"minimum":60,"type":"number"},"critical":{"minimum":60,"type":"number"},"high":{"minimum":60,"type":"number"},"normal":{"minimum":60,"type":"number"},"low":{"minimum":60,"type":"number"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["targets"],"properties":{"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"minimum":60,"type":"number"},"critical":{"minimum":60,"type":"number"},"high":{"minimum":60,"type":"number"},"normal":{"minimum":60,"type":"number"},"low":{"minimum":60,"type":"number"}}}}}},"text/plain":{"schema":{"type":"object","required":["targets"],"properties":{"targets":{"type":"object","required":["blocker","critical","high","normal","low"],"properties":{"blocker":{"minimum":60,"type":"number"},"critical":{"minimum":60,"type":"number"},"high":{"minimum":60,"type":"number"},"normal":{"minimum":60,"type":"number"},"low":{"minimum":60,"type":"number"}}}}}}}}}},"/bff/issue/bulk-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"How many issues were actually updated.","type":"number"},"requested":{"description":"How many keys the caller submitted.","type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"How many issues were actually updated.","type":"number"},"requested":{"description":"How many keys the caller submitted.","type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"How many issues were actually updated.","type":"number"},"requested":{"description":"How many keys the caller submitted.","type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffIssueBulk-status","tags":["Issue"],"summary":"Bulk-update status on many issues","description":"Sets `issue_status_id` on every issue whose `issue_key` is in the list. Single UPDATE scoped to the caller organisation (through the project FK, plus `originating_organisation_id` for support tickets). The target status is validated once via `assertStatusVisibleToOrganisation` — a leaked id from another tenant is refused before the UPDATE runs.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKeys","statusId"],"properties":{"issueKeys":{"description":"Issue keys to update. Silently skips keys that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"statusId":{"description":"Target status id. Must be visible to the caller organisation (system row or org-owned).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKeys","statusId"],"properties":{"issueKeys":{"description":"Issue keys to update. Silently skips keys that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"statusId":{"description":"Target status id. Must be visible to the caller organisation (system row or org-owned).","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["issueKeys","statusId"],"properties":{"issueKeys":{"description":"Issue keys to update. Silently skips keys that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"statusId":{"description":"Target status id. Must be visible to the caller organisation (system row or org-owned).","type":"number"}}}}}}}},"/bff/issue/bulk-priority":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffIssueBulk-priority","tags":["Issue"],"summary":"Bulk-update priority on many issues","description":"Sets `priority` (clamped to 1..5) on every issue whose `issue_key` is in the list.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKeys","priority"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"priority":{"minimum":1,"maximum":5,"description":"1=low, 2=normal, 3=high, 4=critical, 5=blocker.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKeys","priority"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"priority":{"minimum":1,"maximum":5,"description":"1=low, 2=normal, 3=high, 4=critical, 5=blocker.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["issueKeys","priority"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"priority":{"minimum":1,"maximum":5,"description":"1=low, 2=normal, 3=high, 4=critical, 5=blocker.","type":"number"}}}}}}}},"/bff/issue/bulk-velocity":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffIssueBulk-velocity","tags":["Issue"],"summary":"Bulk-update velocity on many issues","description":"Sets `velocity` (clamped 0..100) on every issue whose `issue_key` is in the list. Also stamps the `[AI velocity]` marker into `internal_description` so a subsequent `runIssueAIWorkflow` re-run refuses to overwrite these operator-set values.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKeys","velocity"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKeys","velocity"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["issueKeys","velocity"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"velocity":{"minimum":0,"maximum":100,"description":"Effort/complexity score (0..100). Anchors: 1 trivial, 25 default ~20 min, 50 ~4 h, 75 ~2 days, 90+ split, 100 unsolvable/unclear.","type":"number"}}}}}}}},"/bff/issue/bulk-assignee":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffIssueBulk-assignee","tags":["Issue"],"summary":"Bulk-change assignee on many issues","description":"Sets `primary_assignee_id` on every issue whose `issue_key` is in the list. Pass `assigneeContactId: 0` to unassign in bulk. The contact id itself is not validated here — the caller resolves it through `/bff/person/search` which is already scoped to the caller organisation, and a foreign id would fail the underlying FK anyway.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKeys","assigneeContactId"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"assigneeContactId":{"description":"New primary assignee contact id. Pass `0` to unassign.","examples":[10],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKeys","assigneeContactId"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"assigneeContactId":{"description":"New primary assignee contact id. Pass `0` to unassign.","examples":[10],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["issueKeys","assigneeContactId"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"assigneeContactId":{"description":"New primary assignee contact id. Pass `0` to unassign.","examples":[10],"type":"number"}}}}}}}},"/bff/issue/bulk-spam":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffIssueBulk-spam","tags":["Issue"],"summary":"Bulk-flip the spam flag on many issues","description":"Sets `is_spam` on every issue whose `issue_key` is in the list. When marking (`isSpam=true`) each ticket is additionally transitioned to the org-default `done` status (unless it is already in the `done` category — a specific done-row picked by an operator is preserved). Does NOT re-trigger any outbound notification — the reporter must never learn we flagged the message as spam; the new-issue e-mail already fired at creation time and a bulk triage decision stays silent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKeys","isSpam"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"isSpam":{"description":"True = mark as spam, false = clear the spam flag.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKeys","isSpam"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"isSpam":{"description":"True = mark as spam, false = clear the spam flag.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["issueKeys","isSpam"],"properties":{"issueKeys":{"description":"Issue keys to update.","minItems":1,"maxItems":500,"type":"array","items":{"examples":["PROJ-123"],"type":"string"}},"isSpam":{"description":"True = mark as spam, false = clear the spam flag.","type":"boolean"}}}}}}}},"/bff/issue/merge":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"Number of source issues folded into the root.","type":"number"},"rootIssueKey":{"description":"The ultimate root the sources were re-parented under. Equals `targetIssueKey` when the target had no parent chain of its own.","type":"string"},"targetIssueKey":{"description":"The target key as supplied by the caller.","type":"string"},"mergedIssueKeys":{"description":"Source keys that were folded (order preserved from the request).","type":"array","items":{"type":"string"}}},"required":["success","matched","rootIssueKey","targetIssueKey","mergedIssueKeys"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"Number of source issues folded into the root.","type":"number"},"rootIssueKey":{"description":"The ultimate root the sources were re-parented under. Equals `targetIssueKey` when the target had no parent chain of its own.","type":"string"},"targetIssueKey":{"description":"The target key as supplied by the caller.","type":"string"},"mergedIssueKeys":{"description":"Source keys that were folded (order preserved from the request).","type":"array","items":{"type":"string"}}},"required":["success","matched","rootIssueKey","targetIssueKey","mergedIssueKeys"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"Number of source issues folded into the root.","type":"number"},"rootIssueKey":{"description":"The ultimate root the sources were re-parented under. Equals `targetIssueKey` when the target had no parent chain of its own.","type":"string"},"targetIssueKey":{"description":"The target key as supplied by the caller.","type":"string"},"mergedIssueKeys":{"description":"Source keys that were folded (order preserved from the request).","type":"array","items":{"type":"string"}}},"required":["success","matched","rootIssueKey","targetIssueKey","mergedIssueKeys"]}}}}},"operationId":"postBffIssueMerge","tags":["Issue"],"summary":"Merge one or more issues into a target","description":"Sets `parent_id` on every source to the target's ULTIMATE ROOT — walking the target's own `parent_id` chain up to NULL — so repeated merges stay flat instead of building a tree. Any pre-existing children of the sources are re-parented to the same root in the same call. Each source is transitioned to the org-default `done` category (a specific done-row picked by an operator, e.g. Wontfix, is preserved). Rejects self-merge and merging into an issue that is already the target's own root. Never sends outbound mail — merging is a triage decision.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sourceIssueKeys","targetIssueKey"],"properties":{"sourceIssueKeys":{"description":"Issue keys to merge INTO the target. Every source is re-parented to the target's ultimate root and transitioned to the org-default `done` status. Minimum 1, maximum 100 per call — bulk-merging more than a handful at once usually indicates a triage mistake worth pausing on.","minItems":1,"maxItems":100,"type":"array","items":{"examples":["BANDZ-101","BANDZ-102"],"type":"string"}},"targetIssueKey":{"examples":["BANDZ-100"],"description":"Winning issue key. All sources are re-parented under this issue (or its ultimate root when the target itself has already been merged elsewhere).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["sourceIssueKeys","targetIssueKey"],"properties":{"sourceIssueKeys":{"description":"Issue keys to merge INTO the target. Every source is re-parented to the target's ultimate root and transitioned to the org-default `done` status. Minimum 1, maximum 100 per call — bulk-merging more than a handful at once usually indicates a triage mistake worth pausing on.","minItems":1,"maxItems":100,"type":"array","items":{"examples":["BANDZ-101","BANDZ-102"],"type":"string"}},"targetIssueKey":{"examples":["BANDZ-100"],"description":"Winning issue key. All sources are re-parented under this issue (or its ultimate root when the target itself has already been merged elsewhere).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["sourceIssueKeys","targetIssueKey"],"properties":{"sourceIssueKeys":{"description":"Issue keys to merge INTO the target. Every source is re-parented to the target's ultimate root and transitioned to the org-default `done` status. Minimum 1, maximum 100 per call — bulk-merging more than a handful at once usually indicates a triage mistake worth pausing on.","minItems":1,"maxItems":100,"type":"array","items":{"examples":["BANDZ-101","BANDZ-102"],"type":"string"}},"targetIssueKey":{"examples":["BANDZ-100"],"description":"Winning issue key. All sources are re-parented under this issue (or its ultimate root when the target itself has already been merged elsewhere).","type":"string"}}}}}}}},"/bff/issue/support-escalate":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success","previousPriority","newPriority","changed"],"properties":{"success":{"const":true,"type":"boolean"},"previousPriority":{"description":"Priority BEFORE the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority AFTER the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"},"changed":{"description":"False when the ticket was already at blocker priority — the audit comment is still written.","type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"REASON_TOO_SHORT","type":"string"},{"const":"INVALID_REASON","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"NO_AUTHOR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on INVALID_REASON (short blurb from the classifier) and UPSTREAM_ERROR — surface verbatim in the admin UI.","type":"string"},"nextEscalationAllowedAt":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success","previousPriority","newPriority","changed"],"properties":{"success":{"const":true,"type":"boolean"},"previousPriority":{"description":"Priority BEFORE the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority AFTER the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"},"changed":{"description":"False when the ticket was already at blocker priority — the audit comment is still written.","type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"REASON_TOO_SHORT","type":"string"},{"const":"INVALID_REASON","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"NO_AUTHOR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on INVALID_REASON (short blurb from the classifier) and UPSTREAM_ERROR — surface verbatim in the admin UI.","type":"string"},"nextEscalationAllowedAt":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success","previousPriority","newPriority","changed"],"properties":{"success":{"const":true,"type":"boolean"},"previousPriority":{"description":"Priority BEFORE the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority AFTER the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"},"changed":{"description":"False when the ticket was already at blocker priority — the audit comment is still written.","type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"REASON_TOO_SHORT","type":"string"},{"const":"INVALID_REASON","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"NO_AUTHOR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on INVALID_REASON (short blurb from the classifier) and UPSTREAM_ERROR — surface verbatim in the admin UI.","type":"string"},"nextEscalationAllowedAt":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success","previousPriority","newPriority","changed"],"properties":{"success":{"const":true,"type":"boolean"},"previousPriority":{"description":"Priority BEFORE the escalation (1..5).","type":"number"},"newPriority":{"description":"Priority AFTER the escalation (1..5). Equal to `previousPriority` when already at blocker.","type":"number"},"changed":{"description":"False when the ticket was already at blocker priority — the audit comment is still written.","type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"REASON_TOO_SHORT","type":"string"},{"const":"INVALID_REASON","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"NO_AUTHOR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on INVALID_REASON (short blurb from the classifier) and UPSTREAM_ERROR — surface verbatim in the admin UI.","type":"string"},"nextEscalationAllowedAt":{"type":"string"}}}]}}}}},"operationId":"postBffIssueSupport-escalate","tags":["Issue"],"summary":"Request priority escalation for a support ticket","description":"Admin-facing counterpart of `POST /api/v1/support/issue/:externalId/escalate`. Delegates to the shared `processIssueEscalationRequest` so both surfaces bump priority one step up the ladder (low/normal → high → critical → blocker; blocker stays blocker) and write the same `channel: \"internal\"`, `authorKind: \"system\"` audit comment. Confidentiality gate (`assertIssueAccessibleForIdentity`) applies — non-root operators cannot escalate a secured ticket they cannot see.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","reason"],"properties":{"issueKey":{"examples":["PROJ-123"],"description":"Issue key (e.g. \"PROJ-123\") whose priority should be raised.","type":"string"},"reason":{"minLength":1,"maxLength":500,"examples":["Customer confirmed prod down since 10 AM, cannot process orders."],"description":"Operator justification. Trimmed + silently truncated at 140 chars server-side; rejected as REASON_TOO_SHORT when fewer than 3 non-whitespace chars remain. Runs through the same LLM classifier as the public escalation endpoint — rejects gibberish, spam, prompt-injection, and emphatic non-justifications (\"urgent!!!\", \"asap\") as INVALID_REASON.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","reason"],"properties":{"issueKey":{"examples":["PROJ-123"],"description":"Issue key (e.g. \"PROJ-123\") whose priority should be raised.","type":"string"},"reason":{"minLength":1,"maxLength":500,"examples":["Customer confirmed prod down since 10 AM, cannot process orders."],"description":"Operator justification. Trimmed + silently truncated at 140 chars server-side; rejected as REASON_TOO_SHORT when fewer than 3 non-whitespace chars remain. Runs through the same LLM classifier as the public escalation endpoint — rejects gibberish, spam, prompt-injection, and emphatic non-justifications (\"urgent!!!\", \"asap\") as INVALID_REASON.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","reason"],"properties":{"issueKey":{"examples":["PROJ-123"],"description":"Issue key (e.g. \"PROJ-123\") whose priority should be raised.","type":"string"},"reason":{"minLength":1,"maxLength":500,"examples":["Customer confirmed prod down since 10 AM, cannot process orders."],"description":"Operator justification. Trimmed + silently truncated at 140 chars server-side; rejected as REASON_TOO_SHORT when fewer than 3 non-whitespace chars remain. Runs through the same LLM classifier as the public escalation endpoint — rejects gibberish, spam, prompt-injection, and emphatic non-justifications (\"urgent!!!\", \"asap\") as INVALID_REASON.","type":"string"}}}}}}}},"/bff/issue/support-reply":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"MESSAGE_TOO_SHORT","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"NO_AUTHOR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on RATE_LIMITED and UPSTREAM_ERROR — surface verbatim in the admin UI.","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"MESSAGE_TOO_SHORT","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"NO_AUTHOR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on RATE_LIMITED and UPSTREAM_ERROR — surface verbatim in the admin UI.","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"MESSAGE_TOO_SHORT","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"NO_AUTHOR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on RATE_LIMITED and UPSTREAM_ERROR — surface verbatim in the admin UI.","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"anyOf":[{"const":"MESSAGE_TOO_SHORT","type":"string"},{"const":"RATE_LIMITED","type":"string"},{"const":"UPSTREAM_ERROR","type":"string"},{"const":"NO_AUTHOR","type":"string"}]},"message":{"description":"Human-readable explanation. Present on RATE_LIMITED and UPSTREAM_ERROR — surface verbatim in the admin UI.","type":"string"}}}]}}}}},"operationId":"postBffIssueSupport-reply","tags":["Issue"],"summary":"Post a reply to a support ticket from admin","description":"Admin-facing counterpart of `POST /api/v1/support/issue/:externalId/comment`. Delegates to the shared `processSupportTicketReply` primitive so both surfaces produce the same on-disk state (`channel: \"email_in\"`, `authorKind: \"human\"`, `skipReporterEcho: true`, auto-reopen if closed). Difference from the public path: `trustPolicy: \"trust\"` — the LLM spam classifier is skipped because the caller is authenticated via cookie. Confidentiality gate (`assertIssueAccessibleForIdentity`) applies — non-root operators cannot reply on a secured ticket they cannot see.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key of the support ticket to reply on.","type":"string"},"message":{"minLength":1,"maxLength":10000,"examples":["Thanks — I confirmed the issue on our staging env too. Attaching a screenshot."],"description":"Reply text. Server-side rules: leading/trailing whitespace trimmed, silently truncated at 5000 chars, rejected as MESSAGE_TOO_SHORT if fewer than 3 non-whitespace chars remain. A per-issue 24h volume ceiling applies; the LLM spam classifier is SKIPPED because the caller is cookie-authenticated.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key of the support ticket to reply on.","type":"string"},"message":{"minLength":1,"maxLength":10000,"examples":["Thanks — I confirmed the issue on our staging env too. Attaching a screenshot."],"description":"Reply text. Server-side rules: leading/trailing whitespace trimmed, silently truncated at 5000 chars, rejected as MESSAGE_TOO_SHORT if fewer than 3 non-whitespace chars remain. A per-issue 24h volume ceiling applies; the LLM spam classifier is SKIPPED because the caller is cookie-authenticated.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","message"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key of the support ticket to reply on.","type":"string"},"message":{"minLength":1,"maxLength":10000,"examples":["Thanks — I confirmed the issue on our staging env too. Attaching a screenshot."],"description":"Reply text. Server-side rules: leading/trailing whitespace trimmed, silently truncated at 5000 chars, rejected as MESSAGE_TOO_SHORT if fewer than 3 non-whitespace chars remain. A per-issue 24h volume ceiling applies; the LLM spam classifier is SKIPPED because the caller is cookie-authenticated.","type":"string"}}}}}}}},"/bff/issue/participants":{"get":{"parameters":[{"description":"Issue key.","examples":["BIZKIT-22"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["contactId","externalId","fullName","email","avatarUrl","roles","firstSeenDate","lastSeenDate","canUnfollow","isSelf"],"properties":{"contactId":{"description":"Internal contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public `shop__contact.external_id`.","type":"string"},{"type":"null"}]},"fullName":{"description":"Display name (falls back to e-mail, then \"#id\").","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail (null for phone-only / anonymised).","type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"description":"Avatar URL resolved through `selectContactAvatarBlobMap` (linked user avatar only; own avatar for unlinked contacts).","type":"string"},{"type":"null"}]},"roles":{"type":"array","items":{"anyOf":[{"const":"reporter","type":"string"},{"const":"assignee","type":"string"},{"const":"commenter","type":"string"},{"const":"watcher","type":"string"},{"const":"mentioned","type":"string"}]}},"firstSeenDate":{"description":"ISO timestamp — earliest role attach.","type":"string"},"lastSeenDate":{"description":"ISO timestamp — most recent role activity.","type":"string"},"canUnfollow":{"description":"True only when the row IS the operator's own watcher row (and thus removable via `/bff/issue/unfollow`).","type":"boolean"},"isSelf":{"description":"True when the row is the operator.","type":"boolean"}}}},"selfIsFollowing":{"description":"Operator is currently a watcher on this issue.","type":"boolean"},"selfCanFollow":{"description":"Operator has a resolved contact and can follow (false for identityless-sessions).","type":"boolean"}},"required":["items","selfIsFollowing","selfCanFollow"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["contactId","externalId","fullName","email","avatarUrl","roles","firstSeenDate","lastSeenDate","canUnfollow","isSelf"],"properties":{"contactId":{"description":"Internal contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public `shop__contact.external_id`.","type":"string"},{"type":"null"}]},"fullName":{"description":"Display name (falls back to e-mail, then \"#id\").","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail (null for phone-only / anonymised).","type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"description":"Avatar URL resolved through `selectContactAvatarBlobMap` (linked user avatar only; own avatar for unlinked contacts).","type":"string"},{"type":"null"}]},"roles":{"type":"array","items":{"anyOf":[{"const":"reporter","type":"string"},{"const":"assignee","type":"string"},{"const":"commenter","type":"string"},{"const":"watcher","type":"string"},{"const":"mentioned","type":"string"}]}},"firstSeenDate":{"description":"ISO timestamp — earliest role attach.","type":"string"},"lastSeenDate":{"description":"ISO timestamp — most recent role activity.","type":"string"},"canUnfollow":{"description":"True only when the row IS the operator's own watcher row (and thus removable via `/bff/issue/unfollow`).","type":"boolean"},"isSelf":{"description":"True when the row is the operator.","type":"boolean"}}}},"selfIsFollowing":{"description":"Operator is currently a watcher on this issue.","type":"boolean"},"selfCanFollow":{"description":"Operator has a resolved contact and can follow (false for identityless-sessions).","type":"boolean"}},"required":["items","selfIsFollowing","selfCanFollow"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["contactId","externalId","fullName","email","avatarUrl","roles","firstSeenDate","lastSeenDate","canUnfollow","isSelf"],"properties":{"contactId":{"description":"Internal contact ID.","type":"number"},"externalId":{"nullable":true,"anyOf":[{"description":"Public `shop__contact.external_id`.","type":"string"},{"type":"null"}]},"fullName":{"description":"Display name (falls back to e-mail, then \"#id\").","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Contact e-mail (null for phone-only / anonymised).","type":"string"},{"type":"null"}]},"avatarUrl":{"nullable":true,"anyOf":[{"description":"Avatar URL resolved through `selectContactAvatarBlobMap` (linked user avatar only; own avatar for unlinked contacts).","type":"string"},{"type":"null"}]},"roles":{"type":"array","items":{"anyOf":[{"const":"reporter","type":"string"},{"const":"assignee","type":"string"},{"const":"commenter","type":"string"},{"const":"watcher","type":"string"},{"const":"mentioned","type":"string"}]}},"firstSeenDate":{"description":"ISO timestamp — earliest role attach.","type":"string"},"lastSeenDate":{"description":"ISO timestamp — most recent role activity.","type":"string"},"canUnfollow":{"description":"True only when the row IS the operator's own watcher row (and thus removable via `/bff/issue/unfollow`).","type":"boolean"},"isSelf":{"description":"True when the row is the operator.","type":"boolean"}}}},"selfIsFollowing":{"description":"Operator is currently a watcher on this issue.","type":"boolean"},"selfCanFollow":{"description":"Operator has a resolved contact and can follow (false for identityless-sessions).","type":"boolean"}},"required":["items","selfIsFollowing","selfCanFollow"]}}}}},"operationId":"getBffIssueParticipants","tags":["Issue"],"summary":"List participants (reporter, assignee, commenters, watchers, mentioned) on an issue","description":"Returns every contact linked to the issue via `pm__issue_participant`, deduplicated across roles. `selfIsFollowing` tells the UI whether to render the \"Follow\" or \"Unfollow\" button for the current operator. `canUnfollow` on each row is true only for the operator's own watcher row — reporter/assignee/commenter/mentioned rows can't be unfollowed through this endpoint (change the assignee / delete the comment / etc. instead)."}},"/bff/issue/follow":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"NO_CONTACT","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"NO_CONTACT","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"NO_CONTACT","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"NO_CONTACT","type":"string"}}}]}}}}},"operationId":"postBffIssueFollow","tags":["Issue"],"summary":"Follow an issue (opt-in as watcher)","description":"Idempotent — if the operator is already a watcher, bumps `last_seen_date` and returns success. Fails with `NO_CONTACT` when the session has no resolved `shop__contact` (should not happen in practice; defensive guard).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key.","type":"string"}}}}}}}},"/bff/issue/unfollow":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"NO_CONTACT","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"NO_CONTACT","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"NO_CONTACT","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","error"],"properties":{"success":{"const":false,"type":"boolean"},"error":{"const":"NO_CONTACT","type":"string"}}}]}}}}},"operationId":"postBffIssueUnfollow","tags":["Issue"],"summary":"Unfollow an issue (drop operator's own watcher row)","description":"Removes ONLY the `watcher` role for the operator — other roles (reporter / assignee / commenter / mentioned) are untouched and still cause notification delivery. No-op when the operator is not a watcher. Fails with `NO_CONTACT` when the session has no resolved `shop__contact`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey"],"properties":{"issueKey":{"examples":["BIZKIT-22"],"description":"Issue key.","type":"string"}}}}}}}},"/bff/issue-tag/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description","usageCount","createdByAi","insertedDate"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]},"usageCount":{"description":"Number of issues carrying the tag.","type":"number"},"createdByAi":{"description":"Proposed by AI (catalogue bootstrap / triage), not by an operator.","type":"boolean"},"insertedDate":{"description":"Creation timestamp (ISO 8601).","type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description","usageCount","createdByAi","insertedDate"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]},"usageCount":{"description":"Number of issues carrying the tag.","type":"number"},"createdByAi":{"description":"Proposed by AI (catalogue bootstrap / triage), not by an operator.","type":"boolean"},"insertedDate":{"description":"Creation timestamp (ISO 8601).","type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description","usageCount","createdByAi","insertedDate"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]},"usageCount":{"description":"Number of issues carrying the tag.","type":"number"},"createdByAi":{"description":"Proposed by AI (catalogue bootstrap / triage), not by an operator.","type":"boolean"},"insertedDate":{"description":"Creation timestamp (ISO 8601).","type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssue-tagList","tags":["Issue Tags"],"summary":"List issue tags","description":"Organisation tag catalogue for issues (non-deleted), most-used first."}},"/bff/issue-tag/ai-suggest":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"created":{"description":"Labels of newly created tags.","type":"array","items":{"type":"string"}},"assignedIssueCount":{"description":"Sampled issues that received at least one tag.","type":"number"}},"required":["created","assignedIssueCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"created":{"description":"Labels of newly created tags.","type":"array","items":{"type":"string"}},"assignedIssueCount":{"description":"Sampled issues that received at least one tag.","type":"number"}},"required":["created","assignedIssueCount"]}},"text/plain":{"schema":{"type":"object","properties":{"created":{"description":"Labels of newly created tags.","type":"array","items":{"type":"string"}},"assignedIssueCount":{"description":"Sampled issues that received at least one tag.","type":"number"}},"required":["created","assignedIssueCount"]}}}}},"operationId":"postBffIssue-tagAi-suggest","tags":["Issue Tags"],"summary":"Suggest issue tags with AI","description":"One LLM call over the ~40 most recent non-spam, non-confidential issues: proposes tags the catalogue is missing (never re-proposes deleted ones), creates them and attaches matching tags (new or existing) to the sampled issues. Only adds."}},"/bff/issue-tag/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}},"required":["id","code","label","color","description"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}},"required":["id","code","label","color","description"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}},"required":["id","code","label","color","description"]}}}}},"operationId":"postBffIssue-tagCreate","tags":["Issue Tags"],"summary":"Create issue tag","description":"Creates a tag in the organisation catalogue. Re-using the code of a previously deleted tag revives it (with its old issue links).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label"],"properties":{"label":{"minLength":1,"maxLength":100,"description":"Display name.","type":"string"},"code":{"maxLength":64,"description":"Unique code inside the organisation. Slugified on write; derived from `label` when empty.","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Chip colour in `#RRGGBB` format.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Optional description.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["label"],"properties":{"label":{"minLength":1,"maxLength":100,"description":"Display name.","type":"string"},"code":{"maxLength":64,"description":"Unique code inside the organisation. Slugified on write; derived from `label` when empty.","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Chip colour in `#RRGGBB` format.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Optional description.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["label"],"properties":{"label":{"minLength":1,"maxLength":100,"description":"Display name.","type":"string"},"code":{"maxLength":64,"description":"Unique code inside the organisation. Slugified on write; derived from `label` when empty.","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Chip colour in `#RRGGBB` format.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Optional description.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/issue-tag/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}},"required":["id","code","label","color","description"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}},"required":["id","code","label","color","description"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}},"required":["id","code","label","color","description"]}}}}},"operationId":"postBffIssue-tagUpdate","tags":["Issue Tags"],"summary":"Update issue tag","description":"Partial update of name, code (stays unique in the organisation), colour or description.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID.","type":"number"},"label":{"minLength":1,"maxLength":100,"type":"string"},"code":{"minLength":1,"maxLength":64,"type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Chip colour in `#RRGGBB` format.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID.","type":"number"},"label":{"minLength":1,"maxLength":100,"type":"string"},"code":{"minLength":1,"maxLength":64,"type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Chip colour in `#RRGGBB` format.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID.","type":"number"},"label":{"minLength":1,"maxLength":100,"type":"string"},"code":{"minLength":1,"maxLength":64,"type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Chip colour in `#RRGGBB` format.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/issue-tag/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffIssue-tagDelete","tags":["Issue Tags"],"summary":"Delete issue tag","description":"Soft-deletes the tag (`deleted_date`). It disappears from the catalogue and from every issue.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID.","type":"number"}}}}}}}},"/bff/issue-tag/issue-tags":{"get":{"parameters":[{"examples":["PROJ-123"],"schema":{"type":"string"},"in":"query","name":"issueKey","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssue-tagIssue-tags","tags":["Issue Tags"],"summary":"Tags of one issue","description":"Tags attached to the issue, limited to the caller organisation's catalogue."}},"/bff/issue-tag/assign":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","label","color","description"],"properties":{"id":{"description":"Tag ID (`pm__tag.id`).","type":"number"},"code":{"description":"Machine code, unique inside the organisation (slug).","type":"string"},"label":{"description":"Display name.","type":"string"},"color":{"description":"Chip colour `#RRGGBB`.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Optional operator note explaining when to use the tag.","type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"postBffIssue-tagAssign","tags":["Issue Tags"],"summary":"Attach / detach a tag on an issue","description":"Toggles one tag on one issue and returns the resulting tag list.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["issueKey","tagId","assigned"],"properties":{"issueKey":{"examples":["PROJ-123"],"type":"string"},"tagId":{"description":"Tag ID from the caller organisation catalogue.","type":"number"},"assigned":{"description":"`true` attaches the tag, `false` detaches it. Idempotent.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["issueKey","tagId","assigned"],"properties":{"issueKey":{"examples":["PROJ-123"],"type":"string"},"tagId":{"description":"Tag ID from the caller organisation catalogue.","type":"number"},"assigned":{"description":"`true` attaches the tag, `false` detaches it. Idempotent.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["issueKey","tagId","assigned"],"properties":{"issueKey":{"examples":["PROJ-123"],"type":"string"},"tagId":{"description":"Tag ID from the caller organisation catalogue.","type":"number"},"assigned":{"description":"`true` attaches the tag, `false` detaches it. Idempotent.","type":"boolean"}}}}}}}},"/bff/issue-view/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","isShared","isOwn","canEdit","ownerName","filters","viewMode","sortOrder"],"properties":{"id":{"description":"`pm__issue_view.id`.","type":"number"},"name":{"type":"string"},"isShared":{"description":"Visible to every member of the organisation.","type":"boolean"},"isOwn":{"description":"The viewer created the view.","type":"boolean"},"canEdit":{"description":"The viewer may rename, overwrite or delete the view (owner or org root).","type":"boolean"},"ownerName":{"description":"Display name of the owner (shown on shared views of colleagues).","type":"string"},"filters":{"description":"Grid filter state replayed when the view tab is clicked. Same keys as `GET /bff/issue/list`.","type":"object","properties":{"projectCode":{"type":"string"},"statusCategoryCode":{"description":"`active`, `all`, `new`, `progress`, `waiting` or `done`.","type":"string"},"priority":{"minimum":1,"maximum":5,"type":"number"},"assigneeFilter":{"description":"`me`, `unassigned` or a contact external id.","type":"string"},"reporterFilter":{"description":"Reporter contact external id.","type":"string"},"tagCode":{"type":"string"},"typeCode":{"type":"string"},"isSpam":{"type":"boolean"},"securedOnly":{"type":"boolean"},"overSla":{"type":"boolean"},"filterFulltextQuery":{"type":"string"}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]},"sortOrder":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","isShared","isOwn","canEdit","ownerName","filters","viewMode","sortOrder"],"properties":{"id":{"description":"`pm__issue_view.id`.","type":"number"},"name":{"type":"string"},"isShared":{"description":"Visible to every member of the organisation.","type":"boolean"},"isOwn":{"description":"The viewer created the view.","type":"boolean"},"canEdit":{"description":"The viewer may rename, overwrite or delete the view (owner or org root).","type":"boolean"},"ownerName":{"description":"Display name of the owner (shown on shared views of colleagues).","type":"string"},"filters":{"description":"Grid filter state replayed when the view tab is clicked. Same keys as `GET /bff/issue/list`.","type":"object","properties":{"projectCode":{"type":"string"},"statusCategoryCode":{"description":"`active`, `all`, `new`, `progress`, `waiting` or `done`.","type":"string"},"priority":{"minimum":1,"maximum":5,"type":"number"},"assigneeFilter":{"description":"`me`, `unassigned` or a contact external id.","type":"string"},"reporterFilter":{"description":"Reporter contact external id.","type":"string"},"tagCode":{"type":"string"},"typeCode":{"type":"string"},"isSpam":{"type":"boolean"},"securedOnly":{"type":"boolean"},"overSla":{"type":"boolean"},"filterFulltextQuery":{"type":"string"}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]},"sortOrder":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","isShared","isOwn","canEdit","ownerName","filters","viewMode","sortOrder"],"properties":{"id":{"description":"`pm__issue_view.id`.","type":"number"},"name":{"type":"string"},"isShared":{"description":"Visible to every member of the organisation.","type":"boolean"},"isOwn":{"description":"The viewer created the view.","type":"boolean"},"canEdit":{"description":"The viewer may rename, overwrite or delete the view (owner or org root).","type":"boolean"},"ownerName":{"description":"Display name of the owner (shown on shared views of colleagues).","type":"string"},"filters":{"description":"Grid filter state replayed when the view tab is clicked. Same keys as `GET /bff/issue/list`.","type":"object","properties":{"projectCode":{"type":"string"},"statusCategoryCode":{"description":"`active`, `all`, `new`, `progress`, `waiting` or `done`.","type":"string"},"priority":{"minimum":1,"maximum":5,"type":"number"},"assigneeFilter":{"description":"`me`, `unassigned` or a contact external id.","type":"string"},"reporterFilter":{"description":"Reporter contact external id.","type":"string"},"tagCode":{"type":"string"},"typeCode":{"type":"string"},"isSpam":{"type":"boolean"},"securedOnly":{"type":"boolean"},"overSla":{"type":"boolean"},"filterFulltextQuery":{"type":"string"}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]},"sortOrder":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffIssue-viewList","tags":["Issue"],"summary":"List saved issue views","description":"The caller's own saved `/issue` views followed by views colleagues shared with the organisation."}},"/bff/issue-view/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"number"}},"required":["state","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"number"}},"required":["state","id"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"number"}},"required":["state","id"]}}}}},"operationId":"postBffIssue-viewCreate","tags":["Issue"],"summary":"Create saved issue view","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","filters"],"properties":{"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Unknown keys and malformed values are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","filters"],"properties":{"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Unknown keys and malformed values are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["name","filters"],"properties":{"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Unknown keys and malformed values are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]}}}}}}}},"/bff/issue-view/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}}}}},"operationId":"postBffIssue-viewUpdate","tags":["Issue"],"summary":"Update saved issue view","description":"Rename, share / unshare or overwrite the filters of a saved view. Owner or org root only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Unknown keys and malformed values are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Unknown keys and malformed values are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Unknown keys and malformed values are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"viewMode":{"nullable":true,"anyOf":[{"description":"Preferred layout opened together with the view.","anyOf":[{"const":"grid","type":"string"},{"const":"kanban","type":"string"},{"const":"board","type":"string"}]},{"type":"null"}]}}}}}}}},"/bff/issue-view/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}}}}},"operationId":"postBffIssue-viewDelete","tags":["Issue"],"summary":"Delete saved issue view","description":"Soft delete. Owner or org root only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}}}},"/bff/grid-view/list":{"get":{"parameters":[{"description":"Grid identifier chosen by the admin screen (kebab-case), e.g. `order`.","examples":["order"],"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9-]{0,63}$"},"in":"query","name":"grid","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","isShared","isOwn","canEdit","ownerName","filters","sortOrder"],"properties":{"id":{"description":"`core__grid_view.id`.","type":"number"},"name":{"type":"string"},"isShared":{"description":"Visible to every member of the organisation.","type":"boolean"},"isOwn":{"description":"The viewer created the view.","type":"boolean"},"canEdit":{"description":"The viewer may rename, overwrite or delete the view (owner or org root).","type":"boolean"},"ownerName":{"description":"Display name of the owner.","type":"string"},"filters":{"description":"Flat filter state replayed when the view tab is clicked. Same keys as the grid's list endpoint.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"sortOrder":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","isShared","isOwn","canEdit","ownerName","filters","sortOrder"],"properties":{"id":{"description":"`core__grid_view.id`.","type":"number"},"name":{"type":"string"},"isShared":{"description":"Visible to every member of the organisation.","type":"boolean"},"isOwn":{"description":"The viewer created the view.","type":"boolean"},"canEdit":{"description":"The viewer may rename, overwrite or delete the view (owner or org root).","type":"boolean"},"ownerName":{"description":"Display name of the owner.","type":"string"},"filters":{"description":"Flat filter state replayed when the view tab is clicked. Same keys as the grid's list endpoint.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"sortOrder":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","isShared","isOwn","canEdit","ownerName","filters","sortOrder"],"properties":{"id":{"description":"`core__grid_view.id`.","type":"number"},"name":{"type":"string"},"isShared":{"description":"Visible to every member of the organisation.","type":"boolean"},"isOwn":{"description":"The viewer created the view.","type":"boolean"},"canEdit":{"description":"The viewer may rename, overwrite or delete the view (owner or org root).","type":"boolean"},"ownerName":{"description":"Display name of the owner.","type":"string"},"filters":{"description":"Flat filter state replayed when the view tab is clicked. Same keys as the grid's list endpoint.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"sortOrder":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffGrid-viewList","tags":["DataGrid"],"summary":"List saved grid views","description":"Views shared with the organisation followed by the caller's private views, for one grid."}},"/bff/grid-view/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"number"}},"required":["state","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"number"}},"required":["state","id"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"id":{"type":"number"}},"required":["state","id"]}}}}},"operationId":"postBffGrid-viewCreate","tags":["DataGrid"],"summary":"Create saved grid view","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["grid","name","filters"],"properties":{"grid":{"minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9-]{0,63}$","description":"Grid identifier chosen by the admin screen (kebab-case), e.g. `order`.","examples":["order"],"type":"string"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Non-identifier keys, nested values and empty strings are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["grid","name","filters"],"properties":{"grid":{"minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9-]{0,63}$","description":"Grid identifier chosen by the admin screen (kebab-case), e.g. `order`.","examples":["order"],"type":"string"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Non-identifier keys, nested values and empty strings are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}}}},"text/plain":{"schema":{"type":"object","required":["grid","name","filters"],"properties":{"grid":{"minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9-]{0,63}$","description":"Grid identifier chosen by the admin screen (kebab-case), e.g. `order`.","examples":["order"],"type":"string"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Non-identifier keys, nested values and empty strings are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}}}}}}}},"/bff/grid-view/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}}}}},"operationId":"postBffGrid-viewUpdate","tags":["DataGrid"],"summary":"Update saved grid view","description":"Rename, share / unshare or overwrite the filters of a saved view. Owner or org root only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Non-identifier keys, nested values and empty strings are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Non-identifier keys, nested values and empty strings are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"},"name":{"minLength":1,"maxLength":64,"type":"string"},"isShared":{"type":"boolean"},"filters":{"description":"Grid filter state. Non-identifier keys, nested values and empty strings are dropped server-side.","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}}}}}}}},"/bff/grid-view/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}}}}},"operationId":"postBffGrid-viewDelete","tags":["DataGrid"],"summary":"Delete saved grid view","description":"Soft delete. Owner or org root only.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}}}},"/bff/kb/list":{"get":{"parameters":[{"description":"Free-text filter (legacy alias for filterFulltextQuery).","schema":{"type":"string"},"in":"query","name":"query","required":false},{"description":"Free-text filter — DataGrid fulltext filter maps to this key.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Comma-separated list of kinds to include.","examples":["qa,note"],"schema":{"type":"string"},"in":"query","name":"kind","required":false},{"examples":["draft,active"],"schema":{"type":"string"},"in":"query","name":"status","required":false},{"examples":["chat,manual"],"schema":{"type":"string"},"in":"query","name":"source","required":false},{"description":"Single tag exact match (legacy).","schema":{"type":"string"},"in":"query","name":"tag","required":false},{"description":"Comma-separated tags (DataGrid tag-filter convention). First tag wins.","schema":{"type":"string"},"in":"query","name":"tagFilter","required":false},{"description":"Page size. Default 50, cap 200.","schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Offset-based pagination (legacy).","schema":{"type":"string"},"in":"query","name":"offset","required":false},{"description":"1-based page number (DataGrid convention).","schema":{"type":"string"},"in":"query","name":"page","required":false}],"operationId":"getBffKbList","tags":["Knowledge Base"],"summary":"List KB entries (admin grid)","description":"Paginated per-tenant listing with kind / status / source / tag filters and an optional trigram-backed free-text filter. Accepts both legacy (`query`, `offset`, `tag`) and DataGrid (`filterFulltextQuery`, `page`, `tagFilter`) conventions. Newest entries first. Distinct from `/kb/search` in that this endpoint is filter-first and returns every match; `/kb/search` is the hybrid-retrieval ranked top-N.","responses":{"200":{}}}},"/bff/kb/entry":{"get":{"parameters":[{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"externalId","required":true}],"operationId":"getBffKbEntry","tags":["Knowledge Base"],"summary":"Get KB entry detail","responses":{"200":{}}},"post":{"parameters":[],"operationId":"postBffKbEntry","tags":["Knowledge Base"],"summary":"Create or upsert-update a KB entry","description":"Create when no externalId is passed; update when one is. Accepts BOTH a nested `locales[]` shape (multi-locale writes) and a flat `title/question/body` shape (CmsForm convenience — normalised into a single primary-locale row). The dedicated `PATCH /entry` endpoint remains for callers that want an explicit partial update.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","primaryLocale"],"properties":{"externalId":{"minLength":24,"maxLength":24,"description":"When present, updates the existing entry; otherwise creates a new one.","type":"string"},"kind":{"anyOf":[{"const":"qa","type":"string"},{"const":"note","type":"string"},{"const":"crawl","type":"string"},{"const":"curated","type":"string"}]},"source":{"anyOf":[{"const":"chat","type":"string"},{"const":"crawl","type":"string"},{"const":"manual","type":"string"},{"const":"upload","type":"string"},{"const":"promotion","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]},"primaryLocale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","body"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"title":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"question":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"body":{"minLength":1,"maxLength":100000,"type":"string"}}}},"title":{"maxLength":500,"type":"string"},"question":{"maxLength":500,"type":"string"},"body":{"maxLength":100000,"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"maxLength":64,"type":"string"}},{"type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["kind","primaryLocale"],"properties":{"externalId":{"minLength":24,"maxLength":24,"description":"When present, updates the existing entry; otherwise creates a new one.","type":"string"},"kind":{"anyOf":[{"const":"qa","type":"string"},{"const":"note","type":"string"},{"const":"crawl","type":"string"},{"const":"curated","type":"string"}]},"source":{"anyOf":[{"const":"chat","type":"string"},{"const":"crawl","type":"string"},{"const":"manual","type":"string"},{"const":"upload","type":"string"},{"const":"promotion","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]},"primaryLocale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","body"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"title":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"question":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"body":{"minLength":1,"maxLength":100000,"type":"string"}}}},"title":{"maxLength":500,"type":"string"},"question":{"maxLength":500,"type":"string"},"body":{"maxLength":100000,"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"maxLength":64,"type":"string"}},{"type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["kind","primaryLocale"],"properties":{"externalId":{"minLength":24,"maxLength":24,"description":"When present, updates the existing entry; otherwise creates a new one.","type":"string"},"kind":{"anyOf":[{"const":"qa","type":"string"},{"const":"note","type":"string"},{"const":"crawl","type":"string"},{"const":"curated","type":"string"}]},"source":{"anyOf":[{"const":"chat","type":"string"},{"const":"crawl","type":"string"},{"const":"manual","type":"string"},{"const":"upload","type":"string"},{"const":"promotion","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]},"primaryLocale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","body"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"title":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"question":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"body":{"minLength":1,"maxLength":100000,"type":"string"}}}},"title":{"maxLength":500,"type":"string"},"question":{"maxLength":500,"type":"string"},"body":{"maxLength":100000,"type":"string"},"tags":{"anyOf":[{"type":"array","items":{"maxLength":64,"type":"string"}},{"type":"string"}]}}}}}},"responses":{"200":{}}},"patch":{"parameters":[],"operationId":"patchBffKbEntry","tags":["Knowledge Base"],"summary":"Update a KB entry","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"qa","type":"string"},{"const":"note","type":"string"},{"const":"crawl","type":"string"},{"const":"curated","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]},"primaryLocale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"confidence":{"minimum":0,"maximum":1,"type":"number"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","body"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"title":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"question":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"body":{"minLength":1,"maxLength":100000,"type":"string"}}}},"tags":{"type":"array","items":{"maxLength":64,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"qa","type":"string"},{"const":"note","type":"string"},{"const":"crawl","type":"string"},{"const":"curated","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]},"primaryLocale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"confidence":{"minimum":0,"maximum":1,"type":"number"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","body"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"title":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"question":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"body":{"minLength":1,"maxLength":100000,"type":"string"}}}},"tags":{"type":"array","items":{"maxLength":64,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"qa","type":"string"},{"const":"note","type":"string"},{"const":"crawl","type":"string"},{"const":"curated","type":"string"}]},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]},"primaryLocale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"confidence":{"minimum":0,"maximum":1,"type":"number"},"locales":{"minItems":1,"type":"array","items":{"type":"object","required":["locale","body"],"properties":{"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"title":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"question":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"body":{"minLength":1,"maxLength":100000,"type":"string"}}}},"tags":{"type":"array","items":{"maxLength":64,"type":"string"}}}}}}},"responses":{"200":{}}},"delete":{"parameters":[],"operationId":"deleteBffKbEntry","tags":["Knowledge Base"],"summary":"Soft-delete a KB entry","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/kb/search":{"get":{"parameters":[{"description":"Free-text search query.","examples":["reklamace"],"schema":{"type":"string"},"in":"query","name":"query","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false},{"schema":{"type":"string"},"in":"query","name":"kind","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"\"true\" to include draft entries. Default false.","schema":{"type":"string"},"in":"query","name":"includeDrafts","required":false}],"operationId":"getBffKbSearch","tags":["Knowledge Base"],"summary":"Hybrid KB search (trigram + vector, RRF-merged)","description":"Fulltext over trigram GIN + HNSW vector, merged via Reciprocal Rank Fusion (K=60). Locale is a hint, never a hard filter — cross-lingual retrieval is by design. Fallbacks to trigram-only if the embedding provider is unavailable.","responses":{"200":{}}}},"/bff/kb/tags":{"get":{"operationId":"getBffKbTags","tags":["Knowledge Base"],"summary":"Tag cloud for the KB filter dropdown","responses":{"200":{}}}},"/bff/kb/entry-form-data":{"get":{"parameters":[{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"externalId","required":true}],"operationId":"getBffKbEntry-form-data","tags":["Knowledge Base"],"summary":"Flattened prefill for the CmsForm edit modal","responses":{"200":{}}}},"/bff/kb/entry-status":{"post":{"parameters":[],"operationId":"postBffKbEntry-status","tags":["Knowledge Base"],"summary":"Change a KB entry status (approve draft, mark stale, archive)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","status"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","status"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["externalId","status"],"properties":{"externalId":{"minLength":24,"maxLength":24,"type":"string"},"status":{"anyOf":[{"const":"draft","type":"string"},{"const":"active","type":"string"},{"const":"stale","type":"string"},{"const":"archived","type":"string"}]}}}}}},"responses":{"200":{}}}},"/bff/kb/review-queue":{"get":{"operationId":"getBffKbReview-queue","tags":["Knowledge Base"],"summary":"Review queue — draft / stale / GDPR-flagged buckets","description":"Buckets entries that need a human decision: `draft` (auto-fed from chat, waiting for approval), `stale` (verify-after window elapsed), `flagged` (mentioned contact was anonymised — candidate for hard delete). Each bucket capped at 100 rows.","responses":{"200":{}}}},"/bff/kb/approve-batch":{"post":{"parameters":[],"operationId":"postBffKbApprove-batch","tags":["Knowledge Base"],"summary":"Batch-approve review-queue entries (draft → active or stale → active)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalIds"],"properties":{"externalIds":{"minItems":1,"maxItems":100,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalIds"],"properties":{"externalIds":{"minItems":1,"maxItems":100,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["externalIds"],"properties":{"externalIds":{"minItems":1,"maxItems":100,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}}}},"responses":{"200":{}}}},"/bff/kb/entry-from-chat":{"post":{"parameters":[],"operationId":"postBffKbEntry-from-chat","tags":["Knowledge Base"],"summary":"Confirm a propose-save card into an active KB entry","description":"Enqueues a chat-qa job with `mode=agent-derived` — the handler creates the entry with status=active (i.e. immediately retrievable) because the operator already vouched for the substance by clicking confirm.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question","answer","locale"],"properties":{"question":{"maxLength":4000,"type":"string"},"answer":{"minLength":1,"maxLength":20000,"type":"string"},"tags":{"type":"array","items":{"maxLength":64,"type":"string"}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"dedupeKey":{"maxLength":120,"description":"Optional idempotency key — the assistant chat-message external id is a good default.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["question","answer","locale"],"properties":{"question":{"maxLength":4000,"type":"string"},"answer":{"minLength":1,"maxLength":20000,"type":"string"},"tags":{"type":"array","items":{"maxLength":64,"type":"string"}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"dedupeKey":{"maxLength":120,"description":"Optional idempotency key — the assistant chat-message external id is a good default.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["question","answer","locale"],"properties":{"question":{"maxLength":4000,"type":"string"},"answer":{"minLength":1,"maxLength":20000,"type":"string"},"tags":{"type":"array","items":{"maxLength":64,"type":"string"}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"dedupeKey":{"maxLength":120,"description":"Optional idempotency key — the assistant chat-message external id is a good default.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/lead/list":{"get":{"parameters":[{"description":"Maximum items per page.","examples":[50],"schema":{"type":"number"},"in":"query","name":"limit","required":false},{"description":"Page number (1-based).","examples":[1],"schema":{"type":"number"},"in":"query","name":"page","required":false},{"description":"Lead pipeline status.","schema":{"anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"in":"query","name":"status","required":false},{"description":"How the lead was acquired.","schema":{"anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"in":"query","name":"source","required":false},{"description":"Filter by assigned member ID.","schema":{"type":"string"},"in":"query","name":"assignedMemberId","required":false},{"description":"Search across subject, description, customer name and email.","schema":{"type":"string"},"in":"query","name":"fulltextQuery","required":false},{"description":"Sort field:direction (e.g. \"insertedDate:desc\", \"estimatedValue:asc\", \"followUpDate:asc\").","schema":{"type":"string"},"in":"query","name":"orderBy","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","status","source","subject","estimatedValue","followUpDate","insertedDate","updatedDate","closedDate","customer","assignedMemberName"],"properties":{"id":{"description":"Lead ID.","type":"number"},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"subject":{"description":"Lead subject/title.","type":"string"},"estimatedValue":{"nullable":true,"anyOf":[{"description":"Estimated deal value.","type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"description":"Next follow-up date.","anyOf":[{"description":"Next follow-up date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"When the lead was created.","anyOf":[{"description":"When the lead was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"closedDate":{"nullable":true,"anyOf":[{"description":"When the lead was closed (won/lost).","anyOf":[{"description":"When the lead was closed (won/lost).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","email","name"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts.","type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"assignedMemberName":{"nullable":true,"anyOf":[{"description":"Name of assigned sales rep.","type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total matching leads.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","status","source","subject","estimatedValue","followUpDate","insertedDate","updatedDate","closedDate","customer","assignedMemberName"],"properties":{"id":{"description":"Lead ID.","type":"number"},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"subject":{"description":"Lead subject/title.","type":"string"},"estimatedValue":{"nullable":true,"anyOf":[{"description":"Estimated deal value.","type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"description":"Next follow-up date.","anyOf":[{"description":"Next follow-up date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"When the lead was created.","anyOf":[{"description":"When the lead was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"closedDate":{"nullable":true,"anyOf":[{"description":"When the lead was closed (won/lost).","anyOf":[{"description":"When the lead was closed (won/lost).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","email","name"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts.","type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"assignedMemberName":{"nullable":true,"anyOf":[{"description":"Name of assigned sales rep.","type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total matching leads.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","status","source","subject","estimatedValue","followUpDate","insertedDate","updatedDate","closedDate","customer","assignedMemberName"],"properties":{"id":{"description":"Lead ID.","type":"number"},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"subject":{"description":"Lead subject/title.","type":"string"},"estimatedValue":{"nullable":true,"anyOf":[{"description":"Estimated deal value.","type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"description":"Next follow-up date.","anyOf":[{"description":"Next follow-up date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"When the lead was created.","anyOf":[{"description":"When the lead was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last update.","anyOf":[{"description":"Last update.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"closedDate":{"nullable":true,"anyOf":[{"description":"When the lead was closed (won/lost).","anyOf":[{"description":"When the lead was closed (won/lost).","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","email","name"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts.","type":"string"},{"type":"null"}]},"name":{"type":"string"}}},{"type":"null"}]},"assignedMemberName":{"nullable":true,"anyOf":[{"description":"Name of assigned sales rep.","type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total matching leads.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffLeadList","tags":["Lead"],"summary":"List leads","description":"Returns a paginated list of leads/inquiries with customer and assignee info. Supports filtering by status, source, assigned member, and full-text search."}},"/bff/lead/detail":{"get":{"parameters":[{"description":"Lead ID.","schema":{"type":"string"},"in":"query","name":"leadId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"subject":{"type":"string"},"description":{"type":"string"},"internalNote":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"estimatedValue":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"closedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lostReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","email","name","phone","companyName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts.","type":"string"},{"type":"null"}]},"name":{"type":"string"},"phone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"assignedMember":{"nullable":true,"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"number"},"name":{"type":"string"}}},{"type":"null"}]},"order":{"nullable":true,"anyOf":[{"type":"object","required":["id","orderNumber"],"properties":{"id":{"type":"number"},"orderNumber":{"type":"string"}}},{"type":"null"}]},"issue":{"nullable":true,"anyOf":[{"type":"object","required":["id","issueKey"],"properties":{"id":{"type":"number"},"issueKey":{"type":"string"}}},{"type":"null"}]},"geo":{"nullable":true,"anyOf":[{"type":"object","required":["ip","city","country"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["id","status","source","subject","description","internalNote","estimatedValue","followUpDate","closedDate","lostReason","insertedDate","updatedDate","customer","assignedMember","order","issue","geo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"subject":{"type":"string"},"description":{"type":"string"},"internalNote":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"estimatedValue":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"closedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lostReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","email","name","phone","companyName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts.","type":"string"},{"type":"null"}]},"name":{"type":"string"},"phone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"assignedMember":{"nullable":true,"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"number"},"name":{"type":"string"}}},{"type":"null"}]},"order":{"nullable":true,"anyOf":[{"type":"object","required":["id","orderNumber"],"properties":{"id":{"type":"number"},"orderNumber":{"type":"string"}}},{"type":"null"}]},"issue":{"nullable":true,"anyOf":[{"type":"object","required":["id","issueKey"],"properties":{"id":{"type":"number"},"issueKey":{"type":"string"}}},{"type":"null"}]},"geo":{"nullable":true,"anyOf":[{"type":"object","required":["ip","city","country"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["id","status","source","subject","description","internalNote","estimatedValue","followUpDate","closedDate","lostReason","insertedDate","updatedDate","customer","assignedMember","order","issue","geo"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"subject":{"type":"string"},"description":{"type":"string"},"internalNote":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"estimatedValue":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"closedDate":{"nullable":true,"anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lostReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"customer":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","email","name","phone","companyName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Customer e-mail. `null` for phone-only customers and anonymised contacts.","type":"string"},{"type":"null"}]},"name":{"type":"string"},"phone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"assignedMember":{"nullable":true,"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"type":"number"},"name":{"type":"string"}}},{"type":"null"}]},"order":{"nullable":true,"anyOf":[{"type":"object","required":["id","orderNumber"],"properties":{"id":{"type":"number"},"orderNumber":{"type":"string"}}},{"type":"null"}]},"issue":{"nullable":true,"anyOf":[{"type":"object","required":["id","issueKey"],"properties":{"id":{"type":"number"},"issueKey":{"type":"string"}}},{"type":"null"}]},"geo":{"nullable":true,"anyOf":[{"type":"object","required":["ip","city","country"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["id","status","source","subject","description","internalNote","estimatedValue","followUpDate","closedDate","lostReason","insertedDate","updatedDate","customer","assignedMember","order","issue","geo"]}}}}},"operationId":"getBffLeadDetail","tags":["Lead"],"summary":"Get lead detail","description":"Returns full lead detail including customer, assignee, linked order/issue, and geo info."}},"/bff/lead/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"Created lead ID.","type":"number"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"Created lead ID.","type":"number"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"Created lead ID.","type":"number"}},"required":["success","id"]}}}}},"operationId":"postBffLeadCreate","tags":["Lead"],"summary":"Create lead","description":"Creates a new lead/inquiry. Optionally creates or links an existing customer by email. The lead starts in \"new\" status.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"minLength":1,"description":"Lead subject/title.","type":"string"},"description":{"description":"Detailed description of the inquiry.","type":"string"},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"customerEmail":{"description":"Customer email — creates or finds existing contact.","type":"string"},"customerPhone":{"description":"Customer phone.","type":"string"},"customerFirstName":{"description":"Customer first name.","type":"string"},"customerLastName":{"description":"Customer last name.","type":"string"},"assignedMemberId":{"description":"Organisation member ID to assign.","type":"number"},"estimatedValue":{"description":"Estimated deal value.","type":"number"},"followUpDate":{"description":"Next follow-up date (ISO timestamp).","examples":["2026-03-01"],"type":"string"},"internalNote":{"description":"Internal note for the sales team.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"minLength":1,"description":"Lead subject/title.","type":"string"},"description":{"description":"Detailed description of the inquiry.","type":"string"},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"customerEmail":{"description":"Customer email — creates or finds existing contact.","type":"string"},"customerPhone":{"description":"Customer phone.","type":"string"},"customerFirstName":{"description":"Customer first name.","type":"string"},"customerLastName":{"description":"Customer last name.","type":"string"},"assignedMemberId":{"description":"Organisation member ID to assign.","type":"number"},"estimatedValue":{"description":"Estimated deal value.","type":"number"},"followUpDate":{"description":"Next follow-up date (ISO timestamp).","examples":["2026-03-01"],"type":"string"},"internalNote":{"description":"Internal note for the sales team.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["subject"],"properties":{"subject":{"minLength":1,"description":"Lead subject/title.","type":"string"},"description":{"description":"Detailed description of the inquiry.","type":"string"},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"customerEmail":{"description":"Customer email — creates or finds existing contact.","type":"string"},"customerPhone":{"description":"Customer phone.","type":"string"},"customerFirstName":{"description":"Customer first name.","type":"string"},"customerLastName":{"description":"Customer last name.","type":"string"},"assignedMemberId":{"description":"Organisation member ID to assign.","type":"number"},"estimatedValue":{"description":"Estimated deal value.","type":"number"},"followUpDate":{"description":"Next follow-up date (ISO timestamp).","examples":["2026-03-01"],"type":"string"},"internalNote":{"description":"Internal note for the sales team.","type":"string"}}}}}}}},"/bff/lead/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLeadUpdate","tags":["Lead"],"summary":"Update lead","description":"Updates lead fields. Only provided fields are changed. When status is set to \"won\" or \"lost\", closedDate is auto-set to now if not provided.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["leadId"],"properties":{"leadId":{"description":"Lead ID to update.","type":"number"},"subject":{"minLength":1,"type":"string"},"description":{"type":"string"},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"assignedMemberId":{"nullable":true,"anyOf":[{"description":"Set assigned member, or null to unassign.","type":"number"},{"type":"null"}]},"customerId":{"nullable":true,"anyOf":[{"description":"Set customer ID, or null to unlink.","type":"number"},{"type":"null"}]},"estimatedValue":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp or null to clear.","type":"string"},{"type":"null"}]},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lostReason":{"nullable":true,"anyOf":[{"description":"Reason for losing the lead (when status=lost).","type":"string"},{"type":"null"}]},"internalNote":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["leadId"],"properties":{"leadId":{"description":"Lead ID to update.","type":"number"},"subject":{"minLength":1,"type":"string"},"description":{"type":"string"},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"assignedMemberId":{"nullable":true,"anyOf":[{"description":"Set assigned member, or null to unassign.","type":"number"},{"type":"null"}]},"customerId":{"nullable":true,"anyOf":[{"description":"Set customer ID, or null to unlink.","type":"number"},{"type":"null"}]},"estimatedValue":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp or null to clear.","type":"string"},{"type":"null"}]},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lostReason":{"nullable":true,"anyOf":[{"description":"Reason for losing the lead (when status=lost).","type":"string"},{"type":"null"}]},"internalNote":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["leadId"],"properties":{"leadId":{"description":"Lead ID to update.","type":"number"},"subject":{"minLength":1,"type":"string"},"description":{"type":"string"},"source":{"description":"How the lead was acquired.","anyOf":[{"const":"web_form","type":"string"},{"const":"phone","type":"string"},{"const":"email","type":"string"},{"const":"referral","type":"string"},{"const":"other","type":"string"}]},"status":{"description":"Lead pipeline status.","anyOf":[{"const":"new","type":"string"},{"const":"contacted","type":"string"},{"const":"qualified","type":"string"},{"const":"proposal","type":"string"},{"const":"negotiation","type":"string"},{"const":"won","type":"string"},{"const":"lost","type":"string"}]},"assignedMemberId":{"nullable":true,"anyOf":[{"description":"Set assigned member, or null to unassign.","type":"number"},{"type":"null"}]},"customerId":{"nullable":true,"anyOf":[{"description":"Set customer ID, or null to unlink.","type":"number"},{"type":"null"}]},"estimatedValue":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"followUpDate":{"nullable":true,"anyOf":[{"description":"ISO timestamp or null to clear.","type":"string"},{"type":"null"}]},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lostReason":{"nullable":true,"anyOf":[{"description":"Reason for losing the lead (when status=lost).","type":"string"},{"type":"null"}]},"internalNote":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/locale/list":{"get":{"parameters":[{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","locale","label"],"properties":{"id":{"description":"Internal locale ID.","type":"number"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"label":{"description":"Localized display name of the locale.","examples":["Angličtina"],"type":"string"}}}},"itemCount":{"description":"Total number of locales.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","locale","label"],"properties":{"id":{"description":"Internal locale ID.","type":"number"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"label":{"description":"Localized display name of the locale.","examples":["Angličtina"],"type":"string"}}}},"itemCount":{"description":"Total number of locales.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","locale","label"],"properties":{"id":{"description":"Internal locale ID.","type":"number"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"label":{"description":"Localized display name of the locale.","examples":["Angličtina"],"type":"string"}}}},"itemCount":{"description":"Total number of locales.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffLocaleList","tags":["Locale"],"summary":"List available locales","description":"Returns all available locales with their localized labels. Use the locale query param to control the language of labels."}},"/bff/log/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Sort `field:dir`; field = last_seen | first_seen | event_count.","examples":["last_seen:desc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Search in message, code, code title, fingerprint or event id. Supports qualifiers: is:unresolved|resolved|ignored|regressed|new|all|unassigned|linked|unlinked, level:, component:, code: (with * wildcard), assigned:me|none, issue:yes|no, fingerprint:.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"External (16-char) id of a contact; only groups with an event linked to it.","examples":["Dlko1bEG85c6304a"],"schema":{"type":"string"},"in":"query","name":"contactId","required":false},{"description":"One of unresolved, resolved, ignored, regressed, new, all. Default unresolved.","schema":{"type":"string"},"in":"query","name":"status","required":false},{"description":"One of info, success, error, warning, critical.","schema":{"type":"string"},"in":"query","name":"level","required":false},{"description":"Exact component name.","schema":{"type":"string"},"in":"query","name":"component","required":false},{"description":"Last seen within: 1h, 24h, 7d, 14d, 30d, all.","schema":{"type":"string"},"in":"query","name":"period","required":false},{"description":"YYYY-MM-DD: groups with an event on that day.","schema":{"type":"string"},"in":"query","name":"day","required":false},{"description":"`me` or `unassigned`.","schema":{"type":"string"},"in":"query","name":"assignee","required":false}],"operationId":"getBffLogList","tags":["Log"],"summary":"List log groups","description":"Paginated Sentry-style stream of log groups (one row per fingerprint) for the current organisation, filterable by status, level, component, period, day, fulltext and contact.","responses":{"200":{}}}},"/bff/log/facets":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"External (16-char) id of a contact; only groups with an event linked to it.","examples":["Dlko1bEG85c6304a"],"schema":{"type":"string"},"in":"query","name":"contactId","required":false},{"description":"One of unresolved, resolved, ignored, regressed, new, all. Default unresolved.","schema":{"type":"string"},"in":"query","name":"status","required":false},{"description":"One of info, success, error, warning, critical.","schema":{"type":"string"},"in":"query","name":"level","required":false},{"description":"Exact component name.","schema":{"type":"string"},"in":"query","name":"component","required":false},{"description":"Last seen within: 1h, 24h, 7d, 14d, 30d, all.","schema":{"type":"string"},"in":"query","name":"period","required":false},{"description":"YYYY-MM-DD: groups with an event on that day.","schema":{"type":"string"},"in":"query","name":"day","required":false},{"description":"`me` or `unassigned`.","schema":{"type":"string"},"in":"query","name":"assignee","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"object","required":["unresolved","resolved","ignored","regressed","new","all"],"properties":{"unresolved":{"type":"number"},"resolved":{"type":"number"},"ignored":{"type":"number"},"regressed":{"type":"number"},"new":{"type":"number"},"all":{"type":"number"}}},"components":{"type":"array","items":{"type":"object","required":["component","count"],"properties":{"component":{"type":"string"},"count":{"type":"number"}}}}},"required":["status","components"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"type":"object","required":["unresolved","resolved","ignored","regressed","new","all"],"properties":{"unresolved":{"type":"number"},"resolved":{"type":"number"},"ignored":{"type":"number"},"regressed":{"type":"number"},"new":{"type":"number"},"all":{"type":"number"}}},"components":{"type":"array","items":{"type":"object","required":["component","count"],"properties":{"component":{"type":"string"},"count":{"type":"number"}}}}},"required":["status","components"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"type":"object","required":["unresolved","resolved","ignored","regressed","new","all"],"properties":{"unresolved":{"type":"number"},"resolved":{"type":"number"},"ignored":{"type":"number"},"regressed":{"type":"number"},"new":{"type":"number"},"all":{"type":"number"}}},"components":{"type":"array","items":{"type":"object","required":["component","count"],"properties":{"component":{"type":"string"},"count":{"type":"number"}}}}},"required":["status","components"]}}}}},"operationId":"getBffLogFacets","tags":["Log"],"summary":"Log group counts per status","description":"Counts of log groups per status bucket under the other active filters, plus the component list."}},"/bff/log/group-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"number"}},"required":["changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"changed":{"type":"number"}},"required":["changed"]}},"text/plain":{"schema":{"type":"object","properties":{"changed":{"type":"number"}},"required":["changed"]}}}}},"operationId":"postBffLogGroup-status","tags":["Log"],"summary":"Change log group status","description":"Resolve, ignore (optionally for a duration) or reopen the log groups of the given events. A new event on a resolved group reopens it as a regression.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids","status"],"properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"description":"External id of any event in the target group.","type":"string"}},"status":{"anyOf":[{"const":"unresolved","type":"string"},{"const":"resolved","type":"string"},{"const":"ignored","type":"string"}]},"ignoreDuration":{"anyOf":[{"const":"1h","type":"string"},{"const":"24h","type":"string"},{"const":"7d","type":"string"},{"const":"30d","type":"string"},{"const":"forever","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids","status"],"properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"description":"External id of any event in the target group.","type":"string"}},"status":{"anyOf":[{"const":"unresolved","type":"string"},{"const":"resolved","type":"string"},{"const":"ignored","type":"string"}]},"ignoreDuration":{"anyOf":[{"const":"1h","type":"string"},{"const":"24h","type":"string"},{"const":"7d","type":"string"},{"const":"30d","type":"string"},{"const":"forever","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["ids","status"],"properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"description":"External id of any event in the target group.","type":"string"}},"status":{"anyOf":[{"const":"unresolved","type":"string"},{"const":"resolved","type":"string"},{"const":"ignored","type":"string"}]},"ignoreDuration":{"anyOf":[{"const":"1h","type":"string"},{"const":"24h","type":"string"},{"const":"7d","type":"string"},{"const":"30d","type":"string"},{"const":"forever","type":"string"}]}}}}}}}},"/bff/log/group-context":{"get":{"parameters":[{"description":"Log entry external ID.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffLogGroup-context","tags":["Log"],"summary":"Log group context for the detail page","description":"Status, linked issue, event navigation (oldest / previous / next / latest) and affected contacts of the group the given event belongs to.","responses":{"200":{}}}},"/bff/log/group-assign":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"changed":{"type":"number"}},"required":["changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"changed":{"type":"number"}},"required":["changed"]}},"text/plain":{"schema":{"type":"object","properties":{"changed":{"type":"number"}},"required":["changed"]}}}}},"operationId":"postBffLogGroup-assign","tags":["Log"],"summary":"Assign log groups","description":"Assigns the log groups of the given events to a contact of the organisation, or unassigns them (null).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids","contactId"],"properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"description":"External id of any event in the target group.","type":"string"}},"contactId":{"anyOf":[{"description":"Internal contact id of the assignee.","type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids","contactId"],"properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"description":"External id of any event in the target group.","type":"string"}},"contactId":{"anyOf":[{"description":"Internal contact id of the assignee.","type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["ids","contactId"],"properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"description":"External id of any event in the target group.","type":"string"}},"contactId":{"anyOf":[{"description":"Internal contact id of the assignee.","type":"number"},{"type":"null"}]}}}}}}}},"/bff/log/group-tags":{"get":{"parameters":[{"description":"Log entry external ID.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"sampled":{"type":"number"},"tags":{"type":"array","items":{"type":"object","required":["key","coverage","distinct","top"],"properties":{"key":{"type":"string"},"coverage":{"type":"number"},"distinct":{"type":"number"},"top":{"type":"array","items":{"type":"object","required":["value","count"],"properties":{"value":{"type":"string"},"count":{"type":"number"}}}}}}}},"required":["sampled","tags"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"sampled":{"type":"number"},"tags":{"type":"array","items":{"type":"object","required":["key","coverage","distinct","top"],"properties":{"key":{"type":"string"},"coverage":{"type":"number"},"distinct":{"type":"number"},"top":{"type":"array","items":{"type":"object","required":["value","count"],"properties":{"value":{"type":"string"},"count":{"type":"number"}}}}}}}},"required":["sampled","tags"]}},"text/plain":{"schema":{"type":"object","properties":{"sampled":{"type":"number"},"tags":{"type":"array","items":{"type":"object","required":["key","coverage","distinct","top"],"properties":{"key":{"type":"string"},"coverage":{"type":"number"},"distinct":{"type":"number"},"top":{"type":"array","items":{"type":"object","required":["value","count"],"properties":{"value":{"type":"string"},"count":{"type":"number"}}}}}}}},"required":["sampled","tags"]}}}}},"operationId":"getBffLogGroup-tags","tags":["Log"],"summary":"Tag distribution of a log group","description":"Aggregates the `Key: value` lines (log format v1) of the latest 300 events in the group: coverage, distinct values and the most frequent values per key."}},"/bff/log/group-comment":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}}},"operationId":"postBffLogGroup-comment","tags":["Log"],"summary":"Comment on a log group","description":"Adds an operator note to the timeline of the log group.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","text"],"properties":{"id":{"description":"External id of any event in the group.","type":"string"},"text":{"minLength":1,"maxLength":2000,"description":"Plain-text note.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","text"],"properties":{"id":{"description":"External id of any event in the group.","type":"string"},"text":{"minLength":1,"maxLength":2000,"description":"Plain-text note.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","text"],"properties":{"id":{"description":"External id of any event in the group.","type":"string"},"text":{"minLength":1,"maxLength":2000,"description":"Plain-text note.","type":"string"}}}}}}}},"/bff/log/group-comment-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}},"text/plain":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}}}}},"operationId":"postBffLogGroup-comment-delete","tags":["Log"],"summary":"Delete own log group comment","description":"Deletes a comment from a log group timeline. Only the author can delete it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["activityId"],"properties":{"activityId":{"description":"Timeline entry id of the comment.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["activityId"],"properties":{"activityId":{"description":"Timeline entry id of the comment.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["activityId"],"properties":{"activityId":{"description":"Timeline entry id of the comment.","type":"number"}}}}}}}},"/bff/log/group-create-issue":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"issueKey":{"type":"string"},"created":{"type":"boolean"}},"required":["issueKey","created"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"issueKey":{"type":"string"},"created":{"type":"boolean"}},"required":["issueKey","created"]}},"text/plain":{"schema":{"type":"object","properties":{"issueKey":{"type":"string"},"created":{"type":"boolean"}},"required":["issueKey","created"]}}}}},"operationId":"postBffLogGroup-create-issue","tags":["Log"],"summary":"Create an issue from a log group","description":"Creates a pm__issue for the log group (once) and links it; returns the issue key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External id of any event in the group.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External id of any event in the group.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External id of any event in the group.","type":"string"}}}}}}}},"/bff/log/statistics":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["day","total","unique","newGroups","errors"],"properties":{"day":{"type":"string"},"total":{"type":"number"},"unique":{"type":"number"},"newGroups":{"type":"number"},"errors":{"type":"number"}}}},"totals":{"type":"object","required":["total","unique","newGroups","errors"],"properties":{"total":{"type":"number"},"unique":{"type":"number"},"newGroups":{"type":"number"},"errors":{"type":"number"}}},"medianDailyTotal":{"type":"number"},"components":{"type":"array","items":{"type":"object","required":["component","total","unique","errors"],"properties":{"component":{"type":"string"},"total":{"type":"number"},"unique":{"type":"number"},"errors":{"type":"number"}}}},"levels":{"type":"array","items":{"type":"object","required":["level","total"],"properties":{"level":{"type":"number"},"total":{"type":"number"}}}},"topGroups":{"type":"array","items":{"type":"object","required":["id","title","level","total","status"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"level":{"type":"number"},"total":{"type":"number"},"status":{"type":"string"}}}}},"required":["items","totals","medianDailyTotal","components","levels","topGroups"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["day","total","unique","newGroups","errors"],"properties":{"day":{"type":"string"},"total":{"type":"number"},"unique":{"type":"number"},"newGroups":{"type":"number"},"errors":{"type":"number"}}}},"totals":{"type":"object","required":["total","unique","newGroups","errors"],"properties":{"total":{"type":"number"},"unique":{"type":"number"},"newGroups":{"type":"number"},"errors":{"type":"number"}}},"medianDailyTotal":{"type":"number"},"components":{"type":"array","items":{"type":"object","required":["component","total","unique","errors"],"properties":{"component":{"type":"string"},"total":{"type":"number"},"unique":{"type":"number"},"errors":{"type":"number"}}}},"levels":{"type":"array","items":{"type":"object","required":["level","total"],"properties":{"level":{"type":"number"},"total":{"type":"number"}}}},"topGroups":{"type":"array","items":{"type":"object","required":["id","title","level","total","status"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"level":{"type":"number"},"total":{"type":"number"},"status":{"type":"string"}}}}},"required":["items","totals","medianDailyTotal","components","levels","topGroups"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["day","total","unique","newGroups","errors"],"properties":{"day":{"type":"string"},"total":{"type":"number"},"unique":{"type":"number"},"newGroups":{"type":"number"},"errors":{"type":"number"}}}},"totals":{"type":"object","required":["total","unique","newGroups","errors"],"properties":{"total":{"type":"number"},"unique":{"type":"number"},"newGroups":{"type":"number"},"errors":{"type":"number"}}},"medianDailyTotal":{"type":"number"},"components":{"type":"array","items":{"type":"object","required":["component","total","unique","errors"],"properties":{"component":{"type":"string"},"total":{"type":"number"},"unique":{"type":"number"},"errors":{"type":"number"}}}},"levels":{"type":"array","items":{"type":"object","required":["level","total"],"properties":{"level":{"type":"number"},"total":{"type":"number"}}}},"topGroups":{"type":"array","items":{"type":"object","required":["id","title","level","total","status"],"properties":{"id":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"level":{"type":"number"},"total":{"type":"number"},"status":{"type":"string"}}}}},"required":["items","totals","medianDailyTotal","components","levels","topGroups"]}}}}},"operationId":"getBffLogStatistics","tags":["Log"],"summary":"Daily log volume statistics for the /log list chart","description":"Returns 30 days of per-day counts for the current organisation: total log rows, distinct fingerprints (unique log groups), fingerprints seen for the first time, and error/critical rows. Plus window totals and the median daily volume."}},"/bff/log/detail":{"get":{"parameters":[{"description":"Log entry external ID.","examples":["log_abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffLogDetail","tags":["Log"],"summary":"Get log entry detail","description":"Returns a single log entry with full message, metadata and context.","responses":{"200":{}}}},"/bff/log/group-summary":{"get":{"parameters":[{"description":"Log fingerprint (32-char MD5) that groups structurally identical logs.","schema":{"type":"string"},"in":"query","name":"fingerprint","required":true}],"operationId":"getBffLogGroup-summary","tags":["Log"],"summary":"Get log group summary","description":"Returns aggregate stats (total count, first/last seen, 30-day daily occurrences, related-fingerprint count) for every log in the organisation that shares the given fingerprint.","responses":{"200":{}}}},"/bff/log/group-occurrences":{"get":{"parameters":[{"description":"Log fingerprint (32-char MD5).","schema":{"type":"string"},"in":"query","name":"fingerprint","required":true},{"description":"Page number (1-based).","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Page size (1–200, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffLogGroup-occurrences","tags":["Log"],"summary":"List individual events in a log group","description":"Paginated list of each individual log row that shares the given fingerprint. Each item carries the log external id (so the operator can open a specific occurrence), inserted date, level, and a truncated one-line preview of the message.","responses":{"200":{}}}},"/bff/log/related":{"get":{"parameters":[{"description":"Log fingerprint of the source log — related groups are found relative to it.","schema":{"type":"string"},"in":"query","name":"fingerprint","required":true},{"description":"Max related groups to return (1–50, default 20).","examples":["20"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffLogRelated","tags":["Log"],"summary":"List related log groups","description":"Returns other fingerprints (i.e. distinct incident buckets) that share the source log's code_id — or fall back to the same component when the source has no code. Each item is the latest occurrence of its own group plus a `totalCount` so admin can spot related incidents at a glance.","responses":{"200":{}}}},"/bff/log/detail-log-explain":{"get":{"parameters":[{"description":"Log entry external ID to explain.","examples":["log_abc123"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"operationId":"getBffLogDetail-log-explain","tags":["Log"],"summary":"AI-explain a log entry","description":"Uses AI to generate a human-readable explanation of a log entry in the specified locale.","responses":{"200":{}}}},"/bff/log/detail-code":{"get":{"parameters":[{"description":"System log code identifier.","examples":["ORDER_CREATED"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"operationId":"getBffLogDetail-code","tags":["Log"],"summary":"Get log code definition","description":"Returns the title and description for a system log code. Empty object if the code is unknown.","responses":{"200":{}}}},"/bff/log/write-frontend-log":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLogWrite-frontend-log","tags":["Log"],"summary":"Write a frontend log entry","description":"Writes a log entry from the frontend application. Supports debouncing to prevent log spam.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"description":"Log message text.","type":"string"},"level":{"description":"Log severity level.","examples":["info","error","warning"],"type":"string"},"useDebounce":{"anyOf":[{"type":"boolean"},{"type":"object","required":["maxInterval"],"properties":{"enabled":{"type":"boolean"},"maxInterval":{"type":"string"}}}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["message"],"properties":{"message":{"description":"Log message text.","type":"string"},"level":{"description":"Log severity level.","examples":["info","error","warning"],"type":"string"},"useDebounce":{"anyOf":[{"type":"boolean"},{"type":"object","required":["maxInterval"],"properties":{"enabled":{"type":"boolean"},"maxInterval":{"type":"string"}}}]}}}},"text/plain":{"schema":{"type":"object","required":["message"],"properties":{"message":{"description":"Log message text.","type":"string"},"level":{"description":"Log severity level.","examples":["info","error","warning"],"type":"string"},"useDebounce":{"anyOf":[{"type":"boolean"},{"type":"object","required":["maxInterval"],"properties":{"enabled":{"type":"boolean"},"maxInterval":{"type":"string"}}}]}}}}}}}},"/bff/order/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Filter by customer external ID.","examples":["8zLmc498hr0gJb2I"],"schema":{"type":"string"},"in":"query","name":"customerId","required":false},{"description":"Filter by order group code. Comma-separated list = any of the groups (OR).","examples":["eshop","zak-montaz,zak-revize"],"schema":{"type":"string"},"in":"query","name":"groupCode","required":false},{"description":"Show the master order with this hash together with every order linked under it.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"masterOrderHash","required":false},{"description":"Filter by order status code. Comma-separated list = any of the statuses (OR).","examples":["new","new,processing"],"schema":{"type":"string"},"in":"query","name":"statusCode","required":false},{"description":"Full-text search across order number, customer email, first/last name, company name, phone, non-cancelled items (label, product/variant code, EAN), shipment tracking numbers and invoice numbers. Multi-word query: whitespace-separated tokens are AND-ed; each token matches any of those (ILIKE, accent-insensitive).","examples":["26000432","jan@example.com","Novák matcha"],"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Orders containing at least one non-cancelled item whose label, product code, variant code or EAN matches every whitespace-separated token (ILIKE, accent-insensitive).","examples":["matcha","MAT-100"],"schema":{"type":"string"},"in":"query","name":"productQuery","required":false},{"description":"Delivery method code(s), comma-separated, OR.","examples":["zasilkovna","zasilkovna,gls"],"schema":{"type":"string"},"in":"query","name":"deliveryCode","required":false},{"description":"Payment method code(s), comma-separated, OR.","examples":["card","card,bank-transfer"],"schema":{"type":"string"},"in":"query","name":"paymentCode","required":false},{"description":"ISO 3166-1 alpha-2 country of the delivery address (payment address as fallback), comma-separated, OR.","examples":["CZ","SK,PL"],"schema":{"type":"string"},"in":"query","name":"countryCode","required":false},{"description":"External id(s) of the assigned contact, comma-separated, OR. \"me\" = the signed-in member.","examples":["8zLmc498hr0gJb2I"],"schema":{"type":"string"},"in":"query","name":"assignee","required":false},{"description":"\"true\" = only orders that need attention (\"false\" = only the others): overdue, failed online payment, shipment problem, auto-cancel within 48 h, still \"new\" after 3 days, or a new order with a customer note. Cancelled orders never do. Each list item carries the reasons in `attention`.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"attention","required":false},{"description":"Combined payment filter: \"paid\", \"unpaid\", \"overdue\" (unpaid and past due_date), \"online_failed\", \"online_pending\", \"online_paid\", \"online_none\". Shortcut for isPaid / overdue / onlinePaymentResult; those explicit params take precedence. Unknown values are ignored.","examples":["unpaid","overdue","online_failed"],"schema":{"type":"string"},"in":"query","name":"paymentState","required":false},{"description":"Sort as \"field:asc|desc\". Fields: id, insertedDate, updatedDate, payDate, dueDate, price, statusCode (workflow position), customer, estimatedHours, shipNotBefore. Default insertedDate:desc; unknown fields fall back to the default.","examples":["insertedDate:desc","price:desc","statusCode:asc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Filter orders whose chosen date column is on or after this date (inclusive). See `dateField` for which column is targeted (default: inserted_date).","examples":["2026-01-01"],"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"Filter orders whose chosen date column is on or before this date (inclusive). See `dateField` for which column is targeted (default: inserted_date).","examples":["2026-01-31"],"schema":{"type":"string"},"in":"query","name":"dateTo","required":false},{"description":"Which date column `dateFrom`/`dateTo` apply to: \"inserted\" (default, created_at), \"paid\" (paid_at), \"updated\" (last update), \"due\" (due_date).","examples":["inserted","paid","updated","due"],"schema":{"type":"string"},"in":"query","name":"dateField","required":false},{"description":"Filter by payment status. \"true\" = paid only, \"false\" = unpaid only.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"isPaid","required":false},{"description":"\"true\" = orders past their due_date and still unpaid (cashflow follow-up); \"false\" = orders that are either still in time or already paid.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"overdue","required":false},{"description":"Lower bound for the order total price (inclusive). Compared in raw order currency.","examples":["100","1000"],"schema":{"type":"string"},"in":"query","name":"priceMin","required":false},{"description":"Upper bound for the order total price (inclusive). Compared in raw order currency.","examples":["5000","10000"],"schema":{"type":"string"},"in":"query","name":"priceMax","required":false},{"description":"Broad status type code – aggregates all org-specific statuses sharing the same type. \"new\" / \"processing\" / \"done\" / \"storno\". Comma-separated list = any of the types (OR).","examples":["processing","new,processing"],"schema":{"type":"string"},"in":"query","name":"statusType","required":false},{"description":"Shipment filter: \"none\" (no active shipment), \"open\" (parcel on its way), \"ready_for_pickup\", \"delivered\", \"problem\" (failed or returned), \"label_not_printed\" (active parcel, label not downloaded for printing yet).","examples":["none","open","problem"],"schema":{"type":"string"},"in":"query","name":"shipmentFilter","required":false},{"description":"Computed billing status filter, comma-separated, OR. Codes (priority order): \"credit_note\" (credit note issued), \"paid\" (final invoice/receipt + paid), \"invoiced\" (final invoice, unpaid), \"partially_paid\" (proforma + net received > 0, until the final invoice), \"proforma\" (proforma, nothing received), \"none\" (no accounting document). Unknown codes are ignored.","examples":["proforma,partially_paid","invoiced"],"schema":{"type":"string"},"in":"query","name":"billingStatus","required":false},{"description":"Locale for `billingStatus.label` in the response (cs/sk → Czech, otherwise English). Default cs.","examples":["cs","en"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"description":"\"true\" = order has at least one invoice; \"false\" = no invoice has been issued yet.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"hasInvoice","required":false},{"description":"Aggregated outcome of online payment attempts: \"paid\" (succeeded), \"failed\" (cancelled/timeouted, never paid), \"pending\" (in flight), \"none\" (no online payment attempt at all).","examples":["paid","failed","pending","none"],"schema":{"type":"string"},"in":"query","name":"onlinePaymentResult","required":false},{"description":"\"true\" = exclude orders whose customer is flagged as a test account.","examples":["true"],"schema":{"type":"string"},"in":"query","name":"hideTestAccounts","required":false},{"description":"\"true\" = orders waiting for their postponed shipping day (still in the future). \"false\" = orders that are not waiting.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"postponed","required":false},{"description":"\"true\" = orders with a non-empty public notice (customer wrote a message). \"false\" = orders without a public notice. Internal notices are not considered.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"hasPublicNote","required":false},{"description":"Comma-separated list of `key:value` tag pairs (matches the `code` field on the grid-configuration tag list). Inclusive OR — an order matches if it carries AT LEAST ONE of the listed pairs. Unknown or malformed pairs are silently ignored.","examples":["channel:web","channel:web,priority:high"],"schema":{"type":"string"},"in":"query","name":"tagFilter","required":false}],"operationId":"getBffOrderList","tags":["Order"],"summary":"List orders","description":"Returns a paginated list of orders with customer info and attached files. Supports filtering by status, customer, group, date range, payment status, full-text search, overdue (past due-date and unpaid), price range, status type, invoice presence, online-payment outcome, test-account hiding, public-note presence, item / product, delivery and payment method, country and assignee. Sortable via `orderBy`. Pagination is controlled via X-Pagination headers.","responses":{"200":{}}}},"/bff/order/create":{"post":{"parameters":[],"responses":{"200":{"description":"Order created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"hash":{"description":"Order hash for subsequent operations.","type":"string"},"orderNumber":{"description":"Human-readable order number.","type":"string"}},"required":["success","hash","orderNumber"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"hash":{"description":"Order hash for subsequent operations.","type":"string"},"orderNumber":{"description":"Human-readable order number.","type":"string"}},"required":["success","hash","orderNumber"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"hash":{"description":"Order hash for subsequent operations.","type":"string"},"orderNumber":{"description":"Human-readable order number.","type":"string"}},"required":["success","hash","orderNumber"]}}}}},"operationId":"postBffOrderCreate","tags":["Order"],"summary":"Create a new order","description":"Creates a new order from admin panel (POS mode). By default creates a draft/cart that can be edited before confirmation. Set startAsCart=false to create a confirmed order immediately.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"orderGroupId":{"description":"Order group code (e.g., \"default\", \"eshop\").","type":"string"},"customer":{"description":"Customer information for the order.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Customer first name.","type":"string"},"lastName":{"description":"Customer last name.","type":"string"},"phone":{"description":"Customer phone number.","type":"string"},"companyName":{"description":"Company name for B2B orders.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","type":"string"},"taxIdentificationNumber":{"description":"Tax ID (DIČ).","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"description":"Country code (e.g., \"CZ\", \"SK\").","type":"string"}}},"billingAddress":{"description":"Optional billing address, when it differs from the customer address (which is then the delivery address). The invoice is issued to this address. First and last name default to the customer. Omit it when both addresses are the same. The address is also saved to the customer contact, without changing its primary address.","type":"object","properties":{"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["Václavské náměstí 1"],"type":"string"},"city":{"examples":["Praha"],"type":"string"},"cityPart":{"examples":["Nové Město"],"type":"string"},"stateRegion":{"examples":["Hlavní město Praha"],"type":"string"},"postalCode":{"examples":["110 00"],"type":"string"},"country":{"examples":["CZ"],"type":"string"}}},"items":{"description":"List of order items.","type":"array","items":{"description":"Order item.","type":"object","required":["label"],"properties":{"label":{"description":"Item label/name displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g., 21).","type":"number"},"count":{"description":"Quantity. Defaults to 1.","type":"number"},"sale":{"description":"Discount amount per item.","type":"number"},"unit":{"description":"Unit of measure (e.g., \"ks\", \"hod\").","type":"string"},"productCode":{"description":"Product code to link item to product.","type":"string"},"variantCode":{"description":"Product variant code.","type":"string"},"eventCode":{"description":"Calendar event code for event tickets.","type":"string"},"creditAmount":{"description":"Credit amount if item adds credit.","type":"number"}}}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"currency":{"description":"Currency code (e.g., \"CZK\", \"EUR\"). Defaults to organisation currency.","type":"string"},"sale":{"description":"Global discount amount for the entire order.","type":"number"},"paymentMethod":{"description":"Payment method: \"credits\" for credit balance, \"money\" for standard payment.","anyOf":[{"const":"credits","type":"string"},{"const":"money","type":"string"}]},"deliveryPrice":{"description":"Delivery/shipping price.","type":"number"},"paymentPrice":{"description":"Payment processing fee.","type":"number"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"},"publicNotice":{"description":"Public note visible to customer.","type":"string"},"tags":{"description":"Tags to attach to the order.","type":"object","patternProperties":{"^(.*)$":{}}},"ignoreNotification":{"description":"Skip sending order confirmation email. Defaults to true.","type":"boolean"},"startAsCart":{"description":"Create order as draft/cart (true) or as new order (false). Defaults to false.","type":"boolean"},"preventAutoPayment":{"description":"Prevent automatic marking as paid when order price is 0. Defaults to true.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"orderGroupId":{"description":"Order group code (e.g., \"default\", \"eshop\").","type":"string"},"customer":{"description":"Customer information for the order.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Customer first name.","type":"string"},"lastName":{"description":"Customer last name.","type":"string"},"phone":{"description":"Customer phone number.","type":"string"},"companyName":{"description":"Company name for B2B orders.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","type":"string"},"taxIdentificationNumber":{"description":"Tax ID (DIČ).","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"description":"Country code (e.g., \"CZ\", \"SK\").","type":"string"}}},"billingAddress":{"description":"Optional billing address, when it differs from the customer address (which is then the delivery address). The invoice is issued to this address. First and last name default to the customer. Omit it when both addresses are the same. The address is also saved to the customer contact, without changing its primary address.","type":"object","properties":{"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["Václavské náměstí 1"],"type":"string"},"city":{"examples":["Praha"],"type":"string"},"cityPart":{"examples":["Nové Město"],"type":"string"},"stateRegion":{"examples":["Hlavní město Praha"],"type":"string"},"postalCode":{"examples":["110 00"],"type":"string"},"country":{"examples":["CZ"],"type":"string"}}},"items":{"description":"List of order items.","type":"array","items":{"description":"Order item.","type":"object","required":["label"],"properties":{"label":{"description":"Item label/name displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g., 21).","type":"number"},"count":{"description":"Quantity. Defaults to 1.","type":"number"},"sale":{"description":"Discount amount per item.","type":"number"},"unit":{"description":"Unit of measure (e.g., \"ks\", \"hod\").","type":"string"},"productCode":{"description":"Product code to link item to product.","type":"string"},"variantCode":{"description":"Product variant code.","type":"string"},"eventCode":{"description":"Calendar event code for event tickets.","type":"string"},"creditAmount":{"description":"Credit amount if item adds credit.","type":"number"}}}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"currency":{"description":"Currency code (e.g., \"CZK\", \"EUR\"). Defaults to organisation currency.","type":"string"},"sale":{"description":"Global discount amount for the entire order.","type":"number"},"paymentMethod":{"description":"Payment method: \"credits\" for credit balance, \"money\" for standard payment.","anyOf":[{"const":"credits","type":"string"},{"const":"money","type":"string"}]},"deliveryPrice":{"description":"Delivery/shipping price.","type":"number"},"paymentPrice":{"description":"Payment processing fee.","type":"number"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"},"publicNotice":{"description":"Public note visible to customer.","type":"string"},"tags":{"description":"Tags to attach to the order.","type":"object","patternProperties":{"^(.*)$":{}}},"ignoreNotification":{"description":"Skip sending order confirmation email. Defaults to true.","type":"boolean"},"startAsCart":{"description":"Create order as draft/cart (true) or as new order (false). Defaults to false.","type":"boolean"},"preventAutoPayment":{"description":"Prevent automatic marking as paid when order price is 0. Defaults to true.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","properties":{"orderGroupId":{"description":"Order group code (e.g., \"default\", \"eshop\").","type":"string"},"customer":{"description":"Customer information for the order.","type":"object","required":["email"],"properties":{"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"firstName":{"description":"Customer first name.","type":"string"},"lastName":{"description":"Customer last name.","type":"string"},"phone":{"description":"Customer phone number.","type":"string"},"companyName":{"description":"Company name for B2B orders.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","type":"string"},"taxIdentificationNumber":{"description":"Tax ID (DIČ).","type":"string"},"streetAddress":{"description":"Street address.","type":"string"},"city":{"description":"City.","type":"string"},"postalCode":{"description":"Postal/ZIP code.","type":"string"},"country":{"description":"Country code (e.g., \"CZ\", \"SK\").","type":"string"}}},"billingAddress":{"description":"Optional billing address, when it differs from the customer address (which is then the delivery address). The invoice is issued to this address. First and last name default to the customer. Omit it when both addresses are the same. The address is also saved to the customer contact, without changing its primary address.","type":"object","properties":{"firstName":{"examples":["Jan"],"type":"string"},"lastName":{"examples":["Barášek"],"type":"string"},"companyName":{"examples":["BizKitHub"],"type":"string"},"companyRegistrationNumber":{"examples":["05103118"],"type":"string"},"taxIdentificationNumber":{"examples":["CZ9609040727"],"type":"string"},"streetAddress":{"examples":["Václavské náměstí 1"],"type":"string"},"city":{"examples":["Praha"],"type":"string"},"cityPart":{"examples":["Nové Město"],"type":"string"},"stateRegion":{"examples":["Hlavní město Praha"],"type":"string"},"postalCode":{"examples":["110 00"],"type":"string"},"country":{"examples":["CZ"],"type":"string"}}},"items":{"description":"List of order items.","type":"array","items":{"description":"Order item.","type":"object","required":["label"],"properties":{"label":{"description":"Item label/name displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g., 21).","type":"number"},"count":{"description":"Quantity. Defaults to 1.","type":"number"},"sale":{"description":"Discount amount per item.","type":"number"},"unit":{"description":"Unit of measure (e.g., \"ks\", \"hod\").","type":"string"},"productCode":{"description":"Product code to link item to product.","type":"string"},"variantCode":{"description":"Product variant code.","type":"string"},"eventCode":{"description":"Calendar event code for event tickets.","type":"string"},"creditAmount":{"description":"Credit amount if item adds credit.","type":"number"}}}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"currency":{"description":"Currency code (e.g., \"CZK\", \"EUR\"). Defaults to organisation currency.","type":"string"},"sale":{"description":"Global discount amount for the entire order.","type":"number"},"paymentMethod":{"description":"Payment method: \"credits\" for credit balance, \"money\" for standard payment.","anyOf":[{"const":"credits","type":"string"},{"const":"money","type":"string"}]},"deliveryPrice":{"description":"Delivery/shipping price.","type":"number"},"paymentPrice":{"description":"Payment processing fee.","type":"number"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"},"publicNotice":{"description":"Public note visible to customer.","type":"string"},"tags":{"description":"Tags to attach to the order.","type":"object","patternProperties":{"^(.*)$":{}}},"ignoreNotification":{"description":"Skip sending order confirmation email. Defaults to true.","type":"boolean"},"startAsCart":{"description":"Create order as draft/cart (true) or as new order (false). Defaults to false.","type":"boolean"},"preventAutoPayment":{"description":"Prevent automatic marking as paid when order price is 0. Defaults to true.","type":"boolean"}}}}}}}},"/bff/order/detail":{"get":{"parameters":[{"description":"Unique order hash identifier.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"operationId":"getBffOrderDetail","tags":["Order"],"summary":"Get order detail","description":"Returns full order detail including items, customer info, pricing, tags, events, IP geolocation, and payment status.","responses":{"200":{}}}},"/bff/order/preview":{"get":{"parameters":[{"description":"Unique order hash identifier.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"operationId":"getBffOrderPreview","tags":["Order"],"summary":"Compact order preview for hover cards","description":"Lightweight version of `/detail` for use inside hover popovers on the order grid. Skips addresses, cost items, vouchers, the full event timeline; collapses items to at most 8 rows and reports the total via `itemCount`. Intended to be fetched lazily on first hover — the grid caches by hash.","responses":{"200":{}}}},"/bff/order/detail-recurrence":{"get":{"parameters":[{"description":"Unique order hash identifier.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"operationId":"getBffOrderDetail-recurrence","tags":["Order"],"summary":"Get order recurrence payments","description":"Returns a list of recurrence payment records associated with the order.","responses":{"200":{}}}},"/bff/order/detail-file":{"get":{"parameters":[{"description":"Unique order hash identifier.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"operationId":"getBffOrderDetail-file","tags":["Order"],"summary":"Get order files","description":"Returns invoices and attached files for the given order. Invoice rows carry additional metadata (invoiceExternalId, invoiceSequenceNumber, invoiceVoidedAt, invoiceReplacedBySequenceNumber) so the admin can render void badges + the reissue action without a second round-trip.","responses":{"200":{}}}},"/bff/order/detail-log":{"get":{"parameters":[{"description":"Unique order hash identifier.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true},{"description":"Page number (1-based).","examples":[1],"schema":{"type":"number"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (default 500).","examples":[500],"schema":{"type":"number"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","message","level","insertedDate"],"properties":{"id":{"description":"Log entry index within the current page.","type":"number"},"message":{"description":"Human-readable log message.","type":"string"},"level":{"description":"Log severity level (e.g. info, success, warning, error).","type":"string"},"insertedDate":{"description":"Timestamp when the log entry was created.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp when the log entry was created.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of log entries for this order.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","message","level","insertedDate"],"properties":{"id":{"description":"Log entry index within the current page.","type":"number"},"message":{"description":"Human-readable log message.","type":"string"},"level":{"description":"Log severity level (e.g. info, success, warning, error).","type":"string"},"insertedDate":{"description":"Timestamp when the log entry was created.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp when the log entry was created.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of log entries for this order.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","message","level","insertedDate"],"properties":{"id":{"description":"Log entry index within the current page.","type":"number"},"message":{"description":"Human-readable log message.","type":"string"},"level":{"description":"Log severity level (e.g. info, success, warning, error).","type":"string"},"insertedDate":{"description":"Timestamp when the log entry was created.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp when the log entry was created.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of log entries for this order.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffOrderDetail-log","tags":["Order"],"summary":"Get order log entries","description":"Returns a paginated list of log entries for the given order, sorted by newest first."}},"/bff/order/mark-as-paid":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderMark-as-paid","tags":["Order"],"summary":"Mark order as paid","description":"Manually marks the order as paid. Inserts a `manual_mark` receipt row for the unpaid remainder so the leakage audit (`SUM(price) WHERE kind=manual_mark`) stays accurate. Prefer `/bff/order-payment/record` from new UI — that supports combined payments and the explicit cash / bank_transfer / credit kinds.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"}}}}}}}},"/bff/order/mark-as-non-paid":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderMark-as-non-paid","tags":["Order"],"summary":"Mark order as non-paid","description":"Reverts the order payment status to unpaid and logs the action.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"}}}}}}}},"/bff/order/reissue-invoice":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"newInvoiceId":{"type":"number"},"newInvoiceExternalId":{"type":"string"},"newSequenceNumber":{"type":"string"},"oldInvoiceId":{"type":"number"},"oldInvoiceExternalId":{"type":"string"},"oldSequenceNumber":{"type":"string"},"supplierVatModeChanged":{"type":"boolean"}},"required":["success","newInvoiceId","newInvoiceExternalId","newSequenceNumber","oldInvoiceId","oldInvoiceExternalId","oldSequenceNumber","supplierVatModeChanged"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"newInvoiceId":{"type":"number"},"newInvoiceExternalId":{"type":"string"},"newSequenceNumber":{"type":"string"},"oldInvoiceId":{"type":"number"},"oldInvoiceExternalId":{"type":"string"},"oldSequenceNumber":{"type":"string"},"supplierVatModeChanged":{"type":"boolean"}},"required":["success","newInvoiceId","newInvoiceExternalId","newSequenceNumber","oldInvoiceId","oldInvoiceExternalId","oldSequenceNumber","supplierVatModeChanged"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"newInvoiceId":{"type":"number"},"newInvoiceExternalId":{"type":"string"},"newSequenceNumber":{"type":"string"},"oldInvoiceId":{"type":"number"},"oldInvoiceExternalId":{"type":"string"},"oldSequenceNumber":{"type":"string"},"supplierVatModeChanged":{"type":"boolean"}},"required":["success","newInvoiceId","newInvoiceExternalId","newSequenceNumber","oldInvoiceId","oldInvoiceExternalId","oldSequenceNumber","supplierVatModeChanged"]}}}}},"operationId":"postBffOrderReissue-invoice","tags":["Order"],"summary":"Reissue an invoice with a fresh VAT calculation","description":"Creates a replacement document with a new sequence number, marks the original as voided with a forward link (supersedes_invoice_id). Preserves the customer's original amount to the cent — only the VAT rate on items is recomputed from the current tax profile (which may have moved from PAYER to IDENTIFIED_PERSON since the original issue). Does not send any customer notification: this is a silent accounting-hygiene tool. Paid invoices inherit invoice_pay_date verbatim. Errors if the target invoice is already voided.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash","invoiceExternalId"],"properties":{"hash":{"description":"Order hash.","type":"string"},"invoiceExternalId":{"description":"16-char external id of the invoice to reissue.","type":"string"},"reason":{"description":"Short human-readable reason (max 32 chars, longer text is truncated). Stored on the old invoice as void_reason and mirrored to core__activity meta. Defaults to \"reissued\".","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash","invoiceExternalId"],"properties":{"hash":{"description":"Order hash.","type":"string"},"invoiceExternalId":{"description":"16-char external id of the invoice to reissue.","type":"string"},"reason":{"description":"Short human-readable reason (max 32 chars, longer text is truncated). Stored on the old invoice as void_reason and mirrored to core__activity meta. Defaults to \"reissued\".","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["hash","invoiceExternalId"],"properties":{"hash":{"description":"Order hash.","type":"string"},"invoiceExternalId":{"description":"16-char external id of the invoice to reissue.","type":"string"},"reason":{"description":"Short human-readable reason (max 32 chars, longer text is truncated). Stored on the old invoice as void_reason and mirrored to core__activity meta. Defaults to \"reissued\".","type":"string"}}}}}}}},"/bff/order/set-item-storno":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderSet-item-storno","tags":["Order"],"summary":"Toggle item storno","description":"Toggles the storno flag on an order item and recalculates the order price.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","itemId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"itemId":{"description":"External item ID to toggle storno on.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","itemId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"itemId":{"description":"External item ID to toggle storno on.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","itemId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"itemId":{"description":"External item ID to toggle storno on.","type":"string"}}}}}}}},"/bff/order/remove-item":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderRemove-item","tags":["Order"],"summary":"Remove order item","description":"Permanently deletes an item from the order and recalculates the order price.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","itemId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"itemId":{"description":"External item ID to remove.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","itemId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"itemId":{"description":"External item ID to remove.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","itemId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"itemId":{"description":"External item ID to remove.","type":"string"}}}}}}}},"/bff/order/set-discount":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"discountTotal":{"description":"Total discount on the affected lines incl. VAT.","type":"number"},"price":{"description":"Recomputed order price.","type":"number"},"hasStaleCodShipment":{"description":"A live shipment still carries the old cash-on-delivery amount.","type":"boolean"}},"required":["success","discountTotal","price","hasStaleCodShipment"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"discountTotal":{"description":"Total discount on the affected lines incl. VAT.","type":"number"},"price":{"description":"Recomputed order price.","type":"number"},"hasStaleCodShipment":{"description":"A live shipment still carries the old cash-on-delivery amount.","type":"boolean"}},"required":["success","discountTotal","price","hasStaleCodShipment"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"discountTotal":{"description":"Total discount on the affected lines incl. VAT.","type":"number"},"price":{"description":"Recomputed order price.","type":"number"},"hasStaleCodShipment":{"description":"A live shipment still carries the old cash-on-delivery amount.","type":"boolean"}},"required":["success","discountTotal","price","hasStaleCodShipment"]}}}}},"operationId":"postBffOrderSet-discount","tags":["Order"],"summary":"Set manual discount","description":"Sets a manual discount on an existing order (whole order or one line) by writing the per-unit `sale` of priced, non-storno lines (replacing their current discount) and recomputes the order price. Lines keep their own VAT rate. Existing shipment labels keep their cash-on-delivery amount; `hasStaleCodShipment` tells the caller to re-create the label.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","mode","value"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"mode":{"description":"`percent` = 0–100 % off every affected unit; `amount` = total discount incl. VAT split proportionally.","anyOf":[{"const":"percent","type":"string"},{"const":"amount","type":"string"}]},"value":{"minimum":0,"description":"Percentage (0–100) or amount incl. VAT. 0 removes the discount.","type":"number"},"itemId":{"description":"External item ID to discount only one line. Omit for the whole order.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","mode","value"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"mode":{"description":"`percent` = 0–100 % off every affected unit; `amount` = total discount incl. VAT split proportionally.","anyOf":[{"const":"percent","type":"string"},{"const":"amount","type":"string"}]},"value":{"minimum":0,"description":"Percentage (0–100) or amount incl. VAT. 0 removes the discount.","type":"number"},"itemId":{"description":"External item ID to discount only one line. Omit for the whole order.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","mode","value"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"mode":{"description":"`percent` = 0–100 % off every affected unit; `amount` = total discount incl. VAT split proportionally.","anyOf":[{"const":"percent","type":"string"},{"const":"amount","type":"string"}]},"value":{"minimum":0,"description":"Percentage (0–100) or amount incl. VAT. 0 removes the discount.","type":"number"},"itemId":{"description":"External item ID to discount only one line. Omit for the whole order.","type":"string"}}}}}}}},"/bff/order/create-payment":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"redirectUrl":{"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"redirectUrl":{"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"redirectUrl":{"type":"string"}},"required":["success"]}}}}},"operationId":"postBffOrderCreate-payment","tags":["Order"],"summary":"Create payment for order","description":"Initiates an online payment session for the order and returns a redirect URL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","provider"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"provider":{"description":"Payment provider code (e.g. \"stripe\", \"gopay\").","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","provider"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"provider":{"description":"Payment provider code (e.g. \"stripe\", \"gopay\").","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","provider"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"provider":{"description":"Payment provider code (e.g. \"stripe\", \"gopay\").","type":"string"}}}}}}}},"/bff/order/resend-notification":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderResend-notification","tags":["Order"],"summary":"Resend order notification","description":"Re-sends the status notification email for the order using the specified or current status template.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"statusCode":{"description":"Status code whose notification template to send. Defaults to current status.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"statusCode":{"description":"Status code whose notification template to send. Defaults to current status.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"statusCode":{"description":"Status code whose notification template to send. Defaults to current status.","type":"string"}}}}}}}},"/bff/order/update-ship-not-before":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"shipNotBefore":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isPending":{"type":"boolean"}},"required":["success","shipNotBefore","isPending"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"shipNotBefore":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isPending":{"type":"boolean"}},"required":["success","shipNotBefore","isPending"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"shipNotBefore":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isPending":{"type":"boolean"}},"required":["success","shipNotBefore","isPending"]}}}}},"operationId":"postBffOrderUpdate-ship-not-before","tags":["Order"],"summary":"Set or cancel postponed shipping","description":"Sets the day before which the order must not ship. While it is in the future the order stays out of the fulfillment queue; when it arrives the order returns to the queue and the organisation is notified.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","shipNotBefore"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"description":"Do not ship before this day (YYYY-MM-DD, Prague). null or \"\" cancels the postponement.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","shipNotBefore"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"description":"Do not ship before this day (YYYY-MM-DD, Prague). null or \"\" cancels the postponement.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","shipNotBefore"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"shipNotBefore":{"nullable":true,"anyOf":[{"description":"Do not ship before this day (YYYY-MM-DD, Prague). null or \"\" cancels the postponement.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/order/calendar-events":{"get":{"parameters":[{"description":"Unique order hash identifier.","schema":{"type":"string"},"in":"query","name":"orderHash","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["eventId","kind","calendarId","calendarName","calendarColor","title","startTime","endTime","isAllDay","isStorno","assignees"],"properties":{"eventId":{"description":"External event code.","type":"string"},"kind":{"description":"'expected' = Předpokládaný termín, 'installation' = montáž, 'event' = other scheduled event.","anyOf":[{"const":"event","type":"string"},{"const":"expected","type":"string"},{"const":"installation","type":"string"}]},"calendarId":{"description":"External calendar code.","type":"string"},"calendarName":{"type":"string"},"calendarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string"},"startTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"type":"boolean"},"isStorno":{"type":"boolean"},"assignees":{"description":"Names of member attendees.","type":"array","items":{"type":"string"}}}}},"installationMinutes":{"description":"Total minutes of non-cancelled installations (billing input).","type":"number"},"defaultCalendarId":{"description":"Planning calendar of the order's group, or null when the group has none.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","installationMinutes","defaultCalendarId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["eventId","kind","calendarId","calendarName","calendarColor","title","startTime","endTime","isAllDay","isStorno","assignees"],"properties":{"eventId":{"description":"External event code.","type":"string"},"kind":{"description":"'expected' = Předpokládaný termín, 'installation' = montáž, 'event' = other scheduled event.","anyOf":[{"const":"event","type":"string"},{"const":"expected","type":"string"},{"const":"installation","type":"string"}]},"calendarId":{"description":"External calendar code.","type":"string"},"calendarName":{"type":"string"},"calendarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string"},"startTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"type":"boolean"},"isStorno":{"type":"boolean"},"assignees":{"description":"Names of member attendees.","type":"array","items":{"type":"string"}}}}},"installationMinutes":{"description":"Total minutes of non-cancelled installations (billing input).","type":"number"},"defaultCalendarId":{"description":"Planning calendar of the order's group, or null when the group has none.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","installationMinutes","defaultCalendarId"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["eventId","kind","calendarId","calendarName","calendarColor","title","startTime","endTime","isAllDay","isStorno","assignees"],"properties":{"eventId":{"description":"External event code.","type":"string"},"kind":{"description":"'expected' = Předpokládaný termín, 'installation' = montáž, 'event' = other scheduled event.","anyOf":[{"const":"event","type":"string"},{"const":"expected","type":"string"},{"const":"installation","type":"string"}]},"calendarId":{"description":"External calendar code.","type":"string"},"calendarName":{"type":"string"},"calendarColor":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"type":"string"},"startTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"isAllDay":{"type":"boolean"},"isStorno":{"type":"boolean"},"assignees":{"description":"Names of member attendees.","type":"array","items":{"type":"string"}}}}},"installationMinutes":{"description":"Total minutes of non-cancelled installations (billing input).","type":"number"},"defaultCalendarId":{"description":"Planning calendar of the order's group, or null when the group has none.","anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","installationMinutes","defaultCalendarId"]}}}}},"operationId":"getBffOrderCalendar-events","tags":["Order"],"summary":"Calendar events of a work order","description":"Calendar events the order is scheduled in (BIZKIT-159), cancelled last."}},"/bff/order/schedule-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"eventId":{"type":"string"},"calendarId":{"type":"string"}},"required":["success","eventId","calendarId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"eventId":{"type":"string"},"calendarId":{"type":"string"}},"required":["success","eventId","calendarId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"eventId":{"type":"string"},"calendarId":{"type":"string"}},"required":["success","eventId","calendarId"]}}}},"422":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}}}},"operationId":"postBffOrderSchedule-add","tags":["Order"],"summary":"Plan an order date","description":"BIZKIT-171: creates a calendar event for the expected date or an installation visit and links it to the order. Only one active expected date per order. 422 with a message on invalid input.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","kind","date"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"kind":{"description":"'expected' = Předpokládaný termín (all-day), 'installation' = montáž (date + time from–to).","anyOf":[{"const":"expected","type":"string"},{"const":"installation","type":"string"}]},"calendarId":{"description":"Calendar code; defaults to the order group's planning calendar.","anyOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date in the calendar timezone (YYYY-MM-DD).","examples":["2026-12-10"],"type":"string"},"timeFrom":{"description":"HH:MM, installation only.","examples":["08:00"],"anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"HH:MM, installation only.","examples":["12:30"],"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"description":"Event title; defaults to \"#number customer\".","anyOf":[{"maxLength":250,"type":"string"},{"type":"null"}]},"note":{"description":"Event description.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","kind","date"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"kind":{"description":"'expected' = Předpokládaný termín (all-day), 'installation' = montáž (date + time from–to).","anyOf":[{"const":"expected","type":"string"},{"const":"installation","type":"string"}]},"calendarId":{"description":"Calendar code; defaults to the order group's planning calendar.","anyOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date in the calendar timezone (YYYY-MM-DD).","examples":["2026-12-10"],"type":"string"},"timeFrom":{"description":"HH:MM, installation only.","examples":["08:00"],"anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"HH:MM, installation only.","examples":["12:30"],"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"description":"Event title; defaults to \"#number customer\".","anyOf":[{"maxLength":250,"type":"string"},{"type":"null"}]},"note":{"description":"Event description.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","kind","date"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"kind":{"description":"'expected' = Předpokládaný termín (all-day), 'installation' = montáž (date + time from–to).","anyOf":[{"const":"expected","type":"string"},{"const":"installation","type":"string"}]},"calendarId":{"description":"Calendar code; defaults to the order group's planning calendar.","anyOf":[{"type":"string"},{"type":"null"}]},"date":{"description":"Date in the calendar timezone (YYYY-MM-DD).","examples":["2026-12-10"],"type":"string"},"timeFrom":{"description":"HH:MM, installation only.","examples":["08:00"],"anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"HH:MM, installation only.","examples":["12:30"],"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"description":"Event title; defaults to \"#number customer\".","anyOf":[{"maxLength":250,"type":"string"},{"type":"null"}]},"note":{"description":"Event description.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/order/schedule-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}},"422":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}}}},"operationId":"postBffOrderSchedule-update","tags":["Order"],"summary":"Move a planned order date","description":"BIZKIT-171: moves the expected date or an installation (same calendar).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","eventId","date"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventId":{"description":"External event code of the planned date.","type":"string"},"date":{"description":"Date in the calendar timezone (YYYY-MM-DD).","type":"string"},"timeFrom":{"description":"HH:MM, installation only.","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"HH:MM, installation only.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","eventId","date"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventId":{"description":"External event code of the planned date.","type":"string"},"date":{"description":"Date in the calendar timezone (YYYY-MM-DD).","type":"string"},"timeFrom":{"description":"HH:MM, installation only.","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"HH:MM, installation only.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","eventId","date"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventId":{"description":"External event code of the planned date.","type":"string"},"date":{"description":"Date in the calendar timezone (YYYY-MM-DD).","type":"string"},"timeFrom":{"description":"HH:MM, installation only.","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"HH:MM, installation only.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/order/schedule-cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}},"422":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":false,"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}}}},"operationId":"postBffOrderSchedule-cancel","tags":["Order"],"summary":"Cancel a planned order date","description":"BIZKIT-171: the event is cancelled (storno) and stays on the order as cancelled.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","eventId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventId":{"description":"External event code of the planned date.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","eventId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventId":{"description":"External event code of the planned date.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","eventId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventId":{"description":"External event code of the planned date.","type":"string"}}}}}}}},"/bff/order/update-notice":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderUpdate-notice","tags":["Order"],"summary":"Update order notices","description":"Updates the internal and public notice texts on the order.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","internalNotice","publicNotice"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"},"publicNotice":{"description":"Public note visible to the customer.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","internalNotice","publicNotice"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"},"publicNotice":{"description":"Public note visible to the customer.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","internalNotice","publicNotice"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"internalNotice":{"description":"Internal note visible only to staff.","type":"string"},"publicNotice":{"description":"Public note visible to the customer.","type":"string"}}}}}}}},"/bff/order/update-attributes":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"noOp":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"noOp":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"noOp":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderUpdate-attributes","tags":["Order"],"summary":"Update editable order attributes","description":"Patch endpoint for the admin's inline pencil-icon edits on order-detail. Every field is optional; send only what changed. `null` on a nullable field explicitly clears it (expirationDate, dueDate, taxableSupplyDate, estimatedHours). `locale` cannot be cleared because `locale_id` is NOT NULL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"expirationDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 date-time — new expiration.","type":"string"},{"description":"Clear the expiration date.","type":"null"}]},"dueDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 date-time — new payment due date.","type":"string"},{"description":"Clear the due date.","type":"null"}]},"taxableSupplyDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 — operator-set DUZP override. Invoices generated from this order will use this value instead of their own issue_date.","type":"string"},{"description":"Clear the DUZP override; invoices fall back to their own issue_date.","type":"null"}]},"locale":{"description":"Communication locale code (e.g. `cs`, `en`, `sk`). `locale_id` is NOT NULL, cannot be cleared.","type":"string"},"estimatedHours":{"anyOf":[{"minimum":0,"maximum":99999,"description":"Estimated work in hours (2 decimals).","examples":[4.5],"type":"number"},{"description":"Clear the estimate.","type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"expirationDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 date-time — new expiration.","type":"string"},{"description":"Clear the expiration date.","type":"null"}]},"dueDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 date-time — new payment due date.","type":"string"},{"description":"Clear the due date.","type":"null"}]},"taxableSupplyDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 — operator-set DUZP override. Invoices generated from this order will use this value instead of their own issue_date.","type":"string"},{"description":"Clear the DUZP override; invoices fall back to their own issue_date.","type":"null"}]},"locale":{"description":"Communication locale code (e.g. `cs`, `en`, `sk`). `locale_id` is NOT NULL, cannot be cleared.","type":"string"},"estimatedHours":{"anyOf":[{"minimum":0,"maximum":99999,"description":"Estimated work in hours (2 decimals).","examples":[4.5],"type":"number"},{"description":"Clear the estimate.","type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"expirationDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 date-time — new expiration.","type":"string"},{"description":"Clear the expiration date.","type":"null"}]},"dueDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 date-time — new payment due date.","type":"string"},{"description":"Clear the due date.","type":"null"}]},"taxableSupplyDate":{"anyOf":[{"format":"date-time","description":"ISO 8601 — operator-set DUZP override. Invoices generated from this order will use this value instead of their own issue_date.","type":"string"},{"description":"Clear the DUZP override; invoices fall back to their own issue_date.","type":"null"}]},"locale":{"description":"Communication locale code (e.g. `cs`, `en`, `sk`). `locale_id` is NOT NULL, cannot be cleared.","type":"string"},"estimatedHours":{"anyOf":[{"minimum":0,"maximum":99999,"description":"Estimated work in hours (2 decimals).","examples":[4.5],"type":"number"},{"description":"Clear the estimate.","type":"null"}]}}}}}}}},"/bff/order/linked-list":{"get":{"parameters":[{"description":"Unique order hash identifier.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"operationId":"getBffOrderLinked-list","tags":["Order"],"summary":"List linked orders","description":"The master/linked group of the order (BIZKIT-119): master first, then orders linked under it. Empty `items` when the order is standalone.","responses":{"200":{}}}},"/bff/order/set-master":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"boolean"}},"required":["success","changed"]}}}}},"operationId":"postBffOrderSet-master","tags":["Order"],"summary":"Link order under a master order","description":"Groups several orders into one job (BIZKIT-119). One level only: the master cannot itself be linked, and an order that already has linked orders cannot be attached under another one. Independent from offer versions (`parent`).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","masterOrderHash"],"properties":{"orderHash":{"description":"Order being linked.","type":"string"},"masterOrderHash":{"nullable":true,"anyOf":[{"description":"Hash of the master order. `null` unlinks the order from its master.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","masterOrderHash"],"properties":{"orderHash":{"description":"Order being linked.","type":"string"},"masterOrderHash":{"nullable":true,"anyOf":[{"description":"Hash of the master order. `null` unlinks the order from its master.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","masterOrderHash"],"properties":{"orderHash":{"description":"Order being linked.","type":"string"},"masterOrderHash":{"nullable":true,"anyOf":[{"description":"Hash of the master order. `null` unlinks the order from its master.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/order/add-product":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderAdd-product","tags":["Order"],"summary":"Add product to order","description":"Adds an existing product as a new line item to the order and recalculates the total price.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","productCode","label","price","vat","count"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"productCode":{"description":"Product code to link the item to.","type":"string"},"productVariantCode":{"description":"Product variant code.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"},"count":{"description":"Quantity to add.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","productCode","label","price","vat","count"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"productCode":{"description":"Product code to link the item to.","type":"string"},"productVariantCode":{"description":"Product variant code.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"},"count":{"description":"Quantity to add.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","productCode","label","price","vat","count"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"productCode":{"description":"Product code to link the item to.","type":"string"},"productVariantCode":{"description":"Product variant code.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"},"count":{"description":"Quantity to add.","type":"number"}}}}}}}},"/bff/order/add-virtual-product":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderAdd-virtual-product","tags":["Order"],"summary":"Add virtual product to order","description":"Adds a custom (virtual) line item not linked to any product and recalculates the total price.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","label","price","vat","count"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"},"count":{"description":"Quantity to add.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","label","price","vat","count"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"},"count":{"description":"Quantity to add.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","label","price","vat","count"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"},"count":{"description":"Quantity to add.","type":"number"}}}}}}}},"/bff/order/add-credit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderAdd-credit","tags":["Order"],"summary":"Add credit item to order","description":"Adds a credit-granting line item to the order and recalculates the total price.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","label","price","credit","vat"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"credit":{"description":"Credit amount to grant to the customer.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","label","price","credit","vat"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"credit":{"description":"Credit amount to grant to the customer.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","label","price","credit","vat"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"label":{"description":"Item label displayed on invoice.","type":"string"},"price":{"description":"Unit price including VAT.","type":"number"},"credit":{"description":"Credit amount to grant to the customer.","type":"number"},"vat":{"description":"VAT rate in percent (e.g. 21).","type":"number"}}}}}}}},"/bff/order/add-event":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderAdd-event","tags":["Order"],"summary":"Add event to order","description":"Adds a calendar event as a line item to the order and recalculates the total price.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","eventCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventCode":{"description":"Calendar event code to attach as an order item.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","eventCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventCode":{"description":"Calendar event code to attach as an order item.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","eventCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"eventCode":{"description":"Calendar event code to attach as an order item.","type":"string"}}}}}}}},"/bff/order/detail-recurrence-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderDetail-recurrence-delete","tags":["Order"],"summary":"Delete recurrence payment","description":"Removes a single recurrence payment record from the order.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","paymentId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"paymentId":{"description":"External recurrence payment ID to delete.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","paymentId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"paymentId":{"description":"External recurrence payment ID to delete.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","paymentId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"paymentId":{"description":"External recurrence payment ID to delete.","type":"string"}}}}}}}},"/bff/order/create-invoice":{"get":{"parameters":[{"description":"Unique order hash identifier.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true},{"description":"Invoice type (e.g. \"proforma\", \"invoice\", \"credit-note\").","examples":["invoice"],"schema":{"type":"string"},"in":"query","name":"type","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffOrderCreate-invoice","tags":["Order"],"summary":"Create invoice for order","description":"Generates an invoice document of the specified type for the order."}},"/bff/order/set-status":{"post":{"parameters":[],"operationId":"postBffOrderSet-status","tags":["Order"],"summary":"Set order status","description":"Manually changes the order status and sends the corresponding notification. When the order group has linked statuses, only those are accepted (422 with `allowedStatusCodes` otherwise); a group without links accepts any status.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","statusCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"statusCode":{"description":"Target status code to set on the order.","examples":["processing","done","storno"],"type":"string"},"notify":{"description":"Send the status notification to the customer (default true).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","statusCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"statusCode":{"description":"Target status code to set on the order.","examples":["processing","done","storno"],"type":"string"},"notify":{"description":"Send the status notification to the customer (default true).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","statusCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"statusCode":{"description":"Target status code to set on the order.","examples":["processing","done","storno"],"type":"string"},"notify":{"description":"Send the status notification to the customer (default true).","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/order/bulk-preview":{"post":{"parameters":[],"operationId":"postBffOrderBulk-preview","tags":["Order"],"summary":"Preview a bulk order action","description":"What a bulk action would do, without doing it: how many orders the selection stands for, how many would change, how many are skipped and why (already in the status, already paid, cancelled), and the side effects of the target status. Selections over 200 orders cannot run.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection","action"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"action":{"description":"The bulk action to preview.","anyOf":[{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"}]},"statusCode":{"description":"Target status code (set-status only).","examples":["done"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection","action"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"action":{"description":"The bulk action to preview.","anyOf":[{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"}]},"statusCode":{"description":"Target status code (set-status only).","examples":["done"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["selection","action"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"action":{"description":"The bulk action to preview.","anyOf":[{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"}]},"statusCode":{"description":"Target status code (set-status only).","examples":["done"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/order/bulk-job-create":{"post":{"parameters":[],"operationId":"postBffOrderBulk-job-create","tags":["Order"],"summary":"Start an order bulk action in the background","description":"Snapshots the selection (group permissions apply) and runs the action as a background job, with the same per-order rules as the synchronous endpoints. At most 1000 orders. Returns the job id; follow it at `/bff/bulk-job/detail`. The member gets a realtime `bulk.job` event when it ends.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection","kind"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"kind":{"description":"The bulk action.","anyOf":[{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"},{"const":"shipment-create","type":"string"}]},"statusCode":{"description":"Target status code (set-status only).","examples":["done"],"type":"string"},"notify":{"description":"set-status only: send the customer notification (default true).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection","kind"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"kind":{"description":"The bulk action.","anyOf":[{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"},{"const":"shipment-create","type":"string"}]},"statusCode":{"description":"Target status code (set-status only).","examples":["done"],"type":"string"},"notify":{"description":"set-status only: send the customer notification (default true).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["selection","kind"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"kind":{"description":"The bulk action.","anyOf":[{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"},{"const":"shipment-create","type":"string"}]},"statusCode":{"description":"Target status code (set-status only).","examples":["done"],"type":"string"},"notify":{"description":"set-status only: send the customer notification (default true).","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/order/bulk-set-status":{"post":{"parameters":[],"operationId":"postBffOrderBulk-set-status","tags":["Order"],"summary":"Set the status of several orders","description":"Runs the regular status workflow (documents, payment, notification) for each order. Orders already in the status and cancelled orders are skipped. At most 200 orders; a failing order does not stop the rest and comes back in `failed`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection","statusCode"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"statusCode":{"description":"Target status code.","examples":["processing","done"],"type":"string"},"notify":{"description":"Send the status notification to customers (default true).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection","statusCode"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"statusCode":{"description":"Target status code.","examples":["processing","done"],"type":"string"},"notify":{"description":"Send the status notification to customers (default true).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["selection","statusCode"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"statusCode":{"description":"Target status code.","examples":["processing","done"],"type":"string"},"notify":{"description":"Send the status notification to customers (default true).","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/order/bulk-mark-paid":{"post":{"parameters":[],"operationId":"postBffOrderBulk-mark-paid","tags":["Order"],"summary":"Mark several orders as paid","description":"Records the unpaid remainder of each order as a `manual_mark` receipt, same as the single-order action. Paid and cancelled orders are skipped. At most 200 orders.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"text/plain":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"responses":{"200":{}}}},"/bff/order/bulk-shipment-preview":{"post":{"parameters":[],"operationId":"postBffOrderBulk-shipment-preview","tags":["Order"],"summary":"Preview shipments and labels for several orders","description":"How many orders of the selection get a new shipment, how many already have one (their label is reused) and how many are cancelled (skipped). Selections over 100 orders cannot run.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"text/plain":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"responses":{"200":{}}}},"/bff/order/bulk-shipment-create":{"post":{"parameters":[],"operationId":"postBffOrderBulk-shipment-create","tags":["Order"],"summary":"Create the missing shipments of several orders","description":"Same defaults as the fulfillment station: carrier account, service, pickup point and weight from the shipping method, cash-on-delivery amount. Orders with an active shipment count as `existing`, cancelled orders are skipped. At most 100 orders; a failing order does not stop the rest and comes back in `failed` with the reason.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"text/plain":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"responses":{"200":{}}}},"/bff/order/bulk-labels":{"post":{"parameters":[],"operationId":"postBffOrderBulk-labels","tags":["Order"],"summary":"Download the shipment labels of several orders as one PDF","description":"Labels of every active shipment in the selection, in the order of the list and in the requested layout. Orders whose label is in the PDF are marked as label printed. Returns JSON with the reasons when no label could be produced.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"layout":{"description":"`original` = the carrier PDFs as they are (default), `a4-2x2` = four labels on a landscape A4 sticker sheet, `a6` = one label per A6 page (thermal printers).","anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"description":"First free cell of the A4 sheet (1 top left … 4 bottom right).","type":"number"},"onlyNotPrinted":{"description":"Leave out orders whose label was already downloaded for printing.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"layout":{"description":"`original` = the carrier PDFs as they are (default), `a4-2x2` = four labels on a landscape A4 sticker sheet, `a6` = one label per A6 page (thermal printers).","anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"description":"First free cell of the A4 sheet (1 top left … 4 bottom right).","type":"number"},"onlyNotPrinted":{"description":"Leave out orders whose label was already downloaded for printing.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["selection"],"properties":{"selection":{"description":"Which orders: picked rows, or every order matching the list filter. Group permissions apply.","type":"object","properties":{"hashes":{"maxItems":1000,"description":"Picked orders (order hashes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every order matching these `/order/list` query params. Used only when `hashes` is absent.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"layout":{"description":"`original` = the carrier PDFs as they are (default), `a4-2x2` = four labels on a landscape A4 sticker sheet, `a6` = one label per A6 page (thermal printers).","anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"description":"First free cell of the A4 sheet (1 top left … 4 bottom right).","type":"number"},"onlyNotPrinted":{"description":"Leave out orders whose label was already downloaded for printing.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/order/set-group":{"post":{"parameters":[],"operationId":"postBffOrderSet-group","tags":["Order"],"summary":"Move order to another group","description":"Moves an existing order into another active order group. When the target group has linked statuses, the resulting status must be one of them; otherwise 422 with `allowedStatusCodes`. Writes the order log. Issued documents are unchanged; the target group's invoice prefix and issuer apply to documents issued after the move.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","groupCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"groupCode":{"minLength":1,"description":"Code of the target (active) order group.","examples":["montaz"],"type":"string"},"statusCode":{"description":"Optional status to switch to together with the move. Required when the current status is not linked to the target group.","examples":["nabidka-prijata"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","groupCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"groupCode":{"minLength":1,"description":"Code of the target (active) order group.","examples":["montaz"],"type":"string"},"statusCode":{"description":"Optional status to switch to together with the move. Required when the current status is not linked to the target group.","examples":["nabidka-prijata"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","groupCode"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"groupCode":{"minLength":1,"description":"Code of the target (active) order group.","examples":["montaz"],"type":"string"},"statusCode":{"description":"Optional status to switch to together with the move. Required when the current status is not linked to the target group.","examples":["nabidka-prijata"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/order/set-tags":{"post":{"parameters":[],"operationId":"postBffOrderSet-tags","tags":["Order"],"summary":"Replace order tags","description":"Replaces the whole key:value tag set of an existing order and writes the order log.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","tags"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"tags":{"description":"Full replacement key → value tag map. Empty object removes all tags. Keys are normalised to snake_case.","examples":[{"typ":"montaz","channel":"web"}],"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","tags"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"tags":{"description":"Full replacement key → value tag map. Empty object removes all tags. Keys are normalised to snake_case.","examples":[{"typ":"montaz","channel":"web"}],"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","tags"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"tags":{"description":"Full replacement key → value tag map. Empty object removes all tags. Keys are normalised to snake_case.","examples":[{"typ":"montaz","channel":"web"}],"type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"responses":{"200":{}}}},"/bff/order/statistics":{"get":{"parameters":[{"description":"Filter statistics by order group code.","examples":["eshop"],"schema":{"type":"string"},"in":"query","name":"groupCode","required":false}],"operationId":"getBffOrderStatistics","tags":["Order"],"summary":"Get order statistics","description":"Returns aggregated order statistics, optionally filtered by order group.","responses":{"200":{}}}},"/bff/order/link-blob":{"get":{"parameters":[{"description":"Unique order hash identifier.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true},{"description":"Token of the blob (file) to attach.","schema":{"type":"string"},"in":"query","name":"blobToken","required":true},{"description":"Optional label for the attached file.","schema":{"type":"string"},"in":"query","name":"label","required":false}],"operationId":"getBffOrderLink-blob","tags":["Order"],"summary":"Link blob to order","description":"Attaches an uploaded file (blob) to the order. Skips if already linked.","responses":{"200":{}}}},"/bff/order/grid-configuration":{"get":{"parameters":[{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"operationId":"getBffOrderGrid-configuration","tags":["Order"],"summary":"Get order grid configuration","description":"Returns column definitions, filter options, and status list for the order data grid.","responses":{"200":{}}}},"/bff/order/create-recurrence-payment":{"post":{"operationId":"postBffOrderCreate-recurrence-payment","tags":["Order"],"summary":"Create recurrence payment schedule","description":"Creates a recurring payment schedule for the order based on the provided cycle, period, and strategy.","responses":{"200":{}}}},"/bff/order/detail-recurrence-edit":{"post":{"operationId":"postBffOrderDetail-recurrence-edit","tags":["Order"],"summary":"Edit recurrence payment amount","description":"Updates the amount of a single recurrence payment record.","responses":{"200":{}}}},"/bff/order/set-assignee":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"contactId":{"type":"number"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"contactId":{"type":"number"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"contactId":{"type":"number"}},"required":["success"]}}}}},"operationId":"postBffOrderSet-assignee","tags":["Order"],"summary":"Set / change / clear the manual-handling assignee of an order","description":"Nominates a contact to handle this order manually. Resolves the target by `cuRefNo` (customer reference number) or `email` — invalid input is silently ignored. Send `cuRefNo: null` AND `email: null` to clear the assignee.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"anyOf":[{"description":"16-char customer reference number.","type":"string"},{"type":"null"}]},"email":{"anyOf":[{"description":"Contact e-mail (existing or new — new e-mails auto-create a contact).","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"anyOf":[{"description":"16-char customer reference number.","type":"string"},{"type":"null"}]},"email":{"anyOf":[{"description":"Contact e-mail (existing or new — new e-mails auto-create a contact).","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"anyOf":[{"description":"16-char customer reference number.","type":"string"},{"type":"null"}]},"email":{"anyOf":[{"description":"Contact e-mail (existing or new — new e-mails auto-create a contact).","type":"string"},{"type":"null"}]}}}}}}}},"/bff/order/add-customer":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyLinked":{"type":"boolean"},"contactId":{"type":"number"},"primaryCustomer":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyLinked":{"type":"boolean"},"contactId":{"type":"number"},"primaryCustomer":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"alreadyLinked":{"type":"boolean"},"contactId":{"type":"number"},"primaryCustomer":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrderAdd-customer","tags":["Order"],"summary":"Attach a contact to an order as a customer","description":"Adds a row to `shop__order_customer` linking the contact to the order. Resolves the target by `cuRefNo` (preferred) or `email` (auto-creates a contact if none matches). Refuses to link the org's anonymous fallback contact. Idempotent — already-linked contacts return `alreadyLinked: true`. When the order previously had no linked customers, the new row becomes primary and `shop__order.customer_id` is updated to match.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"description":"16-char customer reference number.","type":"string"},"email":{"description":"Contact e-mail (existing or new — new e-mails auto-create a contact).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"description":"16-char customer reference number.","type":"string"},"email":{"description":"Contact e-mail (existing or new — new e-mails auto-create a contact).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["hash"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"description":"16-char customer reference number.","type":"string"},"email":{"description":"Contact e-mail (existing or new — new e-mails auto-create a contact).","type":"string"}}}}}}}},"/bff/order/remove-customer":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"promotedContactId":{"type":"number"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"promotedContactId":{"type":"number"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"promotedContactId":{"type":"number"}},"required":["success"]}}}}},"operationId":"postBffOrderRemove-customer","tags":["Order"],"summary":"Detach a contact from an order","description":"Removes the `shop__order_customer` row for the given contact + order. Refuses to remove the LAST linked contact — operator must add a replacement first. When the removed contact was the primary, the earliest-added remaining contact is auto-promoted and `shop__order.customer_id` is updated to match.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash","cuRefNo"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"description":"16-char customer reference number to detach.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash","cuRefNo"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"description":"16-char customer reference number to detach.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["hash","cuRefNo"],"properties":{"hash":{"description":"Unique order hash identifier.","type":"string"},"cuRefNo":{"description":"16-char customer reference number to detach.","type":"string"}}}}}}}},"/bff/order/change-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"strategy":{"anyOf":[{"const":"renamed","type":"string"},{"const":"merged","type":"string"},{"const":"moved","type":"string"},{"const":"unchanged","type":"string"}]},"oldEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"newEmail":{"type":"string"},"contactId":{"description":"External ID of the contact the order now belongs to.","type":"string"},"createdContact":{"type":"boolean"},"resent":{"type":"array","items":{"type":"object","required":["kind","label","sent"],"properties":{"kind":{"anyOf":[{"const":"order-status","type":"string"},{"const":"calendar-event-ping","type":"string"}]},"label":{"type":"string"},"sent":{"type":"boolean"},"reason":{"type":"string"}}}}},"required":["success","strategy","oldEmail","newEmail","contactId","createdContact","resent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"strategy":{"anyOf":[{"const":"renamed","type":"string"},{"const":"merged","type":"string"},{"const":"moved","type":"string"},{"const":"unchanged","type":"string"}]},"oldEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"newEmail":{"type":"string"},"contactId":{"description":"External ID of the contact the order now belongs to.","type":"string"},"createdContact":{"type":"boolean"},"resent":{"type":"array","items":{"type":"object","required":["kind","label","sent"],"properties":{"kind":{"anyOf":[{"const":"order-status","type":"string"},{"const":"calendar-event-ping","type":"string"}]},"label":{"type":"string"},"sent":{"type":"boolean"},"reason":{"type":"string"}}}}},"required":["success","strategy","oldEmail","newEmail","contactId","createdContact","resent"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"strategy":{"anyOf":[{"const":"renamed","type":"string"},{"const":"merged","type":"string"},{"const":"moved","type":"string"},{"const":"unchanged","type":"string"}]},"oldEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"newEmail":{"type":"string"},"contactId":{"description":"External ID of the contact the order now belongs to.","type":"string"},"createdContact":{"type":"boolean"},"resent":{"type":"array","items":{"type":"object","required":["kind","label","sent"],"properties":{"kind":{"anyOf":[{"const":"order-status","type":"string"},{"const":"calendar-event-ping","type":"string"}]},"label":{"type":"string"},"sent":{"type":"boolean"},"reason":{"type":"string"}}}}},"required":["success","strategy","oldEmail","newEmail","contactId","createdContact","resent"]}}}}},"operationId":"postBffOrderChange-email","tags":["Order"],"summary":"Correct the customer e-mail of an order","description":"One-step fix for a mistyped customer e-mail. If the order contact exists only because of this order, its e-mail is rewritten (or it is merged into an existing contact that already uses the new address). Otherwise the contact is left untouched and the order moves to the contact of the new address (created when missing). Calendar attendees of events booked by the order follow the order. Address-bound suspicious flags are cleared. Then every status notification the order went through and every access e-mail (calendar-event-ping) that already fired is re-sent in the original order. Everything is written to the order history.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","email"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"email":{"description":"Corrected customer e-mail (normalized server-side, common domain typos fixed).","type":"string"},"resend":{"description":"Re-send the e-mails the order already produced to the new address. Defaults to true when the address changed; pass true to re-send even when it did not.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","email"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"email":{"description":"Corrected customer e-mail (normalized server-side, common domain typos fixed).","type":"string"},"resend":{"description":"Re-send the e-mails the order already produced to the new address. Defaults to true when the address changed; pass true to re-send even when it did not.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","email"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"email":{"description":"Corrected customer e-mail (normalized server-side, common domain typos fixed).","type":"string"},"resend":{"description":"Re-send the e-mails the order already produced to the new address. Defaults to true when the address changed; pass true to re-send even when it did not.","type":"boolean"}}}}}}}},"/bff/order/document-list":{"get":{"parameters":[{"description":"Unique order hash identifier.","schema":{"type":"string"},"in":"query","name":"hash","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","type","status","total","currency","issueDate","dueDate","taxableSupplyDate","paidDate","insertedDate","publicNotice","voidedAt","voidReason","isLocked","parent","supersedesSequenceNumber","replacedBySequenceNumber","file","delivery"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxableSupplyDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"publicNotice":{"anyOf":[{"type":"string"},{"type":"null"}]},"voidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"voidReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"isLocked":{"type":"boolean"},"parent":{"anyOf":[{"type":"object","required":["id","sequenceNumber","type"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"}}},{"type":"null"}]},"supersedesSequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"replacedBySequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"file":{"anyOf":[{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}},{"type":"null"}]},"delivery":{"anyOf":[{"type":"object","required":["count","lastSentAt","lastQueuedAt","openedAt"],"properties":{"count":{"type":"number"},"lastSentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastQueuedAt":{"type":"string"},"openedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"credited":{"type":"array","items":{"type":"object","required":["orderItemId","quantity","amount"],"properties":{"orderItemId":{"type":"number"},"quantity":{"type":"number"},"amount":{"type":"number"}}}}},"required":["items","credited"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","type","status","total","currency","issueDate","dueDate","taxableSupplyDate","paidDate","insertedDate","publicNotice","voidedAt","voidReason","isLocked","parent","supersedesSequenceNumber","replacedBySequenceNumber","file","delivery"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxableSupplyDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"publicNotice":{"anyOf":[{"type":"string"},{"type":"null"}]},"voidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"voidReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"isLocked":{"type":"boolean"},"parent":{"anyOf":[{"type":"object","required":["id","sequenceNumber","type"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"}}},{"type":"null"}]},"supersedesSequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"replacedBySequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"file":{"anyOf":[{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}},{"type":"null"}]},"delivery":{"anyOf":[{"type":"object","required":["count","lastSentAt","lastQueuedAt","openedAt"],"properties":{"count":{"type":"number"},"lastSentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastQueuedAt":{"type":"string"},"openedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"credited":{"type":"array","items":{"type":"object","required":["orderItemId","quantity","amount"],"properties":{"orderItemId":{"type":"number"},"quantity":{"type":"number"},"amount":{"type":"number"}}}}},"required":["items","credited"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","type","status","total","currency","issueDate","dueDate","taxableSupplyDate","paidDate","insertedDate","publicNotice","voidedAt","voidReason","isLocked","parent","supersedesSequenceNumber","replacedBySequenceNumber","file","delivery"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"total":{"type":"number"},"currency":{"type":"string"},"issueDate":{"type":"string"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxableSupplyDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"publicNotice":{"anyOf":[{"type":"string"},{"type":"null"}]},"voidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"voidReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"isLocked":{"type":"boolean"},"parent":{"anyOf":[{"type":"object","required":["id","sequenceNumber","type"],"properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"type":{"type":"string"}}},{"type":"null"}]},"supersedesSequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"replacedBySequenceNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"file":{"anyOf":[{"type":"object","required":["token","filename","size","downloadUrl"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"downloadUrl":{"type":"string"}}},{"type":"null"}]},"delivery":{"anyOf":[{"type":"object","required":["count","lastSentAt","lastQueuedAt","openedAt"],"properties":{"count":{"type":"number"},"lastSentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastQueuedAt":{"type":"string"},"openedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"credited":{"type":"array","items":{"type":"object","required":["orderItemId","quantity","amount"],"properties":{"orderItemId":{"type":"number"},"quantity":{"type":"number"},"amount":{"type":"number"}}}}},"required":["items","credited"]}}}}},"operationId":"getBffOrderDocument-list","tags":["Order"],"summary":"Order documents","description":"Every document issued for the order (newest first) with PDF file, parent link, void / supersede chain and e-mail delivery, plus the already-credited quantity / amount per order line."}},"/bff/order/document-issue":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"created","type":"string"},{"const":"exists","type":"string"}]},"id":{"type":"string"},"sequenceNumber":{"type":"string"}},"required":["state","id","sequenceNumber"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"created","type":"string"},{"const":"exists","type":"string"}]},"id":{"type":"string"},"sequenceNumber":{"type":"string"}},"required":["state","id","sequenceNumber"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"created","type":"string"},{"const":"exists","type":"string"}]},"id":{"type":"string"},"sequenceNumber":{"type":"string"}},"required":["state","id","sequenceNumber"]}}}}},"operationId":"postBffOrderDocument-issue","tags":["Order"],"summary":"Issue an order document by hand","description":"Issues an invoice / proforma / receipt / tax document / final invoice for the order (zero-value guard bypassed). One document per type: when it already exists, `state: \"exists\"` returns it instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","type"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"type":{"description":"Document type to issue.","anyOf":[{"const":"invoice","type":"string"},{"const":"proforma","type":"string"},{"const":"receipt","type":"string"},{"const":"taxDocument","type":"string"},{"const":"finalInvoice","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","type"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"type":{"description":"Document type to issue.","anyOf":[{"const":"invoice","type":"string"},{"const":"proforma","type":"string"},{"const":"receipt","type":"string"},{"const":"taxDocument","type":"string"},{"const":"finalInvoice","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","type"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"type":{"description":"Document type to issue.","anyOf":[{"const":"invoice","type":"string"},{"const":"proforma","type":"string"},{"const":"receipt","type":"string"},{"const":"taxDocument","type":"string"},{"const":"finalInvoice","type":"string"}]}}}}}}}},"/bff/order/document-credit-note":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"total":{"type":"number"}},"required":["id","sequenceNumber","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"total":{"type":"number"}},"required":["id","sequenceNumber","total"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"sequenceNumber":{"type":"string"},"total":{"type":"number"}},"required":["id","sequenceNumber","total"]}}}}},"operationId":"postBffOrderDocument-credit-note","tags":["Order"],"summary":"Issue a manual credit note","description":"Credit note (dobropis) for selected order lines, full or partial quantity / amount, attached to a tax document of the order. Document only: order lines and payments are not changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","lines"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"parentId":{"description":"External id of the tax document to correct. Default: best match.","type":"string"},"lines":{"minItems":1,"type":"array","items":{"type":"object","required":["orderItemId","quantity","unitPrice"],"properties":{"orderItemId":{"description":"Order line id.","type":"number"},"quantity":{"description":"Units to credit.","type":"number"},"unitPrice":{"description":"Amount per unit incl. VAT to credit.","type":"number"}}}},"reason":{"description":"Reason printed on the credit note.","maxLength":1000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","lines"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"parentId":{"description":"External id of the tax document to correct. Default: best match.","type":"string"},"lines":{"minItems":1,"type":"array","items":{"type":"object","required":["orderItemId","quantity","unitPrice"],"properties":{"orderItemId":{"description":"Order line id.","type":"number"},"quantity":{"description":"Units to credit.","type":"number"},"unitPrice":{"description":"Amount per unit incl. VAT to credit.","type":"number"}}}},"reason":{"description":"Reason printed on the credit note.","maxLength":1000,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","lines"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"parentId":{"description":"External id of the tax document to correct. Default: best match.","type":"string"},"lines":{"minItems":1,"type":"array","items":{"type":"object","required":["orderItemId","quantity","unitPrice"],"properties":{"orderItemId":{"description":"Order line id.","type":"number"},"quantity":{"description":"Units to credit.","type":"number"},"unitPrice":{"description":"Amount per unit incl. VAT to credit.","type":"number"}}}},"reason":{"description":"Reason printed on the credit note.","maxLength":1000,"type":"string"}}}}}}}},"/bff/order/document-send":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"email":{"type":"string"},"queued":{"type":"boolean"}},"required":["success","email","queued"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"email":{"type":"string"},"queued":{"type":"boolean"}},"required":["success","email","queued"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"email":{"type":"string"},"queued":{"type":"boolean"}},"required":["success","email","queued"]}}}}},"operationId":"postBffOrderDocument-send","tags":["Order"],"summary":"Send an order document to the customer","description":"E-mails the document PDF (document-send template) to the order customer or a chosen contact. Renders the PDF first when it is missing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","documentId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"documentId":{"description":"External id of the document (shop__invoice.external_id).","type":"string"},"contactId":{"description":"External contact id of the recipient. Default: the order customer.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","documentId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"documentId":{"description":"External id of the document (shop__invoice.external_id).","type":"string"},"contactId":{"description":"External contact id of the recipient. Default: the order customer.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","documentId"],"properties":{"orderHash":{"description":"Unique order hash identifier.","type":"string"},"documentId":{"description":"External id of the document (shop__invoice.external_id).","type":"string"},"contactId":{"description":"External contact id of the recipient. Default: the order customer.","type":"string"}}}}}}}},"/bff/order-payment/list":{"get":{"parameters":[{"description":"Unique order hash.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"hash","required":true}],"operationId":"getBffOrder-paymentList","tags":["Order Payment"],"summary":"List order payment receipts","description":"Unified payment-receipt timeline for an order: gateway attempts, bank wires, customer-credit applications and admin-recorded cash / manual_mark / refund rows — all sources joined into one chronological list. `summary` exposes the totals used by the order paid-state engine.","responses":{"200":{}}}},"/bff/order-payment/record":{"post":{"parameters":[],"operationId":"postBffOrder-paymentRecord","tags":["Order Payment"],"summary":"Record order payment(s)","description":"Records one or more payment-receipt rows against the order. Supports combined payments (e.g. 1500 cash + 500 manual_mark in one call). If the cumulative receipt log now covers the order price, the order is flipped to paid via the standard workflow hooks. The acting admin's contact id is captured as `recorded_by_contact_id` on every inserted row.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["hash","entries"],"properties":{"hash":{"description":"Unique order hash.","examples":["a1b2c3d4"],"type":"string"},"entries":{"minItems":1,"description":"One or more receipt rows. Multiple = combined payment in one call.","type":"array","items":{"type":"object","required":["kindCode","price"],"properties":{"kindCode":{"description":"Payment kind code (FK to shop__order_payment_kind.code).","anyOf":[{"const":"gateway","type":"string"},{"const":"bank_transfer","type":"string"},{"const":"cash","type":"string"},{"const":"manual_mark","type":"string"},{"const":"credit","type":"string"},{"const":"voucher_redeem","type":"string"},{"const":"refund","type":"string"}]},"price":{"description":"Positive amount in the order currency.","minimum":0.0001,"type":"number"},"status":{"description":"Override status; otherwise per-kind default.","type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"note":{"type":"string"},"branchId":{"description":"Branch (cash register) where the receipt was taken.","type":"number"},"currencyId":{"type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["hash","entries"],"properties":{"hash":{"description":"Unique order hash.","examples":["a1b2c3d4"],"type":"string"},"entries":{"minItems":1,"description":"One or more receipt rows. Multiple = combined payment in one call.","type":"array","items":{"type":"object","required":["kindCode","price"],"properties":{"kindCode":{"description":"Payment kind code (FK to shop__order_payment_kind.code).","anyOf":[{"const":"gateway","type":"string"},{"const":"bank_transfer","type":"string"},{"const":"cash","type":"string"},{"const":"manual_mark","type":"string"},{"const":"credit","type":"string"},{"const":"voucher_redeem","type":"string"},{"const":"refund","type":"string"}]},"price":{"description":"Positive amount in the order currency.","minimum":0.0001,"type":"number"},"status":{"description":"Override status; otherwise per-kind default.","type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"note":{"type":"string"},"branchId":{"description":"Branch (cash register) where the receipt was taken.","type":"number"},"currencyId":{"type":"number"}}}}}}},"text/plain":{"schema":{"type":"object","required":["hash","entries"],"properties":{"hash":{"description":"Unique order hash.","examples":["a1b2c3d4"],"type":"string"},"entries":{"minItems":1,"description":"One or more receipt rows. Multiple = combined payment in one call.","type":"array","items":{"type":"object","required":["kindCode","price"],"properties":{"kindCode":{"description":"Payment kind code (FK to shop__order_payment_kind.code).","anyOf":[{"const":"gateway","type":"string"},{"const":"bank_transfer","type":"string"},{"const":"cash","type":"string"},{"const":"manual_mark","type":"string"},{"const":"credit","type":"string"},{"const":"voucher_redeem","type":"string"},{"const":"refund","type":"string"}]},"price":{"description":"Positive amount in the order currency.","minimum":0.0001,"type":"number"},"status":{"description":"Override status; otherwise per-kind default.","type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"note":{"type":"string"},"branchId":{"description":"Branch (cash register) where the receipt was taken.","type":"number"},"currencyId":{"type":"number"}}}}}}}}},"responses":{"200":{}}}},"/bff/organisation/profile":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Organisation display name. Used as the sender name in all outgoing emails (transactional, marketing, newsletters), shown on invoices as the supplier name, displayed in admin panels and organisation switcher. Must be unique across all organisations.","type":"string"},"slug":{"description":"URL-safe unique identifier. Used in public URLs (e.g. /[slug]/...), newsletter unsubscribe links, Firmy.cz feed paths, and terminal commands for org switching. Read-only — set at creation from the org name.","type":"string"},"storageSlug":{"description":"CDN storage path prefix. All uploaded files (images, documents) are stored under this slug at the storage CDN (e.g. https://storage.xhp.cz/{storageSlug}/...). Read-only — set at creation, same as slug.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Organisation about text / profile description. Shown in admin organisation lists. Optional free-form text for internal reference.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"description":"Visual emoji icon for the organisation. Displayed next to the org name in account details, org switcher, and terminal output. If not set manually, the system auto-generates one using AI based on the org configuration.","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"description":"Czech company registration number (IČO). Printed on invoices and receipts as \"IČO: {value}\". Used for ARES address lookup, Firmy.cz feed integration, and invoice export data for accounting.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"description":"Tax identification number (DIČ). Printed on invoices and receipts as \"DIČ: {value}\". Used for address lookup validation and included in invoice exports for accounting software.","type":"string"},{"type":"null"}]},"vatPayer":{"description":"Whether the organisation is a VAT payer. When true, invoices include VAT rates (21%, 12%, 0%) on line items. When false, all invoice items use 0% VAT. Also triggers unreliable VAT payer fraud checks against the Czech Ministry of Finance list.","type":"boolean"},"country":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"Internal country ID. Use this value as countryId in update-profile.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 country code of the organisation's primary HQ. Drives per-country security posture (firewall rules, geo-risk scoring in login) and default UX. Populated at org creation from the country picker (pre-filled by GeoIP), user-editable in /settings/company.","examples":["CZ"],"type":"string"},"name":{"description":"Localized country name (English).","type":"string"}}},{"type":"null"}]},"accountingCountry":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"Internal country ID. Use this value as accountingCountryId in update-profile.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 country code. Defines accounting / tax jurisdiction (used for VAT rules, ARES vs RPO lookup, legal form picker scoping).","examples":["CZ"],"type":"string"},"name":{"description":"Localized country name (English).","type":"string"}}},{"type":"null"}]},"legalForm":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","slug","name"],"properties":{"id":{"description":"Internal legal form ID. Use this value as legalFormId in update-profile.","type":"number"},"code":{"description":"Country-specific legal form code (e.g. ARES \"pravniForma\" 112 = s.r.o. in CZ).","examples":["112"],"type":"string"},"slug":{"description":"Cross-country slug (osvc, sro, as, vos, ks, druzstvo, po, fo_podnikatel, neziskovka...).","examples":["sro"],"type":"string"},"name":{"description":"Localized human-readable legal form name.","examples":["Společnost s ručením omezeným (s.r.o.)"],"type":"string"}}},{"type":"null"}]},"timezone":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"description":"Internal timezone ID. Use this value when setting timezoneId in update-profile.","type":"number"},"timezone":{"description":"IANA timezone identifier. Used to format dates in email notifications and calendar events.","examples":["Europe/Prague"],"type":"string"},"gmt":{"description":"GMT offset string for display purposes.","examples":["+01:00"],"type":"string"},"label":{"description":"Human-readable timezone label for picker display.","examples":["Central European Time - Prague"],"type":"string"}}},"primaryLocale":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Internal locale ID. Use this value when setting primaryLocaleId in update-profile.","type":"number"},"locale":{"description":"ISO 639-1 locale code. Determines default language for contacts, emails, and content selection.","examples":["cs"],"type":"string"}}},"defaultCurrency":{"description":"Default currency ISO 4217 code (e.g. \"CZK\"). Used for pricing of products and orders. Changing this value is a sensitive operation — update requests that attempt to change it are rejected and logged as a warning; contact BizKitHub technical support to change the organisation default currency.","examples":["CZK"],"type":"string"},"supportPerson":{"nullable":true,"anyOf":[{"type":"object","required":["id","fullName"],"properties":{"id":{"description":"Internal member ID of the support person (from GET /organisation/members).","type":"number"},"fullName":{"description":"Full name of the designated support contact for this organisation.","type":"string"}}},{"type":"null"}]},"vendor":{"nullable":true,"anyOf":[{"description":"Vendor (parent) organisation that resells / technically manages this org. Returned only when (a) parent_id is set AND (b) the parent holds an active white-label licence. NULL otherwise — i.e. either we sell directly to the customer or the parent's licence has been revoked.","type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug — used by /vendor/switch.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor (mirror of cas__white_label_licence.licence_key).","type":"string"},"contactPerson":{"nullable":true,"anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"description":"cas__organisation_member.id of the vendor's nominated contact.","type":"number"},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"nullable":true,"anyOf":[{"description":"Email address customers should write to. Resolved as: vendor's `default_send_from_email` (transactional sender) → contact person's login username → null.","type":"string"},{"type":"null"}]},"myTariff":{"description":"The CUSTOMER's own tariff & billing summary — what the vendor manages on their behalf. Bundled here so the settings page can render \"Spravuje mě\" + \"Můj tarif\" in one go.","type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"description":"Tariff id from cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"description":"Tariff display name.","type":"string"},"monthlyPriceCzk":{"description":"Final monthly price the customer actually pays, in WHOLE CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"},"customPriceCzk":{"nullable":true,"anyOf":[{"description":"Negotiated price (CZK) when set, NULL = catalogue minus discount.","type":"number"},{"type":"null"}]},"discountPercent":{"description":"Discount applied on top of catalogue price (0-100).","type":"number"},"expiresAt":{"nullable":true,"anyOf":[{"description":"ISO datetime when the current paid period ends. NULL = no paid-until set.","type":"string"},{"type":"null"}]},"daysUntilExpiry":{"nullable":true,"anyOf":[{"description":"Whole days until expiry. Negative = already expired.","type":"number"},{"type":"null"}]},"isExpired":{"description":"TRUE when expiresAt < now.","type":"boolean"}}}}},{"type":"null"}]},"tariff":{"type":"object","required":["id","code","storageMb","limitMembers","limitProducts","limitOrdersMonthly","limitCustomers","limitEmailsMonthly","limitAiTokensMonthly","limitForms"],"properties":{"id":{"description":"Tariff ID (read-only — managed via /tariff endpoints by admins).","type":"number"},"code":{"description":"Tariff plan identifier. Determines resource limits and pricing for the organisation.","examples":["business"],"type":"string"},"storageMb":{"description":"File storage limit in MB. Compare with storageUsed (in bytes) to calculate usage. 0 = unlimited.","type":"number"},"limitMembers":{"description":"Max active (non-blocked) organisation members. 0 = unlimited.","type":"number"},"limitProducts":{"description":"Max non-deleted products in the shop. 0 = unlimited.","type":"number"},"limitOrdersMonthly":{"description":"Max orders per calendar month. Tracked in usage_monthly table. 0 = unlimited.","type":"number"},"limitCustomers":{"description":"Max contact records in the system. 0 = unlimited.","type":"number"},"limitEmailsMonthly":{"description":"Max transactional emails per calendar month. 0 = unlimited.","type":"number"},"limitAiTokensMonthly":{"description":"Max AI token usage per calendar month. 0 = unlimited.","type":"number"},"limitForms":{"description":"Max form records. 0 = unlimited.","type":"number"}}},"logoUrl":{"nullable":true,"anyOf":[{"description":"Organisation logo URL displayed in the header of all outgoing email templates. Rendered as an <img> tag in the default email layout. If not set, the logo section is hidden. Also shown in the account organisation list for the logged-in user.","type":"string"},{"type":"null"}]},"printLogoUrl":{"nullable":true,"anyOf":[{"description":"Organisation logo URL optimized for print use (invoices, receipts, contracts, PDF documents). If not set, the standard logoUrl is used as fallback when generating print documents.","type":"string"},{"type":"null"}]},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex color of the organisation (e.g. \"#1a2b3c\"). Used for branding customization. Must be a valid 3 or 6 digit hex color with leading #.","examples":["#1a2b3c"],"type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex color of the organisation (e.g. \"#f0f0f0\"). Used for branding customization. Must be a valid 3 or 6 digit hex color with leading #.","examples":["#f0f0f0"],"type":"string"},{"type":"null"}]},"logoWhiteBackdrop":{"description":"Whether the admin header / menu shows the logo on a white plate (default true). False for transparent logos designed for dark backgrounds.","type":"boolean"},"adminLightHeader":{"description":"Whether the admin uses a white header and forces the light colour theme for all members (default false). With a light header the logo is shown without the white plate (logoWhiteBackdrop does not apply).","type":"boolean"},"adminBrandColors":{"description":"Whether the admin accent colour (buttons, active menu item, pagination, links, focus ring) is derived from primaryColor for all members (default false). Semantic and workflow status colours are unchanged.","type":"boolean"},"supportEmail":{"nullable":true,"anyOf":[{"description":"Default \"From\" email address for all transactional emails: order confirmations, calendar event notifications, account registration, password resets, member invitations, credit/voucher notifications, and system alerts. If not configured, falls back to the organisation's internal contact email, then to \"info@brj.cz\".","examples":["info@example.com"],"type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"description":"Override \"From\" email address used only for newsletter and marketing bulk emails. Allows separating marketing sender identity from transactional emails (different IP reputation, branding). If not set, marketing emails use the transactional supportEmail instead.","type":"string"},{"type":"null"}]},"emailerFooter":{"nullable":true,"anyOf":[{"description":"Custom HTML footer appended to the bottom of all outgoing emails (transactional, marketing, newsletters). Typically contains company info, legal disclaimers, and unsubscribe links. If not set, a default footer is auto-generated with the organisation name.","type":"string"},{"type":"null"}]},"emailerLayout":{"nullable":true,"anyOf":[{"description":"Custom HTML email template wrapper using Handlebars syntax. Wraps all outgoing email content. Supported variables: {{ htmlBody }} (email content), {{ logoUrl }} (org logo), {{ footer }} (footer HTML). Supports conditionals: {{ if logoUrl }}...{{ /if }}. If not set, uses the built-in default template with logo header, content area, and footer.","type":"string"},{"type":"null"}]},"emailerSmtpHost":{"nullable":true,"anyOf":[{"description":"SMTP server hostname for transactional email delivery (e.g. \"smtp.gmail.com\"). Required to enable any email sending. Without SMTP configured, the organisation cannot send emails. Validated by sending a test email during initial setup via /bff/emailer/setup-smtp.","type":"string"},{"type":"null"}]},"emailerSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP server port. Use \"587\" for STARTTLS (recommended) or \"465\" for implicit SSL. Port 465 enables secure: true in the SMTP connection; all other ports use STARTTLS upgrade.","type":"string"},{"type":"null"}]},"emailerSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP authentication username for transactional email delivery. Usually the email address itself (e.g. \"info@example.com\").","type":"string"},{"type":"null"}]},"emailerMarketingSmtpHost":{"nullable":true,"anyOf":[{"description":"Separate SMTP server for newsletter and marketing bulk emails. Allows using a dedicated email service (SendGrid, Mailchimp SMTP, etc.) with different rate limits and IP reputation. If not configured, marketing emails fall back to the transactional SMTP above.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port for marketing email server. Same port logic as transactional: \"587\" for STARTTLS, \"465\" for SSL.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP authentication username for marketing email server.","type":"string"},{"type":"null"}]},"emailerNewsletterReturnUrl":{"nullable":true,"anyOf":[{"description":"URL where users are redirected after clicking the newsletter subscription confirmation link. For example \"/newsletter-thanks\" or a specific blog post. If not set, no redirect happens and the API just returns a success response.","type":"string"},{"type":"null"}]},"paymentReturnToShop":{"description":"Payment gateways (Comgate, GoPay, Stripe) return the customer to the order `returnUrl` sent by the storefront (with `?hash=<order hash>&payment=paid|cancelled|pending`) instead of bizkithub.com/order. Default false.","type":"boolean"},"newsletterSingleOptIn":{"description":"Single opt-in newsletter sign-up (default false = double opt-in). When true, POST /api/v1/newsletter/register-contact requests carrying `consent.text` subscribe the contact immediately, record the consent with its evidence and send the `newsletter-welcome-contact` e-mail. Contacts who opted out before still need a confirmation.","type":"boolean"},"smsSluzbaCzLogin":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account login (username). Required together with the password for outgoing SMS via the apixml30 gateway.","type":"string"},{"type":"null"}]},"smsSluzbaCzDefaultSender":{"nullable":true,"anyOf":[{"description":"Optional default sender label (numeric msisdn or alphanumeric brand) attached to outgoing SMS when the caller does not pass one explicitly.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated email addresses that receive BCC copies of all order status notification emails. Internal team members listed here get notified whenever an order changes status (new, paid, shipped, cancelled, etc.). Emails are deduplicated and validated before sending.","type":"string"},{"type":"null"}]},"orderRefundStrategy":{"nullable":true,"anyOf":[{"description":"Default refund strategy when an order is cancelled (storno). \"credit\" = money returned as store account credit (default). \"cash\" = triggers credit note generation and manual bank transfer refund. \"none\" = no refund issued. Can be overridden per individual storno request.","examples":["credit"],"type":"string"},{"type":"null"}]},"orderAccountingMode":{"nullable":true,"anyOf":[{"description":"Controls automatic credit note generation during cash refunds. \"auto\" or \"always\" = credit note (tax document) is auto-generated with storno items linked to the original invoice. \"never\" = skips credit note, requires manual accounting. Only applies when refund strategy is \"cash\" and the order was paid. Defaults to \"auto\".","examples":["auto"],"type":"string"},{"type":"null"}]},"orderZeroTotalAutoPay":{"default":"all","description":"Automatic \"paid\" mark for newly created orders with a zero / negative total. \"all\" (default) = every such order is marked as paid. \"commerce\" = only kind \"commerce\" orders; \"registration\" orders stay unpaid. \"none\" = never. An explicit preventAutoPayment on the create request always wins.","examples":["all"],"type":"string","enum":["all","commerce","none"]},"orderShipNotBeforeAi":{"description":"AI reads the customer note of new API orders and may set the postponed shipping day (\"poslat až 10. 12.\").","type":"boolean"},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated email addresses that receive system error alert emails. Added as BCC on: (1) Daily log report — aggregated CRITICAL/ERROR/WARNING logs from the past 24 hours grouped by severity; (2) Individual critical error notifications triggered in real-time. Separate from order notification emails.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Master switch for the automatic newsletter digest feature. When enabled, a cron job periodically collects recent blog posts and sends a digest email to all contacts with active newsletter subscriptions. Posts are ordered by star status and recency.","type":"boolean"},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"description":"Number of days between automatic digest sends. The cron job checks: if (now - lastSentDate) >= intervalDays, send a new digest. Defaults to 14 days if not set. The timer resets even if no posts are found or no subscribers exist, to prevent retry storms.","type":"number"},{"type":"null"}]},"postDigestLastSentDate":{"nullable":true,"anyOf":[{"description":"ISO 8601 timestamp of the last digest send attempt. Managed automatically by the system — updated after each run (whether successful, no posts found, or no subscribers). Can be manually cleared to force an immediate next send. Read-only in the UI.","type":"string"},{"type":"null"}]},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Email subject line template for digest newsletters. Supports Handlebars variables: {{ postCount }} (number of articles in this digest) and {{ intervalDays }} (configured interval). Default: \"Nové články ({{ postCount }})\" → renders as e.g. \"Nové články (5)\".","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Custom intro block inserted before the article list in the digest email body. Accepts Markdown (GFM); raw HTML tags are passed through unchanged, so legacy values that already store handwritten HTML keep rendering identically. Supports the same Handlebars variables as postDigestSubject: {{ postCount }} (articles in this digest) and {{ intervalDays }} (configured interval). Rendering order is: markdown → HTML → template. Use for welcome messages, promotional text, or instructions. If empty, the email starts directly with the post list.","type":"string"},{"type":"null"}]},"postDigestLocale":{"nullable":true,"anyOf":[{"description":"Override locale code (e.g. \"cs\", \"en\") for selecting which posts appear in the digest. Only posts in this locale are included. If not set, falls back to the organisation's primary locale. Useful for multilingual organisations that want to send Czech-only or English-only digests.","type":"string"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"description":"Maximum number of posts to include in a single digest email. Posts are selected by: starred first, then most recently updated. Defaults to 20 if not set. Controls email length — lower values keep digests concise.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"description":"Hour of day (0-23, UTC) at which the digest may be sent. The cron job runs hourly and only sends when the current UTC hour matches this value; the interval-days rule is still enforced on top of that. Populated automatically to the current UTC hour the first time the digest cron fires for this organisation (so \"the hour the operator turned it on\" becomes the default cadence). Can be overridden by the operator.","type":"number"},{"type":"null"}]},"teamChatMeetingEnabled":{"description":"Team chat: members may find each other and start conversations through this organisation. Existing conversations are not affected when turned off.","type":"boolean"},"paymentRecurringEnabled":{"description":"Enables automatic recurring subscription payment charging via Comgate gateway. When true, the system can: (1) initialize card tokenization on first payment (initRecurring flag), and (2) charge subsequent subscription payments automatically without customer re-authentication. Required for SaaS/subscription billing models.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration period for newly created customer account credit (e.g. from refunds or manual additions). Value in days (e.g. \"365\" for 1 year). Expired credit cannot be used for purchases. If not set, credit records are created without expiration. Applied automatically when credit is issued via storno refund or manual addition.","type":"string"},{"type":"null"}]},"storageUsed":{"description":"Current total storage usage in bytes (read-only). Calculated by summing all blob file sizes for this organisation. Updated automatically by the storage read model. Compare with tariff.storageMb to show usage percentage.","type":"number"},"insertedDate":{"description":"ISO 8601 timestamp when the organisation was created. Read-only metadata for display purposes.","type":"string"},"magnitude":{"nullable":true,"anyOf":[{"description":"Absolute magnitude score of the organisation (0 – 1 000 000): how big and alive it is, recomputed daily and smoothed. Read-only. The rank among other organisations is deliberately never exposed here.","type":"number"},{"type":"null"}]},"internalContactEmail":{"nullable":true,"anyOf":[{"description":"Email address of the organisation's own internal contact (shop__contact joined via internal_customer_id). Minted at org creation as a synthetic `-org-<random>@` alias so it never collides with the founder's mailbox. Historically used as the fallback From/Reply-To for outgoing transactional mail — now superseded by adminContact.email for that role and kept only as a legal / accounting artefact (IČO/DIČ mirror). Read-only.","examples":["acme-org-a1b2c3d4@example.com"],"type":"string"},{"type":"null"}]},"adminContact":{"nullable":true,"anyOf":[{"description":"Operator (\"Provozovatel\") contact — the deliverable in-org shop__contact that receives platform notifications and acts as the default From/Reply-To for outbound transactional mail. Always present for a healthy org (the resolver self-heals from the oldest active member when the column is NULL). Change via POST /organisation/update-admin-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"description":"shop__contact.external_id — wire id used by /contact endpoints and the picker.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Deliverable e-mail address of the operator contact.","type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"description":"Display name — first+last if present, else email.","type":"string"}}},{"type":"null"}]},"transactionalContact":{"nullable":true,"anyOf":[{"description":"Optional override for the outbound transactional From address. NULL = inherit adminContact. Change or clear via POST /organisation/update-transactional-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"}}},{"type":"null"}]},"reportContact":{"nullable":true,"anyOf":[{"description":"Optional business (\"report\") contact, typically the CEO / owner / decision maker. Receives only the business variant of the daily report (no system logs). NULL = not set. Change or clear via POST /organisation/update-report-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"}}},{"type":"null"}]}},"required":["name","slug","storageSlug","description","emoji","companyRegistrationNumber","taxIdentificationNumber","vatPayer","country","accountingCountry","legalForm","timezone","primaryLocale","defaultCurrency","supportPerson","vendor","tariff","logoUrl","printLogoUrl","primaryColor","secondaryColor","logoWhiteBackdrop","adminLightHeader","adminBrandColors","supportEmail","supportEmailMarketing","emailerFooter","emailerLayout","emailerSmtpHost","emailerSmtpPort","emailerSmtpUser","emailerMarketingSmtpHost","emailerMarketingSmtpPort","emailerMarketingSmtpUser","emailerNewsletterReturnUrl","paymentReturnToShop","newsletterSingleOptIn","smsSluzbaCzLogin","smsSluzbaCzDefaultSender","orderInternalNotificationEmails","orderRefundStrategy","orderAccountingMode","orderZeroTotalAutoPay","orderShipNotBeforeAi","logInternalNotificationEmails","postDigestEnabled","postDigestIntervalDays","postDigestLastSentDate","postDigestSubject","postDigestIntroText","postDigestLocale","postDigestMaxPosts","postDigestSendHourUtc","teamChatMeetingEnabled","paymentRecurringEnabled","customerCreditDefaultExpiration","storageUsed","insertedDate","magnitude","internalContactEmail","adminContact","transactionalContact","reportContact"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"description":"Organisation display name. Used as the sender name in all outgoing emails (transactional, marketing, newsletters), shown on invoices as the supplier name, displayed in admin panels and organisation switcher. Must be unique across all organisations.","type":"string"},"slug":{"description":"URL-safe unique identifier. Used in public URLs (e.g. /[slug]/...), newsletter unsubscribe links, Firmy.cz feed paths, and terminal commands for org switching. Read-only — set at creation from the org name.","type":"string"},"storageSlug":{"description":"CDN storage path prefix. All uploaded files (images, documents) are stored under this slug at the storage CDN (e.g. https://storage.xhp.cz/{storageSlug}/...). Read-only — set at creation, same as slug.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Organisation about text / profile description. Shown in admin organisation lists. Optional free-form text for internal reference.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"description":"Visual emoji icon for the organisation. Displayed next to the org name in account details, org switcher, and terminal output. If not set manually, the system auto-generates one using AI based on the org configuration.","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"description":"Czech company registration number (IČO). Printed on invoices and receipts as \"IČO: {value}\". Used for ARES address lookup, Firmy.cz feed integration, and invoice export data for accounting.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"description":"Tax identification number (DIČ). Printed on invoices and receipts as \"DIČ: {value}\". Used for address lookup validation and included in invoice exports for accounting software.","type":"string"},{"type":"null"}]},"vatPayer":{"description":"Whether the organisation is a VAT payer. When true, invoices include VAT rates (21%, 12%, 0%) on line items. When false, all invoice items use 0% VAT. Also triggers unreliable VAT payer fraud checks against the Czech Ministry of Finance list.","type":"boolean"},"country":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"Internal country ID. Use this value as countryId in update-profile.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 country code of the organisation's primary HQ. Drives per-country security posture (firewall rules, geo-risk scoring in login) and default UX. Populated at org creation from the country picker (pre-filled by GeoIP), user-editable in /settings/company.","examples":["CZ"],"type":"string"},"name":{"description":"Localized country name (English).","type":"string"}}},{"type":"null"}]},"accountingCountry":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"Internal country ID. Use this value as accountingCountryId in update-profile.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 country code. Defines accounting / tax jurisdiction (used for VAT rules, ARES vs RPO lookup, legal form picker scoping).","examples":["CZ"],"type":"string"},"name":{"description":"Localized country name (English).","type":"string"}}},{"type":"null"}]},"legalForm":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","slug","name"],"properties":{"id":{"description":"Internal legal form ID. Use this value as legalFormId in update-profile.","type":"number"},"code":{"description":"Country-specific legal form code (e.g. ARES \"pravniForma\" 112 = s.r.o. in CZ).","examples":["112"],"type":"string"},"slug":{"description":"Cross-country slug (osvc, sro, as, vos, ks, druzstvo, po, fo_podnikatel, neziskovka...).","examples":["sro"],"type":"string"},"name":{"description":"Localized human-readable legal form name.","examples":["Společnost s ručením omezeným (s.r.o.)"],"type":"string"}}},{"type":"null"}]},"timezone":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"description":"Internal timezone ID. Use this value when setting timezoneId in update-profile.","type":"number"},"timezone":{"description":"IANA timezone identifier. Used to format dates in email notifications and calendar events.","examples":["Europe/Prague"],"type":"string"},"gmt":{"description":"GMT offset string for display purposes.","examples":["+01:00"],"type":"string"},"label":{"description":"Human-readable timezone label for picker display.","examples":["Central European Time - Prague"],"type":"string"}}},"primaryLocale":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Internal locale ID. Use this value when setting primaryLocaleId in update-profile.","type":"number"},"locale":{"description":"ISO 639-1 locale code. Determines default language for contacts, emails, and content selection.","examples":["cs"],"type":"string"}}},"defaultCurrency":{"description":"Default currency ISO 4217 code (e.g. \"CZK\"). Used for pricing of products and orders. Changing this value is a sensitive operation — update requests that attempt to change it are rejected and logged as a warning; contact BizKitHub technical support to change the organisation default currency.","examples":["CZK"],"type":"string"},"supportPerson":{"nullable":true,"anyOf":[{"type":"object","required":["id","fullName"],"properties":{"id":{"description":"Internal member ID of the support person (from GET /organisation/members).","type":"number"},"fullName":{"description":"Full name of the designated support contact for this organisation.","type":"string"}}},{"type":"null"}]},"vendor":{"nullable":true,"anyOf":[{"description":"Vendor (parent) organisation that resells / technically manages this org. Returned only when (a) parent_id is set AND (b) the parent holds an active white-label licence. NULL otherwise — i.e. either we sell directly to the customer or the parent's licence has been revoked.","type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug — used by /vendor/switch.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor (mirror of cas__white_label_licence.licence_key).","type":"string"},"contactPerson":{"nullable":true,"anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"description":"cas__organisation_member.id of the vendor's nominated contact.","type":"number"},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"nullable":true,"anyOf":[{"description":"Email address customers should write to. Resolved as: vendor's `default_send_from_email` (transactional sender) → contact person's login username → null.","type":"string"},{"type":"null"}]},"myTariff":{"description":"The CUSTOMER's own tariff & billing summary — what the vendor manages on their behalf. Bundled here so the settings page can render \"Spravuje mě\" + \"Můj tarif\" in one go.","type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"description":"Tariff id from cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"description":"Tariff display name.","type":"string"},"monthlyPriceCzk":{"description":"Final monthly price the customer actually pays, in WHOLE CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"},"customPriceCzk":{"nullable":true,"anyOf":[{"description":"Negotiated price (CZK) when set, NULL = catalogue minus discount.","type":"number"},{"type":"null"}]},"discountPercent":{"description":"Discount applied on top of catalogue price (0-100).","type":"number"},"expiresAt":{"nullable":true,"anyOf":[{"description":"ISO datetime when the current paid period ends. NULL = no paid-until set.","type":"string"},{"type":"null"}]},"daysUntilExpiry":{"nullable":true,"anyOf":[{"description":"Whole days until expiry. Negative = already expired.","type":"number"},{"type":"null"}]},"isExpired":{"description":"TRUE when expiresAt < now.","type":"boolean"}}}}},{"type":"null"}]},"tariff":{"type":"object","required":["id","code","storageMb","limitMembers","limitProducts","limitOrdersMonthly","limitCustomers","limitEmailsMonthly","limitAiTokensMonthly","limitForms"],"properties":{"id":{"description":"Tariff ID (read-only — managed via /tariff endpoints by admins).","type":"number"},"code":{"description":"Tariff plan identifier. Determines resource limits and pricing for the organisation.","examples":["business"],"type":"string"},"storageMb":{"description":"File storage limit in MB. Compare with storageUsed (in bytes) to calculate usage. 0 = unlimited.","type":"number"},"limitMembers":{"description":"Max active (non-blocked) organisation members. 0 = unlimited.","type":"number"},"limitProducts":{"description":"Max non-deleted products in the shop. 0 = unlimited.","type":"number"},"limitOrdersMonthly":{"description":"Max orders per calendar month. Tracked in usage_monthly table. 0 = unlimited.","type":"number"},"limitCustomers":{"description":"Max contact records in the system. 0 = unlimited.","type":"number"},"limitEmailsMonthly":{"description":"Max transactional emails per calendar month. 0 = unlimited.","type":"number"},"limitAiTokensMonthly":{"description":"Max AI token usage per calendar month. 0 = unlimited.","type":"number"},"limitForms":{"description":"Max form records. 0 = unlimited.","type":"number"}}},"logoUrl":{"nullable":true,"anyOf":[{"description":"Organisation logo URL displayed in the header of all outgoing email templates. Rendered as an <img> tag in the default email layout. If not set, the logo section is hidden. Also shown in the account organisation list for the logged-in user.","type":"string"},{"type":"null"}]},"printLogoUrl":{"nullable":true,"anyOf":[{"description":"Organisation logo URL optimized for print use (invoices, receipts, contracts, PDF documents). If not set, the standard logoUrl is used as fallback when generating print documents.","type":"string"},{"type":"null"}]},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex color of the organisation (e.g. \"#1a2b3c\"). Used for branding customization. Must be a valid 3 or 6 digit hex color with leading #.","examples":["#1a2b3c"],"type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex color of the organisation (e.g. \"#f0f0f0\"). Used for branding customization. Must be a valid 3 or 6 digit hex color with leading #.","examples":["#f0f0f0"],"type":"string"},{"type":"null"}]},"logoWhiteBackdrop":{"description":"Whether the admin header / menu shows the logo on a white plate (default true). False for transparent logos designed for dark backgrounds.","type":"boolean"},"adminLightHeader":{"description":"Whether the admin uses a white header and forces the light colour theme for all members (default false). With a light header the logo is shown without the white plate (logoWhiteBackdrop does not apply).","type":"boolean"},"adminBrandColors":{"description":"Whether the admin accent colour (buttons, active menu item, pagination, links, focus ring) is derived from primaryColor for all members (default false). Semantic and workflow status colours are unchanged.","type":"boolean"},"supportEmail":{"nullable":true,"anyOf":[{"description":"Default \"From\" email address for all transactional emails: order confirmations, calendar event notifications, account registration, password resets, member invitations, credit/voucher notifications, and system alerts. If not configured, falls back to the organisation's internal contact email, then to \"info@brj.cz\".","examples":["info@example.com"],"type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"description":"Override \"From\" email address used only for newsletter and marketing bulk emails. Allows separating marketing sender identity from transactional emails (different IP reputation, branding). If not set, marketing emails use the transactional supportEmail instead.","type":"string"},{"type":"null"}]},"emailerFooter":{"nullable":true,"anyOf":[{"description":"Custom HTML footer appended to the bottom of all outgoing emails (transactional, marketing, newsletters). Typically contains company info, legal disclaimers, and unsubscribe links. If not set, a default footer is auto-generated with the organisation name.","type":"string"},{"type":"null"}]},"emailerLayout":{"nullable":true,"anyOf":[{"description":"Custom HTML email template wrapper using Handlebars syntax. Wraps all outgoing email content. Supported variables: {{ htmlBody }} (email content), {{ logoUrl }} (org logo), {{ footer }} (footer HTML). Supports conditionals: {{ if logoUrl }}...{{ /if }}. If not set, uses the built-in default template with logo header, content area, and footer.","type":"string"},{"type":"null"}]},"emailerSmtpHost":{"nullable":true,"anyOf":[{"description":"SMTP server hostname for transactional email delivery (e.g. \"smtp.gmail.com\"). Required to enable any email sending. Without SMTP configured, the organisation cannot send emails. Validated by sending a test email during initial setup via /bff/emailer/setup-smtp.","type":"string"},{"type":"null"}]},"emailerSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP server port. Use \"587\" for STARTTLS (recommended) or \"465\" for implicit SSL. Port 465 enables secure: true in the SMTP connection; all other ports use STARTTLS upgrade.","type":"string"},{"type":"null"}]},"emailerSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP authentication username for transactional email delivery. Usually the email address itself (e.g. \"info@example.com\").","type":"string"},{"type":"null"}]},"emailerMarketingSmtpHost":{"nullable":true,"anyOf":[{"description":"Separate SMTP server for newsletter and marketing bulk emails. Allows using a dedicated email service (SendGrid, Mailchimp SMTP, etc.) with different rate limits and IP reputation. If not configured, marketing emails fall back to the transactional SMTP above.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port for marketing email server. Same port logic as transactional: \"587\" for STARTTLS, \"465\" for SSL.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP authentication username for marketing email server.","type":"string"},{"type":"null"}]},"emailerNewsletterReturnUrl":{"nullable":true,"anyOf":[{"description":"URL where users are redirected after clicking the newsletter subscription confirmation link. For example \"/newsletter-thanks\" or a specific blog post. If not set, no redirect happens and the API just returns a success response.","type":"string"},{"type":"null"}]},"paymentReturnToShop":{"description":"Payment gateways (Comgate, GoPay, Stripe) return the customer to the order `returnUrl` sent by the storefront (with `?hash=<order hash>&payment=paid|cancelled|pending`) instead of bizkithub.com/order. Default false.","type":"boolean"},"newsletterSingleOptIn":{"description":"Single opt-in newsletter sign-up (default false = double opt-in). When true, POST /api/v1/newsletter/register-contact requests carrying `consent.text` subscribe the contact immediately, record the consent with its evidence and send the `newsletter-welcome-contact` e-mail. Contacts who opted out before still need a confirmation.","type":"boolean"},"smsSluzbaCzLogin":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account login (username). Required together with the password for outgoing SMS via the apixml30 gateway.","type":"string"},{"type":"null"}]},"smsSluzbaCzDefaultSender":{"nullable":true,"anyOf":[{"description":"Optional default sender label (numeric msisdn or alphanumeric brand) attached to outgoing SMS when the caller does not pass one explicitly.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated email addresses that receive BCC copies of all order status notification emails. Internal team members listed here get notified whenever an order changes status (new, paid, shipped, cancelled, etc.). Emails are deduplicated and validated before sending.","type":"string"},{"type":"null"}]},"orderRefundStrategy":{"nullable":true,"anyOf":[{"description":"Default refund strategy when an order is cancelled (storno). \"credit\" = money returned as store account credit (default). \"cash\" = triggers credit note generation and manual bank transfer refund. \"none\" = no refund issued. Can be overridden per individual storno request.","examples":["credit"],"type":"string"},{"type":"null"}]},"orderAccountingMode":{"nullable":true,"anyOf":[{"description":"Controls automatic credit note generation during cash refunds. \"auto\" or \"always\" = credit note (tax document) is auto-generated with storno items linked to the original invoice. \"never\" = skips credit note, requires manual accounting. Only applies when refund strategy is \"cash\" and the order was paid. Defaults to \"auto\".","examples":["auto"],"type":"string"},{"type":"null"}]},"orderZeroTotalAutoPay":{"default":"all","description":"Automatic \"paid\" mark for newly created orders with a zero / negative total. \"all\" (default) = every such order is marked as paid. \"commerce\" = only kind \"commerce\" orders; \"registration\" orders stay unpaid. \"none\" = never. An explicit preventAutoPayment on the create request always wins.","examples":["all"],"type":"string","enum":["all","commerce","none"]},"orderShipNotBeforeAi":{"description":"AI reads the customer note of new API orders and may set the postponed shipping day (\"poslat až 10. 12.\").","type":"boolean"},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated email addresses that receive system error alert emails. Added as BCC on: (1) Daily log report — aggregated CRITICAL/ERROR/WARNING logs from the past 24 hours grouped by severity; (2) Individual critical error notifications triggered in real-time. Separate from order notification emails.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Master switch for the automatic newsletter digest feature. When enabled, a cron job periodically collects recent blog posts and sends a digest email to all contacts with active newsletter subscriptions. Posts are ordered by star status and recency.","type":"boolean"},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"description":"Number of days between automatic digest sends. The cron job checks: if (now - lastSentDate) >= intervalDays, send a new digest. Defaults to 14 days if not set. The timer resets even if no posts are found or no subscribers exist, to prevent retry storms.","type":"number"},{"type":"null"}]},"postDigestLastSentDate":{"nullable":true,"anyOf":[{"description":"ISO 8601 timestamp of the last digest send attempt. Managed automatically by the system — updated after each run (whether successful, no posts found, or no subscribers). Can be manually cleared to force an immediate next send. Read-only in the UI.","type":"string"},{"type":"null"}]},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Email subject line template for digest newsletters. Supports Handlebars variables: {{ postCount }} (number of articles in this digest) and {{ intervalDays }} (configured interval). Default: \"Nové články ({{ postCount }})\" → renders as e.g. \"Nové články (5)\".","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Custom intro block inserted before the article list in the digest email body. Accepts Markdown (GFM); raw HTML tags are passed through unchanged, so legacy values that already store handwritten HTML keep rendering identically. Supports the same Handlebars variables as postDigestSubject: {{ postCount }} (articles in this digest) and {{ intervalDays }} (configured interval). Rendering order is: markdown → HTML → template. Use for welcome messages, promotional text, or instructions. If empty, the email starts directly with the post list.","type":"string"},{"type":"null"}]},"postDigestLocale":{"nullable":true,"anyOf":[{"description":"Override locale code (e.g. \"cs\", \"en\") for selecting which posts appear in the digest. Only posts in this locale are included. If not set, falls back to the organisation's primary locale. Useful for multilingual organisations that want to send Czech-only or English-only digests.","type":"string"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"description":"Maximum number of posts to include in a single digest email. Posts are selected by: starred first, then most recently updated. Defaults to 20 if not set. Controls email length — lower values keep digests concise.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"description":"Hour of day (0-23, UTC) at which the digest may be sent. The cron job runs hourly and only sends when the current UTC hour matches this value; the interval-days rule is still enforced on top of that. Populated automatically to the current UTC hour the first time the digest cron fires for this organisation (so \"the hour the operator turned it on\" becomes the default cadence). Can be overridden by the operator.","type":"number"},{"type":"null"}]},"teamChatMeetingEnabled":{"description":"Team chat: members may find each other and start conversations through this organisation. Existing conversations are not affected when turned off.","type":"boolean"},"paymentRecurringEnabled":{"description":"Enables automatic recurring subscription payment charging via Comgate gateway. When true, the system can: (1) initialize card tokenization on first payment (initRecurring flag), and (2) charge subsequent subscription payments automatically without customer re-authentication. Required for SaaS/subscription billing models.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration period for newly created customer account credit (e.g. from refunds or manual additions). Value in days (e.g. \"365\" for 1 year). Expired credit cannot be used for purchases. If not set, credit records are created without expiration. Applied automatically when credit is issued via storno refund or manual addition.","type":"string"},{"type":"null"}]},"storageUsed":{"description":"Current total storage usage in bytes (read-only). Calculated by summing all blob file sizes for this organisation. Updated automatically by the storage read model. Compare with tariff.storageMb to show usage percentage.","type":"number"},"insertedDate":{"description":"ISO 8601 timestamp when the organisation was created. Read-only metadata for display purposes.","type":"string"},"magnitude":{"nullable":true,"anyOf":[{"description":"Absolute magnitude score of the organisation (0 – 1 000 000): how big and alive it is, recomputed daily and smoothed. Read-only. The rank among other organisations is deliberately never exposed here.","type":"number"},{"type":"null"}]},"internalContactEmail":{"nullable":true,"anyOf":[{"description":"Email address of the organisation's own internal contact (shop__contact joined via internal_customer_id). Minted at org creation as a synthetic `-org-<random>@` alias so it never collides with the founder's mailbox. Historically used as the fallback From/Reply-To for outgoing transactional mail — now superseded by adminContact.email for that role and kept only as a legal / accounting artefact (IČO/DIČ mirror). Read-only.","examples":["acme-org-a1b2c3d4@example.com"],"type":"string"},{"type":"null"}]},"adminContact":{"nullable":true,"anyOf":[{"description":"Operator (\"Provozovatel\") contact — the deliverable in-org shop__contact that receives platform notifications and acts as the default From/Reply-To for outbound transactional mail. Always present for a healthy org (the resolver self-heals from the oldest active member when the column is NULL). Change via POST /organisation/update-admin-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"description":"shop__contact.external_id — wire id used by /contact endpoints and the picker.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Deliverable e-mail address of the operator contact.","type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"description":"Display name — first+last if present, else email.","type":"string"}}},{"type":"null"}]},"transactionalContact":{"nullable":true,"anyOf":[{"description":"Optional override for the outbound transactional From address. NULL = inherit adminContact. Change or clear via POST /organisation/update-transactional-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"}}},{"type":"null"}]},"reportContact":{"nullable":true,"anyOf":[{"description":"Optional business (\"report\") contact, typically the CEO / owner / decision maker. Receives only the business variant of the daily report (no system logs). NULL = not set. Change or clear via POST /organisation/update-report-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"}}},{"type":"null"}]}},"required":["name","slug","storageSlug","description","emoji","companyRegistrationNumber","taxIdentificationNumber","vatPayer","country","accountingCountry","legalForm","timezone","primaryLocale","defaultCurrency","supportPerson","vendor","tariff","logoUrl","printLogoUrl","primaryColor","secondaryColor","logoWhiteBackdrop","adminLightHeader","adminBrandColors","supportEmail","supportEmailMarketing","emailerFooter","emailerLayout","emailerSmtpHost","emailerSmtpPort","emailerSmtpUser","emailerMarketingSmtpHost","emailerMarketingSmtpPort","emailerMarketingSmtpUser","emailerNewsletterReturnUrl","paymentReturnToShop","newsletterSingleOptIn","smsSluzbaCzLogin","smsSluzbaCzDefaultSender","orderInternalNotificationEmails","orderRefundStrategy","orderAccountingMode","orderZeroTotalAutoPay","orderShipNotBeforeAi","logInternalNotificationEmails","postDigestEnabled","postDigestIntervalDays","postDigestLastSentDate","postDigestSubject","postDigestIntroText","postDigestLocale","postDigestMaxPosts","postDigestSendHourUtc","teamChatMeetingEnabled","paymentRecurringEnabled","customerCreditDefaultExpiration","storageUsed","insertedDate","magnitude","internalContactEmail","adminContact","transactionalContact","reportContact"]}},"text/plain":{"schema":{"type":"object","properties":{"name":{"description":"Organisation display name. Used as the sender name in all outgoing emails (transactional, marketing, newsletters), shown on invoices as the supplier name, displayed in admin panels and organisation switcher. Must be unique across all organisations.","type":"string"},"slug":{"description":"URL-safe unique identifier. Used in public URLs (e.g. /[slug]/...), newsletter unsubscribe links, Firmy.cz feed paths, and terminal commands for org switching. Read-only — set at creation from the org name.","type":"string"},"storageSlug":{"description":"CDN storage path prefix. All uploaded files (images, documents) are stored under this slug at the storage CDN (e.g. https://storage.xhp.cz/{storageSlug}/...). Read-only — set at creation, same as slug.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Organisation about text / profile description. Shown in admin organisation lists. Optional free-form text for internal reference.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"description":"Visual emoji icon for the organisation. Displayed next to the org name in account details, org switcher, and terminal output. If not set manually, the system auto-generates one using AI based on the org configuration.","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"description":"Czech company registration number (IČO). Printed on invoices and receipts as \"IČO: {value}\". Used for ARES address lookup, Firmy.cz feed integration, and invoice export data for accounting.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"description":"Tax identification number (DIČ). Printed on invoices and receipts as \"DIČ: {value}\". Used for address lookup validation and included in invoice exports for accounting software.","type":"string"},{"type":"null"}]},"vatPayer":{"description":"Whether the organisation is a VAT payer. When true, invoices include VAT rates (21%, 12%, 0%) on line items. When false, all invoice items use 0% VAT. Also triggers unreliable VAT payer fraud checks against the Czech Ministry of Finance list.","type":"boolean"},"country":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"Internal country ID. Use this value as countryId in update-profile.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 country code of the organisation's primary HQ. Drives per-country security posture (firewall rules, geo-risk scoring in login) and default UX. Populated at org creation from the country picker (pre-filled by GeoIP), user-editable in /settings/company.","examples":["CZ"],"type":"string"},"name":{"description":"Localized country name (English).","type":"string"}}},{"type":"null"}]},"accountingCountry":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"Internal country ID. Use this value as accountingCountryId in update-profile.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 country code. Defines accounting / tax jurisdiction (used for VAT rules, ARES vs RPO lookup, legal form picker scoping).","examples":["CZ"],"type":"string"},"name":{"description":"Localized country name (English).","type":"string"}}},{"type":"null"}]},"legalForm":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","slug","name"],"properties":{"id":{"description":"Internal legal form ID. Use this value as legalFormId in update-profile.","type":"number"},"code":{"description":"Country-specific legal form code (e.g. ARES \"pravniForma\" 112 = s.r.o. in CZ).","examples":["112"],"type":"string"},"slug":{"description":"Cross-country slug (osvc, sro, as, vos, ks, druzstvo, po, fo_podnikatel, neziskovka...).","examples":["sro"],"type":"string"},"name":{"description":"Localized human-readable legal form name.","examples":["Společnost s ručením omezeným (s.r.o.)"],"type":"string"}}},{"type":"null"}]},"timezone":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"description":"Internal timezone ID. Use this value when setting timezoneId in update-profile.","type":"number"},"timezone":{"description":"IANA timezone identifier. Used to format dates in email notifications and calendar events.","examples":["Europe/Prague"],"type":"string"},"gmt":{"description":"GMT offset string for display purposes.","examples":["+01:00"],"type":"string"},"label":{"description":"Human-readable timezone label for picker display.","examples":["Central European Time - Prague"],"type":"string"}}},"primaryLocale":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Internal locale ID. Use this value when setting primaryLocaleId in update-profile.","type":"number"},"locale":{"description":"ISO 639-1 locale code. Determines default language for contacts, emails, and content selection.","examples":["cs"],"type":"string"}}},"defaultCurrency":{"description":"Default currency ISO 4217 code (e.g. \"CZK\"). Used for pricing of products and orders. Changing this value is a sensitive operation — update requests that attempt to change it are rejected and logged as a warning; contact BizKitHub technical support to change the organisation default currency.","examples":["CZK"],"type":"string"},"supportPerson":{"nullable":true,"anyOf":[{"type":"object","required":["id","fullName"],"properties":{"id":{"description":"Internal member ID of the support person (from GET /organisation/members).","type":"number"},"fullName":{"description":"Full name of the designated support contact for this organisation.","type":"string"}}},{"type":"null"}]},"vendor":{"nullable":true,"anyOf":[{"description":"Vendor (parent) organisation that resells / technically manages this org. Returned only when (a) parent_id is set AND (b) the parent holds an active white-label licence. NULL otherwise — i.e. either we sell directly to the customer or the parent's licence has been revoked.","type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug — used by /vendor/switch.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor (mirror of cas__white_label_licence.licence_key).","type":"string"},"contactPerson":{"nullable":true,"anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"description":"cas__organisation_member.id of the vendor's nominated contact.","type":"number"},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"nullable":true,"anyOf":[{"description":"Email address customers should write to. Resolved as: vendor's `default_send_from_email` (transactional sender) → contact person's login username → null.","type":"string"},{"type":"null"}]},"myTariff":{"description":"The CUSTOMER's own tariff & billing summary — what the vendor manages on their behalf. Bundled here so the settings page can render \"Spravuje mě\" + \"Můj tarif\" in one go.","type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"description":"Tariff id from cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"description":"Tariff display name.","type":"string"},"monthlyPriceCzk":{"description":"Final monthly price the customer actually pays, in WHOLE CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"},"customPriceCzk":{"nullable":true,"anyOf":[{"description":"Negotiated price (CZK) when set, NULL = catalogue minus discount.","type":"number"},{"type":"null"}]},"discountPercent":{"description":"Discount applied on top of catalogue price (0-100).","type":"number"},"expiresAt":{"nullable":true,"anyOf":[{"description":"ISO datetime when the current paid period ends. NULL = no paid-until set.","type":"string"},{"type":"null"}]},"daysUntilExpiry":{"nullable":true,"anyOf":[{"description":"Whole days until expiry. Negative = already expired.","type":"number"},{"type":"null"}]},"isExpired":{"description":"TRUE when expiresAt < now.","type":"boolean"}}}}},{"type":"null"}]},"tariff":{"type":"object","required":["id","code","storageMb","limitMembers","limitProducts","limitOrdersMonthly","limitCustomers","limitEmailsMonthly","limitAiTokensMonthly","limitForms"],"properties":{"id":{"description":"Tariff ID (read-only — managed via /tariff endpoints by admins).","type":"number"},"code":{"description":"Tariff plan identifier. Determines resource limits and pricing for the organisation.","examples":["business"],"type":"string"},"storageMb":{"description":"File storage limit in MB. Compare with storageUsed (in bytes) to calculate usage. 0 = unlimited.","type":"number"},"limitMembers":{"description":"Max active (non-blocked) organisation members. 0 = unlimited.","type":"number"},"limitProducts":{"description":"Max non-deleted products in the shop. 0 = unlimited.","type":"number"},"limitOrdersMonthly":{"description":"Max orders per calendar month. Tracked in usage_monthly table. 0 = unlimited.","type":"number"},"limitCustomers":{"description":"Max contact records in the system. 0 = unlimited.","type":"number"},"limitEmailsMonthly":{"description":"Max transactional emails per calendar month. 0 = unlimited.","type":"number"},"limitAiTokensMonthly":{"description":"Max AI token usage per calendar month. 0 = unlimited.","type":"number"},"limitForms":{"description":"Max form records. 0 = unlimited.","type":"number"}}},"logoUrl":{"nullable":true,"anyOf":[{"description":"Organisation logo URL displayed in the header of all outgoing email templates. Rendered as an <img> tag in the default email layout. If not set, the logo section is hidden. Also shown in the account organisation list for the logged-in user.","type":"string"},{"type":"null"}]},"printLogoUrl":{"nullable":true,"anyOf":[{"description":"Organisation logo URL optimized for print use (invoices, receipts, contracts, PDF documents). If not set, the standard logoUrl is used as fallback when generating print documents.","type":"string"},{"type":"null"}]},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex color of the organisation (e.g. \"#1a2b3c\"). Used for branding customization. Must be a valid 3 or 6 digit hex color with leading #.","examples":["#1a2b3c"],"type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex color of the organisation (e.g. \"#f0f0f0\"). Used for branding customization. Must be a valid 3 or 6 digit hex color with leading #.","examples":["#f0f0f0"],"type":"string"},{"type":"null"}]},"logoWhiteBackdrop":{"description":"Whether the admin header / menu shows the logo on a white plate (default true). False for transparent logos designed for dark backgrounds.","type":"boolean"},"adminLightHeader":{"description":"Whether the admin uses a white header and forces the light colour theme for all members (default false). With a light header the logo is shown without the white plate (logoWhiteBackdrop does not apply).","type":"boolean"},"adminBrandColors":{"description":"Whether the admin accent colour (buttons, active menu item, pagination, links, focus ring) is derived from primaryColor for all members (default false). Semantic and workflow status colours are unchanged.","type":"boolean"},"supportEmail":{"nullable":true,"anyOf":[{"description":"Default \"From\" email address for all transactional emails: order confirmations, calendar event notifications, account registration, password resets, member invitations, credit/voucher notifications, and system alerts. If not configured, falls back to the organisation's internal contact email, then to \"info@brj.cz\".","examples":["info@example.com"],"type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"description":"Override \"From\" email address used only for newsletter and marketing bulk emails. Allows separating marketing sender identity from transactional emails (different IP reputation, branding). If not set, marketing emails use the transactional supportEmail instead.","type":"string"},{"type":"null"}]},"emailerFooter":{"nullable":true,"anyOf":[{"description":"Custom HTML footer appended to the bottom of all outgoing emails (transactional, marketing, newsletters). Typically contains company info, legal disclaimers, and unsubscribe links. If not set, a default footer is auto-generated with the organisation name.","type":"string"},{"type":"null"}]},"emailerLayout":{"nullable":true,"anyOf":[{"description":"Custom HTML email template wrapper using Handlebars syntax. Wraps all outgoing email content. Supported variables: {{ htmlBody }} (email content), {{ logoUrl }} (org logo), {{ footer }} (footer HTML). Supports conditionals: {{ if logoUrl }}...{{ /if }}. If not set, uses the built-in default template with logo header, content area, and footer.","type":"string"},{"type":"null"}]},"emailerSmtpHost":{"nullable":true,"anyOf":[{"description":"SMTP server hostname for transactional email delivery (e.g. \"smtp.gmail.com\"). Required to enable any email sending. Without SMTP configured, the organisation cannot send emails. Validated by sending a test email during initial setup via /bff/emailer/setup-smtp.","type":"string"},{"type":"null"}]},"emailerSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP server port. Use \"587\" for STARTTLS (recommended) or \"465\" for implicit SSL. Port 465 enables secure: true in the SMTP connection; all other ports use STARTTLS upgrade.","type":"string"},{"type":"null"}]},"emailerSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP authentication username for transactional email delivery. Usually the email address itself (e.g. \"info@example.com\").","type":"string"},{"type":"null"}]},"emailerMarketingSmtpHost":{"nullable":true,"anyOf":[{"description":"Separate SMTP server for newsletter and marketing bulk emails. Allows using a dedicated email service (SendGrid, Mailchimp SMTP, etc.) with different rate limits and IP reputation. If not configured, marketing emails fall back to the transactional SMTP above.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port for marketing email server. Same port logic as transactional: \"587\" for STARTTLS, \"465\" for SSL.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP authentication username for marketing email server.","type":"string"},{"type":"null"}]},"emailerNewsletterReturnUrl":{"nullable":true,"anyOf":[{"description":"URL where users are redirected after clicking the newsletter subscription confirmation link. For example \"/newsletter-thanks\" or a specific blog post. If not set, no redirect happens and the API just returns a success response.","type":"string"},{"type":"null"}]},"paymentReturnToShop":{"description":"Payment gateways (Comgate, GoPay, Stripe) return the customer to the order `returnUrl` sent by the storefront (with `?hash=<order hash>&payment=paid|cancelled|pending`) instead of bizkithub.com/order. Default false.","type":"boolean"},"newsletterSingleOptIn":{"description":"Single opt-in newsletter sign-up (default false = double opt-in). When true, POST /api/v1/newsletter/register-contact requests carrying `consent.text` subscribe the contact immediately, record the consent with its evidence and send the `newsletter-welcome-contact` e-mail. Contacts who opted out before still need a confirmation.","type":"boolean"},"smsSluzbaCzLogin":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account login (username). Required together with the password for outgoing SMS via the apixml30 gateway.","type":"string"},{"type":"null"}]},"smsSluzbaCzDefaultSender":{"nullable":true,"anyOf":[{"description":"Optional default sender label (numeric msisdn or alphanumeric brand) attached to outgoing SMS when the caller does not pass one explicitly.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated email addresses that receive BCC copies of all order status notification emails. Internal team members listed here get notified whenever an order changes status (new, paid, shipped, cancelled, etc.). Emails are deduplicated and validated before sending.","type":"string"},{"type":"null"}]},"orderRefundStrategy":{"nullable":true,"anyOf":[{"description":"Default refund strategy when an order is cancelled (storno). \"credit\" = money returned as store account credit (default). \"cash\" = triggers credit note generation and manual bank transfer refund. \"none\" = no refund issued. Can be overridden per individual storno request.","examples":["credit"],"type":"string"},{"type":"null"}]},"orderAccountingMode":{"nullable":true,"anyOf":[{"description":"Controls automatic credit note generation during cash refunds. \"auto\" or \"always\" = credit note (tax document) is auto-generated with storno items linked to the original invoice. \"never\" = skips credit note, requires manual accounting. Only applies when refund strategy is \"cash\" and the order was paid. Defaults to \"auto\".","examples":["auto"],"type":"string"},{"type":"null"}]},"orderZeroTotalAutoPay":{"default":"all","description":"Automatic \"paid\" mark for newly created orders with a zero / negative total. \"all\" (default) = every such order is marked as paid. \"commerce\" = only kind \"commerce\" orders; \"registration\" orders stay unpaid. \"none\" = never. An explicit preventAutoPayment on the create request always wins.","examples":["all"],"type":"string","enum":["all","commerce","none"]},"orderShipNotBeforeAi":{"description":"AI reads the customer note of new API orders and may set the postponed shipping day (\"poslat až 10. 12.\").","type":"boolean"},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated email addresses that receive system error alert emails. Added as BCC on: (1) Daily log report — aggregated CRITICAL/ERROR/WARNING logs from the past 24 hours grouped by severity; (2) Individual critical error notifications triggered in real-time. Separate from order notification emails.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Master switch for the automatic newsletter digest feature. When enabled, a cron job periodically collects recent blog posts and sends a digest email to all contacts with active newsletter subscriptions. Posts are ordered by star status and recency.","type":"boolean"},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"description":"Number of days between automatic digest sends. The cron job checks: if (now - lastSentDate) >= intervalDays, send a new digest. Defaults to 14 days if not set. The timer resets even if no posts are found or no subscribers exist, to prevent retry storms.","type":"number"},{"type":"null"}]},"postDigestLastSentDate":{"nullable":true,"anyOf":[{"description":"ISO 8601 timestamp of the last digest send attempt. Managed automatically by the system — updated after each run (whether successful, no posts found, or no subscribers). Can be manually cleared to force an immediate next send. Read-only in the UI.","type":"string"},{"type":"null"}]},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Email subject line template for digest newsletters. Supports Handlebars variables: {{ postCount }} (number of articles in this digest) and {{ intervalDays }} (configured interval). Default: \"Nové články ({{ postCount }})\" → renders as e.g. \"Nové články (5)\".","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Custom intro block inserted before the article list in the digest email body. Accepts Markdown (GFM); raw HTML tags are passed through unchanged, so legacy values that already store handwritten HTML keep rendering identically. Supports the same Handlebars variables as postDigestSubject: {{ postCount }} (articles in this digest) and {{ intervalDays }} (configured interval). Rendering order is: markdown → HTML → template. Use for welcome messages, promotional text, or instructions. If empty, the email starts directly with the post list.","type":"string"},{"type":"null"}]},"postDigestLocale":{"nullable":true,"anyOf":[{"description":"Override locale code (e.g. \"cs\", \"en\") for selecting which posts appear in the digest. Only posts in this locale are included. If not set, falls back to the organisation's primary locale. Useful for multilingual organisations that want to send Czech-only or English-only digests.","type":"string"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"description":"Maximum number of posts to include in a single digest email. Posts are selected by: starred first, then most recently updated. Defaults to 20 if not set. Controls email length — lower values keep digests concise.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"description":"Hour of day (0-23, UTC) at which the digest may be sent. The cron job runs hourly and only sends when the current UTC hour matches this value; the interval-days rule is still enforced on top of that. Populated automatically to the current UTC hour the first time the digest cron fires for this organisation (so \"the hour the operator turned it on\" becomes the default cadence). Can be overridden by the operator.","type":"number"},{"type":"null"}]},"teamChatMeetingEnabled":{"description":"Team chat: members may find each other and start conversations through this organisation. Existing conversations are not affected when turned off.","type":"boolean"},"paymentRecurringEnabled":{"description":"Enables automatic recurring subscription payment charging via Comgate gateway. When true, the system can: (1) initialize card tokenization on first payment (initRecurring flag), and (2) charge subsequent subscription payments automatically without customer re-authentication. Required for SaaS/subscription billing models.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration period for newly created customer account credit (e.g. from refunds or manual additions). Value in days (e.g. \"365\" for 1 year). Expired credit cannot be used for purchases. If not set, credit records are created without expiration. Applied automatically when credit is issued via storno refund or manual addition.","type":"string"},{"type":"null"}]},"storageUsed":{"description":"Current total storage usage in bytes (read-only). Calculated by summing all blob file sizes for this organisation. Updated automatically by the storage read model. Compare with tariff.storageMb to show usage percentage.","type":"number"},"insertedDate":{"description":"ISO 8601 timestamp when the organisation was created. Read-only metadata for display purposes.","type":"string"},"magnitude":{"nullable":true,"anyOf":[{"description":"Absolute magnitude score of the organisation (0 – 1 000 000): how big and alive it is, recomputed daily and smoothed. Read-only. The rank among other organisations is deliberately never exposed here.","type":"number"},{"type":"null"}]},"internalContactEmail":{"nullable":true,"anyOf":[{"description":"Email address of the organisation's own internal contact (shop__contact joined via internal_customer_id). Minted at org creation as a synthetic `-org-<random>@` alias so it never collides with the founder's mailbox. Historically used as the fallback From/Reply-To for outgoing transactional mail — now superseded by adminContact.email for that role and kept only as a legal / accounting artefact (IČO/DIČ mirror). Read-only.","examples":["acme-org-a1b2c3d4@example.com"],"type":"string"},{"type":"null"}]},"adminContact":{"nullable":true,"anyOf":[{"description":"Operator (\"Provozovatel\") contact — the deliverable in-org shop__contact that receives platform notifications and acts as the default From/Reply-To for outbound transactional mail. Always present for a healthy org (the resolver self-heals from the oldest active member when the column is NULL). Change via POST /organisation/update-admin-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"description":"shop__contact.external_id — wire id used by /contact endpoints and the picker.","type":"string"},"email":{"nullable":true,"anyOf":[{"description":"Deliverable e-mail address of the operator contact.","type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"description":"Display name — first+last if present, else email.","type":"string"}}},{"type":"null"}]},"transactionalContact":{"nullable":true,"anyOf":[{"description":"Optional override for the outbound transactional From address. NULL = inherit adminContact. Change or clear via POST /organisation/update-transactional-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"}}},{"type":"null"}]},"reportContact":{"nullable":true,"anyOf":[{"description":"Optional business (\"report\") contact, typically the CEO / owner / decision maker. Receives only the business variant of the daily report (no system logs). NULL = not set. Change or clear via POST /organisation/update-report-contact.","type":"object","required":["externalId","email","firstName","lastName","fullName"],"properties":{"externalId":{"type":"string"},"email":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"type":"string"}}},{"type":"null"}]}},"required":["name","slug","storageSlug","description","emoji","companyRegistrationNumber","taxIdentificationNumber","vatPayer","country","accountingCountry","legalForm","timezone","primaryLocale","defaultCurrency","supportPerson","vendor","tariff","logoUrl","printLogoUrl","primaryColor","secondaryColor","logoWhiteBackdrop","adminLightHeader","adminBrandColors","supportEmail","supportEmailMarketing","emailerFooter","emailerLayout","emailerSmtpHost","emailerSmtpPort","emailerSmtpUser","emailerMarketingSmtpHost","emailerMarketingSmtpPort","emailerMarketingSmtpUser","emailerNewsletterReturnUrl","paymentReturnToShop","newsletterSingleOptIn","smsSluzbaCzLogin","smsSluzbaCzDefaultSender","orderInternalNotificationEmails","orderRefundStrategy","orderAccountingMode","orderZeroTotalAutoPay","orderShipNotBeforeAi","logInternalNotificationEmails","postDigestEnabled","postDigestIntervalDays","postDigestLastSentDate","postDigestSubject","postDigestIntroText","postDigestLocale","postDigestMaxPosts","postDigestSendHourUtc","teamChatMeetingEnabled","paymentRecurringEnabled","customerCreditDefaultExpiration","storageUsed","insertedDate","magnitude","internalContactEmail","adminContact","transactionalContact","reportContact"]}}}}},"operationId":"getBffOrganisationProfile","tags":["Organisation"],"description":"Returns the complete organisation profile including basic info, company details, feature flags, timezone, locale, tariff limits, branding, email configuration, order settings, post digest settings, and payment settings. Combines data from the organisation table and configuration key-value store. Sensitive values (SMTP passwords, payment gateway secrets) are NOT included — use the /settings/env-variable-value endpoint to access those individually.","summary":"Get organisation profile"}},"/bff/organisation/update-profile":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisationUpdate-profile","tags":["Organisation"],"description":"Updates organisation profile fields. All fields are optional — only provided fields are updated. Direct organisation columns (name, vatPayer, etc.) are updated in the organisation table. Configuration values (SMTP, branding, etc.) are updated in the key-value configuration store. SMTP passwords are write-only and never returned in the profile GET endpoint. Clears the cache after successful update.","summary":"Update organisation profile","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Organisation display name. Sanitized on save (disallowed chars removed, first letter capitalized). Changes propagate to email sender names, invoices, and all UI displays.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":5000,"description":"Free-form about text / profile description. Shown in admin org lists. Null to clear.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"description":"Organisation emoji icon (e.g. \"🏢\"). Shown in org switcher, account detail, and terminal. Null to clear (system may auto-generate one via AI).","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Company registration number (IČO). Printed on invoices/receipts. Used for ARES lookup and Firmy.cz feed.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Tax identification number (DIČ). Printed on invoices/receipts. Used in invoice exports for accounting.","type":"string"},{"type":"null"}]},"vatPayer":{"description":"VAT payer flag. When true, invoices include VAT rates on line items and fraud checks run against the unreliable payer list. When false, all invoice items use 0% VAT.","type":"boolean"},"defaultInvoiceFooterHtml":{"nullable":true,"anyOf":[{"maxLength":10000,"description":"Organisation-wide fallback for the free-text invoice-footer snippet. Rendered under the auto-generated § 435 OZ commercial-register notice when the issuer contact has no own footer. Franchise groups set this centrally and only override on a per-branch shop__contact.invoice_footer_html when needed. HTML allowed. Null clears the default.","type":"string"},{"type":"null"}]},"countryId":{"nullable":true,"anyOf":[{"description":"Primary HQ country (from GET /organisation/available-countries). Stored on cas__organisation.country_id. Drives per-country security posture (firewall rules, geo-risk scoring). Distinct from accountingCountryId — usually the same, but a multinational can invoice from a different jurisdiction. Null clears the HQ country.","type":"number"},{"type":"null"}]},"accountingCountryId":{"nullable":true,"anyOf":[{"description":"Accounting / tax jurisdiction country (from GET /organisation/available-countries). Stored on cas__organisation.accounting_country_id and mirrored to the organisation's internal contact (shop__contact.company_country_id). Drives legal form picker scoping and country-specific VAT rules. Null clears the accounting country.","type":"number"},{"type":"null"}]},"legalFormId":{"nullable":true,"anyOf":[{"description":"Legal form ID (from GET /organisation/legal-forms?countryId=X). Must belong to accountingCountryId — the API rejects mismatched country/legalForm pairs. When provided without accountingCountryId, the accounting country is auto-aligned to the legal form's country. Mirrored to the internal contact. Null clears the legal form.","type":"number"},{"type":"null"}]},"timezoneId":{"description":"Default timezone ID (from GET /organisation/timezones). Used to format dates in email notifications and calendar event times. If a calendar has no specific timezone, this org default is used.","type":"number"},"primaryLocaleId":{"description":"Primary locale ID (from GET /organisation/available-locales). Used as default language for: new contacts without a locale preference, email template rendering, and newsletter digest post selection.","type":"number"},"defaultCurrency":{"minLength":3,"maxLength":3,"description":"Requested default currency ISO 4217 code (e.g. \"CZK\"). Changing the default currency is NOT performed through this endpoint: if the provided code differs from the current default, the change is rejected, a warning is logged, and a technical notification is sent to the organisation asking them to contact BizKitHub technical support. Passing the current code is a no-op.","examples":["CZK"],"type":"string"},"supportPersonId":{"nullable":true,"anyOf":[{"description":"Internal member ID of the designated support contact (from GET /organisation/members). Informational field shown in the org profile. Null to unset.","type":"number"},{"type":"null"}]},"logoUrl":{"nullable":true,"anyOf":[{"description":"Logo URL displayed in the header of all email templates and in the account org list. If null, the logo section is hidden in emails. Can also be set via /bff/emailer/layout-link-logo-blob.","type":"string"},{"type":"null"}]},"printLogoUrl":{"nullable":true,"anyOf":[{"description":"Logo URL optimized for print (invoices, receipts, contracts, PDFs). If null, the standard logoUrl is used as fallback. Can also be set via /bff/organisation/link-print-logo-blob.","type":"string"},{"type":"null"}]},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex color (e.g. \"#1a2b3c\"). Must be a valid 3 or 6 digit hex with leading #. Invalid values are silently discarded (treated as null).","type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex color (e.g. \"#f0f0f0\"). Must be a valid 3 or 6 digit hex with leading #. Invalid values are silently discarded (treated as null).","type":"string"},{"type":"null"}]},"logoWhiteBackdrop":{"description":"White plate under the logo in the admin header / menu. Default true.","type":"boolean"},"adminLightHeader":{"description":"Force a white admin header and the light colour theme for all members. Default false.","type":"boolean"},"adminBrandColors":{"description":"Derive the admin accent colour from primaryColor for all members. Default false.","type":"boolean"},"supportEmail":{"nullable":true,"anyOf":[{"format":"email","description":"Default \"From\" address for all transactional emails (orders, calendar, accounts, system alerts). If null, falls back to the org internal contact email, then \"info@brj.cz\".","type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"format":"email","description":"Override \"From\" address for newsletter/marketing emails only. If null, marketing emails use supportEmail. Useful for separating marketing sender reputation from transactional.","type":"string"},{"type":"null"}]},"emailerFooter":{"nullable":true,"anyOf":[{"description":"Custom HTML footer for all outgoing emails. Typically company info, legal disclaimers, unsubscribe links. If null, a default footer is auto-generated with the org name.","type":"string"},{"type":"null"}]},"emailerLayout":{"nullable":true,"anyOf":[{"description":"Custom Handlebars HTML email wrapper template. Variables: {{ htmlBody }}, {{ logoUrl }}, {{ footer }}. Conditionals: {{ if logoUrl }}...{{ /if }}. If null, uses the built-in default template.","type":"string"},{"type":"null"}]},"emailerSmtpHost":{"nullable":true,"anyOf":[{"description":"SMTP server hostname for transactional emails (e.g. \"smtp.gmail.com\"). Required to enable email sending. Validated during initial setup via test email.","type":"string"},{"type":"null"}]},"emailerSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port. \"587\" for STARTTLS (recommended), \"465\" for implicit SSL. Stored as string.","type":"string"},{"type":"null"}]},"emailerSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP auth username for transactional emails. Usually the email address itself.","type":"string"},{"type":"null"}]},"emailerSmtpPassword":{"nullable":true,"anyOf":[{"description":"SMTP auth password for transactional emails. Write-only — never returned in GET profile. Show as a password field with \"unchanged\" placeholder in the UI.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpHost":{"nullable":true,"anyOf":[{"description":"Separate SMTP hostname for marketing/newsletter bulk emails (e.g. SendGrid, Mailchimp SMTP). If null, marketing emails fall back to the transactional SMTP.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port for marketing server. \"587\" for STARTTLS, \"465\" for SSL.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP auth username for marketing email server.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPassword":{"nullable":true,"anyOf":[{"description":"SMTP auth password for marketing emails. Write-only — never returned in GET profile.","type":"string"},{"type":"null"}]},"emailerNewsletterReturnUrl":{"nullable":true,"anyOf":[{"description":"Redirect URL after newsletter subscription confirmation click. E.g. \"/newsletter-thanks\". If null, no redirect — API returns success response directly.","type":"string"},{"type":"null"}]},"paymentReturnToShop":{"description":"Return customers from the payment gateway to the storefront `returnUrl` (with `hash` and `payment`) instead of bizkithub.com/order.","type":"boolean"},"newsletterSingleOptIn":{"description":"Enable single opt-in newsletter sign-up (no confirmation link) for register-contact requests that send `consent`. Default false.","type":"boolean"},"smsSluzbaCzLogin":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account login (username). Together with `smsSluzbaCzPassword` it forms the credentials passed to the apixml30 gateway as query parameters. Both must be set for outgoing SMS to work.","type":"string"},{"type":"null"}]},"smsSluzbaCzPassword":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account password / API key. Write-only — never returned in GET profile. Show as a password field with \"unchanged\" placeholder in the UI.","type":"string"},{"type":"null"}]},"smsSluzbaCzDefaultSender":{"nullable":true,"anyOf":[{"description":"Optional default sender label (numeric msisdn or alphanumeric brand) attached to outgoing SMS when the caller does not pass one explicitly.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated emails that receive BCC copies of all order status change emails. Internal team is notified when orders are created, paid, shipped, cancelled, etc.","type":"string"},{"type":"null"}]},"orderRefundStrategy":{"nullable":true,"anyOf":[{"description":"Default refund handling on order storno. \"credit\" = return as store credit (default). \"cash\" = generate credit note + manual bank refund. \"none\" = no refund. Overridable per storno.","type":"string"},{"type":"null"}]},"orderAccountingMode":{"nullable":true,"anyOf":[{"description":"Credit note auto-generation on cash refunds. \"auto\"/\"always\" = auto-generate credit note linked to original invoice. \"never\" = skip, handle manually. Only applies when strategy is \"cash\" and order was paid.","type":"string"},{"type":"null"}]},"orderZeroTotalAutoPay":{"nullable":true,"anyOf":[{"default":"all","description":"Zero-total auto-pay policy: \"all\" (default) | \"commerce\" (registrations stay unpaid) | \"none\". null resets to the default.","type":"string","enum":["all","commerce","none"]},{"type":"null"}]},"orderShipNotBeforeAi":{"description":"Enable the AI reader of customer notes for postponed shipping on new API orders.","type":"boolean"},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated emails for system error alerts. Receive: (1) daily aggregated log reports with CRITICAL/ERROR/WARNING counts, (2) real-time individual critical error notifications. Separate from order notifications.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Master switch for automatic newsletter digest. When enabled, a cron job periodically sends a digest of recent blog posts to all contacts with active newsletter subscriptions.","type":"boolean"},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"minimum":1,"maximum":365,"description":"Days between digest sends. Cron checks: if (now - lastSent) >= interval, send. Default 14.","type":"number"},{"type":"null"}]},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Handlebars subject template. Variables: {{ postCount }}, {{ intervalDays }}. Default: \"Nové články ({{ postCount }})\" → \"Nové články (5)\".","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Custom intro block before the article list in the digest email. Accepts Markdown (GFM); raw HTML tags are passed through unchanged. Supports the same Handlebars variables as postDigestSubject: {{ postCount }}, {{ intervalDays }}. Rendering order is: markdown → HTML → template. Null to omit.","type":"string"},{"type":"null"}]},"postDigestLocale":{"nullable":true,"anyOf":[{"minLength":2,"maxLength":2,"description":"Override locale for post selection (e.g. \"cs\"). Only posts in this locale are included. Falls back to primary locale.","type":"string"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"minimum":1,"maximum":100,"description":"Max posts per digest. Starred posts first, then by recency. Default 20.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"minimum":0,"maximum":23,"description":"Hour of day (0-23, UTC) at which the digest may be sent. The cron runs hourly; it only sends when the current UTC hour matches this value (interval-days is enforced on top). Null / omitted lets the system lazy-initialise it to the current UTC hour the next time the digest fires. Server clamps out-of-range values into 0..23.","type":"number"},{"type":"null"}]},"teamChatMeetingEnabled":{"description":"Team chat: members may meet (start conversations) through this organisation.","type":"boolean"},"paymentRecurringEnabled":{"description":"Enable Comgate recurring payment charging. When true, allows card tokenization on first payment and automatic subsequent charges without customer re-auth. Required for subscription billing.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration for new customer credit records, in days (e.g. \"365\"). Applied when credit is issued via refund or manual addition. Expired credit cannot be used. Null = no expiration.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Organisation display name. Sanitized on save (disallowed chars removed, first letter capitalized). Changes propagate to email sender names, invoices, and all UI displays.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":5000,"description":"Free-form about text / profile description. Shown in admin org lists. Null to clear.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"description":"Organisation emoji icon (e.g. \"🏢\"). Shown in org switcher, account detail, and terminal. Null to clear (system may auto-generate one via AI).","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Company registration number (IČO). Printed on invoices/receipts. Used for ARES lookup and Firmy.cz feed.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Tax identification number (DIČ). Printed on invoices/receipts. Used in invoice exports for accounting.","type":"string"},{"type":"null"}]},"vatPayer":{"description":"VAT payer flag. When true, invoices include VAT rates on line items and fraud checks run against the unreliable payer list. When false, all invoice items use 0% VAT.","type":"boolean"},"defaultInvoiceFooterHtml":{"nullable":true,"anyOf":[{"maxLength":10000,"description":"Organisation-wide fallback for the free-text invoice-footer snippet. Rendered under the auto-generated § 435 OZ commercial-register notice when the issuer contact has no own footer. Franchise groups set this centrally and only override on a per-branch shop__contact.invoice_footer_html when needed. HTML allowed. Null clears the default.","type":"string"},{"type":"null"}]},"countryId":{"nullable":true,"anyOf":[{"description":"Primary HQ country (from GET /organisation/available-countries). Stored on cas__organisation.country_id. Drives per-country security posture (firewall rules, geo-risk scoring). Distinct from accountingCountryId — usually the same, but a multinational can invoice from a different jurisdiction. Null clears the HQ country.","type":"number"},{"type":"null"}]},"accountingCountryId":{"nullable":true,"anyOf":[{"description":"Accounting / tax jurisdiction country (from GET /organisation/available-countries). Stored on cas__organisation.accounting_country_id and mirrored to the organisation's internal contact (shop__contact.company_country_id). Drives legal form picker scoping and country-specific VAT rules. Null clears the accounting country.","type":"number"},{"type":"null"}]},"legalFormId":{"nullable":true,"anyOf":[{"description":"Legal form ID (from GET /organisation/legal-forms?countryId=X). Must belong to accountingCountryId — the API rejects mismatched country/legalForm pairs. When provided without accountingCountryId, the accounting country is auto-aligned to the legal form's country. Mirrored to the internal contact. Null clears the legal form.","type":"number"},{"type":"null"}]},"timezoneId":{"description":"Default timezone ID (from GET /organisation/timezones). Used to format dates in email notifications and calendar event times. If a calendar has no specific timezone, this org default is used.","type":"number"},"primaryLocaleId":{"description":"Primary locale ID (from GET /organisation/available-locales). Used as default language for: new contacts without a locale preference, email template rendering, and newsletter digest post selection.","type":"number"},"defaultCurrency":{"minLength":3,"maxLength":3,"description":"Requested default currency ISO 4217 code (e.g. \"CZK\"). Changing the default currency is NOT performed through this endpoint: if the provided code differs from the current default, the change is rejected, a warning is logged, and a technical notification is sent to the organisation asking them to contact BizKitHub technical support. Passing the current code is a no-op.","examples":["CZK"],"type":"string"},"supportPersonId":{"nullable":true,"anyOf":[{"description":"Internal member ID of the designated support contact (from GET /organisation/members). Informational field shown in the org profile. Null to unset.","type":"number"},{"type":"null"}]},"logoUrl":{"nullable":true,"anyOf":[{"description":"Logo URL displayed in the header of all email templates and in the account org list. If null, the logo section is hidden in emails. Can also be set via /bff/emailer/layout-link-logo-blob.","type":"string"},{"type":"null"}]},"printLogoUrl":{"nullable":true,"anyOf":[{"description":"Logo URL optimized for print (invoices, receipts, contracts, PDFs). If null, the standard logoUrl is used as fallback. Can also be set via /bff/organisation/link-print-logo-blob.","type":"string"},{"type":"null"}]},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex color (e.g. \"#1a2b3c\"). Must be a valid 3 or 6 digit hex with leading #. Invalid values are silently discarded (treated as null).","type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex color (e.g. \"#f0f0f0\"). Must be a valid 3 or 6 digit hex with leading #. Invalid values are silently discarded (treated as null).","type":"string"},{"type":"null"}]},"logoWhiteBackdrop":{"description":"White plate under the logo in the admin header / menu. Default true.","type":"boolean"},"adminLightHeader":{"description":"Force a white admin header and the light colour theme for all members. Default false.","type":"boolean"},"adminBrandColors":{"description":"Derive the admin accent colour from primaryColor for all members. Default false.","type":"boolean"},"supportEmail":{"nullable":true,"anyOf":[{"format":"email","description":"Default \"From\" address for all transactional emails (orders, calendar, accounts, system alerts). If null, falls back to the org internal contact email, then \"info@brj.cz\".","type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"format":"email","description":"Override \"From\" address for newsletter/marketing emails only. If null, marketing emails use supportEmail. Useful for separating marketing sender reputation from transactional.","type":"string"},{"type":"null"}]},"emailerFooter":{"nullable":true,"anyOf":[{"description":"Custom HTML footer for all outgoing emails. Typically company info, legal disclaimers, unsubscribe links. If null, a default footer is auto-generated with the org name.","type":"string"},{"type":"null"}]},"emailerLayout":{"nullable":true,"anyOf":[{"description":"Custom Handlebars HTML email wrapper template. Variables: {{ htmlBody }}, {{ logoUrl }}, {{ footer }}. Conditionals: {{ if logoUrl }}...{{ /if }}. If null, uses the built-in default template.","type":"string"},{"type":"null"}]},"emailerSmtpHost":{"nullable":true,"anyOf":[{"description":"SMTP server hostname for transactional emails (e.g. \"smtp.gmail.com\"). Required to enable email sending. Validated during initial setup via test email.","type":"string"},{"type":"null"}]},"emailerSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port. \"587\" for STARTTLS (recommended), \"465\" for implicit SSL. Stored as string.","type":"string"},{"type":"null"}]},"emailerSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP auth username for transactional emails. Usually the email address itself.","type":"string"},{"type":"null"}]},"emailerSmtpPassword":{"nullable":true,"anyOf":[{"description":"SMTP auth password for transactional emails. Write-only — never returned in GET profile. Show as a password field with \"unchanged\" placeholder in the UI.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpHost":{"nullable":true,"anyOf":[{"description":"Separate SMTP hostname for marketing/newsletter bulk emails (e.g. SendGrid, Mailchimp SMTP). If null, marketing emails fall back to the transactional SMTP.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port for marketing server. \"587\" for STARTTLS, \"465\" for SSL.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP auth username for marketing email server.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPassword":{"nullable":true,"anyOf":[{"description":"SMTP auth password for marketing emails. Write-only — never returned in GET profile.","type":"string"},{"type":"null"}]},"emailerNewsletterReturnUrl":{"nullable":true,"anyOf":[{"description":"Redirect URL after newsletter subscription confirmation click. E.g. \"/newsletter-thanks\". If null, no redirect — API returns success response directly.","type":"string"},{"type":"null"}]},"paymentReturnToShop":{"description":"Return customers from the payment gateway to the storefront `returnUrl` (with `hash` and `payment`) instead of bizkithub.com/order.","type":"boolean"},"newsletterSingleOptIn":{"description":"Enable single opt-in newsletter sign-up (no confirmation link) for register-contact requests that send `consent`. Default false.","type":"boolean"},"smsSluzbaCzLogin":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account login (username). Together with `smsSluzbaCzPassword` it forms the credentials passed to the apixml30 gateway as query parameters. Both must be set for outgoing SMS to work.","type":"string"},{"type":"null"}]},"smsSluzbaCzPassword":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account password / API key. Write-only — never returned in GET profile. Show as a password field with \"unchanged\" placeholder in the UI.","type":"string"},{"type":"null"}]},"smsSluzbaCzDefaultSender":{"nullable":true,"anyOf":[{"description":"Optional default sender label (numeric msisdn or alphanumeric brand) attached to outgoing SMS when the caller does not pass one explicitly.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated emails that receive BCC copies of all order status change emails. Internal team is notified when orders are created, paid, shipped, cancelled, etc.","type":"string"},{"type":"null"}]},"orderRefundStrategy":{"nullable":true,"anyOf":[{"description":"Default refund handling on order storno. \"credit\" = return as store credit (default). \"cash\" = generate credit note + manual bank refund. \"none\" = no refund. Overridable per storno.","type":"string"},{"type":"null"}]},"orderAccountingMode":{"nullable":true,"anyOf":[{"description":"Credit note auto-generation on cash refunds. \"auto\"/\"always\" = auto-generate credit note linked to original invoice. \"never\" = skip, handle manually. Only applies when strategy is \"cash\" and order was paid.","type":"string"},{"type":"null"}]},"orderZeroTotalAutoPay":{"nullable":true,"anyOf":[{"default":"all","description":"Zero-total auto-pay policy: \"all\" (default) | \"commerce\" (registrations stay unpaid) | \"none\". null resets to the default.","type":"string","enum":["all","commerce","none"]},{"type":"null"}]},"orderShipNotBeforeAi":{"description":"Enable the AI reader of customer notes for postponed shipping on new API orders.","type":"boolean"},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated emails for system error alerts. Receive: (1) daily aggregated log reports with CRITICAL/ERROR/WARNING counts, (2) real-time individual critical error notifications. Separate from order notifications.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Master switch for automatic newsletter digest. When enabled, a cron job periodically sends a digest of recent blog posts to all contacts with active newsletter subscriptions.","type":"boolean"},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"minimum":1,"maximum":365,"description":"Days between digest sends. Cron checks: if (now - lastSent) >= interval, send. Default 14.","type":"number"},{"type":"null"}]},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Handlebars subject template. Variables: {{ postCount }}, {{ intervalDays }}. Default: \"Nové články ({{ postCount }})\" → \"Nové články (5)\".","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Custom intro block before the article list in the digest email. Accepts Markdown (GFM); raw HTML tags are passed through unchanged. Supports the same Handlebars variables as postDigestSubject: {{ postCount }}, {{ intervalDays }}. Rendering order is: markdown → HTML → template. Null to omit.","type":"string"},{"type":"null"}]},"postDigestLocale":{"nullable":true,"anyOf":[{"minLength":2,"maxLength":2,"description":"Override locale for post selection (e.g. \"cs\"). Only posts in this locale are included. Falls back to primary locale.","type":"string"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"minimum":1,"maximum":100,"description":"Max posts per digest. Starred posts first, then by recency. Default 20.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"minimum":0,"maximum":23,"description":"Hour of day (0-23, UTC) at which the digest may be sent. The cron runs hourly; it only sends when the current UTC hour matches this value (interval-days is enforced on top). Null / omitted lets the system lazy-initialise it to the current UTC hour the next time the digest fires. Server clamps out-of-range values into 0..23.","type":"number"},{"type":"null"}]},"teamChatMeetingEnabled":{"description":"Team chat: members may meet (start conversations) through this organisation.","type":"boolean"},"paymentRecurringEnabled":{"description":"Enable Comgate recurring payment charging. When true, allows card tokenization on first payment and automatic subsequent charges without customer re-auth. Required for subscription billing.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration for new customer credit records, in days (e.g. \"365\"). Applied when credit is issued via refund or manual addition. Expired credit cannot be used. Null = no expiration.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"name":{"minLength":1,"maxLength":255,"description":"Organisation display name. Sanitized on save (disallowed chars removed, first letter capitalized). Changes propagate to email sender names, invoices, and all UI displays.","type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":5000,"description":"Free-form about text / profile description. Shown in admin org lists. Null to clear.","type":"string"},{"type":"null"}]},"emoji":{"nullable":true,"anyOf":[{"maxLength":16,"description":"Organisation emoji icon (e.g. \"🏢\"). Shown in org switcher, account detail, and terminal. Null to clear (system may auto-generate one via AI).","type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Company registration number (IČO). Printed on invoices/receipts. Used for ARES lookup and Firmy.cz feed.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"maxLength":50,"description":"Tax identification number (DIČ). Printed on invoices/receipts. Used in invoice exports for accounting.","type":"string"},{"type":"null"}]},"vatPayer":{"description":"VAT payer flag. When true, invoices include VAT rates on line items and fraud checks run against the unreliable payer list. When false, all invoice items use 0% VAT.","type":"boolean"},"defaultInvoiceFooterHtml":{"nullable":true,"anyOf":[{"maxLength":10000,"description":"Organisation-wide fallback for the free-text invoice-footer snippet. Rendered under the auto-generated § 435 OZ commercial-register notice when the issuer contact has no own footer. Franchise groups set this centrally and only override on a per-branch shop__contact.invoice_footer_html when needed. HTML allowed. Null clears the default.","type":"string"},{"type":"null"}]},"countryId":{"nullable":true,"anyOf":[{"description":"Primary HQ country (from GET /organisation/available-countries). Stored on cas__organisation.country_id. Drives per-country security posture (firewall rules, geo-risk scoring). Distinct from accountingCountryId — usually the same, but a multinational can invoice from a different jurisdiction. Null clears the HQ country.","type":"number"},{"type":"null"}]},"accountingCountryId":{"nullable":true,"anyOf":[{"description":"Accounting / tax jurisdiction country (from GET /organisation/available-countries). Stored on cas__organisation.accounting_country_id and mirrored to the organisation's internal contact (shop__contact.company_country_id). Drives legal form picker scoping and country-specific VAT rules. Null clears the accounting country.","type":"number"},{"type":"null"}]},"legalFormId":{"nullable":true,"anyOf":[{"description":"Legal form ID (from GET /organisation/legal-forms?countryId=X). Must belong to accountingCountryId — the API rejects mismatched country/legalForm pairs. When provided without accountingCountryId, the accounting country is auto-aligned to the legal form's country. Mirrored to the internal contact. Null clears the legal form.","type":"number"},{"type":"null"}]},"timezoneId":{"description":"Default timezone ID (from GET /organisation/timezones). Used to format dates in email notifications and calendar event times. If a calendar has no specific timezone, this org default is used.","type":"number"},"primaryLocaleId":{"description":"Primary locale ID (from GET /organisation/available-locales). Used as default language for: new contacts without a locale preference, email template rendering, and newsletter digest post selection.","type":"number"},"defaultCurrency":{"minLength":3,"maxLength":3,"description":"Requested default currency ISO 4217 code (e.g. \"CZK\"). Changing the default currency is NOT performed through this endpoint: if the provided code differs from the current default, the change is rejected, a warning is logged, and a technical notification is sent to the organisation asking them to contact BizKitHub technical support. Passing the current code is a no-op.","examples":["CZK"],"type":"string"},"supportPersonId":{"nullable":true,"anyOf":[{"description":"Internal member ID of the designated support contact (from GET /organisation/members). Informational field shown in the org profile. Null to unset.","type":"number"},{"type":"null"}]},"logoUrl":{"nullable":true,"anyOf":[{"description":"Logo URL displayed in the header of all email templates and in the account org list. If null, the logo section is hidden in emails. Can also be set via /bff/emailer/layout-link-logo-blob.","type":"string"},{"type":"null"}]},"printLogoUrl":{"nullable":true,"anyOf":[{"description":"Logo URL optimized for print (invoices, receipts, contracts, PDFs). If null, the standard logoUrl is used as fallback. Can also be set via /bff/organisation/link-print-logo-blob.","type":"string"},{"type":"null"}]},"primaryColor":{"nullable":true,"anyOf":[{"description":"Primary brand hex color (e.g. \"#1a2b3c\"). Must be a valid 3 or 6 digit hex with leading #. Invalid values are silently discarded (treated as null).","type":"string"},{"type":"null"}]},"secondaryColor":{"nullable":true,"anyOf":[{"description":"Secondary brand hex color (e.g. \"#f0f0f0\"). Must be a valid 3 or 6 digit hex with leading #. Invalid values are silently discarded (treated as null).","type":"string"},{"type":"null"}]},"logoWhiteBackdrop":{"description":"White plate under the logo in the admin header / menu. Default true.","type":"boolean"},"adminLightHeader":{"description":"Force a white admin header and the light colour theme for all members. Default false.","type":"boolean"},"adminBrandColors":{"description":"Derive the admin accent colour from primaryColor for all members. Default false.","type":"boolean"},"supportEmail":{"nullable":true,"anyOf":[{"format":"email","description":"Default \"From\" address for all transactional emails (orders, calendar, accounts, system alerts). If null, falls back to the org internal contact email, then \"info@brj.cz\".","type":"string"},{"type":"null"}]},"supportEmailMarketing":{"nullable":true,"anyOf":[{"format":"email","description":"Override \"From\" address for newsletter/marketing emails only. If null, marketing emails use supportEmail. Useful for separating marketing sender reputation from transactional.","type":"string"},{"type":"null"}]},"emailerFooter":{"nullable":true,"anyOf":[{"description":"Custom HTML footer for all outgoing emails. Typically company info, legal disclaimers, unsubscribe links. If null, a default footer is auto-generated with the org name.","type":"string"},{"type":"null"}]},"emailerLayout":{"nullable":true,"anyOf":[{"description":"Custom Handlebars HTML email wrapper template. Variables: {{ htmlBody }}, {{ logoUrl }}, {{ footer }}. Conditionals: {{ if logoUrl }}...{{ /if }}. If null, uses the built-in default template.","type":"string"},{"type":"null"}]},"emailerSmtpHost":{"nullable":true,"anyOf":[{"description":"SMTP server hostname for transactional emails (e.g. \"smtp.gmail.com\"). Required to enable email sending. Validated during initial setup via test email.","type":"string"},{"type":"null"}]},"emailerSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port. \"587\" for STARTTLS (recommended), \"465\" for implicit SSL. Stored as string.","type":"string"},{"type":"null"}]},"emailerSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP auth username for transactional emails. Usually the email address itself.","type":"string"},{"type":"null"}]},"emailerSmtpPassword":{"nullable":true,"anyOf":[{"description":"SMTP auth password for transactional emails. Write-only — never returned in GET profile. Show as a password field with \"unchanged\" placeholder in the UI.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpHost":{"nullable":true,"anyOf":[{"description":"Separate SMTP hostname for marketing/newsletter bulk emails (e.g. SendGrid, Mailchimp SMTP). If null, marketing emails fall back to the transactional SMTP.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPort":{"nullable":true,"anyOf":[{"description":"SMTP port for marketing server. \"587\" for STARTTLS, \"465\" for SSL.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpUser":{"nullable":true,"anyOf":[{"description":"SMTP auth username for marketing email server.","type":"string"},{"type":"null"}]},"emailerMarketingSmtpPassword":{"nullable":true,"anyOf":[{"description":"SMTP auth password for marketing emails. Write-only — never returned in GET profile.","type":"string"},{"type":"null"}]},"emailerNewsletterReturnUrl":{"nullable":true,"anyOf":[{"description":"Redirect URL after newsletter subscription confirmation click. E.g. \"/newsletter-thanks\". If null, no redirect — API returns success response directly.","type":"string"},{"type":"null"}]},"paymentReturnToShop":{"description":"Return customers from the payment gateway to the storefront `returnUrl` (with `hash` and `payment`) instead of bizkithub.com/order.","type":"boolean"},"newsletterSingleOptIn":{"description":"Enable single opt-in newsletter sign-up (no confirmation link) for register-contact requests that send `consent`. Default false.","type":"boolean"},"smsSluzbaCzLogin":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account login (username). Together with `smsSluzbaCzPassword` it forms the credentials passed to the apixml30 gateway as query parameters. Both must be set for outgoing SMS to work.","type":"string"},{"type":"null"}]},"smsSluzbaCzPassword":{"nullable":true,"anyOf":[{"description":"sms-sluzba.cz account password / API key. Write-only — never returned in GET profile. Show as a password field with \"unchanged\" placeholder in the UI.","type":"string"},{"type":"null"}]},"smsSluzbaCzDefaultSender":{"nullable":true,"anyOf":[{"description":"Optional default sender label (numeric msisdn or alphanumeric brand) attached to outgoing SMS when the caller does not pass one explicitly.","type":"string"},{"type":"null"}]},"orderInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated emails that receive BCC copies of all order status change emails. Internal team is notified when orders are created, paid, shipped, cancelled, etc.","type":"string"},{"type":"null"}]},"orderRefundStrategy":{"nullable":true,"anyOf":[{"description":"Default refund handling on order storno. \"credit\" = return as store credit (default). \"cash\" = generate credit note + manual bank refund. \"none\" = no refund. Overridable per storno.","type":"string"},{"type":"null"}]},"orderAccountingMode":{"nullable":true,"anyOf":[{"description":"Credit note auto-generation on cash refunds. \"auto\"/\"always\" = auto-generate credit note linked to original invoice. \"never\" = skip, handle manually. Only applies when strategy is \"cash\" and order was paid.","type":"string"},{"type":"null"}]},"orderZeroTotalAutoPay":{"nullable":true,"anyOf":[{"default":"all","description":"Zero-total auto-pay policy: \"all\" (default) | \"commerce\" (registrations stay unpaid) | \"none\". null resets to the default.","type":"string","enum":["all","commerce","none"]},{"type":"null"}]},"orderShipNotBeforeAi":{"description":"Enable the AI reader of customer notes for postponed shipping on new API orders.","type":"boolean"},"logInternalNotificationEmails":{"nullable":true,"anyOf":[{"description":"Comma-separated emails for system error alerts. Receive: (1) daily aggregated log reports with CRITICAL/ERROR/WARNING counts, (2) real-time individual critical error notifications. Separate from order notifications.","type":"string"},{"type":"null"}]},"postDigestEnabled":{"description":"Master switch for automatic newsletter digest. When enabled, a cron job periodically sends a digest of recent blog posts to all contacts with active newsletter subscriptions.","type":"boolean"},"postDigestIntervalDays":{"nullable":true,"anyOf":[{"minimum":1,"maximum":365,"description":"Days between digest sends. Cron checks: if (now - lastSent) >= interval, send. Default 14.","type":"number"},{"type":"null"}]},"postDigestSubject":{"nullable":true,"anyOf":[{"description":"Handlebars subject template. Variables: {{ postCount }}, {{ intervalDays }}. Default: \"Nové články ({{ postCount }})\" → \"Nové články (5)\".","type":"string"},{"type":"null"}]},"postDigestIntroText":{"nullable":true,"anyOf":[{"description":"Custom intro block before the article list in the digest email. Accepts Markdown (GFM); raw HTML tags are passed through unchanged. Supports the same Handlebars variables as postDigestSubject: {{ postCount }}, {{ intervalDays }}. Rendering order is: markdown → HTML → template. Null to omit.","type":"string"},{"type":"null"}]},"postDigestLocale":{"nullable":true,"anyOf":[{"minLength":2,"maxLength":2,"description":"Override locale for post selection (e.g. \"cs\"). Only posts in this locale are included. Falls back to primary locale.","type":"string"},{"type":"null"}]},"postDigestMaxPosts":{"nullable":true,"anyOf":[{"minimum":1,"maximum":100,"description":"Max posts per digest. Starred posts first, then by recency. Default 20.","type":"number"},{"type":"null"}]},"postDigestSendHourUtc":{"nullable":true,"anyOf":[{"minimum":0,"maximum":23,"description":"Hour of day (0-23, UTC) at which the digest may be sent. The cron runs hourly; it only sends when the current UTC hour matches this value (interval-days is enforced on top). Null / omitted lets the system lazy-initialise it to the current UTC hour the next time the digest fires. Server clamps out-of-range values into 0..23.","type":"number"},{"type":"null"}]},"teamChatMeetingEnabled":{"description":"Team chat: members may meet (start conversations) through this organisation.","type":"boolean"},"paymentRecurringEnabled":{"description":"Enable Comgate recurring payment charging. When true, allows card tokenization on first payment and automatic subsequent charges without customer re-auth. Required for subscription billing.","type":"boolean"},"customerCreditDefaultExpiration":{"nullable":true,"anyOf":[{"description":"Default expiration for new customer credit records, in days (e.g. \"365\"). Applied when credit is issued via refund or manual addition. Expired credit cannot be used. Null = no expiration.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/organisation/update-admin-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisationUpdate-admin-contact","tags":["Organisation"],"description":"Re-points cas__organisation.admin_contact_id at another in-org shop__contact. The contact must belong to the caller's organisation and must carry an email (otherwise platform notifications have nowhere to go). Bumps the cache; downstream support-email lookups pick up the change on the next request.","summary":"Change the operator (\"Provozovatel\") contact","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"description":"shop__contact.external_id of an in-org contact with a deliverable email address.","examples":["cust_abc123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"description":"shop__contact.external_id of an in-org contact with a deliverable email address.","examples":["cust_abc123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"description":"shop__contact.external_id of an in-org contact with a deliverable email address.","examples":["cust_abc123"],"type":"string"}}}}}}}},"/bff/organisation/update-report-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisationUpdate-report-contact","tags":["Organisation"],"description":"Sets cas__organisation.report_contact_id: the CEO / owner / decision maker who receives the business variant of the daily report (orders, documents, contacts, content, tariff, activity; no system logs). Any in-org contact with an e-mail, membership not required. Requires root.","summary":"Set or remove the business report contact","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id of an in-org contact with an e-mail address, or NULL to remove the business report contact.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id of an in-org contact with an e-mail address, or NULL to remove the business report contact.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id of an in-org contact with an e-mail address, or NULL to remove the business report contact.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/organisation/update-transactional-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisationUpdate-transactional-contact","tags":["Organisation"],"description":"Optional per-org override that lets an operator route the outbound transactional From address through a different in-org shop__contact than the operator (\"Provozovatel\") relation. Pass a contactExternalId to set the override or `null` to clear it.","summary":"Change or clear the transactional From-address contact","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id to override the outbound From address with, or NULL to clear the override and inherit the operator contact.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id to override the outbound From address with, or NULL to clear the override and inherit the operator contact.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["contactExternalId"],"properties":{"contactExternalId":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id to override the outbound From address with, or NULL to clear the override and inherit the operator contact.","examples":["cust_abc123"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/organisation/request-default-currency-change":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the support ticket was created successfully.","type":"boolean"},"issueKey":{"description":"Generated ticket key.","examples":["BIZKIT-42"],"type":"string"}},"required":["success","issueKey"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the support ticket was created successfully.","type":"boolean"},"issueKey":{"description":"Generated ticket key.","examples":["BIZKIT-42"],"type":"string"}},"required":["success","issueKey"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the support ticket was created successfully.","type":"boolean"},"issueKey":{"description":"Generated ticket key.","examples":["BIZKIT-42"],"type":"string"}},"required":["success","issueKey"]}}}}},"operationId":"postBffOrganisationRequest-default-currency-change","tags":["Organisation"],"description":"Files an internal BizKitHub support ticket requesting a change of the organisation's default currency. The ticket body is composed server-side in English and embeds the organisation name, slug, IČO, primary language, current + requested currency codes and the operator's free-form reason. The reporter is the authenticated member's contact.","summary":"Request a default-currency change","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["newCurrencyCode","reason"],"properties":{"newCurrencyCode":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of the currency the organisation wants to switch to (e.g. \"USD\").","examples":["USD"],"type":"string"},"reason":{"minLength":1,"maxLength":2000,"description":"Free-form reason the operator entered in the request form. Embedded verbatim in the English ticket body so the BKH support team sees the original wording.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["newCurrencyCode","reason"],"properties":{"newCurrencyCode":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of the currency the organisation wants to switch to (e.g. \"USD\").","examples":["USD"],"type":"string"},"reason":{"minLength":1,"maxLength":2000,"description":"Free-form reason the operator entered in the request form. Embedded verbatim in the English ticket body so the BKH support team sees the original wording.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["newCurrencyCode","reason"],"properties":{"newCurrencyCode":{"minLength":3,"maxLength":3,"description":"ISO 4217 code of the currency the organisation wants to switch to (e.g. \"USD\").","examples":["USD"],"type":"string"},"reason":{"minLength":1,"maxLength":2000,"description":"Free-form reason the operator entered in the request form. Embedded verbatim in the English ticket body so the BKH support team sees the original wording.","type":"string"}}}}}}}},"/bff/organisation/timezones":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"All available timezones ordered by GMT offset.","type":"array","items":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"description":"Internal timezone ID. Use this value when setting timezoneId in update-profile.","type":"number"},"timezone":{"description":"IANA timezone identifier. Used to format dates in email notifications and calendar events.","examples":["Europe/Prague"],"type":"string"},"gmt":{"description":"GMT offset string for display purposes.","examples":["+01:00"],"type":"string"},"label":{"description":"Human-readable timezone label for picker display.","examples":["Central European Time - Prague"],"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"All available timezones ordered by GMT offset.","type":"array","items":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"description":"Internal timezone ID. Use this value when setting timezoneId in update-profile.","type":"number"},"timezone":{"description":"IANA timezone identifier. Used to format dates in email notifications and calendar events.","examples":["Europe/Prague"],"type":"string"},"gmt":{"description":"GMT offset string for display purposes.","examples":["+01:00"],"type":"string"},"label":{"description":"Human-readable timezone label for picker display.","examples":["Central European Time - Prague"],"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"All available timezones ordered by GMT offset.","type":"array","items":{"type":"object","required":["id","timezone","gmt","label"],"properties":{"id":{"description":"Internal timezone ID. Use this value when setting timezoneId in update-profile.","type":"number"},"timezone":{"description":"IANA timezone identifier. Used to format dates in email notifications and calendar events.","examples":["Europe/Prague"],"type":"string"},"gmt":{"description":"GMT offset string for display purposes.","examples":["+01:00"],"type":"string"},"label":{"description":"Human-readable timezone label for picker display.","examples":["Central European Time - Prague"],"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffOrganisationTimezones","tags":["Organisation"],"description":"Returns all available timezones in the system. Use this to populate a timezone picker when configuring the organisation default timezone.","summary":"List available timezones"}},"/bff/organisation/available-locales":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"All system locales ordered by position.","type":"array","items":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Internal locale ID. Use this value when setting primaryLocaleId in update-profile.","type":"number"},"locale":{"description":"ISO 639-1 locale code. Determines default language for contacts, emails, and content selection.","examples":["cs"],"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"All system locales ordered by position.","type":"array","items":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Internal locale ID. Use this value when setting primaryLocaleId in update-profile.","type":"number"},"locale":{"description":"ISO 639-1 locale code. Determines default language for contacts, emails, and content selection.","examples":["cs"],"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"All system locales ordered by position.","type":"array","items":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Internal locale ID. Use this value when setting primaryLocaleId in update-profile.","type":"number"},"locale":{"description":"ISO 639-1 locale code. Determines default language for contacts, emails, and content selection.","examples":["cs"],"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffOrganisationAvailable-locales","tags":["Organisation"],"description":"Returns all locales available in the system. Use this to populate a locale picker when configuring organisation locales or primary locale.","summary":"List all system locales"}},"/bff/organisation/internal-contact":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"external_id of the org internal contact.","type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","firstName","lastName","companyName","email"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"external_id of the org internal contact.","type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","firstName","lastName","companyName","email"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"external_id of the org internal contact.","type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","firstName","lastName","companyName","email"]}}}}},"operationId":"getBffOrganisationInternal-contact","tags":["Organisation"],"description":"Returns the display fields (external id, name, e-mail, company) of the organisation's internal contact — the `shop__contact` row referenced by `cas__organisation.internal_customer_id`. Consumed by the admin expense modals as the default \"PŘÍJEMCE\" (supplier) on manual writeoffs.","summary":"Get the organisation internal contact display info"}},"/bff/organisation/available-currencies":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"All system currencies ordered by ISO code.","type":"array","items":{"type":"object","required":["id","code","symbol"],"properties":{"id":{"description":"Internal currency ID.","type":"number"},"code":{"description":"ISO 4217 currency code. Use this value to reference the currency across the API.","examples":["CZK"],"type":"string"},"symbol":{"description":"Display symbol of the currency (up to 3 characters).","examples":["Kč"],"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"All system currencies ordered by ISO code.","type":"array","items":{"type":"object","required":["id","code","symbol"],"properties":{"id":{"description":"Internal currency ID.","type":"number"},"code":{"description":"ISO 4217 currency code. Use this value to reference the currency across the API.","examples":["CZK"],"type":"string"},"symbol":{"description":"Display symbol of the currency (up to 3 characters).","examples":["Kč"],"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"All system currencies ordered by ISO code.","type":"array","items":{"type":"object","required":["id","code","symbol"],"properties":{"id":{"description":"Internal currency ID.","type":"number"},"code":{"description":"ISO 4217 currency code. Use this value to reference the currency across the API.","examples":["CZK"],"type":"string"},"symbol":{"description":"Display symbol of the currency (up to 3 characters).","examples":["Kč"],"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffOrganisationAvailable-currencies","tags":["Organisation"],"description":"Returns all currencies available in the system with their ISO 4217 code and display symbol. Use this to populate a currency picker when configuring the organisation default currency.","summary":"List all system currencies"}},"/bff/organisation/available-countries":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"All countries ordered alphabetically by name.","type":"array","items":{"type":"object","required":["id","code","isoCode","name","isEu"],"properties":{"id":{"description":"Internal country ID. Use as accountingCountryId / companyCountryId.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 code.","examples":["CZ"],"type":"string"},"isoCode":{"description":"ISO 3166-1 alpha-3 code.","examples":["CZE"],"type":"string"},"name":{"description":"Country display name.","type":"string"},"isEu":{"description":"Whether this country is an EU member state (drives reverse-charge VAT logic).","type":"boolean"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"All countries ordered alphabetically by name.","type":"array","items":{"type":"object","required":["id","code","isoCode","name","isEu"],"properties":{"id":{"description":"Internal country ID. Use as accountingCountryId / companyCountryId.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 code.","examples":["CZ"],"type":"string"},"isoCode":{"description":"ISO 3166-1 alpha-3 code.","examples":["CZE"],"type":"string"},"name":{"description":"Country display name.","type":"string"},"isEu":{"description":"Whether this country is an EU member state (drives reverse-charge VAT logic).","type":"boolean"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"All countries ordered alphabetically by name.","type":"array","items":{"type":"object","required":["id","code","isoCode","name","isEu"],"properties":{"id":{"description":"Internal country ID. Use as accountingCountryId / companyCountryId.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 code.","examples":["CZ"],"type":"string"},"isoCode":{"description":"ISO 3166-1 alpha-3 code.","examples":["CZE"],"type":"string"},"name":{"description":"Country display name.","type":"string"},"isEu":{"description":"Whether this country is an EU member state (drives reverse-charge VAT logic).","type":"boolean"}}}}},"required":["items"]}}}}},"operationId":"getBffOrganisationAvailable-countries","tags":["Organisation"],"description":"Returns all countries available in the system. Use this to populate a country picker for accountingCountryId in update-profile, contact billing country, or address forms.","summary":"List all system countries"}},"/bff/organisation/detect-country-from-ip":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name","isEu"],"properties":{"id":{"description":"Internal country ID. Use as countryId in /organisation/create.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 code.","examples":["CZ"],"type":"string"},"name":{"description":"Country display name.","type":"string"},"isEu":{"description":"Whether this country is an EU member state.","type":"boolean"}}},{"type":"null"}]}},"required":["country"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"country":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name","isEu"],"properties":{"id":{"description":"Internal country ID. Use as countryId in /organisation/create.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 code.","examples":["CZ"],"type":"string"},"name":{"description":"Country display name.","type":"string"},"isEu":{"description":"Whether this country is an EU member state.","type":"boolean"}}},{"type":"null"}]}},"required":["country"]}},"text/plain":{"schema":{"type":"object","properties":{"country":{"nullable":true,"anyOf":[{"type":"object","required":["id","code","name","isEu"],"properties":{"id":{"description":"Internal country ID. Use as countryId in /organisation/create.","type":"number"},"code":{"description":"ISO 3166-1 alpha-2 code.","examples":["CZ"],"type":"string"},"name":{"description":"Country display name.","type":"string"},"isEu":{"description":"Whether this country is an EU member state.","type":"boolean"}}},{"type":"null"}]}},"required":["country"]}}}}},"operationId":"getBffOrganisationDetect-country-from-ip","tags":["Organisation"],"description":"Returns the core__country row that matches the caller's current IP (via GeoIP city lookup). Used to pre-select a sensible default in the org-create form. Returns { country: null } when the IP has no city enrichment yet (freshly-seen private / reserved IP) — the caller should fall back to a manual pick.","summary":"Detect country from requestor IP"}},"/bff/organisation/defaults-for-country":{"get":{"parameters":[{"description":"core__country.id from GET /organisation/available-countries. Query params are strings in Elysia; parsed as a number server-side.","examples":["158"],"schema":{"type":"string"},"in":"query","name":"countryId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"localeCode":{"description":"ISO 639-1 locale code (cs, en, pl, sk, de, …).","examples":["cs"],"type":"string"},"currencyCode":{"description":"ISO 4217 currency code (CZK, EUR, PLN, USD, GBP).","examples":["CZK"],"type":"string"}},"required":["localeCode","currencyCode"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"localeCode":{"description":"ISO 639-1 locale code (cs, en, pl, sk, de, …).","examples":["cs"],"type":"string"},"currencyCode":{"description":"ISO 4217 currency code (CZK, EUR, PLN, USD, GBP).","examples":["CZK"],"type":"string"}},"required":["localeCode","currencyCode"]}},"text/plain":{"schema":{"type":"object","properties":{"localeCode":{"description":"ISO 639-1 locale code (cs, en, pl, sk, de, …).","examples":["cs"],"type":"string"},"currencyCode":{"description":"ISO 4217 currency code (CZK, EUR, PLN, USD, GBP).","examples":["CZK"],"type":"string"}},"required":["localeCode","currencyCode"]}}}}},"operationId":"getBffOrganisationDefaults-for-country","tags":["Organisation"],"description":"Returns the admin-onboarding default pair for a given HQ country — CZ→(cs, CZK), SK→(sk, EUR), PL→(pl, PLN), DE/AT→(de, EUR), US→(en, USD), GB→(en, GBP). Unknown countries fall back to (en, EUR). The admin \"new organisation\" form calls this on every country change to pre-select the locale and currency pickers.","summary":"Resolve default locale + currency for a country"}},"/bff/organisation/ares-lookup":{"get":{"parameters":[{"description":"Czech company registration number (IČO). Any format accepted — the server runs `parseCompanyRegistrationNumber` which extracts the 8-digit value and validates the mod-11 checksum. Non-matching inputs return `{ found: false }` without erroring.","examples":["25596641"],"schema":{"type":"string"},"in":"query","name":"ico","required":true}],"responses":{"200":{"anyOf":[{"description":"IČO invalid or not reachable in ARES.","type":"object","required":["found"],"properties":{"found":{"const":false,"type":"boolean"}}},{"description":"ARES record found and parsed into a preview-friendly projection.","type":"object","required":["found","ico","name","taxIdentificationNumber","isVatPayer","legalFormCode","address","city","postalCode","countryCode","establishedDate"],"properties":{"found":{"const":true,"type":"boolean"},"ico":{"description":"Normalised 8-digit IČO.","examples":["25596641"],"type":"string"},"name":{"nullable":true,"anyOf":[{"description":"Official business name from ARES.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"description":"DIČ (CZxxxxxxxx) when registered.","type":"string"},{"type":"null"}]},"isVatPayer":{"description":"True when the DPH registration is AKTIVNI in ARES.","type":"boolean"},"legalFormCode":{"nullable":true,"anyOf":[{"description":"ARES legal-form code (e.g. \"101\" = s.r.o.).","type":"string"},{"type":"null"}]},"address":{"nullable":true,"anyOf":[{"description":"Pretty single-line address from `sidlo`.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City from `sidlo.nazevObce`.","type":"string"},{"type":"null"}]},"postalCode":{"nullable":true,"anyOf":[{"description":"Postal code from `sidlo.psc` (as string).","type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"description":"ISO 3166-1 alpha-2 from `sidlo.kodStatu`.","type":"string"},{"type":"null"}]},"establishedDate":{"nullable":true,"anyOf":[{"description":"ISO date of company establishment.","type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"anyOf":[{"description":"IČO invalid or not reachable in ARES.","type":"object","required":["found"],"properties":{"found":{"const":false,"type":"boolean"}}},{"description":"ARES record found and parsed into a preview-friendly projection.","type":"object","required":["found","ico","name","taxIdentificationNumber","isVatPayer","legalFormCode","address","city","postalCode","countryCode","establishedDate"],"properties":{"found":{"const":true,"type":"boolean"},"ico":{"description":"Normalised 8-digit IČO.","examples":["25596641"],"type":"string"},"name":{"nullable":true,"anyOf":[{"description":"Official business name from ARES.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"description":"DIČ (CZxxxxxxxx) when registered.","type":"string"},{"type":"null"}]},"isVatPayer":{"description":"True when the DPH registration is AKTIVNI in ARES.","type":"boolean"},"legalFormCode":{"nullable":true,"anyOf":[{"description":"ARES legal-form code (e.g. \"101\" = s.r.o.).","type":"string"},{"type":"null"}]},"address":{"nullable":true,"anyOf":[{"description":"Pretty single-line address from `sidlo`.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City from `sidlo.nazevObce`.","type":"string"},{"type":"null"}]},"postalCode":{"nullable":true,"anyOf":[{"description":"Postal code from `sidlo.psc` (as string).","type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"description":"ISO 3166-1 alpha-2 from `sidlo.kodStatu`.","type":"string"},{"type":"null"}]},"establishedDate":{"nullable":true,"anyOf":[{"description":"ISO date of company establishment.","type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"description":"IČO invalid or not reachable in ARES.","type":"object","required":["found"],"properties":{"found":{"const":false,"type":"boolean"}}},{"description":"ARES record found and parsed into a preview-friendly projection.","type":"object","required":["found","ico","name","taxIdentificationNumber","isVatPayer","legalFormCode","address","city","postalCode","countryCode","establishedDate"],"properties":{"found":{"const":true,"type":"boolean"},"ico":{"description":"Normalised 8-digit IČO.","examples":["25596641"],"type":"string"},"name":{"nullable":true,"anyOf":[{"description":"Official business name from ARES.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"description":"DIČ (CZxxxxxxxx) when registered.","type":"string"},{"type":"null"}]},"isVatPayer":{"description":"True when the DPH registration is AKTIVNI in ARES.","type":"boolean"},"legalFormCode":{"nullable":true,"anyOf":[{"description":"ARES legal-form code (e.g. \"101\" = s.r.o.).","type":"string"},{"type":"null"}]},"address":{"nullable":true,"anyOf":[{"description":"Pretty single-line address from `sidlo`.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City from `sidlo.nazevObce`.","type":"string"},{"type":"null"}]},"postalCode":{"nullable":true,"anyOf":[{"description":"Postal code from `sidlo.psc` (as string).","type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"description":"ISO 3166-1 alpha-2 from `sidlo.kodStatu`.","type":"string"},{"type":"null"}]},"establishedDate":{"nullable":true,"anyOf":[{"description":"ISO date of company establishment.","type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"anyOf":[{"description":"IČO invalid or not reachable in ARES.","type":"object","required":["found"],"properties":{"found":{"const":false,"type":"boolean"}}},{"description":"ARES record found and parsed into a preview-friendly projection.","type":"object","required":["found","ico","name","taxIdentificationNumber","isVatPayer","legalFormCode","address","city","postalCode","countryCode","establishedDate"],"properties":{"found":{"const":true,"type":"boolean"},"ico":{"description":"Normalised 8-digit IČO.","examples":["25596641"],"type":"string"},"name":{"nullable":true,"anyOf":[{"description":"Official business name from ARES.","type":"string"},{"type":"null"}]},"taxIdentificationNumber":{"nullable":true,"anyOf":[{"description":"DIČ (CZxxxxxxxx) when registered.","type":"string"},{"type":"null"}]},"isVatPayer":{"description":"True when the DPH registration is AKTIVNI in ARES.","type":"boolean"},"legalFormCode":{"nullable":true,"anyOf":[{"description":"ARES legal-form code (e.g. \"101\" = s.r.o.).","type":"string"},{"type":"null"}]},"address":{"nullable":true,"anyOf":[{"description":"Pretty single-line address from `sidlo`.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City from `sidlo.nazevObce`.","type":"string"},{"type":"null"}]},"postalCode":{"nullable":true,"anyOf":[{"description":"Postal code from `sidlo.psc` (as string).","type":"string"},{"type":"null"}]},"countryCode":{"nullable":true,"anyOf":[{"description":"ISO 3166-1 alpha-2 from `sidlo.kodStatu`.","type":"string"},{"type":"null"}]},"establishedDate":{"nullable":true,"anyOf":[{"description":"ISO date of company establishment.","type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getBffOrganisationAres-lookup","tags":["Organisation"],"description":"Previews company data from the ARES registry for the admin \"new organisation\" form. The returned fields are only displayed in the form; the authoritative sync happens inside /organisation/create via `setContactCompanyData` → `syncContactCompanyRecord` once the org and its self-contact exist. CZ-only today; other countries will plug in through `resolveCompanyRegistryBundle` under their own BFF endpoint.","summary":"Lookup Czech company by IČO (ARES)"}},"/bff/organisation/legal-forms":{"get":{"parameters":[{"description":"Filter legal forms by country ID (from GET /organisation/available-countries). Strongly recommended — without it the response includes legal forms for all countries. Query params are always strings in Elysia; the value is parsed as a number server-side.","examples":["158"],"schema":{"type":"string"},"in":"query","name":"countryId","required":false},{"description":"Optional label locale. When provided and a translation exists for (countryCode, slug), the response `name` is the localised label; otherwise the DB `name` is returned unchanged.","examples":["en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Active legal forms ordered by country, then position.","type":"array","items":{"type":"object","required":["id","countryId","countryCode","code","slug","name","isLegalEntity","vatRegistrationDefault"],"properties":{"id":{"description":"Legal form ID. Use as legalFormId in update-profile / contact detail-edit.","type":"number"},"countryId":{"description":"Country this legal form belongs to.","type":"number"},"countryCode":{"description":"ISO 3166-1 alpha-2 code of the country.","examples":["CZ"],"type":"string"},"code":{"description":"Country-specific code (e.g. ARES \"pravniForma\").","examples":["112"],"type":"string"},"slug":{"description":"Cross-country slug (osvc/sro/as/vos/ks/druzstvo/po/fo_podnikatel/neziskovka...).","examples":["sro"],"type":"string"},"name":{"description":"Localized human-readable name.","type":"string"},"isLegalEntity":{"description":"true = legal entity (PO), false = natural person (FO). Drives accounting/invoice logic.","type":"boolean"},"vatRegistrationDefault":{"description":"Whether this legal form is typically a VAT payer by default (UI hint only — not auto-applied).","type":"boolean"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Active legal forms ordered by country, then position.","type":"array","items":{"type":"object","required":["id","countryId","countryCode","code","slug","name","isLegalEntity","vatRegistrationDefault"],"properties":{"id":{"description":"Legal form ID. Use as legalFormId in update-profile / contact detail-edit.","type":"number"},"countryId":{"description":"Country this legal form belongs to.","type":"number"},"countryCode":{"description":"ISO 3166-1 alpha-2 code of the country.","examples":["CZ"],"type":"string"},"code":{"description":"Country-specific code (e.g. ARES \"pravniForma\").","examples":["112"],"type":"string"},"slug":{"description":"Cross-country slug (osvc/sro/as/vos/ks/druzstvo/po/fo_podnikatel/neziskovka...).","examples":["sro"],"type":"string"},"name":{"description":"Localized human-readable name.","type":"string"},"isLegalEntity":{"description":"true = legal entity (PO), false = natural person (FO). Drives accounting/invoice logic.","type":"boolean"},"vatRegistrationDefault":{"description":"Whether this legal form is typically a VAT payer by default (UI hint only — not auto-applied).","type":"boolean"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Active legal forms ordered by country, then position.","type":"array","items":{"type":"object","required":["id","countryId","countryCode","code","slug","name","isLegalEntity","vatRegistrationDefault"],"properties":{"id":{"description":"Legal form ID. Use as legalFormId in update-profile / contact detail-edit.","type":"number"},"countryId":{"description":"Country this legal form belongs to.","type":"number"},"countryCode":{"description":"ISO 3166-1 alpha-2 code of the country.","examples":["CZ"],"type":"string"},"code":{"description":"Country-specific code (e.g. ARES \"pravniForma\").","examples":["112"],"type":"string"},"slug":{"description":"Cross-country slug (osvc/sro/as/vos/ks/druzstvo/po/fo_podnikatel/neziskovka...).","examples":["sro"],"type":"string"},"name":{"description":"Localized human-readable name.","type":"string"},"isLegalEntity":{"description":"true = legal entity (PO), false = natural person (FO). Drives accounting/invoice logic.","type":"boolean"},"vatRegistrationDefault":{"description":"Whether this legal form is typically a VAT payer by default (UI hint only — not auto-applied).","type":"boolean"}}}}},"required":["items"]}}}}},"operationId":"getBffOrganisationLegal-forms","tags":["Organisation"],"description":"Returns active legal forms from core__legal_form. Use to populate the legal form picker on the organisation profile and on contact detail. Pair with the contact/organisation accounting country. The optional `locale` query param translates the `name` field for CZ/SK/AT/DE forms.","summary":"List legal forms (optionally filtered by country)"}},"/bff/organisation/locales":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Configured locales ordered by position.","type":"array","items":{"type":"object","required":["locale","isDefault","position"],"properties":{"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"isDefault":{"description":"Whether this is the default locale for the organisation.","type":"boolean"},"position":{"description":"Display order position (0-based).","type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Configured locales ordered by position.","type":"array","items":{"type":"object","required":["locale","isDefault","position"],"properties":{"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"isDefault":{"description":"Whether this is the default locale for the organisation.","type":"boolean"},"position":{"description":"Display order position (0-based).","type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Configured locales ordered by position.","type":"array","items":{"type":"object","required":["locale","isDefault","position"],"properties":{"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"isDefault":{"description":"Whether this is the default locale for the organisation.","type":"boolean"},"position":{"description":"Display order position (0-based).","type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffOrganisationLocales","tags":["Organisation"],"description":"Returns the list of locales configured for the current organisation. Each locale includes its code, whether it is the default, and its display position.","summary":"Get organisation locales"}},"/bff/organisation/save-locales":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the locales were saved successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the locales were saved successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the locales were saved successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisationSave-locales","tags":["Organisation"],"description":"Replaces the entire locale configuration for the organisation. The array order determines position (0-based). Exactly one locale must be marked as default. At least one locale is required. Clears the locale cache after saving.","summary":"Save organisation locales","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["locales"],"properties":{"locales":{"minItems":1,"description":"New locale configuration. Replaces all existing locales for the organisation.","type":"array","items":{"type":"object","required":["locale","isDefault"],"properties":{"locale":{"minLength":2,"maxLength":2,"description":"Locale code (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"isDefault":{"description":"Whether this locale is the default. Exactly one must be true.","type":"boolean"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["locales"],"properties":{"locales":{"minItems":1,"description":"New locale configuration. Replaces all existing locales for the organisation.","type":"array","items":{"type":"object","required":["locale","isDefault"],"properties":{"locale":{"minLength":2,"maxLength":2,"description":"Locale code (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"isDefault":{"description":"Whether this locale is the default. Exactly one must be true.","type":"boolean"}}}}}}},"text/plain":{"schema":{"type":"object","required":["locales"],"properties":{"locales":{"minItems":1,"description":"New locale configuration. Replaces all existing locales for the organisation.","type":"array","items":{"type":"object","required":["locale","isDefault"],"properties":{"locale":{"minLength":2,"maxLength":2,"description":"Locale code (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"isDefault":{"description":"Whether this locale is the default. Exactly one must be true.","type":"boolean"}}}}}}}}}}},"/bff/organisation/members":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Non-blocked organisation members.","type":"array","items":{"type":"object","required":["id","fullName"],"properties":{"id":{"description":"Internal member ID (use as supportPersonId).","type":"number"},"fullName":{"description":"Full name of the member.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Non-blocked organisation members.","type":"array","items":{"type":"object","required":["id","fullName"],"properties":{"id":{"description":"Internal member ID (use as supportPersonId).","type":"number"},"fullName":{"description":"Full name of the member.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Non-blocked organisation members.","type":"array","items":{"type":"object","required":["id","fullName"],"properties":{"id":{"description":"Internal member ID (use as supportPersonId).","type":"number"},"fullName":{"description":"Full name of the member.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffOrganisationMembers","tags":["Organisation"],"description":"Returns a lightweight list of non-blocked organisation members with internal member ID and full name. Use this for pickers (e.g. support person selection in organisation profile). The returned ID is the internal member ID used by supportPersonId in update-profile.","summary":"List organisation members (simple)"}},"/bff/organisation/vat-rates":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"rates":{"description":"Available VAT rates.","type":"array","items":{"type":"object","required":["rate"],"properties":{"rate":{"description":"VAT rate percentage (e.g. 21, 12, 0).","type":"number"}}}}},"required":["rates"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"rates":{"description":"Available VAT rates.","type":"array","items":{"type":"object","required":["rate"],"properties":{"rate":{"description":"VAT rate percentage (e.g. 21, 12, 0).","type":"number"}}}}},"required":["rates"]}},"text/plain":{"schema":{"type":"object","properties":{"rates":{"description":"Available VAT rates.","type":"array","items":{"type":"object","required":["rate"],"properties":{"rate":{"description":"VAT rate percentage (e.g. 21, 12, 0).","type":"number"}}}}},"required":["rates"]}}}}},"operationId":"getBffOrganisationVat-rates","tags":["Organisation"],"description":"Returns the list of available VAT rates for the organisation. Used for product and order forms.","summary":"Get VAT rates"}},"/bff/organisation/link-blob":{"get":{"parameters":[{"description":"Blob token of the uploaded file to link.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the blob was linked successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the blob was linked successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the blob was linked successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffOrganisationLink-blob","tags":["Organisation"],"description":"Links an uploaded blob to the organisation (e.g. logo, favicon).","summary":"Link blob to organisation"}},"/bff/organisation/link-print-logo-blob":{"get":{"parameters":[{"description":"Blob storage token of the image to use as print logo.","examples":["tok_abc123"],"schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was set successfully.","type":"boolean"},"url":{"description":"Stored print logo URL (a PNG when an SVG was uploaded).","type":"string"},"rasterizedFromSvg":{"description":"True when the uploaded SVG was rendered to PNG.","type":"boolean"}},"required":["success","url","rasterizedFromSvg"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was set successfully.","type":"boolean"},"url":{"description":"Stored print logo URL (a PNG when an SVG was uploaded).","type":"string"},"rasterizedFromSvg":{"description":"True when the uploaded SVG was rendered to PNG.","type":"boolean"}},"required":["success","url","rasterizedFromSvg"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was set successfully.","type":"boolean"},"url":{"description":"Stored print logo URL (a PNG when an SVG was uploaded).","type":"string"},"rasterizedFromSvg":{"description":"True when the uploaded SVG was rendered to PNG.","type":"boolean"}},"required":["success","url","rasterizedFromSvg"]}}}}},"operationId":"getBffOrganisationLink-print-logo-blob","tags":["Organisation"],"description":"Links an uploaded image blob as the organisation print logo used in invoices, receipts, contracts, and PDF documents.","summary":"Set print logo from blob"}},"/bff/organisation/generate-print-logo":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was generated and saved successfully.","type":"boolean"},"printLogoUrl":{"description":"Public download URL of the newly generated print logo.","examples":["https://storage.xhp.cz/org-slug/logo%2Fprint"],"type":"string"}},"required":["success","printLogoUrl"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was generated and saved successfully.","type":"boolean"},"printLogoUrl":{"description":"Public download URL of the newly generated print logo.","examples":["https://storage.xhp.cz/org-slug/logo%2Fprint"],"type":"string"}},"required":["success","printLogoUrl"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was generated and saved successfully.","type":"boolean"},"printLogoUrl":{"description":"Public download URL of the newly generated print logo.","examples":["https://storage.xhp.cz/org-slug/logo%2Fprint"],"type":"string"}},"required":["success","printLogoUrl"]}}}}},"operationId":"postBffOrganisationGenerate-print-logo","tags":["Organisation"],"description":"Loads the organisation base logo, transforms it into a monochrome print-friendly variant via Gemini (nano banana) and stores it as the print logo. Requires the organisation to have a base logo set.","summary":"Generate print logo from base logo via AI"}},"/bff/organisation/print-logo":{"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was removed successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was removed successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the print logo was removed successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"deleteBffOrganisationPrint-logo","tags":["Organisation"],"description":"Removes the print logo from the organisation. Print documents will fall back to the standard organisation logo.","summary":"Remove print logo"}},"/bff/organisation/issue-notification-settings":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"object","required":["issue_created","issue_assigned","customer_reply","operator_reply"],"properties":{"issue_created":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"issue_assigned":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"customer_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"operator_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}}}},"defaults":{"type":"object","required":["issue_created","issue_assigned","customer_reply","operator_reply"],"properties":{"issue_created":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"issue_assigned":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"customer_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"operator_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}}}},"delayMinutes":{"type":"number"},"branchIssueInvolvement":{"nullable":true,"anyOf":[{"anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"branchActionAiHint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"defaultBranchActionAiHint":{"type":"string"}},"required":["rules","defaults","delayMinutes","branchIssueInvolvement","branchActionAiHint","defaultBranchActionAiHint"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"rules":{"type":"object","required":["issue_created","issue_assigned","customer_reply","operator_reply"],"properties":{"issue_created":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"issue_assigned":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"customer_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"operator_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}}}},"defaults":{"type":"object","required":["issue_created","issue_assigned","customer_reply","operator_reply"],"properties":{"issue_created":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"issue_assigned":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"customer_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"operator_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}}}},"delayMinutes":{"type":"number"},"branchIssueInvolvement":{"nullable":true,"anyOf":[{"anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"branchActionAiHint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"defaultBranchActionAiHint":{"type":"string"}},"required":["rules","defaults","delayMinutes","branchIssueInvolvement","branchActionAiHint","defaultBranchActionAiHint"]}},"text/plain":{"schema":{"type":"object","properties":{"rules":{"type":"object","required":["issue_created","issue_assigned","customer_reply","operator_reply"],"properties":{"issue_created":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"issue_assigned":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"customer_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"operator_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}}}},"defaults":{"type":"object","required":["issue_created","issue_assigned","customer_reply","operator_reply"],"properties":{"issue_created":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"issue_assigned":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"customer_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}},"operator_reply":{"type":"object","required":["audiences","extraEmails"],"properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"type":"array","items":{"type":"string"}}}}}},"delayMinutes":{"type":"number"},"branchIssueInvolvement":{"nullable":true,"anyOf":[{"anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"branchActionAiHint":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"defaultBranchActionAiHint":{"type":"string"}},"required":["rules","defaults","delayMinutes","branchIssueInvolvement","branchActionAiHint","defaultBranchActionAiHint"]}}}}},"operationId":"getBffOrganisationIssue-notification-settings","tags":["Organisation"],"description":"Effective internal e-mail rules for tickets: event × audience matrix (`issue_created`, `issue_assigned`, `customer_reply`, `operator_reply` × `mailbox`, `assignee`, `branch`, `participants`) with extra copy addresses, the delay of internal e-mails, the default branch involvement and the AI \"branch must act\" definition. The customer side (reporter) is never governed by these rules. Requires `module-settings`.","summary":"Get issue notification settings (BIZKIT-124)"},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisationIssue-notification-settings","tags":["Organisation"],"description":"Partial update; omitted fields are kept. `rules` replaces the whole matrix (send the full effective matrix from GET; only differences from the platform defaults are stored). Requires `module-settings`.","summary":"Update issue notification settings (BIZKIT-124)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"object","properties":{"issue_created":{"type":"object","properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"issue_assigned":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"customer_reply":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"operator_reply":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}}}},"delayMinutes":{"nullable":true,"anyOf":[{"minimum":0,"maximum":1440,"type":"number"},{"type":"null"}]},"branchIssueInvolvement":{"nullable":true,"anyOf":[{"anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"branchActionAiHint":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"rules":{"type":"object","properties":{"issue_created":{"type":"object","properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"issue_assigned":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"customer_reply":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"operator_reply":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}}}},"delayMinutes":{"nullable":true,"anyOf":[{"minimum":0,"maximum":1440,"type":"number"},{"type":"null"}]},"branchIssueInvolvement":{"nullable":true,"anyOf":[{"anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"branchActionAiHint":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"rules":{"type":"object","properties":{"issue_created":{"type":"object","properties":{"audiences":{"type":"object","properties":{"mailbox":{"type":"boolean"},"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"issue_assigned":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"customer_reply":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}},"operator_reply":{"type":"object","properties":{"audiences":{"type":"object","properties":{"assignee":{"type":"boolean"},"branch":{"type":"boolean"},"participants":{"type":"boolean"}}},"extraEmails":{"maxItems":10,"type":"array","items":{"maxLength":254,"type":"string"}}}}}},"delayMinutes":{"nullable":true,"anyOf":[{"minimum":0,"maximum":1440,"type":"number"},{"type":"null"}]},"branchIssueInvolvement":{"nullable":true,"anyOf":[{"anyOf":[{"const":"all","type":"string"},{"const":"flagged","type":"string"},{"const":"manual","type":"string"}]},{"type":"null"}]},"branchActionAiHint":{"nullable":true,"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/organisation/notification-preference":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"object","required":["experimentNotification","dailyLogReportNotification","orderCreatedInternalNotification","expensePendingApprovalNotification","issueCreatedNotification","issueCommentNotification","paymentGatewayOutageNotification","organisationTechnicalNotification"],"properties":{"experimentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"dailyLogReportNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"orderCreatedInternalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"expensePendingApprovalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCreatedNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCommentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"paymentGatewayOutageNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"organisationTechnicalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]}}},"defaults":{"type":"object","required":["experimentNotification","dailyLogReportNotification","orderCreatedInternalNotification","expensePendingApprovalNotification","issueCreatedNotification","issueCommentNotification","paymentGatewayOutageNotification","organisationTechnicalNotification"],"properties":{"experimentNotification":{"type":"boolean"},"dailyLogReportNotification":{"type":"boolean"},"orderCreatedInternalNotification":{"type":"boolean"},"expensePendingApprovalNotification":{"type":"boolean"},"issueCreatedNotification":{"type":"boolean"},"issueCommentNotification":{"type":"boolean"},"paymentGatewayOutageNotification":{"type":"boolean"},"organisationTechnicalNotification":{"type":"boolean"}}}},"required":["preferences","defaults"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"preferences":{"type":"object","required":["experimentNotification","dailyLogReportNotification","orderCreatedInternalNotification","expensePendingApprovalNotification","issueCreatedNotification","issueCommentNotification","paymentGatewayOutageNotification","organisationTechnicalNotification"],"properties":{"experimentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"dailyLogReportNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"orderCreatedInternalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"expensePendingApprovalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCreatedNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCommentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"paymentGatewayOutageNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"organisationTechnicalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]}}},"defaults":{"type":"object","required":["experimentNotification","dailyLogReportNotification","orderCreatedInternalNotification","expensePendingApprovalNotification","issueCreatedNotification","issueCommentNotification","paymentGatewayOutageNotification","organisationTechnicalNotification"],"properties":{"experimentNotification":{"type":"boolean"},"dailyLogReportNotification":{"type":"boolean"},"orderCreatedInternalNotification":{"type":"boolean"},"expensePendingApprovalNotification":{"type":"boolean"},"issueCreatedNotification":{"type":"boolean"},"issueCommentNotification":{"type":"boolean"},"paymentGatewayOutageNotification":{"type":"boolean"},"organisationTechnicalNotification":{"type":"boolean"}}}},"required":["preferences","defaults"]}},"text/plain":{"schema":{"type":"object","properties":{"preferences":{"type":"object","required":["experimentNotification","dailyLogReportNotification","orderCreatedInternalNotification","expensePendingApprovalNotification","issueCreatedNotification","issueCommentNotification","paymentGatewayOutageNotification","organisationTechnicalNotification"],"properties":{"experimentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"dailyLogReportNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"orderCreatedInternalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"expensePendingApprovalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCreatedNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCommentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"paymentGatewayOutageNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"organisationTechnicalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]}}},"defaults":{"type":"object","required":["experimentNotification","dailyLogReportNotification","orderCreatedInternalNotification","expensePendingApprovalNotification","issueCreatedNotification","issueCommentNotification","paymentGatewayOutageNotification","organisationTechnicalNotification"],"properties":{"experimentNotification":{"type":"boolean"},"dailyLogReportNotification":{"type":"boolean"},"orderCreatedInternalNotification":{"type":"boolean"},"expensePendingApprovalNotification":{"type":"boolean"},"issueCreatedNotification":{"type":"boolean"},"issueCommentNotification":{"type":"boolean"},"paymentGatewayOutageNotification":{"type":"boolean"},"organisationTechnicalNotification":{"type":"boolean"}}}},"required":["preferences","defaults"]}}}}},"operationId":"getBffOrganisationNotification-preference","tags":["Organisation"],"description":"Returns the per-organisation opt-in / opt-out overrides for internal platform notifications. Each preference is nullable: `true` = force on, `false` = force off, `null` = fall back to the platform default (also included in the response so the UI can display \"Default (on)\" or \"Default (off)\").","summary":"Get organisation notification preferences"},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisationNotification-preference","tags":["Organisation"],"description":"Partial update of the always-present preference row. Any subset of the eight keys may be sent. `true`/`false` write an explicit override; `null` clears the row back to the platform default. Omitted keys are left untouched.","summary":"Update organisation notification preferences","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"experimentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"dailyLogReportNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"orderCreatedInternalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"expensePendingApprovalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCreatedNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCommentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"paymentGatewayOutageNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"organisationTechnicalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"experimentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"dailyLogReportNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"orderCreatedInternalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"expensePendingApprovalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCreatedNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCommentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"paymentGatewayOutageNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"organisationTechnicalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"experimentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"dailyLogReportNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"orderCreatedInternalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"expensePendingApprovalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCreatedNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"issueCommentNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"paymentGatewayOutageNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]},"organisationTechnicalNotification":{"nullable":true,"anyOf":[{"type":"boolean"},{"type":"null"}]}}}}}}}},"/bff/organisation/lifecycle/deactivate":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"deletedDate":{"type":"string"},"alreadyDeactivated":{"type":"boolean"}},"required":["success","organisationId","name","deletedDate","alreadyDeactivated"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"deletedDate":{"type":"string"},"alreadyDeactivated":{"type":"boolean"}},"required":["success","organisationId","name","deletedDate","alreadyDeactivated"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"deletedDate":{"type":"string"},"alreadyDeactivated":{"type":"boolean"}},"required":["success","organisationId","name","deletedDate","alreadyDeactivated"]}}}}},"operationId":"postBffOrganisationLifecycleDeactivate","tags":["Organisation"],"description":"Marks `cas__organisation.deleted_date = NOW()`. Reversible via /lifecycle/reactivate. Callable only from the internal platform organisation (INTERNAL_ORGANISATION_ID). Data is left intact until a subsequent /lifecycle/purge call.","summary":"Deactivate an organisation (soft-delete)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to deactivate (soft-delete). Must not be the internal org.","type":"number"},"reason":{"description":"Free-form reason kept on the audit trail.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to deactivate (soft-delete). Must not be the internal org.","type":"number"},"reason":{"description":"Free-form reason kept on the audit trail.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to deactivate (soft-delete). Must not be the internal org.","type":"number"},"reason":{"description":"Free-form reason kept on the audit trail.","type":"string"}}}}}}}},"/bff/organisation/lifecycle/reactivate":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"alreadyActive":{"type":"boolean"}},"required":["success","organisationId","name","alreadyActive"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"alreadyActive":{"type":"boolean"}},"required":["success","organisationId","name","alreadyActive"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"alreadyActive":{"type":"boolean"}},"required":["success","organisationId","name","alreadyActive"]}}}}},"operationId":"postBffOrganisationLifecycleReactivate","tags":["Organisation"],"description":"Clears `cas__organisation.deleted_date`. No-op on already-active orgs.","summary":"Reactivate a previously deactivated organisation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to reactivate (clear deleted_date).","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to reactivate (clear deleted_date).","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to reactivate (clear deleted_date).","type":"number"}}}}}}}},"/bff/organisation/lifecycle/suspend":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"suspendedDate":{"type":"string"},"alreadySuspended":{"type":"boolean"}},"required":["success","organisationId","name","suspendedDate","alreadySuspended"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"suspendedDate":{"type":"string"},"alreadySuspended":{"type":"boolean"}},"required":["success","organisationId","name","suspendedDate","alreadySuspended"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"suspendedDate":{"type":"string"},"alreadySuspended":{"type":"boolean"}},"required":["success","organisationId","name","suspendedDate","alreadySuspended"]}}}}},"operationId":"postBffOrganisationLifecycleSuspend","tags":["Organisation"],"description":"Sets `cas__organisation.suspended_date = NOW()`. The organisation is frozen: background jobs skip it, its API keys are rejected and no new blob can be written. Data is kept intact. Reversible via /lifecycle/resume. Writes a critical system log (ORG_SUSPEND) with a notification e-mail. Callable only by a human root member of the internal platform organisation.","summary":"Suspend (freeze) an organisation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to suspend. Must not be the internal org.","type":"number"},"reason":{"maxLength":1000,"description":"Free-form reason kept in the system log + activity.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to suspend. Must not be the internal org.","type":"number"},"reason":{"maxLength":1000,"description":"Free-form reason kept in the system log + activity.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to suspend. Must not be the internal org.","type":"number"},"reason":{"maxLength":1000,"description":"Free-form reason kept in the system log + activity.","type":"string"}}}}}}}},"/bff/organisation/lifecycle/resume":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"alreadyRunning":{"type":"boolean"}},"required":["success","organisationId","name","alreadyRunning"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"alreadyRunning":{"type":"boolean"}},"required":["success","organisationId","name","alreadyRunning"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"type":"number"},"name":{"type":"string"},"alreadyRunning":{"type":"boolean"}},"required":["success","organisationId","name","alreadyRunning"]}}}}},"operationId":"postBffOrganisationLifecycleResume","tags":["Organisation"],"description":"Clears `cas__organisation.suspended_date`. No-op on running orgs. Writes a critical system log (ORG_RESUME) with a notification e-mail.","summary":"Resume a suspended organisation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to resume (clear suspended_date).","type":"number"},"reason":{"maxLength":1000,"description":"Free-form reason kept in the system log + activity.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to resume (clear suspended_date).","type":"number"},"reason":{"maxLength":1000,"description":"Free-form reason kept in the system log + activity.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to resume (clear suspended_date).","type":"number"},"reason":{"maxLength":1000,"description":"Free-form reason kept in the system log + activity.","type":"string"}}}}}}}},"/bff/organisation/lifecycle/purge":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"report":{"type":"object","required":["organisationId","organisationName","dryRun","stats","tablesTouched","rowsDeletedByTable","totalRowsDeleted","blobsDeletedFromStorage","usersRepointed","usersDeleted","nullableRefsSetNull"],"properties":{"organisationId":{"type":"number"},"organisationName":{"type":"string"},"dryRun":{"type":"boolean"},"stats":{"type":"object","required":["directCount","transitiveCount","fkEdgesInScope","selfRefsPreNulled"],"properties":{"directCount":{"type":"number"},"transitiveCount":{"type":"number"},"fkEdgesInScope":{"type":"number"},"selfRefsPreNulled":{"type":"number"}}},"tablesTouched":{"type":"number"},"rowsDeletedByTable":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"totalRowsDeleted":{"type":"number"},"blobsDeletedFromStorage":{"type":"number"},"usersRepointed":{"type":"number"},"usersDeleted":{"type":"number"},"nullableRefsSetNull":{"type":"number"}}}},"required":["success","report"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"report":{"type":"object","required":["organisationId","organisationName","dryRun","stats","tablesTouched","rowsDeletedByTable","totalRowsDeleted","blobsDeletedFromStorage","usersRepointed","usersDeleted","nullableRefsSetNull"],"properties":{"organisationId":{"type":"number"},"organisationName":{"type":"string"},"dryRun":{"type":"boolean"},"stats":{"type":"object","required":["directCount","transitiveCount","fkEdgesInScope","selfRefsPreNulled"],"properties":{"directCount":{"type":"number"},"transitiveCount":{"type":"number"},"fkEdgesInScope":{"type":"number"},"selfRefsPreNulled":{"type":"number"}}},"tablesTouched":{"type":"number"},"rowsDeletedByTable":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"totalRowsDeleted":{"type":"number"},"blobsDeletedFromStorage":{"type":"number"},"usersRepointed":{"type":"number"},"usersDeleted":{"type":"number"},"nullableRefsSetNull":{"type":"number"}}}},"required":["success","report"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"report":{"type":"object","required":["organisationId","organisationName","dryRun","stats","tablesTouched","rowsDeletedByTable","totalRowsDeleted","blobsDeletedFromStorage","usersRepointed","usersDeleted","nullableRefsSetNull"],"properties":{"organisationId":{"type":"number"},"organisationName":{"type":"string"},"dryRun":{"type":"boolean"},"stats":{"type":"object","required":["directCount","transitiveCount","fkEdgesInScope","selfRefsPreNulled"],"properties":{"directCount":{"type":"number"},"transitiveCount":{"type":"number"},"fkEdgesInScope":{"type":"number"},"selfRefsPreNulled":{"type":"number"}}},"tablesTouched":{"type":"number"},"rowsDeletedByTable":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"totalRowsDeleted":{"type":"number"},"blobsDeletedFromStorage":{"type":"number"},"usersRepointed":{"type":"number"},"usersDeleted":{"type":"number"},"nullableRefsSetNull":{"type":"number"}}}},"required":["success","report"]}}}}},"operationId":"postBffOrganisationLifecyclePurge","tags":["Organisation"],"description":"Cascade-deletes an organisation and every row that FK-transitively depends on it (~276 tables). The target must have been deactivated first (deleted_date IS NOT NULL) unless `skipDeactivationCheck: true` is passed. Users whose canonical contact was in this org are repointed to another org membership if any, or deleted otherwise. Returns a per-table row-count report. Use `dryRun: true` first to preview the impact.","summary":"Hard-purge an organisation (irreversible)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to hard-purge.","type":"number"},"dryRun":{"description":"Compute the plan + row counts without deleting.","type":"boolean"},"skipDeactivationCheck":{"description":"Bypass the \"must be deactivated first\" gate. Only use for confirmed bot/spam organisations.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to hard-purge.","type":"number"},"dryRun":{"description":"Compute the plan + row counts without deleting.","type":"boolean"},"skipDeactivationCheck":{"description":"Bypass the \"must be deactivated first\" gate. Only use for confirmed bot/spam organisations.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["organisationId"],"properties":{"organisationId":{"description":"Target organisation id to hard-purge.","type":"number"},"dryRun":{"description":"Compute the plan + row counts without deleting.","type":"boolean"},"skipDeactivationCheck":{"description":"Bypass the \"must be deactivated first\" gate. Only use for confirmed bot/spam organisations.","type":"boolean"}}}}}}}},"/bff/organisation/create":{"post":{"parameters":[],"responses":{"200":{"description":"Organisation created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"description":"Always true on success.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffOrganisationCreate","tags":["Organisation"],"description":"Creates a new organisation and makes the authenticated user its root member. By default the org has no parent (managed directly by BizKitHub); the caller's current session org is never propagated as parent_id. A white-label partner may pass `parentOrganisationSlug` to place the org under its partner organisation. Requires authenticated user.","summary":"Create new organisation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationName","timezone"],"properties":{"organisationName":{"minLength":1,"description":"Name of the new organisation. Must be unique.","examples":["Acme Corp"],"type":"string"},"timezone":{"description":"Timezone identifier (e.g., \"Europe/Prague\", \"America/New_York\").","examples":["Europe/Prague"],"type":"string"},"description":{"description":"Optional description of the organisation.","examples":["Our main production workspace."],"type":"string"},"countryId":{"description":"Primary HQ country FK (core__country.id, from GET /organisation/available-countries). Drives per-country security posture. If omitted, resolved from the request IP with Czech Republic as ultimate default.","examples":[158],"type":"number"},"companyRegistrationNumber":{"description":"Optional company registration number (IČO in CZ). When present and the registry for the resolved country is reachable (ARES for CZ), the self-contact is enriched with the official business name, address, DIČ and VAT payer status so the org is immediately ready to issue invoices. Admin UI hides this field outside CZ.","examples":["25596641"],"type":"string"},"technicalEmail":{"format":"email","description":"Technical / accounting mailbox that becomes the e-mail of the org's accounting self-contact (`internalCustomerId`). When omitted or equal to the founder's address, a synthetic `-org-<random>@` alias is minted (BC with pre-STEP 2 behaviour). Dedicated mailboxes like `fakturace@acme.cz` land here.","examples":["fakturace@acme.cz"],"type":"string"},"defaultLocaleCode":{"description":"ISO 639-1 locale code for the org's primary language (cs, en, pl, sk, de, …). When omitted, derived from `countryId` via the country→defaults mapping (CZ→cs, SK→sk, …).","examples":["cs"],"type":"string"},"defaultCurrencyCode":{"description":"ISO 4217 currency code (CZK, EUR, PLN, USD, …). When omitted, derived from `countryId` via the country→defaults mapping (CZ→CZK, SK/DE/AT→EUR, PL→PLN, …).","examples":["CZK"],"type":"string"},"parentOrganisationSlug":{"nullable":true,"anyOf":[{"description":"Integration partner (white-label) that will manage the new org (`parent_id`). Must be one of GET /organisation/white-label-parent-options — the caller must be an active member of an org with an active white-label licence. Omit / null = managed directly by BizKitHub.","examples":["7-napadu-s-r-o"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationName","timezone"],"properties":{"organisationName":{"minLength":1,"description":"Name of the new organisation. Must be unique.","examples":["Acme Corp"],"type":"string"},"timezone":{"description":"Timezone identifier (e.g., \"Europe/Prague\", \"America/New_York\").","examples":["Europe/Prague"],"type":"string"},"description":{"description":"Optional description of the organisation.","examples":["Our main production workspace."],"type":"string"},"countryId":{"description":"Primary HQ country FK (core__country.id, from GET /organisation/available-countries). Drives per-country security posture. If omitted, resolved from the request IP with Czech Republic as ultimate default.","examples":[158],"type":"number"},"companyRegistrationNumber":{"description":"Optional company registration number (IČO in CZ). When present and the registry for the resolved country is reachable (ARES for CZ), the self-contact is enriched with the official business name, address, DIČ and VAT payer status so the org is immediately ready to issue invoices. Admin UI hides this field outside CZ.","examples":["25596641"],"type":"string"},"technicalEmail":{"format":"email","description":"Technical / accounting mailbox that becomes the e-mail of the org's accounting self-contact (`internalCustomerId`). When omitted or equal to the founder's address, a synthetic `-org-<random>@` alias is minted (BC with pre-STEP 2 behaviour). Dedicated mailboxes like `fakturace@acme.cz` land here.","examples":["fakturace@acme.cz"],"type":"string"},"defaultLocaleCode":{"description":"ISO 639-1 locale code for the org's primary language (cs, en, pl, sk, de, …). When omitted, derived from `countryId` via the country→defaults mapping (CZ→cs, SK→sk, …).","examples":["cs"],"type":"string"},"defaultCurrencyCode":{"description":"ISO 4217 currency code (CZK, EUR, PLN, USD, …). When omitted, derived from `countryId` via the country→defaults mapping (CZ→CZK, SK/DE/AT→EUR, PL→PLN, …).","examples":["CZK"],"type":"string"},"parentOrganisationSlug":{"nullable":true,"anyOf":[{"description":"Integration partner (white-label) that will manage the new org (`parent_id`). Must be one of GET /organisation/white-label-parent-options — the caller must be an active member of an org with an active white-label licence. Omit / null = managed directly by BizKitHub.","examples":["7-napadu-s-r-o"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["organisationName","timezone"],"properties":{"organisationName":{"minLength":1,"description":"Name of the new organisation. Must be unique.","examples":["Acme Corp"],"type":"string"},"timezone":{"description":"Timezone identifier (e.g., \"Europe/Prague\", \"America/New_York\").","examples":["Europe/Prague"],"type":"string"},"description":{"description":"Optional description of the organisation.","examples":["Our main production workspace."],"type":"string"},"countryId":{"description":"Primary HQ country FK (core__country.id, from GET /organisation/available-countries). Drives per-country security posture. If omitted, resolved from the request IP with Czech Republic as ultimate default.","examples":[158],"type":"number"},"companyRegistrationNumber":{"description":"Optional company registration number (IČO in CZ). When present and the registry for the resolved country is reachable (ARES for CZ), the self-contact is enriched with the official business name, address, DIČ and VAT payer status so the org is immediately ready to issue invoices. Admin UI hides this field outside CZ.","examples":["25596641"],"type":"string"},"technicalEmail":{"format":"email","description":"Technical / accounting mailbox that becomes the e-mail of the org's accounting self-contact (`internalCustomerId`). When omitted or equal to the founder's address, a synthetic `-org-<random>@` alias is minted (BC with pre-STEP 2 behaviour). Dedicated mailboxes like `fakturace@acme.cz` land here.","examples":["fakturace@acme.cz"],"type":"string"},"defaultLocaleCode":{"description":"ISO 639-1 locale code for the org's primary language (cs, en, pl, sk, de, …). When omitted, derived from `countryId` via the country→defaults mapping (CZ→cs, SK→sk, …).","examples":["cs"],"type":"string"},"defaultCurrencyCode":{"description":"ISO 4217 currency code (CZK, EUR, PLN, USD, …). When omitted, derived from `countryId` via the country→defaults mapping (CZ→CZK, SK/DE/AT→EUR, PL→PLN, …).","examples":["CZK"],"type":"string"},"parentOrganisationSlug":{"nullable":true,"anyOf":[{"description":"Integration partner (white-label) that will manage the new org (`parent_id`). Must be one of GET /organisation/white-label-parent-options — the caller must be an active member of an org with an active white-label licence. Omit / null = managed directly by BizKitHub.","examples":["7-napadu-s-r-o"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/organisation/white-label-parent-options":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","emoji"],"properties":{"id":{"description":"Partner organisation ID.","type":"number"},"slug":{"description":"Partner organisation slug — pass as `parentOrganisationSlug`.","type":"string"},"name":{"description":"Partner organisation name.","type":"string"},"emoji":{"description":"Partner organisation emoji.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","emoji"],"properties":{"id":{"description":"Partner organisation ID.","type":"number"},"slug":{"description":"Partner organisation slug — pass as `parentOrganisationSlug`.","type":"string"},"name":{"description":"Partner organisation name.","type":"string"},"emoji":{"description":"Partner organisation emoji.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","slug","name","emoji"],"properties":{"id":{"description":"Partner organisation ID.","type":"number"},"slug":{"description":"Partner organisation slug — pass as `parentOrganisationSlug`.","type":"string"},"name":{"description":"Partner organisation name.","type":"string"},"emoji":{"description":"Partner organisation emoji.","anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getBffOrganisationWhite-label-parent-options","tags":["Organisation"],"description":"Organisations with an active white-label licence where the caller is an active member. Drives the \"Integration partner\" picker on the create-organisation form; an empty list means the picker is hidden and new orgs are managed directly by BizKitHub.","summary":"Integration partners the caller may pick as parent of a new organisation"}},"/bff/organisation/create-check":{"post":{"parameters":[],"responses":{"200":{"description":"Organisation name availability check result.","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"description":"Whether the organisation name is available for use.","examples":[true],"type":"boolean"},"name":{"description":"The organisation name that was checked.","examples":["Acme Corp"],"type":"string"},"slug":{"description":"Generated URL-friendly slug for the organisation. Guaranteed to be unique.","examples":["acme-corp"],"type":"string"}},"required":["available","name","slug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"available":{"description":"Whether the organisation name is available for use.","examples":[true],"type":"boolean"},"name":{"description":"The organisation name that was checked.","examples":["Acme Corp"],"type":"string"},"slug":{"description":"Generated URL-friendly slug for the organisation. Guaranteed to be unique.","examples":["acme-corp"],"type":"string"}},"required":["available","name","slug"]}},"text/plain":{"schema":{"type":"object","properties":{"available":{"description":"Whether the organisation name is available for use.","examples":[true],"type":"boolean"},"name":{"description":"The organisation name that was checked.","examples":["Acme Corp"],"type":"string"},"slug":{"description":"Generated URL-friendly slug for the organisation. Guaranteed to be unique.","examples":["acme-corp"],"type":"string"}},"required":["available","name","slug"]}}}}},"operationId":"postBffOrganisationCreate-check","tags":["Organisation"],"description":"Checks if the proposed organisation name is available and generates a unique URL slug. Use this endpoint before creating an organisation to validate the name.","summary":"Check organisation name availability","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationName"],"properties":{"organisationName":{"description":"Proposed organisation name to check availability.","examples":["Acme Corp"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationName"],"properties":{"organisationName":{"description":"Proposed organisation name to check availability.","examples":["Acme Corp"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationName"],"properties":{"organisationName":{"description":"Proposed organisation name to check availability.","examples":["Acme Corp"],"type":"string"}}}}}}}},"/bff/packeta/sync-branches":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed successfully.","default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed successfully.","default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffPacketaSync-branches","tags":["Packeta"],"summary":"Sync Packeta branch points","description":"Fetches and synchronizes Packeta (Zasilkovna) pickup branch points from the Packeta API. Currently syncs Czech locale branches. Runs idempotently -- existing branches are updated, new ones inserted."}},"/bff/payment-gateway/list":{"get":{"responses":{"200":{"description":"List of payment gateway instances with usage statistics.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"List of configured payment gateways.","type":"array","items":{"description":"Payment gateway instance configuration and statistics.","type":"object","required":["code","description","environment","active","insertedDate","gatewayCode","gatewayName","paymentCount","turnoverLast30d","turnoverPrevious30d","turnoverDeltaPct","turnoverCurrencyCode","issuerExternalId","issuerName"],"properties":{"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description of the gateway configuration.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Whether the gateway is currently active and can process payments.","type":"boolean"},"insertedDate":{"description":"Date when the gateway was configured.","anyOf":[{"description":"Date when the gateway was configured.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"gatewayCode":{"description":"Provider code (e.g., \"gopay\", \"comgate\", \"stripe\").","type":"string"},"gatewayName":{"description":"Human-readable provider name.","type":"string"},"paymentCount":{"description":"Total number of payments processed through this gateway.","type":"number"},"lastUsedDate":{"description":"Date of the most recent payment attempt.","anyOf":[{"description":"Date of the most recent payment attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"turnoverLast30d":{"description":"SUM of successful in-payments (PAID/COMPLETE, non-storno orders) in the last 30 days, in `turnoverCurrencyCode`.","type":"number"},"turnoverPrevious30d":{"description":"Same aggregation as `turnoverLast30d` but over the previous 30-day window (60..30 days ago). Baseline for `turnoverDeltaPct`.","type":"number"},"turnoverDeltaPct":{"description":"Percentage change of `turnoverLast30d` vs `turnoverPrevious30d`. `null` when the previous window had zero turnover — no meaningful baseline.","anyOf":[{"type":"number"},{"type":"null"}]},"turnoverCurrencyCode":{"description":"Organisation default currency code (e.g. \"CZK\") — the currency of the turnover totals.","type":"string"},"issuerExternalId":{"description":"External id (`shop__contact.external_id`) of the invoice issuer bound to this gateway.","type":"string"},"issuerName":{"description":"Display name of the invoice issuer — first + last name, falls back to company_name, falls back to the external id.","type":"string"}}}},"itemCount":{"description":"Total number of gateway instances.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"List of configured payment gateways.","type":"array","items":{"description":"Payment gateway instance configuration and statistics.","type":"object","required":["code","description","environment","active","insertedDate","gatewayCode","gatewayName","paymentCount","turnoverLast30d","turnoverPrevious30d","turnoverDeltaPct","turnoverCurrencyCode","issuerExternalId","issuerName"],"properties":{"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description of the gateway configuration.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Whether the gateway is currently active and can process payments.","type":"boolean"},"insertedDate":{"description":"Date when the gateway was configured.","anyOf":[{"description":"Date when the gateway was configured.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"gatewayCode":{"description":"Provider code (e.g., \"gopay\", \"comgate\", \"stripe\").","type":"string"},"gatewayName":{"description":"Human-readable provider name.","type":"string"},"paymentCount":{"description":"Total number of payments processed through this gateway.","type":"number"},"lastUsedDate":{"description":"Date of the most recent payment attempt.","anyOf":[{"description":"Date of the most recent payment attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"turnoverLast30d":{"description":"SUM of successful in-payments (PAID/COMPLETE, non-storno orders) in the last 30 days, in `turnoverCurrencyCode`.","type":"number"},"turnoverPrevious30d":{"description":"Same aggregation as `turnoverLast30d` but over the previous 30-day window (60..30 days ago). Baseline for `turnoverDeltaPct`.","type":"number"},"turnoverDeltaPct":{"description":"Percentage change of `turnoverLast30d` vs `turnoverPrevious30d`. `null` when the previous window had zero turnover — no meaningful baseline.","anyOf":[{"type":"number"},{"type":"null"}]},"turnoverCurrencyCode":{"description":"Organisation default currency code (e.g. \"CZK\") — the currency of the turnover totals.","type":"string"},"issuerExternalId":{"description":"External id (`shop__contact.external_id`) of the invoice issuer bound to this gateway.","type":"string"},"issuerName":{"description":"Display name of the invoice issuer — first + last name, falls back to company_name, falls back to the external id.","type":"string"}}}},"itemCount":{"description":"Total number of gateway instances.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"List of configured payment gateways.","type":"array","items":{"description":"Payment gateway instance configuration and statistics.","type":"object","required":["code","description","environment","active","insertedDate","gatewayCode","gatewayName","paymentCount","turnoverLast30d","turnoverPrevious30d","turnoverDeltaPct","turnoverCurrencyCode","issuerExternalId","issuerName"],"properties":{"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description of the gateway configuration.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Whether the gateway is currently active and can process payments.","type":"boolean"},"insertedDate":{"description":"Date when the gateway was configured.","anyOf":[{"description":"Date when the gateway was configured.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"gatewayCode":{"description":"Provider code (e.g., \"gopay\", \"comgate\", \"stripe\").","type":"string"},"gatewayName":{"description":"Human-readable provider name.","type":"string"},"paymentCount":{"description":"Total number of payments processed through this gateway.","type":"number"},"lastUsedDate":{"description":"Date of the most recent payment attempt.","anyOf":[{"description":"Date of the most recent payment attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"turnoverLast30d":{"description":"SUM of successful in-payments (PAID/COMPLETE, non-storno orders) in the last 30 days, in `turnoverCurrencyCode`.","type":"number"},"turnoverPrevious30d":{"description":"Same aggregation as `turnoverLast30d` but over the previous 30-day window (60..30 days ago). Baseline for `turnoverDeltaPct`.","type":"number"},"turnoverDeltaPct":{"description":"Percentage change of `turnoverLast30d` vs `turnoverPrevious30d`. `null` when the previous window had zero turnover — no meaningful baseline.","anyOf":[{"type":"number"},{"type":"null"}]},"turnoverCurrencyCode":{"description":"Organisation default currency code (e.g. \"CZK\") — the currency of the turnover totals.","type":"string"},"issuerExternalId":{"description":"External id (`shop__contact.external_id`) of the invoice issuer bound to this gateway.","type":"string"},"issuerName":{"description":"Display name of the invoice issuer — first + last name, falls back to company_name, falls back to the external id.","type":"string"}}}},"itemCount":{"description":"Total number of gateway instances.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPayment-gatewayList","tags":["Payment Gateway"],"summary":"List payment gateways","description":"Returns a list of all configured payment gateway instances for the organisation. Each gateway includes basic configuration, usage statistics, and last activity date. Sensitive credentials (API keys, secrets) are NOT included - use the /keys endpoint for those."}},"/bff/payment-gateway/list-for-order-group":{"get":{"responses":{"200":{"description":"Merged list of selectable gateway instances.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Gateway instance eligible for selection as an order-group preference.","type":"object","required":["code","description","environment","active","gatewayCode","gatewayName","foreign"],"properties":{"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description of the gateway configuration.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Whether the gateway is currently active.","type":"boolean"},"gatewayCode":{"description":"Provider code (e.g., \"gopay\", \"comgate\", \"stripe\").","type":"string"},"gatewayName":{"description":"Human-readable provider name.","type":"string"},"foreign":{"description":"True when the gateway instance is owned by a different organisation but already referenced by one of this organisation's order groups (legacy binding).","type":"boolean"}}}},"itemCount":{"description":"Total number of items.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Gateway instance eligible for selection as an order-group preference.","type":"object","required":["code","description","environment","active","gatewayCode","gatewayName","foreign"],"properties":{"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description of the gateway configuration.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Whether the gateway is currently active.","type":"boolean"},"gatewayCode":{"description":"Provider code (e.g., \"gopay\", \"comgate\", \"stripe\").","type":"string"},"gatewayName":{"description":"Human-readable provider name.","type":"string"},"foreign":{"description":"True when the gateway instance is owned by a different organisation but already referenced by one of this organisation's order groups (legacy binding).","type":"boolean"}}}},"itemCount":{"description":"Total number of items.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Gateway instance eligible for selection as an order-group preference.","type":"object","required":["code","description","environment","active","gatewayCode","gatewayName","foreign"],"properties":{"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description of the gateway configuration.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Whether the gateway is currently active.","type":"boolean"},"gatewayCode":{"description":"Provider code (e.g., \"gopay\", \"comgate\", \"stripe\").","type":"string"},"gatewayName":{"description":"Human-readable provider name.","type":"string"},"foreign":{"description":"True when the gateway instance is owned by a different organisation but already referenced by one of this organisation's order groups (legacy binding).","type":"boolean"}}}},"itemCount":{"description":"Total number of items.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPayment-gatewayList-for-order-group","tags":["Payment Gateway"],"summary":"List gateways selectable for an order-group preference","description":"Returns the union of (a) all payment gateway instances owned by the organisation and (b) gateway instances owned by other organisations that are already referenced by at least one of this organisation's order groups via shop__order_payment_gateway_preference (legacy cross-organisation bindings). Used by the workflow \"Payment gateway for group\" modal so the operator can keep historical bindings consistent across groups."}},"/bff/payment-gateway/detail":{"get":{"parameters":[{"description":"Unique code/slug of the gateway instance.","examples":["gopay-production"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"description":"Detailed gateway information with statistics.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Internal database ID.","type":"string"},"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"environmentLabel":{"description":"Human-readable environment label.","type":"string"},"active":{"description":"Whether the gateway is active.","type":"boolean"},"insertedDate":{"description":"Date when the gateway was configured.","anyOf":[{"description":"Date when the gateway was configured.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"merchantId":{"description":"Merchant ID (if applicable for the provider).","type":"string"},"extra":{"description":"Additional provider-specific configuration.","type":"object","properties":{}},"providerId":{"description":"Internal provider ID.","type":"number"},"gatewayCode":{"description":"Provider code.","type":"string"},"gatewayName":{"description":"Provider name.","type":"string"},"paymentCount":{"description":"Total number of payments.","type":"number"},"paidPaymentCount":{"description":"Number of successful payments.","type":"number"},"totalAmount":{"description":"Total amount processed (successful payments only).","type":"number"},"lastUsedDate":{"description":"Date of most recent payment.","anyOf":[{"description":"Date of most recent payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"firstUsedDate":{"description":"Date of first payment.","anyOf":[{"description":"Date of first payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"issuer":{"description":"Invoice issuer bound to this gateway. Always present — the FK on the instance table is NOT NULL.","type":"object","required":["externalId","displayName","boundOrderGroupCount"],"properties":{"externalId":{"description":"Issuer contact external id.","type":"string"},"displayName":{"description":"Issuer display name (first + last name; falls back to company name; falls back to id).","type":"string"},"companyName":{"description":"Company name if set.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ / VAT id).","type":"string"},"primaryAddress":{"description":"Primary billing address of the issuer. Absent when the contact has none configured.","type":"object","properties":{"streetAddress":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"}}},"boundOrderGroupCount":{"description":"How many `shop__order_group` rows in this org already use this contact as their invoice issuer. Non-zero means the admin can verify the same contact is really used as an invoice issuer elsewhere.","type":"number"}}}},"required":["id","code","description","environment","environmentLabel","active","insertedDate","extra","providerId","gatewayCode","gatewayName","paymentCount","paidPaymentCount","totalAmount","issuer"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Internal database ID.","type":"string"},"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"environmentLabel":{"description":"Human-readable environment label.","type":"string"},"active":{"description":"Whether the gateway is active.","type":"boolean"},"insertedDate":{"description":"Date when the gateway was configured.","anyOf":[{"description":"Date when the gateway was configured.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"merchantId":{"description":"Merchant ID (if applicable for the provider).","type":"string"},"extra":{"description":"Additional provider-specific configuration.","type":"object","properties":{}},"providerId":{"description":"Internal provider ID.","type":"number"},"gatewayCode":{"description":"Provider code.","type":"string"},"gatewayName":{"description":"Provider name.","type":"string"},"paymentCount":{"description":"Total number of payments.","type":"number"},"paidPaymentCount":{"description":"Number of successful payments.","type":"number"},"totalAmount":{"description":"Total amount processed (successful payments only).","type":"number"},"lastUsedDate":{"description":"Date of most recent payment.","anyOf":[{"description":"Date of most recent payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"firstUsedDate":{"description":"Date of first payment.","anyOf":[{"description":"Date of first payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"issuer":{"description":"Invoice issuer bound to this gateway. Always present — the FK on the instance table is NOT NULL.","type":"object","required":["externalId","displayName","boundOrderGroupCount"],"properties":{"externalId":{"description":"Issuer contact external id.","type":"string"},"displayName":{"description":"Issuer display name (first + last name; falls back to company name; falls back to id).","type":"string"},"companyName":{"description":"Company name if set.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ / VAT id).","type":"string"},"primaryAddress":{"description":"Primary billing address of the issuer. Absent when the contact has none configured.","type":"object","properties":{"streetAddress":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"}}},"boundOrderGroupCount":{"description":"How many `shop__order_group` rows in this org already use this contact as their invoice issuer. Non-zero means the admin can verify the same contact is really used as an invoice issuer elsewhere.","type":"number"}}}},"required":["id","code","description","environment","environmentLabel","active","insertedDate","extra","providerId","gatewayCode","gatewayName","paymentCount","paidPaymentCount","totalAmount","issuer"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Internal database ID.","type":"string"},"code":{"description":"Unique identifier/slug for this gateway instance.","type":"string"},"description":{"description":"Human-readable description.","type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"environmentLabel":{"description":"Human-readable environment label.","type":"string"},"active":{"description":"Whether the gateway is active.","type":"boolean"},"insertedDate":{"description":"Date when the gateway was configured.","anyOf":[{"description":"Date when the gateway was configured.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"merchantId":{"description":"Merchant ID (if applicable for the provider).","type":"string"},"extra":{"description":"Additional provider-specific configuration.","type":"object","properties":{}},"providerId":{"description":"Internal provider ID.","type":"number"},"gatewayCode":{"description":"Provider code.","type":"string"},"gatewayName":{"description":"Provider name.","type":"string"},"paymentCount":{"description":"Total number of payments.","type":"number"},"paidPaymentCount":{"description":"Number of successful payments.","type":"number"},"totalAmount":{"description":"Total amount processed (successful payments only).","type":"number"},"lastUsedDate":{"description":"Date of most recent payment.","anyOf":[{"description":"Date of most recent payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"firstUsedDate":{"description":"Date of first payment.","anyOf":[{"description":"Date of first payment.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"issuer":{"description":"Invoice issuer bound to this gateway. Always present — the FK on the instance table is NOT NULL.","type":"object","required":["externalId","displayName","boundOrderGroupCount"],"properties":{"externalId":{"description":"Issuer contact external id.","type":"string"},"displayName":{"description":"Issuer display name (first + last name; falls back to company name; falls back to id).","type":"string"},"companyName":{"description":"Company name if set.","type":"string"},"companyRegistrationNumber":{"description":"Company registration number (IČO).","type":"string"},"taxIdentificationNumber":{"description":"Tax identification number (DIČ / VAT id).","type":"string"},"primaryAddress":{"description":"Primary billing address of the issuer. Absent when the contact has none configured.","type":"object","properties":{"streetAddress":{"type":"string"},"city":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"}}},"boundOrderGroupCount":{"description":"How many `shop__order_group` rows in this org already use this contact as their invoice issuer. Non-zero means the admin can verify the same contact is really used as an invoice issuer elsewhere.","type":"number"}}}},"required":["id","code","description","environment","environmentLabel","active","insertedDate","extra","providerId","gatewayCode","gatewayName","paymentCount","paidPaymentCount","totalAmount","issuer"]}}}}},"operationId":"getBffPayment-gatewayDetail","tags":["Payment Gateway"],"summary":"Get gateway detail","description":"Returns detailed information about a specific payment gateway instance, including configuration, extended statistics (success rate, total amount processed), and metadata. Sensitive credentials are NOT included - use the /keys endpoint for those."}},"/bff/payment-gateway/keys":{"get":{"parameters":[{"description":"Unique code/slug of the gateway instance.","examples":["gopay-production"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"description":"Gateway API credentials. Handle with care!","content":{"application/json":{"schema":{"type":"object","properties":{"publicKey":{"description":"Public API key (if applicable).","type":"string"},"secretKey":{"description":"Secret API key (if applicable).","type":"string"},"merchantId":{"description":"Merchant ID (if applicable).","type":"string"},"secureKey":{"description":"Additional secure key (if applicable).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"publicKey":{"description":"Public API key (if applicable).","type":"string"},"secretKey":{"description":"Secret API key (if applicable).","type":"string"},"merchantId":{"description":"Merchant ID (if applicable).","type":"string"},"secureKey":{"description":"Additional secure key (if applicable).","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"publicKey":{"description":"Public API key (if applicable).","type":"string"},"secretKey":{"description":"Secret API key (if applicable).","type":"string"},"merchantId":{"description":"Merchant ID (if applicable).","type":"string"},"secureKey":{"description":"Additional secure key (if applicable).","type":"string"}}}}}}},"operationId":"getBffPayment-gatewayKeys","tags":["Payment Gateway"],"summary":"Get gateway credentials","description":"Returns the sensitive API credentials for a payment gateway. This endpoint is separated from the detail endpoint for security reasons - credentials should only be fetched when explicitly needed (e.g., when editing gateway configuration). Requires elevated permissions."}},"/bff/payment-gateway/connection-status":{"get":{"parameters":[{"description":"Gateway instance code.","examples":["gopay-production"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"description":"Gateway connection status and masked credentials.","content":{"application/json":{"schema":{"type":"object","properties":{"configured":{"description":"Whether credentials are fully configured.","type":"boolean"},"connectionWorks":{"description":"Whether the connection test succeeded.","type":"boolean"},"errorMessage":{"description":"Provider error when the connection test failed.","type":"string"},"blockedIp":{"description":"Server IP the provider rejected (not on its IP whitelist).","examples":["137.74.200.109"],"type":"string"},"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"credentials":{"description":"Masked credentials for UI display.","type":"object","properties":{"merchantId":{"description":"Merchant ID (if applicable).","type":"string"},"publicKey":{"description":"Public API key (if applicable).","type":"string"},"secretKey":{"description":"Masked secret API key.","type":"string"},"secureKey":{"description":"Masked secure key.","type":"string"}}}},"required":["configured","connectionWorks","provider","environment","credentials"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"configured":{"description":"Whether credentials are fully configured.","type":"boolean"},"connectionWorks":{"description":"Whether the connection test succeeded.","type":"boolean"},"errorMessage":{"description":"Provider error when the connection test failed.","type":"string"},"blockedIp":{"description":"Server IP the provider rejected (not on its IP whitelist).","examples":["137.74.200.109"],"type":"string"},"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"credentials":{"description":"Masked credentials for UI display.","type":"object","properties":{"merchantId":{"description":"Merchant ID (if applicable).","type":"string"},"publicKey":{"description":"Public API key (if applicable).","type":"string"},"secretKey":{"description":"Masked secret API key.","type":"string"},"secureKey":{"description":"Masked secure key.","type":"string"}}}},"required":["configured","connectionWorks","provider","environment","credentials"]}},"text/plain":{"schema":{"type":"object","properties":{"configured":{"description":"Whether credentials are fully configured.","type":"boolean"},"connectionWorks":{"description":"Whether the connection test succeeded.","type":"boolean"},"errorMessage":{"description":"Provider error when the connection test failed.","type":"string"},"blockedIp":{"description":"Server IP the provider rejected (not on its IP whitelist).","examples":["137.74.200.109"],"type":"string"},"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"credentials":{"description":"Masked credentials for UI display.","type":"object","properties":{"merchantId":{"description":"Merchant ID (if applicable).","type":"string"},"publicKey":{"description":"Public API key (if applicable).","type":"string"},"secretKey":{"description":"Masked secret API key.","type":"string"},"secureKey":{"description":"Masked secure key.","type":"string"}}}},"required":["configured","connectionWorks","provider","environment","credentials"]}}}}},"operationId":"getBffPayment-gatewayConnection-status","tags":["Payment Gateway"],"summary":"Check gateway connection status","description":"Checks if the gateway credentials are configured and tests the actual connection to the payment provider. Returns masked credentials for display in UI."}},"/bff/payment-gateway/diagnose":{"get":{"parameters":[{"description":"Gateway instance code.","examples":["comgate"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"description":"Worst status across all checks (info never degrades it).","anyOf":[{"const":"ok","type":"string"},{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"checks":{"type":"array","items":{"type":"object","required":["code","status","params"],"properties":{"code":{"description":"Stable check identifier.","examples":["connection-ip-blocked"],"type":"string"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"params":{"description":"Values for the explanation template.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"detail":{"description":"Raw provider or log message.","type":"string"}}}},"provider":{"anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"merchantId":{"type":"string"},"server":{"type":"object","required":["outboundIp","comgateAllowedIpRange","comgatePushUrl"],"properties":{"outboundIp":{"description":"IPv4 the provider sees BizKitHub calls coming from.","type":"string"},"comgateAllowedIpRange":{"description":"Value for Comgate \"Povolené IP adresy\": the global range, not the server IP.","examples":["0.0.0.0/0"],"type":"string"},"comgatePushUrl":{"description":"URL to set as Comgate \"Url pro předání výsledku platby\".","type":"string"}}},"checkedAt":{"description":"ISO timestamp of the check.","type":"string"}},"required":["status","checks","provider","environment","server","checkedAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"status":{"description":"Worst status across all checks (info never degrades it).","anyOf":[{"const":"ok","type":"string"},{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"checks":{"type":"array","items":{"type":"object","required":["code","status","params"],"properties":{"code":{"description":"Stable check identifier.","examples":["connection-ip-blocked"],"type":"string"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"params":{"description":"Values for the explanation template.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"detail":{"description":"Raw provider or log message.","type":"string"}}}},"provider":{"anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"merchantId":{"type":"string"},"server":{"type":"object","required":["outboundIp","comgateAllowedIpRange","comgatePushUrl"],"properties":{"outboundIp":{"description":"IPv4 the provider sees BizKitHub calls coming from.","type":"string"},"comgateAllowedIpRange":{"description":"Value for Comgate \"Povolené IP adresy\": the global range, not the server IP.","examples":["0.0.0.0/0"],"type":"string"},"comgatePushUrl":{"description":"URL to set as Comgate \"Url pro předání výsledku platby\".","type":"string"}}},"checkedAt":{"description":"ISO timestamp of the check.","type":"string"}},"required":["status","checks","provider","environment","server","checkedAt"]}},"text/plain":{"schema":{"type":"object","properties":{"status":{"description":"Worst status across all checks (info never degrades it).","anyOf":[{"const":"ok","type":"string"},{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"checks":{"type":"array","items":{"type":"object","required":["code","status","params"],"properties":{"code":{"description":"Stable check identifier.","examples":["connection-ip-blocked"],"type":"string"},"status":{"anyOf":[{"const":"ok","type":"string"},{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"params":{"description":"Values for the explanation template.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}},"detail":{"description":"Raw provider or log message.","type":"string"}}}},"provider":{"anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"merchantId":{"type":"string"},"server":{"type":"object","required":["outboundIp","comgateAllowedIpRange","comgatePushUrl"],"properties":{"outboundIp":{"description":"IPv4 the provider sees BizKitHub calls coming from.","type":"string"},"comgateAllowedIpRange":{"description":"Value for Comgate \"Povolené IP adresy\": the global range, not the server IP.","examples":["0.0.0.0/0"],"type":"string"},"comgatePushUrl":{"description":"URL to set as Comgate \"Url pro předání výsledku platby\".","type":"string"}}},"checkedAt":{"description":"ISO timestamp of the check.","type":"string"}},"required":["status","checks","provider","environment","server","checkedAt"]}}}}},"operationId":"getBffPayment-gatewayDiagnose","tags":["Payment Gateway"],"summary":"Diagnose gateway","description":"Runs a full health check of the gateway: stored credentials, live connection to the provider (incl. IP-whitelist detection), production mode, order-group routing, invoice issuer and recent payment traffic. Each check carries a stable `code` the admin maps to an explanation and fix steps."}},"/bff/payment-gateway/test-connection":{"post":{"parameters":[],"responses":{"200":{"description":"Connection test result. On success with `code`, typed-in credentials are saved.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the connection test succeeded.","type":"boolean"},"errorMessage":{"description":"Error message if test failed.","type":"string"},"blockedIp":{"description":"Server IP the provider rejected (not on its IP whitelist). Set only for that failure.","examples":["137.74.200.109"],"type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the connection test succeeded.","type":"boolean"},"errorMessage":{"description":"Error message if test failed.","type":"string"},"blockedIp":{"description":"Server IP the provider rejected (not on its IP whitelist). Set only for that failure.","examples":["137.74.200.109"],"type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the connection test succeeded.","type":"boolean"},"errorMessage":{"description":"Error message if test failed.","type":"string"},"blockedIp":{"description":"Server IP the provider rejected (not on its IP whitelist). Set only for that failure.","examples":["137.74.200.109"],"type":"string"}},"required":["success"]}}}}},"operationId":"postBffPayment-gatewayTest-connection","tags":["Payment Gateway"],"summary":"Test gateway connection","description":"Tests the connection to a payment gateway with provided credentials. If a gateway code is provided, missing credentials will be loaded from the database, allowing you to test new credentials alongside existing ones. When `code` is provided and the test succeeds, the credentials sent in the body are saved to the gateway.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider"],"properties":{"code":{"description":"Gateway code - if provided, missing credentials are loaded from DB.","examples":["gopay-production"],"type":"string"},"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"publicKey":{"description":"Public API key.","type":"string"},"secretKey":{"description":"Secret API key.","type":"string"},"merchantId":{"description":"Merchant ID.","type":"string"},"secureKey":{"description":"Secure key.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["provider"],"properties":{"code":{"description":"Gateway code - if provided, missing credentials are loaded from DB.","examples":["gopay-production"],"type":"string"},"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"publicKey":{"description":"Public API key.","type":"string"},"secretKey":{"description":"Secret API key.","type":"string"},"merchantId":{"description":"Merchant ID.","type":"string"},"secureKey":{"description":"Secure key.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["provider"],"properties":{"code":{"description":"Gateway code - if provided, missing credentials are loaded from DB.","examples":["gopay-production"],"type":"string"},"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox, \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"publicKey":{"description":"Public API key.","type":"string"},"secretKey":{"description":"Secret API key.","type":"string"},"merchantId":{"description":"Merchant ID.","type":"string"},"secureKey":{"description":"Secure key.","type":"string"}}}}}}}},"/bff/payment-gateway/stats":{"get":{"responses":{"200":{"description":"Aggregated payment statistics.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Statistics grouped by gateway.","type":"array","items":{"description":"Statistics for a single gateway.","type":"object","required":["gatewayCode","gatewayName","totalPayments","paidPayments","failedPayments","pendingPayments","totalAmount","successRate"],"properties":{"gatewayCode":{"description":"Gateway instance code.","type":"string"},"gatewayName":{"description":"Provider name.","type":"string"},"totalPayments":{"description":"Total number of payment attempts.","type":"number"},"paidPayments":{"description":"Number of successful payments.","type":"number"},"failedPayments":{"description":"Number of failed/cancelled payments.","type":"number"},"pendingPayments":{"description":"Number of pending payments.","type":"number"},"totalAmount":{"description":"Total amount from successful payments.","type":"number"},"successRate":{"description":"Success rate as percentage (0-100).","type":"number"}}}},"itemCount":{"description":"Number of gateways with statistics.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Statistics grouped by gateway.","type":"array","items":{"description":"Statistics for a single gateway.","type":"object","required":["gatewayCode","gatewayName","totalPayments","paidPayments","failedPayments","pendingPayments","totalAmount","successRate"],"properties":{"gatewayCode":{"description":"Gateway instance code.","type":"string"},"gatewayName":{"description":"Provider name.","type":"string"},"totalPayments":{"description":"Total number of payment attempts.","type":"number"},"paidPayments":{"description":"Number of successful payments.","type":"number"},"failedPayments":{"description":"Number of failed/cancelled payments.","type":"number"},"pendingPayments":{"description":"Number of pending payments.","type":"number"},"totalAmount":{"description":"Total amount from successful payments.","type":"number"},"successRate":{"description":"Success rate as percentage (0-100).","type":"number"}}}},"itemCount":{"description":"Number of gateways with statistics.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Statistics grouped by gateway.","type":"array","items":{"description":"Statistics for a single gateway.","type":"object","required":["gatewayCode","gatewayName","totalPayments","paidPayments","failedPayments","pendingPayments","totalAmount","successRate"],"properties":{"gatewayCode":{"description":"Gateway instance code.","type":"string"},"gatewayName":{"description":"Provider name.","type":"string"},"totalPayments":{"description":"Total number of payment attempts.","type":"number"},"paidPayments":{"description":"Number of successful payments.","type":"number"},"failedPayments":{"description":"Number of failed/cancelled payments.","type":"number"},"pendingPayments":{"description":"Number of pending payments.","type":"number"},"totalAmount":{"description":"Total amount from successful payments.","type":"number"},"successRate":{"description":"Success rate as percentage (0-100).","type":"number"}}}},"itemCount":{"description":"Number of gateways with statistics.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPayment-gatewayStats","tags":["Payment Gateway"],"summary":"Get payment statistics","description":"Returns aggregated payment statistics grouped by gateway. Includes success rates, payment counts by status, and total amounts processed. Useful for analytics dashboards."}},"/bff/payment-gateway/payment-list":{"get":{"parameters":[{"description":"Filter by order hash. Returns payments for specific order.","examples":["abc123def"],"schema":{"type":"string"},"in":"query","name":"orderHash","required":false},{"description":"Filter by gateway code. Returns payments for specific gateway.","examples":["gopay-production"],"schema":{"type":"string"},"in":"query","name":"gatewayCode","required":false},{"description":"Filter by payment status (e.g., \"PAID\", \"PENDING\", \"CANCELLED\").","examples":["PAID"],"schema":{"type":"string"},"in":"query","name":"status","required":false}],"responses":{"200":{"description":"Paginated list of payment transactions.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"List of payment transactions.","type":"array","items":{"description":"Payment transaction record.","type":"object","required":["id","internal_id","gateway_id","provider_id","gateway_description","gateway_name","price","currency_code","status","inserted_date","label"],"properties":{"id":{"description":"Composite payment identifier.","type":"string"},"internal_id":{"description":"Internal database ID.","type":"number"},"gateway_id":{"description":"Provider-specific transaction ID.","type":"string"},"gateway_code":{"description":"Gateway instance code.","type":"string"},"provider_id":{"description":"Payment provider ID.","type":"number"},"gateway_description":{"description":"Gateway description; null when the operator left it blank.","anyOf":[{"type":"string"},{"type":"null"}]},"gateway_name":{"description":"Provider name.","type":"string"},"price":{"description":"Payment amount.","type":"number"},"currency_code":{"description":"Currency code (e.g., \"CZK\", \"EUR\").","type":"string"},"status":{"description":"Current payment status.","type":"string"},"inserted_date":{"description":"Date when payment was created.","anyOf":[{"description":"Date when payment was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"last_checked_date":{"description":"Date of last status check.","anyOf":[{"description":"Date of last status check.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"label":{"description":"Human-readable payment label with status.","type":"string"},"order_number":{"description":"Associated order number.","type":"string"},"order_hash":{"description":"Associated order hash for linking.","type":"string"}}}},"itemCount":{"description":"Total number of payments matching the filter (for pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"List of payment transactions.","type":"array","items":{"description":"Payment transaction record.","type":"object","required":["id","internal_id","gateway_id","provider_id","gateway_description","gateway_name","price","currency_code","status","inserted_date","label"],"properties":{"id":{"description":"Composite payment identifier.","type":"string"},"internal_id":{"description":"Internal database ID.","type":"number"},"gateway_id":{"description":"Provider-specific transaction ID.","type":"string"},"gateway_code":{"description":"Gateway instance code.","type":"string"},"provider_id":{"description":"Payment provider ID.","type":"number"},"gateway_description":{"description":"Gateway description; null when the operator left it blank.","anyOf":[{"type":"string"},{"type":"null"}]},"gateway_name":{"description":"Provider name.","type":"string"},"price":{"description":"Payment amount.","type":"number"},"currency_code":{"description":"Currency code (e.g., \"CZK\", \"EUR\").","type":"string"},"status":{"description":"Current payment status.","type":"string"},"inserted_date":{"description":"Date when payment was created.","anyOf":[{"description":"Date when payment was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"last_checked_date":{"description":"Date of last status check.","anyOf":[{"description":"Date of last status check.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"label":{"description":"Human-readable payment label with status.","type":"string"},"order_number":{"description":"Associated order number.","type":"string"},"order_hash":{"description":"Associated order hash for linking.","type":"string"}}}},"itemCount":{"description":"Total number of payments matching the filter (for pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"List of payment transactions.","type":"array","items":{"description":"Payment transaction record.","type":"object","required":["id","internal_id","gateway_id","provider_id","gateway_description","gateway_name","price","currency_code","status","inserted_date","label"],"properties":{"id":{"description":"Composite payment identifier.","type":"string"},"internal_id":{"description":"Internal database ID.","type":"number"},"gateway_id":{"description":"Provider-specific transaction ID.","type":"string"},"gateway_code":{"description":"Gateway instance code.","type":"string"},"provider_id":{"description":"Payment provider ID.","type":"number"},"gateway_description":{"description":"Gateway description; null when the operator left it blank.","anyOf":[{"type":"string"},{"type":"null"}]},"gateway_name":{"description":"Provider name.","type":"string"},"price":{"description":"Payment amount.","type":"number"},"currency_code":{"description":"Currency code (e.g., \"CZK\", \"EUR\").","type":"string"},"status":{"description":"Current payment status.","type":"string"},"inserted_date":{"description":"Date when payment was created.","anyOf":[{"description":"Date when payment was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"last_checked_date":{"description":"Date of last status check.","anyOf":[{"description":"Date of last status check.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"label":{"description":"Human-readable payment label with status.","type":"string"},"order_number":{"description":"Associated order number.","type":"string"},"order_hash":{"description":"Associated order hash for linking.","type":"string"}}}},"itemCount":{"description":"Total number of payments matching the filter (for pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPayment-gatewayPayment-list","tags":["Payment Gateway"],"summary":"List payments","description":"Returns a paginated list of online payment transactions. Supports filtering by order, gateway, and status. Use query params `page` and `limit` for pagination."}},"/bff/payment-gateway/add":{"post":{"parameters":[],"responses":{"200":{"description":"Gateway created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"description":"The code/slug assigned to the new gateway.","type":"string"}},"required":["success","code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"description":"The code/slug assigned to the new gateway.","type":"string"}},"required":["success","code"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"description":"The code/slug assigned to the new gateway.","type":"string"}},"required":["success","code"]}}}}},"operationId":"postBffPayment-gatewayAdd","tags":["Payment Gateway"],"summary":"Add new gateway","description":"Creates a new payment gateway instance. The provider must be one of the supported types. Credentials can be provided during creation or added later via the update endpoint.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["provider","issuerContactExternalId"],"properties":{"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"issuerContactExternalId":{"description":"External id (`shop__contact.external_id`) of the contact that will be the invoice issuer for documents produced through this gateway. Required — the schema has a NOT NULL FK. The picker in the admin forces a selection and the create endpoint rejects a missing or cross-tenant contact.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"code":{"description":"Custom code/slug. Auto-generated if not provided.","examples":["gopay-production"],"type":"string"},"description":{"description":"Human-readable description.","examples":["GoPay production gateway"],"type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox (default), \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"publicKey":{"description":"Public API key.","type":"string"},"secretKey":{"description":"Secret API key.","type":"string"},"merchantId":{"description":"Merchant ID.","type":"string"},"secureKey":{"description":"Additional secure key.","type":"string"},"extra":{"description":"Additional provider-specific settings.","type":"object","properties":{}}}}},"multipart/form-data":{"schema":{"type":"object","required":["provider","issuerContactExternalId"],"properties":{"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"issuerContactExternalId":{"description":"External id (`shop__contact.external_id`) of the contact that will be the invoice issuer for documents produced through this gateway. Required — the schema has a NOT NULL FK. The picker in the admin forces a selection and the create endpoint rejects a missing or cross-tenant contact.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"code":{"description":"Custom code/slug. Auto-generated if not provided.","examples":["gopay-production"],"type":"string"},"description":{"description":"Human-readable description.","examples":["GoPay production gateway"],"type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox (default), \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"publicKey":{"description":"Public API key.","type":"string"},"secretKey":{"description":"Secret API key.","type":"string"},"merchantId":{"description":"Merchant ID.","type":"string"},"secureKey":{"description":"Additional secure key.","type":"string"},"extra":{"description":"Additional provider-specific settings.","type":"object","properties":{}}}}},"text/plain":{"schema":{"type":"object","required":["provider","issuerContactExternalId"],"properties":{"provider":{"description":"Payment provider type.","anyOf":[{"const":"gopay","type":"string"},{"const":"comgate","type":"string"},{"const":"stripe","type":"string"}]},"issuerContactExternalId":{"description":"External id (`shop__contact.external_id`) of the contact that will be the invoice issuer for documents produced through this gateway. Required — the schema has a NOT NULL FK. The picker in the admin forces a selection and the create endpoint rejects a missing or cross-tenant contact.","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"},"code":{"description":"Custom code/slug. Auto-generated if not provided.","examples":["gopay-production"],"type":"string"},"description":{"description":"Human-readable description.","examples":["GoPay production gateway"],"type":"string"},"environment":{"description":"Environment: \"p\" = Production, \"s\" = Sandbox (default), \"t\" = Test.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"publicKey":{"description":"Public API key.","type":"string"},"secretKey":{"description":"Secret API key.","type":"string"},"merchantId":{"description":"Merchant ID.","type":"string"},"secureKey":{"description":"Additional secure key.","type":"string"},"extra":{"description":"Additional provider-specific settings.","type":"object","properties":{}}}}}}}}},"/bff/payment-gateway/update":{"post":{"parameters":[],"responses":{"200":{"description":"Gateway updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPayment-gatewayUpdate","tags":["Payment Gateway"],"summary":"Update gateway","description":"Updates an existing payment gateway instance. Only provided fields will be updated. To clear a field, pass an empty string. To change credentials, provide new values.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Gateway code to update.","examples":["gopay-production"],"type":"string"},"description":{"description":"New description.","type":"string"},"environment":{"description":"New environment setting.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Enable or disable the gateway.","type":"boolean"},"publicKey":{"description":"New public API key.","type":"string"},"secretKey":{"description":"New secret API key.","type":"string"},"merchantId":{"description":"New merchant ID.","type":"string"},"secureKey":{"description":"New secure key.","type":"string"},"extra":{"description":"New extra configuration.","type":"object","properties":{}},"issuerContactExternalId":{"description":"New invoice-issuer contact (`shop__contact.external_id`). When provided, every `shop__order_group` currently bound to this gateway has its `invoice_issuer_id` realigned in the same transaction — the app-level invariant is \"as long as a group has a payment gateway, its issuer must equal the gateway's issuer\".","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Gateway code to update.","examples":["gopay-production"],"type":"string"},"description":{"description":"New description.","type":"string"},"environment":{"description":"New environment setting.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Enable or disable the gateway.","type":"boolean"},"publicKey":{"description":"New public API key.","type":"string"},"secretKey":{"description":"New secret API key.","type":"string"},"merchantId":{"description":"New merchant ID.","type":"string"},"secureKey":{"description":"New secure key.","type":"string"},"extra":{"description":"New extra configuration.","type":"object","properties":{}},"issuerContactExternalId":{"description":"New invoice-issuer contact (`shop__contact.external_id`). When provided, every `shop__order_group` currently bound to this gateway has its `invoice_issuer_id` realigned in the same transaction — the app-level invariant is \"as long as a group has a payment gateway, its issuer must equal the gateway's issuer\".","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Gateway code to update.","examples":["gopay-production"],"type":"string"},"description":{"description":"New description.","type":"string"},"environment":{"description":"New environment setting.","anyOf":[{"const":"p","type":"string"},{"const":"s","type":"string"},{"const":"t","type":"string"}]},"active":{"description":"Enable or disable the gateway.","type":"boolean"},"publicKey":{"description":"New public API key.","type":"string"},"secretKey":{"description":"New secret API key.","type":"string"},"merchantId":{"description":"New merchant ID.","type":"string"},"secureKey":{"description":"New secure key.","type":"string"},"extra":{"description":"New extra configuration.","type":"object","properties":{}},"issuerContactExternalId":{"description":"New invoice-issuer contact (`shop__contact.external_id`). When provided, every `shop__order_group` currently bound to this gateway has its `invoice_issuer_id` realigned in the same transaction — the app-level invariant is \"as long as a group has a payment gateway, its issuer must equal the gateway's issuer\".","examples":["aB3xKm9pQ2wLn4Yz"],"type":"string"}}}}}}}},"/bff/payment-gateway/toggle-active":{"post":{"parameters":[],"responses":{"200":{"description":"Status toggled successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPayment-gatewayToggle-active","tags":["Payment Gateway"],"summary":"Toggle gateway active status","description":"Quickly enable or disable a payment gateway. Disabled gateways cannot process new payments but existing payments can still be checked/synced.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Gateway code.","examples":["gopay-production"],"type":"string"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Gateway code.","examples":["gopay-production"],"type":"string"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Gateway code.","examples":["gopay-production"],"type":"string"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}}}}}},"/bff/payment-gateway/delete":{"post":{"parameters":[],"responses":{"200":{"description":"Gateway deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPayment-gatewayDelete","tags":["Payment Gateway"],"summary":"Delete gateway","description":"Permanently deletes a payment gateway instance. This operation is only allowed if the gateway has no associated payments. If payments exist, deactivate the gateway instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Gateway code to delete.","examples":["gopay-sandbox"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Gateway code to delete.","examples":["gopay-sandbox"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Gateway code to delete.","examples":["gopay-sandbox"],"type":"string"}}}}}}}},"/bff/payment-gateway/sync-payment":{"post":{"parameters":[],"responses":{"200":{"description":"Sync result.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"message":{"description":"Error message if sync failed.","type":"string"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"message":{"description":"Error message if sync failed.","type":"string"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"message":{"description":"Error message if sync failed.","type":"string"}},"required":["success"]}}}}},"operationId":"postBffPayment-gatewaySync-payment","tags":["Payment Gateway"],"summary":"Sync payment status","description":"Fetches the current payment status from the payment provider and updates the local record. Useful for checking if a payment has been completed or for troubleshooting.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Payment ID to sync.","examples":["pay_12345"],"type":"string"},"orderHash":{"description":"Order hash - syncs all payments for this order.","examples":["abc123def"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Payment ID to sync.","examples":["pay_12345"],"type":"string"},"orderHash":{"description":"Order hash - syncs all payments for this order.","examples":["abc123def"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Payment ID to sync.","examples":["pay_12345"],"type":"string"},"orderHash":{"description":"Order hash - syncs all payments for this order.","examples":["abc123def"],"type":"string"}}}}}}}},"/bff/payment-gateway/monthly-analytics":{"get":{"parameters":[{"description":"Gateway instance code/slug.","examples":["comgate-smichov"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"How many calendar months to return (default 24, clamped to [1, 240]). The window always ends with the current month and is automatically clamped down to the first month with any payment activity — so a gateway younger than `monthCount` months reports only as many buckets as actually exist.","examples":["12","24","36","240"],"schema":{"type":"string"},"in":"query","name":"monthCount","required":false}],"responses":{"200":{"description":"Per-month performance roll-up for a single payment-gateway instance.","content":{"application/json":{"schema":{"type":"object","properties":{"gatewayCode":{"description":"Gateway instance code/slug echoed back for client-side cache keys.","type":"string"},"gatewayName":{"description":"Human-readable provider name (GoPay, Comgate, Stripe).","type":"string"},"currency":{"description":"Organisation's default currency code — all amounts are reported as raw numbers in this currency.","type":"string"},"monthCount":{"description":"Effective number of months returned. May be lower than the requested value when the gateway is younger than the requested window.","type":"number"},"months":{"type":"array","items":{"type":"object","required":["month","totalCount","successCount","failedCount","pendingCount","receivedAmount","potentialAmount","lostAmount","successRatePct","averageSuccessfulAmount","averageAttemptAmount"],"properties":{"month":{"description":"YYYY-MM bucket identifier.","type":"string"},"totalCount":{"description":"Distinct non-storno orders whose FIRST payment attempt through this gateway landed in this month.","type":"number"},"successCount":{"description":"Orders in this bucket that eventually got paid (any payment succeeded).","type":"number"},"failedCount":{"description":"Orders with no success and no pending payment — the true \"leaked\" bucket.","type":"number"},"pendingCount":{"description":"Orders with no success yet, but at least one payment is still open.","type":"number"},"receivedAmount":{"description":"SUM of the first successful payment's price across successful orders in this bucket.","type":"number"},"potentialAmount":{"description":"SUM of first-attempt prices across ALL orders in this bucket — the ceiling we tried to collect.","type":"number"},"lostAmount":{"description":"SUM of first-attempt prices across FAILED orders in this bucket. Pending orders contribute 0.","type":"number"},"successRatePct":{"description":"successCount / totalCount × 100. Zero when there are no orders in the bucket.","type":"number"},"averageSuccessfulAmount":{"description":"AVG(first-successful-payment price) across successful orders. Zero when there were none.","type":"number"},"averageAttemptAmount":{"description":"AVG(first-attempt price) across all qualifying orders. Zero when there were none.","type":"number"}}}},"totals":{"type":"object","required":["totalCount","successCount","failedCount","pendingCount","receivedAmount","potentialAmount","lostAmount","successRatePct","averageSuccessfulAmount","averageAttemptAmount","monthlyAverageReceived","monthlyMedianReceived","monthlyAverageSuccessRatePct","monthlyMedianSuccessRatePct","bestMonth","worstMonth"],"properties":{"totalCount":{"type":"number"},"successCount":{"type":"number"},"failedCount":{"type":"number"},"pendingCount":{"type":"number"},"receivedAmount":{"type":"number"},"potentialAmount":{"type":"number"},"lostAmount":{"type":"number"},"successRatePct":{"description":"Window-wide success rate.","type":"number"},"averageSuccessfulAmount":{"type":"number"},"averageAttemptAmount":{"type":"number"},"monthlyAverageReceived":{"description":"Arithmetic mean of monthly `receivedAmount`. Used as the chart's \"average\" reference line.","type":"number"},"monthlyMedianReceived":{"description":"Median of monthly `receivedAmount`. Used as the chart's \"median\" reference line.","type":"number"},"monthlyAverageSuccessRatePct":{"description":"Arithmetic mean of monthly `successRatePct`, computed only over months with at least one attempt.","type":"number"},"monthlyMedianSuccessRatePct":{"description":"Median of monthly `successRatePct`, computed only over months with at least one attempt.","type":"number"},"bestMonth":{"description":"Month with the highest `receivedAmount` in the window. Null when there were no attempts.","anyOf":[{"type":"object","required":["month","receivedAmount"],"properties":{"month":{"type":"string"},"receivedAmount":{"type":"number"}}},{"type":"null"}]},"worstMonth":{"description":"Month with the lowest `receivedAmount` (among months that had at least one attempt). Null when there were none.","anyOf":[{"type":"object","required":["month","receivedAmount"],"properties":{"month":{"type":"string"},"receivedAmount":{"type":"number"}}},{"type":"null"}]}}}},"required":["gatewayCode","gatewayName","currency","monthCount","months","totals"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"gatewayCode":{"description":"Gateway instance code/slug echoed back for client-side cache keys.","type":"string"},"gatewayName":{"description":"Human-readable provider name (GoPay, Comgate, Stripe).","type":"string"},"currency":{"description":"Organisation's default currency code — all amounts are reported as raw numbers in this currency.","type":"string"},"monthCount":{"description":"Effective number of months returned. May be lower than the requested value when the gateway is younger than the requested window.","type":"number"},"months":{"type":"array","items":{"type":"object","required":["month","totalCount","successCount","failedCount","pendingCount","receivedAmount","potentialAmount","lostAmount","successRatePct","averageSuccessfulAmount","averageAttemptAmount"],"properties":{"month":{"description":"YYYY-MM bucket identifier.","type":"string"},"totalCount":{"description":"Distinct non-storno orders whose FIRST payment attempt through this gateway landed in this month.","type":"number"},"successCount":{"description":"Orders in this bucket that eventually got paid (any payment succeeded).","type":"number"},"failedCount":{"description":"Orders with no success and no pending payment — the true \"leaked\" bucket.","type":"number"},"pendingCount":{"description":"Orders with no success yet, but at least one payment is still open.","type":"number"},"receivedAmount":{"description":"SUM of the first successful payment's price across successful orders in this bucket.","type":"number"},"potentialAmount":{"description":"SUM of first-attempt prices across ALL orders in this bucket — the ceiling we tried to collect.","type":"number"},"lostAmount":{"description":"SUM of first-attempt prices across FAILED orders in this bucket. Pending orders contribute 0.","type":"number"},"successRatePct":{"description":"successCount / totalCount × 100. Zero when there are no orders in the bucket.","type":"number"},"averageSuccessfulAmount":{"description":"AVG(first-successful-payment price) across successful orders. Zero when there were none.","type":"number"},"averageAttemptAmount":{"description":"AVG(first-attempt price) across all qualifying orders. Zero when there were none.","type":"number"}}}},"totals":{"type":"object","required":["totalCount","successCount","failedCount","pendingCount","receivedAmount","potentialAmount","lostAmount","successRatePct","averageSuccessfulAmount","averageAttemptAmount","monthlyAverageReceived","monthlyMedianReceived","monthlyAverageSuccessRatePct","monthlyMedianSuccessRatePct","bestMonth","worstMonth"],"properties":{"totalCount":{"type":"number"},"successCount":{"type":"number"},"failedCount":{"type":"number"},"pendingCount":{"type":"number"},"receivedAmount":{"type":"number"},"potentialAmount":{"type":"number"},"lostAmount":{"type":"number"},"successRatePct":{"description":"Window-wide success rate.","type":"number"},"averageSuccessfulAmount":{"type":"number"},"averageAttemptAmount":{"type":"number"},"monthlyAverageReceived":{"description":"Arithmetic mean of monthly `receivedAmount`. Used as the chart's \"average\" reference line.","type":"number"},"monthlyMedianReceived":{"description":"Median of monthly `receivedAmount`. Used as the chart's \"median\" reference line.","type":"number"},"monthlyAverageSuccessRatePct":{"description":"Arithmetic mean of monthly `successRatePct`, computed only over months with at least one attempt.","type":"number"},"monthlyMedianSuccessRatePct":{"description":"Median of monthly `successRatePct`, computed only over months with at least one attempt.","type":"number"},"bestMonth":{"description":"Month with the highest `receivedAmount` in the window. Null when there were no attempts.","anyOf":[{"type":"object","required":["month","receivedAmount"],"properties":{"month":{"type":"string"},"receivedAmount":{"type":"number"}}},{"type":"null"}]},"worstMonth":{"description":"Month with the lowest `receivedAmount` (among months that had at least one attempt). Null when there were none.","anyOf":[{"type":"object","required":["month","receivedAmount"],"properties":{"month":{"type":"string"},"receivedAmount":{"type":"number"}}},{"type":"null"}]}}}},"required":["gatewayCode","gatewayName","currency","monthCount","months","totals"]}},"text/plain":{"schema":{"type":"object","properties":{"gatewayCode":{"description":"Gateway instance code/slug echoed back for client-side cache keys.","type":"string"},"gatewayName":{"description":"Human-readable provider name (GoPay, Comgate, Stripe).","type":"string"},"currency":{"description":"Organisation's default currency code — all amounts are reported as raw numbers in this currency.","type":"string"},"monthCount":{"description":"Effective number of months returned. May be lower than the requested value when the gateway is younger than the requested window.","type":"number"},"months":{"type":"array","items":{"type":"object","required":["month","totalCount","successCount","failedCount","pendingCount","receivedAmount","potentialAmount","lostAmount","successRatePct","averageSuccessfulAmount","averageAttemptAmount"],"properties":{"month":{"description":"YYYY-MM bucket identifier.","type":"string"},"totalCount":{"description":"Distinct non-storno orders whose FIRST payment attempt through this gateway landed in this month.","type":"number"},"successCount":{"description":"Orders in this bucket that eventually got paid (any payment succeeded).","type":"number"},"failedCount":{"description":"Orders with no success and no pending payment — the true \"leaked\" bucket.","type":"number"},"pendingCount":{"description":"Orders with no success yet, but at least one payment is still open.","type":"number"},"receivedAmount":{"description":"SUM of the first successful payment's price across successful orders in this bucket.","type":"number"},"potentialAmount":{"description":"SUM of first-attempt prices across ALL orders in this bucket — the ceiling we tried to collect.","type":"number"},"lostAmount":{"description":"SUM of first-attempt prices across FAILED orders in this bucket. Pending orders contribute 0.","type":"number"},"successRatePct":{"description":"successCount / totalCount × 100. Zero when there are no orders in the bucket.","type":"number"},"averageSuccessfulAmount":{"description":"AVG(first-successful-payment price) across successful orders. Zero when there were none.","type":"number"},"averageAttemptAmount":{"description":"AVG(first-attempt price) across all qualifying orders. Zero when there were none.","type":"number"}}}},"totals":{"type":"object","required":["totalCount","successCount","failedCount","pendingCount","receivedAmount","potentialAmount","lostAmount","successRatePct","averageSuccessfulAmount","averageAttemptAmount","monthlyAverageReceived","monthlyMedianReceived","monthlyAverageSuccessRatePct","monthlyMedianSuccessRatePct","bestMonth","worstMonth"],"properties":{"totalCount":{"type":"number"},"successCount":{"type":"number"},"failedCount":{"type":"number"},"pendingCount":{"type":"number"},"receivedAmount":{"type":"number"},"potentialAmount":{"type":"number"},"lostAmount":{"type":"number"},"successRatePct":{"description":"Window-wide success rate.","type":"number"},"averageSuccessfulAmount":{"type":"number"},"averageAttemptAmount":{"type":"number"},"monthlyAverageReceived":{"description":"Arithmetic mean of monthly `receivedAmount`. Used as the chart's \"average\" reference line.","type":"number"},"monthlyMedianReceived":{"description":"Median of monthly `receivedAmount`. Used as the chart's \"median\" reference line.","type":"number"},"monthlyAverageSuccessRatePct":{"description":"Arithmetic mean of monthly `successRatePct`, computed only over months with at least one attempt.","type":"number"},"monthlyMedianSuccessRatePct":{"description":"Median of monthly `successRatePct`, computed only over months with at least one attempt.","type":"number"},"bestMonth":{"description":"Month with the highest `receivedAmount` in the window. Null when there were no attempts.","anyOf":[{"type":"object","required":["month","receivedAmount"],"properties":{"month":{"type":"string"},"receivedAmount":{"type":"number"}}},{"type":"null"}]},"worstMonth":{"description":"Month with the lowest `receivedAmount` (among months that had at least one attempt). Null when there were none.","anyOf":[{"type":"object","required":["month","receivedAmount"],"properties":{"month":{"type":"string"},"receivedAmount":{"type":"number"}}},{"type":"null"}]}}}},"required":["gatewayCode","gatewayName","currency","monthCount","months","totals"]}}}}},"operationId":"getBffPayment-gatewayMonthly-analytics","tags":["Payment Gateway"],"summary":"Per-month performance roll-up for the gateway detail \"Analytics\" tab","description":"Order-level (NOT payment-level) roll-up. Each qualifying order counts once, bucketed by the month of its FIRST payment attempt through this gateway. Storno orders (shop__order_status.type_id = 3) are excluded entirely. An order counts as a success if ANY of its payments succeeded (PAID / COMPLETE), even if earlier attempts failed — so retries don't inflate the \"leaked\" bucket. Amounts: `receivedAmount` = first successful payment's price; `potentialAmount` = first attempt's price; `lostAmount` = first attempt's price for orders that ended up failed (no success, no pending). Only `direction = 'in'` payments contribute."}},"/bff/payment-gateway/monthly-analytics-by-order-group":{"get":{"parameters":[{"description":"Gateway instance code/slug.","examples":["comgate-smichov"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"How many calendar months to return (default 24, clamped to [1, 240]). Same clamp semantics as `/monthly-analytics`.","examples":["12","24","36","240"],"schema":{"type":"string"},"in":"query","name":"monthCount","required":false}],"responses":{"200":{"description":"Per-(month × order group) received-amount pivot for a single payment-gateway instance.","content":{"application/json":{"schema":{"type":"object","properties":{"gatewayCode":{"type":"string"},"gatewayName":{"type":"string"},"currency":{"type":"string"},"monthCount":{"description":"Effective number of months in the pivot (may be shorter than requested when the gateway has less history).","type":"number"},"groups":{"type":"array","items":{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"shop__order_group.id echoed as string.","type":"string"},"code":{"type":"string"},"name":{"type":"string"}}}},"months":{"type":"array","items":{"type":"object","required":["month","cells","total","totalPaidOrderCount"],"properties":{"month":{"description":"YYYY-MM bucket.","type":"string"},"cells":{"type":"array","items":{"type":"object","required":["groupId","receivedAmount","paidOrderCount"],"properties":{"groupId":{"type":"string"},"receivedAmount":{"type":"number"},"paidOrderCount":{"type":"number"}}}},"total":{"description":"Sum of `receivedAmount` across all groups in this month.","type":"number"},"totalPaidOrderCount":{"description":"Sum of `paidOrderCount` across all groups in this month.","type":"number"}}}},"totalsByGroup":{"type":"array","items":{"type":"object","required":["groupId","receivedAmount","paidOrderCount"],"properties":{"groupId":{"type":"string"},"receivedAmount":{"type":"number"},"paidOrderCount":{"type":"number"}}}},"grandTotal":{"type":"number"},"grandPaidOrderCount":{"type":"number"}},"required":["gatewayCode","gatewayName","currency","monthCount","groups","months","totalsByGroup","grandTotal","grandPaidOrderCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"gatewayCode":{"type":"string"},"gatewayName":{"type":"string"},"currency":{"type":"string"},"monthCount":{"description":"Effective number of months in the pivot (may be shorter than requested when the gateway has less history).","type":"number"},"groups":{"type":"array","items":{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"shop__order_group.id echoed as string.","type":"string"},"code":{"type":"string"},"name":{"type":"string"}}}},"months":{"type":"array","items":{"type":"object","required":["month","cells","total","totalPaidOrderCount"],"properties":{"month":{"description":"YYYY-MM bucket.","type":"string"},"cells":{"type":"array","items":{"type":"object","required":["groupId","receivedAmount","paidOrderCount"],"properties":{"groupId":{"type":"string"},"receivedAmount":{"type":"number"},"paidOrderCount":{"type":"number"}}}},"total":{"description":"Sum of `receivedAmount` across all groups in this month.","type":"number"},"totalPaidOrderCount":{"description":"Sum of `paidOrderCount` across all groups in this month.","type":"number"}}}},"totalsByGroup":{"type":"array","items":{"type":"object","required":["groupId","receivedAmount","paidOrderCount"],"properties":{"groupId":{"type":"string"},"receivedAmount":{"type":"number"},"paidOrderCount":{"type":"number"}}}},"grandTotal":{"type":"number"},"grandPaidOrderCount":{"type":"number"}},"required":["gatewayCode","gatewayName","currency","monthCount","groups","months","totalsByGroup","grandTotal","grandPaidOrderCount"]}},"text/plain":{"schema":{"type":"object","properties":{"gatewayCode":{"type":"string"},"gatewayName":{"type":"string"},"currency":{"type":"string"},"monthCount":{"description":"Effective number of months in the pivot (may be shorter than requested when the gateway has less history).","type":"number"},"groups":{"type":"array","items":{"type":"object","required":["id","code","name"],"properties":{"id":{"description":"shop__order_group.id echoed as string.","type":"string"},"code":{"type":"string"},"name":{"type":"string"}}}},"months":{"type":"array","items":{"type":"object","required":["month","cells","total","totalPaidOrderCount"],"properties":{"month":{"description":"YYYY-MM bucket.","type":"string"},"cells":{"type":"array","items":{"type":"object","required":["groupId","receivedAmount","paidOrderCount"],"properties":{"groupId":{"type":"string"},"receivedAmount":{"type":"number"},"paidOrderCount":{"type":"number"}}}},"total":{"description":"Sum of `receivedAmount` across all groups in this month.","type":"number"},"totalPaidOrderCount":{"description":"Sum of `paidOrderCount` across all groups in this month.","type":"number"}}}},"totalsByGroup":{"type":"array","items":{"type":"object","required":["groupId","receivedAmount","paidOrderCount"],"properties":{"groupId":{"type":"string"},"receivedAmount":{"type":"number"},"paidOrderCount":{"type":"number"}}}},"grandTotal":{"type":"number"},"grandPaidOrderCount":{"type":"number"}},"required":["gatewayCode","gatewayName","currency","monthCount","groups","months","totalsByGroup","grandTotal","grandPaidOrderCount"]}}}}},"operationId":"getBffPayment-gatewayMonthly-analytics-by-order-group","tags":["Payment Gateway"],"summary":"Per-(month × order group) pivot of received amounts through the gateway","description":"Returns rows = months, columns = order groups, cells = the received amount plus the number of orders that eventually got paid via this gateway. Uses the same order-level semantics as `/monthly-analytics` (storno excluded, one order = one row, bucketed by first-attempt month). Column set is limited to groups that actually appear in the window — empty groups are dropped to keep the table readable."}},"/bff/payment-gateway/commission-list":{"get":{"parameters":[{"description":"Gateway instance code.","examples":["gopay-production"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fromDate","toDate","percentage","monthlyFee","monthlyFeeMinTurnover","note","insertedDate"],"properties":{"id":{"description":"Internal database ID of the commission period.","type":"string"},"fromDate":{"description":"Start of the period (inclusive), YYYY-MM-DD.","type":"string"},"toDate":{"description":"End of the period (inclusive). NULL = open-ended (still in force).","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Commission rate in percent (e.g. 1.25 = 1.25 %).","type":"number"},"monthlyFee":{"description":"Flat monthly fee in the gateway currency. NULL = no flat fee charged.","anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"Minimum gateway turnover the month must reach before the flat fee is charged. NULL = charge unconditionally. Ignored when monthlyFee is NULL.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Optional human note (contract ref, reason for change, …).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the row was created.","anyOf":[{"description":"When the row was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fromDate","toDate","percentage","monthlyFee","monthlyFeeMinTurnover","note","insertedDate"],"properties":{"id":{"description":"Internal database ID of the commission period.","type":"string"},"fromDate":{"description":"Start of the period (inclusive), YYYY-MM-DD.","type":"string"},"toDate":{"description":"End of the period (inclusive). NULL = open-ended (still in force).","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Commission rate in percent (e.g. 1.25 = 1.25 %).","type":"number"},"monthlyFee":{"description":"Flat monthly fee in the gateway currency. NULL = no flat fee charged.","anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"Minimum gateway turnover the month must reach before the flat fee is charged. NULL = charge unconditionally. Ignored when monthlyFee is NULL.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Optional human note (contract ref, reason for change, …).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the row was created.","anyOf":[{"description":"When the row was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fromDate","toDate","percentage","monthlyFee","monthlyFeeMinTurnover","note","insertedDate"],"properties":{"id":{"description":"Internal database ID of the commission period.","type":"string"},"fromDate":{"description":"Start of the period (inclusive), YYYY-MM-DD.","type":"string"},"toDate":{"description":"End of the period (inclusive). NULL = open-ended (still in force).","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Commission rate in percent (e.g. 1.25 = 1.25 %).","type":"number"},"monthlyFee":{"description":"Flat monthly fee in the gateway currency. NULL = no flat fee charged.","anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"Minimum gateway turnover the month must reach before the flat fee is charged. NULL = charge unconditionally. Ignored when monthlyFee is NULL.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Optional human note (contract ref, reason for change, …).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the row was created.","anyOf":[{"description":"When the row was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPayment-gatewayCommission-list","tags":["Payment Gateway"],"summary":"List commission periods for a gateway","description":"Returns the chronological list of commission-rate validity periods configured for the given gateway instance. Each row defines a percentage that applies between `fromDate` (inclusive) and `toDate` (inclusive, NULL = open-ended). The Branch Finance roll-up uses the period matching each payment date to compute the \"Poplatek bráně\" column."}},"/bff/payment-gateway/commission-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffPayment-gatewayCommission-add","tags":["Payment Gateway"],"summary":"Add a commission period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","fromDate","percentage"],"properties":{"code":{"description":"Gateway instance code the period belongs to.","examples":["gopay-production"],"type":"string"},"fromDate":{"description":"Start of the validity period (inclusive), YYYY-MM-DD.","examples":["2026-01-01"],"type":"string"},"toDate":{"description":"End of the validity period (inclusive). Omit or pass null for open-ended.","examples":["2026-12-31"],"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Commission rate in percent (e.g. 1.25 for 1.25 %). Must be >= 0.","examples":[1.25],"type":"number"},"monthlyFee":{"description":"Flat monthly fee charged in addition to the percentage. Null/0 = no flat fee.","examples":[100],"anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"Charge the flat fee only when the month's gateway turnover reaches this value. Null = charge unconditionally. Ignored when monthlyFee is null/0.","examples":[50000],"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Optional note (contract ref, reason).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","fromDate","percentage"],"properties":{"code":{"description":"Gateway instance code the period belongs to.","examples":["gopay-production"],"type":"string"},"fromDate":{"description":"Start of the validity period (inclusive), YYYY-MM-DD.","examples":["2026-01-01"],"type":"string"},"toDate":{"description":"End of the validity period (inclusive). Omit or pass null for open-ended.","examples":["2026-12-31"],"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Commission rate in percent (e.g. 1.25 for 1.25 %). Must be >= 0.","examples":[1.25],"type":"number"},"monthlyFee":{"description":"Flat monthly fee charged in addition to the percentage. Null/0 = no flat fee.","examples":[100],"anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"Charge the flat fee only when the month's gateway turnover reaches this value. Null = charge unconditionally. Ignored when monthlyFee is null/0.","examples":[50000],"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Optional note (contract ref, reason).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code","fromDate","percentage"],"properties":{"code":{"description":"Gateway instance code the period belongs to.","examples":["gopay-production"],"type":"string"},"fromDate":{"description":"Start of the validity period (inclusive), YYYY-MM-DD.","examples":["2026-01-01"],"type":"string"},"toDate":{"description":"End of the validity period (inclusive). Omit or pass null for open-ended.","examples":["2026-12-31"],"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"Commission rate in percent (e.g. 1.25 for 1.25 %). Must be >= 0.","examples":[1.25],"type":"number"},"monthlyFee":{"description":"Flat monthly fee charged in addition to the percentage. Null/0 = no flat fee.","examples":[100],"anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"Charge the flat fee only when the month's gateway turnover reaches this value. Null = charge unconditionally. Ignored when monthlyFee is null/0.","examples":[50000],"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Optional note (contract ref, reason).","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/payment-gateway/commission-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPayment-gatewayCommission-update","tags":["Payment Gateway"],"summary":"Update a commission period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Commission period ID.","examples":["1"],"type":"string"},"fromDate":{"description":"New start (YYYY-MM-DD).","type":"string"},"toDate":{"description":"New end (YYYY-MM-DD) or null for open-ended.","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"New percentage. Must be >= 0.","type":"number"},"monthlyFee":{"description":"New flat monthly fee. Null/0 clears the flat fee (and its turnover threshold).","anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"New turnover threshold gating the flat fee. Null = charge unconditionally. Forced to null when monthlyFee is cleared.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"New note.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Commission period ID.","examples":["1"],"type":"string"},"fromDate":{"description":"New start (YYYY-MM-DD).","type":"string"},"toDate":{"description":"New end (YYYY-MM-DD) or null for open-ended.","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"New percentage. Must be >= 0.","type":"number"},"monthlyFee":{"description":"New flat monthly fee. Null/0 clears the flat fee (and its turnover threshold).","anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"New turnover threshold gating the flat fee. Null = charge unconditionally. Forced to null when monthlyFee is cleared.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"New note.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Commission period ID.","examples":["1"],"type":"string"},"fromDate":{"description":"New start (YYYY-MM-DD).","type":"string"},"toDate":{"description":"New end (YYYY-MM-DD) or null for open-ended.","anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"description":"New percentage. Must be >= 0.","type":"number"},"monthlyFee":{"description":"New flat monthly fee. Null/0 clears the flat fee (and its turnover threshold).","anyOf":[{"type":"number"},{"type":"null"}]},"monthlyFeeMinTurnover":{"description":"New turnover threshold gating the flat fee. Null = charge unconditionally. Forced to null when monthlyFee is cleared.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"New note.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/payment-gateway/commission-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPayment-gatewayCommission-delete","tags":["Payment Gateway"],"summary":"Delete a commission period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Commission period ID.","examples":["1"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Commission period ID.","examples":["1"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Commission period ID.","examples":["1"],"type":"string"}}}}}}}},"/bff/permission/shareable-entities":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"string"}}},"required":["items"]}}}}},"operationId":"getBffPermissionShareable-entities","tags":["Permission"],"summary":"List entity types that support per-entity sharing"}},"/bff/permission/entity-share-list":{"get":{"parameters":[{"description":"Entity code (e.g. \"calendar\").","schema":{"type":"string"},"in":"query","name":"entity","required":true},{"description":"Public code/slug identifying the specific entity.","schema":{"type":"string"},"in":"query","name":"entityCode","required":true}],"operationId":"getBffPermissionEntity-share-list","tags":["Permission"],"summary":"List members with access to an entity","description":"Returns members who can see the entity: those with an explicit grant in `cas__organisation_entity_permission`, plus members with the `root` permission (implicit access). Used by the admin sharing dialog.","responses":{"200":{}}}},"/bff/permission/entity-share-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPermissionEntity-share-add","tags":["Permission"],"summary":"Grant a member direct access to an entity","description":"Idempotent — if an active grant already exists, validTo / permissionCode are updated in place.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entity","entityCode","memberId"],"properties":{"entity":{"type":"string"},"entityCode":{"type":"string"},"memberId":{"description":"External member id (shop__contact.external_id).","type":"string"},"permissionCode":{"description":"Optional fine-grained permission code attached to the grant.","type":"string"},"validTo":{"description":"ISO timestamp; access expires at this date. Omit for indefinite access.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entity","entityCode","memberId"],"properties":{"entity":{"type":"string"},"entityCode":{"type":"string"},"memberId":{"description":"External member id (shop__contact.external_id).","type":"string"},"permissionCode":{"description":"Optional fine-grained permission code attached to the grant.","type":"string"},"validTo":{"description":"ISO timestamp; access expires at this date. Omit for indefinite access.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entity","entityCode","memberId"],"properties":{"entity":{"type":"string"},"entityCode":{"type":"string"},"memberId":{"description":"External member id (shop__contact.external_id).","type":"string"},"permissionCode":{"description":"Optional fine-grained permission code attached to the grant.","type":"string"},"validTo":{"description":"ISO timestamp; access expires at this date. Omit for indefinite access.","type":"string"}}}}}}}},"/bff/permission/member-entity-summary":{"get":{"parameters":[{"description":"External member id (shop__contact.external_id).","schema":{"type":"string"},"in":"query","name":"memberId","required":true}],"operationId":"getBffPermissionMember-entity-summary","tags":["Permission"],"summary":"Summarise per-entity-type access for one member","description":"For every shareable entity type returns: the count of entities the member can see, the total available in the organisation, whether visibility comes from `root`, and up to 3 example names. Powers the reverse-axis \"what does this member see\" UI block in admin.","responses":{"200":{}}}},"/bff/permission/member-entity-picker":{"get":{"parameters":[{"description":"External member id whose access is being managed.","schema":{"type":"string"},"in":"query","name":"memberId","required":true},{"description":"Shareable entity type code (e.g. \"calendar\").","schema":{"type":"string"},"in":"query","name":"entity","required":true},{"description":"Free-text filter — matches name/code/email.","schema":{"type":"string"},"in":"query","name":"search","required":false},{"description":"1-indexed page number.","schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Page size (default 30, max 200).","schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffPermissionMember-entity-picker","tags":["Permission"],"summary":"List entities of a type with per-row \"isShared\" flag for one member","description":"Backs the reverse-axis picker modal in admin (member detail → pick which entities of a given type they can access). Pair with /permission/entity-share-add and -remove to toggle individual entries.","responses":{"200":{}}}},"/bff/permission/entity-share-remove":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPermissionEntity-share-remove","tags":["Permission"],"summary":"Revoke a member’s direct access to an entity","description":"Soft-revoke (sets valid_to=NOW()). Root members keep access through the `root` permission.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entity","entityCode","memberId"],"properties":{"entity":{"type":"string"},"entityCode":{"type":"string"},"memberId":{"description":"External member id of the member whose access to revoke.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entity","entityCode","memberId"],"properties":{"entity":{"type":"string"},"entityCode":{"type":"string"},"memberId":{"description":"External member id of the member whose access to revoke.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entity","entityCode","memberId"],"properties":{"entity":{"type":"string"},"entityCode":{"type":"string"},"memberId":{"description":"External member id of the member whose access to revoke.","type":"string"}}}}}}}},"/bff/presence/entity-touch":{"post":{"parameters":[],"operationId":"postBffPresenceEntity-touch","tags":["Presence"],"summary":"Touch + list \"who is viewing this entity\"","description":"Stamps the caller as currently viewing the (entity, entityCode) pair and returns the list of recent viewers from the same organisation. Intended to be polled by the admin UI every ~10 s while a member has an entity detail open.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entity","entityCode"],"properties":{"entity":{"minLength":1,"maxLength":32,"description":"Entity type code, e.g. \"order\".","type":"string"},"entityCode":{"minLength":1,"maxLength":255,"description":"Public identifier of the entity (hash/slug/code).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entity","entityCode"],"properties":{"entity":{"minLength":1,"maxLength":32,"description":"Entity type code, e.g. \"order\".","type":"string"},"entityCode":{"minLength":1,"maxLength":255,"description":"Public identifier of the entity (hash/slug/code).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entity","entityCode"],"properties":{"entity":{"minLength":1,"maxLength":32,"description":"Entity type code, e.g. \"order\".","type":"string"},"entityCode":{"minLength":1,"maxLength":255,"description":"Public identifier of the entity (hash/slug/code).","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/presence/members":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","userId","fullName","username","jobTitle","isYou","customStatus","statusUntil","inCall","workLocation","meetingUntil","avatarInfo"],"properties":{"id":{"type":"string"},"userId":{"description":"User wire id (`cas__user.external_id`), the team chat identity.","type":"string"},"fullName":{"type":"string"},"username":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isYou":{"type":"boolean"},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"statusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inCall":{"type":"boolean"},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}}}},"itemCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","userId","fullName","username","jobTitle","isYou","customStatus","statusUntil","inCall","workLocation","meetingUntil","avatarInfo"],"properties":{"id":{"type":"string"},"userId":{"description":"User wire id (`cas__user.external_id`), the team chat identity.","type":"string"},"fullName":{"type":"string"},"username":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isYou":{"type":"boolean"},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"statusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inCall":{"type":"boolean"},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}}}},"itemCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","userId","fullName","username","jobTitle","isYou","customStatus","statusUntil","inCall","workLocation","meetingUntil","avatarInfo"],"properties":{"id":{"type":"string"},"userId":{"description":"User wire id (`cas__user.external_id`), the team chat identity.","type":"string"},"fullName":{"type":"string"},"username":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isYou":{"type":"boolean"},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"statusUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"inCall":{"type":"boolean"},"workLocation":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]}}}}}}}},"itemCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","itemCount"]}}}}},"operationId":"getBffPresenceMembers","tags":["Presence"],"summary":"Team presence: every active member with avatar + effective availability","description":"Lean list of active, non-blocked members of the current organisation with name, avatar and the effective availability status (manual `cas__user.activity_status` combined with the last heartbeat by `resolveActivityInfo`). Backs the shared admin presence cache used by every member avatar and by the team chat. Available to every member; no module permission required."}},"/bff/team-chat/contacts":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fullName","jobTitle","isYou","avatarInfo","organisations","isBlocked","headline","awayUntil","awayMessage","customStatus","inCall","workLocation","meetingUntil","timezone","lastLocation","memberships"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isYou":{"type":"boolean"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{}}},"organisations":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}}},"isBlocked":{"description":"I blocked this person.","type":"boolean"},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayUntil":{"nullable":true,"anyOf":[{"description":"Out of office until (ISO), future only.","type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"inCall":{"type":"boolean"},"workLocation":{"nullable":true,"anyOf":[{"anyOf":[{"const":"office","type":"string"},{"const":"remote","type":"string"},{"const":"travel","type":"string"}]},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastLocation":{"nullable":true,"anyOf":[{"type":"object","required":["city","country","seenAt"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"seenAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"memberships":{"type":"array","items":{"type":"object","required":["slug","memberId"],"properties":{"slug":{"type":"string"},"memberId":{"type":"string"}}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fullName","jobTitle","isYou","avatarInfo","organisations","isBlocked","headline","awayUntil","awayMessage","customStatus","inCall","workLocation","meetingUntil","timezone","lastLocation","memberships"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isYou":{"type":"boolean"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{}}},"organisations":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}}},"isBlocked":{"description":"I blocked this person.","type":"boolean"},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayUntil":{"nullable":true,"anyOf":[{"description":"Out of office until (ISO), future only.","type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"inCall":{"type":"boolean"},"workLocation":{"nullable":true,"anyOf":[{"anyOf":[{"const":"office","type":"string"},{"const":"remote","type":"string"},{"const":"travel","type":"string"}]},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastLocation":{"nullable":true,"anyOf":[{"type":"object","required":["city","country","seenAt"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"seenAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"memberships":{"type":"array","items":{"type":"object","required":["slug","memberId"],"properties":{"slug":{"type":"string"},"memberId":{"type":"string"}}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","fullName","jobTitle","isYou","avatarInfo","organisations","isBlocked","headline","awayUntil","awayMessage","customStatus","inCall","workLocation","meetingUntil","timezone","lastLocation","memberships"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isYou":{"type":"boolean"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{}}},"organisations":{"type":"array","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string"},"name":{"type":"string"}}}},"isBlocked":{"description":"I blocked this person.","type":"boolean"},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayUntil":{"nullable":true,"anyOf":[{"description":"Out of office until (ISO), future only.","type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"inCall":{"type":"boolean"},"workLocation":{"nullable":true,"anyOf":[{"anyOf":[{"const":"office","type":"string"},{"const":"remote","type":"string"},{"const":"travel","type":"string"}]},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastLocation":{"nullable":true,"anyOf":[{"type":"object","required":["city","country","seenAt"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"seenAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"memberships":{"type":"array","items":{"type":"object","required":["slug","memberId"],"properties":{"slug":{"type":"string"},"memberId":{"type":"string"}}}}}}}},"required":["items"]}}}}},"operationId":"getBffTeam-chatContacts","tags":["Team chat"],"summary":"People the caller can write to (across organisations)","description":"Users sharing an active membership with the caller (with the shared organisations) plus counterparts of existing conversations. The caller is first (`isYou`), then online people, then by name. Max 1000."}},"/bff/team-chat/profile":{"get":{"parameters":[{"description":"User wire id (`cas__user.external_id`).","schema":{"type":"string","minLength":1,"maxLength":32},"in":"query","name":"userId","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","profile"],"properties":{"state":{"const":"ok","type":"string"},"profile":{"type":"object","required":["id","fullName","isYou","avatarInfo","headline","bio","location","workingHours","skills","awayUntil","awayMessage","customStatus","workLocation","meetingUntil","timezone","lastLocation","organisations"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"isYou":{"type":"boolean"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{}}},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"anyOf":[{"const":"office","type":"string"},{"const":"remote","type":"string"},{"const":"travel","type":"string"}]},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastLocation":{"nullable":true,"anyOf":[{"type":"object","required":["city","country","seenAt"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"seenAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"organisations":{"type":"array","items":{"type":"object","required":["memberId","slug","name","jobTitle","department","manager"],"properties":{"memberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"name":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"department":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"manager":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","profile"],"properties":{"state":{"const":"ok","type":"string"},"profile":{"type":"object","required":["id","fullName","isYou","avatarInfo","headline","bio","location","workingHours","skills","awayUntil","awayMessage","customStatus","workLocation","meetingUntil","timezone","lastLocation","organisations"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"isYou":{"type":"boolean"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{}}},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"anyOf":[{"const":"office","type":"string"},{"const":"remote","type":"string"},{"const":"travel","type":"string"}]},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastLocation":{"nullable":true,"anyOf":[{"type":"object","required":["city","country","seenAt"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"seenAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"organisations":{"type":"array","items":{"type":"object","required":["memberId","slug","name","jobTitle","department","manager"],"properties":{"memberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"name":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"department":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"manager":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","profile"],"properties":{"state":{"const":"ok","type":"string"},"profile":{"type":"object","required":["id","fullName","isYou","avatarInfo","headline","bio","location","workingHours","skills","awayUntil","awayMessage","customStatus","workLocation","meetingUntil","timezone","lastLocation","organisations"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"isYou":{"type":"boolean"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{}}},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"anyOf":[{"const":"office","type":"string"},{"const":"remote","type":"string"},{"const":"travel","type":"string"}]},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastLocation":{"nullable":true,"anyOf":[{"type":"object","required":["city","country","seenAt"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"seenAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"organisations":{"type":"array","items":{"type":"object","required":["memberId","slug","name","jobTitle","department","manager"],"properties":{"memberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"name":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"department":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"manager":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","profile"],"properties":{"state":{"const":"ok","type":"string"},"profile":{"type":"object","required":["id","fullName","isYou","avatarInfo","headline","bio","location","workingHours","skills","awayUntil","awayMessage","customStatus","workLocation","meetingUntil","timezone","lastLocation","organisations"],"properties":{"id":{"type":"string"},"fullName":{"type":"string"},"isYou":{"type":"boolean"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{}}},"headline":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"workingHours":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"skills":{"type":"array","items":{"type":"string"}},"awayUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"awayMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"customStatus":{"nullable":true,"anyOf":[{"type":"object","required":["emoji","text","clearDate"],"properties":{"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"clearDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"workLocation":{"nullable":true,"anyOf":[{"anyOf":[{"const":"office","type":"string"},{"const":"remote","type":"string"},{"const":"travel","type":"string"}]},{"type":"null"}]},"meetingUntil":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastLocation":{"nullable":true,"anyOf":[{"type":"object","required":["city","country","seenAt"],"properties":{"city":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"seenAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"organisations":{"type":"array","items":{"type":"object","required":["memberId","slug","name","jobTitle","department","manager"],"properties":{"memberId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"name":{"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"department":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"manager":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"getBffTeam-chatProfile","tags":["Team chat"],"summary":"A colleague's public profile card","description":"Visible for contacts (shared organisations or conversation partners) and the caller. Positions only for organisations both share."}},"/bff/team-chat/inbox":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","theme","draft","type","title","participants","lastPosition","lastMessage","lastMessageDate","blockedByMe","isBlocked","myLastReadPosition","unreadCount","myRole","isMuted","isPinned","insertedDate","departmentChannel"],"properties":{"id":{"type":"string"},"theme":{"nullable":true,"anyOf":[{"description":"Colour theme key (see room-update), null = brand colour.","type":"string"},{"type":"null"}]},"draft":{"nullable":true,"anyOf":[{"type":"object","required":["text","mentions","savedAt"],"properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"savedAt":{"type":"string"}}},{"type":"null"}]},"type":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participants":{"type":"array","items":{"type":"object","required":["userId","fullName","role","lastReadPosition","lastReadDate"],"properties":{"userId":{"type":"string"},"fullName":{"type":"string"},"role":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastReadDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessage":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","kind","authorUserId","preview","system","attachmentCount","insertedDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"}}},{"type":"null"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"blockedByMe":{"description":"Direct room: I blocked the other person.","type":"boolean"},"isBlocked":{"description":"Direct room: a block exists in either direction; sending is disabled.","type":"boolean"},"myLastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"myRole":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"isMuted":{"type":"boolean"},"isPinned":{"type":"boolean"},"insertedDate":{"type":"string"},"departmentChannel":{"nullable":true,"anyOf":[{"description":"Department channel: membership follows the structure.","type":"object","required":["organisationName"],"properties":{"organisationName":{"type":"string"}}},{"type":"null"}]}}}},"totalUnread":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","totalUnread"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","theme","draft","type","title","participants","lastPosition","lastMessage","lastMessageDate","blockedByMe","isBlocked","myLastReadPosition","unreadCount","myRole","isMuted","isPinned","insertedDate","departmentChannel"],"properties":{"id":{"type":"string"},"theme":{"nullable":true,"anyOf":[{"description":"Colour theme key (see room-update), null = brand colour.","type":"string"},{"type":"null"}]},"draft":{"nullable":true,"anyOf":[{"type":"object","required":["text","mentions","savedAt"],"properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"savedAt":{"type":"string"}}},{"type":"null"}]},"type":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participants":{"type":"array","items":{"type":"object","required":["userId","fullName","role","lastReadPosition","lastReadDate"],"properties":{"userId":{"type":"string"},"fullName":{"type":"string"},"role":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastReadDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessage":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","kind","authorUserId","preview","system","attachmentCount","insertedDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"}}},{"type":"null"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"blockedByMe":{"description":"Direct room: I blocked the other person.","type":"boolean"},"isBlocked":{"description":"Direct room: a block exists in either direction; sending is disabled.","type":"boolean"},"myLastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"myRole":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"isMuted":{"type":"boolean"},"isPinned":{"type":"boolean"},"insertedDate":{"type":"string"},"departmentChannel":{"nullable":true,"anyOf":[{"description":"Department channel: membership follows the structure.","type":"object","required":["organisationName"],"properties":{"organisationName":{"type":"string"}}},{"type":"null"}]}}}},"totalUnread":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","totalUnread"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","theme","draft","type","title","participants","lastPosition","lastMessage","lastMessageDate","blockedByMe","isBlocked","myLastReadPosition","unreadCount","myRole","isMuted","isPinned","insertedDate","departmentChannel"],"properties":{"id":{"type":"string"},"theme":{"nullable":true,"anyOf":[{"description":"Colour theme key (see room-update), null = brand colour.","type":"string"},{"type":"null"}]},"draft":{"nullable":true,"anyOf":[{"type":"object","required":["text","mentions","savedAt"],"properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"savedAt":{"type":"string"}}},{"type":"null"}]},"type":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participants":{"type":"array","items":{"type":"object","required":["userId","fullName","role","lastReadPosition","lastReadDate"],"properties":{"userId":{"type":"string"},"fullName":{"type":"string"},"role":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastReadDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessage":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","kind","authorUserId","preview","system","attachmentCount","insertedDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"}}},{"type":"null"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"blockedByMe":{"description":"Direct room: I blocked the other person.","type":"boolean"},"isBlocked":{"description":"Direct room: a block exists in either direction; sending is disabled.","type":"boolean"},"myLastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"myRole":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"isMuted":{"type":"boolean"},"isPinned":{"type":"boolean"},"insertedDate":{"type":"string"},"departmentChannel":{"nullable":true,"anyOf":[{"description":"Department channel: membership follows the structure.","type":"object","required":["organisationName"],"properties":{"organisationName":{"type":"string"}}},{"type":"null"}]}}}},"totalUnread":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","totalUnread"]}}}}},"operationId":"getBffTeam-chatInbox","tags":["Team chat"],"summary":"Team chat rooms of the caller","description":"Self / direct / group rooms the caller participates in, pinned first, then by latest activity. Each room carries participants with their read watermark, the last message preview and the unread count (`lastPosition - myLastReadPosition`). `totalUnread` sums unread counts of non-muted rooms (header badge)."}},"/bff/team-chat/block":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"blocked":{"type":"boolean"}},"required":["blocked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"blocked":{"type":"boolean"}},"required":["blocked"]}},"text/plain":{"schema":{"type":"object","properties":{"blocked":{"type":"boolean"}},"required":["blocked"]}}}}},"operationId":"postBffTeam-chatBlock","tags":["Team chat"],"summary":"Block or unblock a person in team chat","description":"While a block exists (either direction) the 1:1 room is read-only and neither person can start a conversation with or add the other to a group. Existing groups are not affected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId","blocked"],"properties":{"userId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},"blocked":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId","blocked"],"properties":{"userId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},"blocked":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["userId","blocked"],"properties":{"userId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},"blocked":{"type":"boolean"}}}}}}}},"/bff/team-chat/room":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","room"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","theme","draft","type","title","participants","lastPosition","lastMessage","lastMessageDate","blockedByMe","isBlocked","myLastReadPosition","unreadCount","myRole","isMuted","isPinned","insertedDate","departmentChannel"],"properties":{"id":{"type":"string"},"theme":{"nullable":true,"anyOf":[{"description":"Colour theme key (see room-update), null = brand colour.","type":"string"},{"type":"null"}]},"draft":{"nullable":true,"anyOf":[{"type":"object","required":["text","mentions","savedAt"],"properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"savedAt":{"type":"string"}}},{"type":"null"}]},"type":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participants":{"type":"array","items":{"type":"object","required":["userId","fullName","role","lastReadPosition","lastReadDate"],"properties":{"userId":{"type":"string"},"fullName":{"type":"string"},"role":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastReadDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessage":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","kind","authorUserId","preview","system","attachmentCount","insertedDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"}}},{"type":"null"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"blockedByMe":{"description":"Direct room: I blocked the other person.","type":"boolean"},"isBlocked":{"description":"Direct room: a block exists in either direction; sending is disabled.","type":"boolean"},"myLastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"myRole":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"isMuted":{"type":"boolean"},"isPinned":{"type":"boolean"},"insertedDate":{"type":"string"},"departmentChannel":{"nullable":true,"anyOf":[{"description":"Department channel: membership follows the structure.","type":"object","required":["organisationName"],"properties":{"organisationName":{"type":"string"}}},{"type":"null"}]}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","room"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","theme","draft","type","title","participants","lastPosition","lastMessage","lastMessageDate","blockedByMe","isBlocked","myLastReadPosition","unreadCount","myRole","isMuted","isPinned","insertedDate","departmentChannel"],"properties":{"id":{"type":"string"},"theme":{"nullable":true,"anyOf":[{"description":"Colour theme key (see room-update), null = brand colour.","type":"string"},{"type":"null"}]},"draft":{"nullable":true,"anyOf":[{"type":"object","required":["text","mentions","savedAt"],"properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"savedAt":{"type":"string"}}},{"type":"null"}]},"type":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participants":{"type":"array","items":{"type":"object","required":["userId","fullName","role","lastReadPosition","lastReadDate"],"properties":{"userId":{"type":"string"},"fullName":{"type":"string"},"role":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastReadDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessage":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","kind","authorUserId","preview","system","attachmentCount","insertedDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"}}},{"type":"null"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"blockedByMe":{"description":"Direct room: I blocked the other person.","type":"boolean"},"isBlocked":{"description":"Direct room: a block exists in either direction; sending is disabled.","type":"boolean"},"myLastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"myRole":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"isMuted":{"type":"boolean"},"isPinned":{"type":"boolean"},"insertedDate":{"type":"string"},"departmentChannel":{"nullable":true,"anyOf":[{"description":"Department channel: membership follows the structure.","type":"object","required":["organisationName"],"properties":{"organisationName":{"type":"string"}}},{"type":"null"}]}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","room"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","theme","draft","type","title","participants","lastPosition","lastMessage","lastMessageDate","blockedByMe","isBlocked","myLastReadPosition","unreadCount","myRole","isMuted","isPinned","insertedDate","departmentChannel"],"properties":{"id":{"type":"string"},"theme":{"nullable":true,"anyOf":[{"description":"Colour theme key (see room-update), null = brand colour.","type":"string"},{"type":"null"}]},"draft":{"nullable":true,"anyOf":[{"type":"object","required":["text","mentions","savedAt"],"properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"savedAt":{"type":"string"}}},{"type":"null"}]},"type":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participants":{"type":"array","items":{"type":"object","required":["userId","fullName","role","lastReadPosition","lastReadDate"],"properties":{"userId":{"type":"string"},"fullName":{"type":"string"},"role":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastReadDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessage":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","kind","authorUserId","preview","system","attachmentCount","insertedDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"}}},{"type":"null"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"blockedByMe":{"description":"Direct room: I blocked the other person.","type":"boolean"},"isBlocked":{"description":"Direct room: a block exists in either direction; sending is disabled.","type":"boolean"},"myLastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"myRole":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"isMuted":{"type":"boolean"},"isPinned":{"type":"boolean"},"insertedDate":{"type":"string"},"departmentChannel":{"nullable":true,"anyOf":[{"description":"Department channel: membership follows the structure.","type":"object","required":["organisationName"],"properties":{"organisationName":{"type":"string"}}},{"type":"null"}]}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","room"],"properties":{"state":{"const":"ok","type":"string"},"room":{"type":"object","required":["id","theme","draft","type","title","participants","lastPosition","lastMessage","lastMessageDate","blockedByMe","isBlocked","myLastReadPosition","unreadCount","myRole","isMuted","isPinned","insertedDate","departmentChannel"],"properties":{"id":{"type":"string"},"theme":{"nullable":true,"anyOf":[{"description":"Colour theme key (see room-update), null = brand colour.","type":"string"},{"type":"null"}]},"draft":{"nullable":true,"anyOf":[{"type":"object","required":["text","mentions","savedAt"],"properties":{"text":{"type":"string"},"mentions":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"savedAt":{"type":"string"}}},{"type":"null"}]},"type":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"title":{"type":"string"},"participants":{"type":"array","items":{"type":"object","required":["userId","fullName","role","lastReadPosition","lastReadDate"],"properties":{"userId":{"type":"string"},"fullName":{"type":"string"},"role":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastReadDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"lastMessage":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","kind","authorUserId","preview","system","attachmentCount","insertedDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"}}},{"type":"null"}]},"lastMessageDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"blockedByMe":{"description":"Direct room: I blocked the other person.","type":"boolean"},"isBlocked":{"description":"Direct room: a block exists in either direction; sending is disabled.","type":"boolean"},"myLastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"unreadCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"myRole":{"anyOf":[{"const":"owner","type":"string"},{"const":"member","type":"string"}]},"isMuted":{"type":"boolean"},"isPinned":{"type":"boolean"},"insertedDate":{"type":"string"},"departmentChannel":{"nullable":true,"anyOf":[{"description":"Department channel: membership follows the structure.","type":"object","required":["organisationName"],"properties":{"organisationName":{"type":"string"}}},{"type":"null"}]}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"getBffTeam-chatRoom","tags":["Team chat"],"summary":"Team chat room detail (participants + read watermarks)"}},"/bff/team-chat/messages":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"roomId","required":true},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"beforePosition","required":false},{"schema":{"minimum":0,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":0,"type":"number"}]},"in":"query","name":"afterPosition","required":false},{"description":"`changeCursor` of an earlier response.","schema":{"minimum":0,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":0,"description":"`changeCursor` of an earlier response.","type":"number"}]},"in":"query","name":"changedSince","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"fromPosition","required":false},{"schema":{"minimum":1,"maximum":200,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":200,"type":"number"}]},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"hasMoreBefore":{"type":"boolean"},"hasMoreAfter":{"type":"boolean"},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"changeCursor":{"description":"Pass as `changedSince` to fetch later edits / deletes / reactions.","type":"number"}},"required":["items","hasMoreBefore","hasMoreAfter","lastPosition","changeCursor"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"hasMoreBefore":{"type":"boolean"},"hasMoreAfter":{"type":"boolean"},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"changeCursor":{"description":"Pass as `changedSince` to fetch later edits / deletes / reactions.","type":"number"}},"required":["items","hasMoreBefore","hasMoreAfter","lastPosition","changeCursor"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"hasMoreBefore":{"type":"boolean"},"hasMoreAfter":{"type":"boolean"},"lastPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"changeCursor":{"description":"Pass as `changedSince` to fetch later edits / deletes / reactions.","type":"number"}},"required":["items","hasMoreBefore","hasMoreAfter","lastPosition","changeCursor"]}}}}},"operationId":"getBffTeam-chatMessages","tags":["Team chat"],"summary":"Messages of a team chat room (cursor by position)","description":"No cursor = newest page. `beforePosition` = older page (scrolling up). `afterPosition` = newer messages (catch-up / polling); keep fetching while `hasMoreAfter`. `changedSince` (+ `fromPosition`) = messages edited, deleted or re-reacted since an earlier `changeCursor`. Items are always ascending by position."}},"/bff/team-chat/files":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"roomId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage","messagePosition","authorUserId","insertedDate"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"messagePosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage","messagePosition","authorUserId","insertedDate"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"messagePosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage","messagePosition","authorUserId","insertedDate"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"messagePosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffTeam-chatFiles","tags":["Team chat"],"summary":"Shared files of a team chat room (newest first, max 200)"}},"/bff/team-chat/open-direct":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"operationId":"postBffTeam-chatOpen-direct","tags":["Team chat"],"summary":"Open (get or create) a 1:1 room, or the self room when userId is the caller","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}}}}}},"/bff/team-chat/create-group":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"operationId":"postBffTeam-chatCreate-group","tags":["Team chat"],"summary":"Create a group room (caller becomes owner)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","userIds"],"properties":{"title":{"minLength":1,"maxLength":100,"type":"string"},"userIds":{"minItems":1,"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["title","userIds"],"properties":{"title":{"minLength":1,"maxLength":100,"type":"string"},"userIds":{"minItems":1,"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["title","userIds"],"properties":{"title":{"minLength":1,"maxLength":100,"type":"string"},"userIds":{"minItems":1,"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}}}}}}},"/bff/team-chat/send":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"duplicate":{"type":"boolean"}},"required":["id","position","duplicate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"duplicate":{"type":"boolean"}},"required":["id","position","duplicate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"duplicate":{"type":"boolean"}},"required":["id","position","duplicate"]}}}}},"operationId":"postBffTeam-chatSend","tags":["Team chat"],"summary":"Send a message (text and/or attachments uploaded via /attachment-upload)","description":"`threadRootId` = reply in the thread of that message (hidden from the main timeline).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"clientNonce":{"minLength":8,"maxLength":36,"description":"Client-generated id (UUID); makes the send idempotent.","type":"string"},"content":{"maxLength":10000,"type":"string"},"attachmentTokens":{"maxItems":10,"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}},"replyToId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"threadRootId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"clientNonce":{"minLength":8,"maxLength":36,"description":"Client-generated id (UUID); makes the send idempotent.","type":"string"},"content":{"maxLength":10000,"type":"string"},"attachmentTokens":{"maxItems":10,"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}},"replyToId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"threadRootId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"clientNonce":{"minLength":8,"maxLength":36,"description":"Client-generated id (UUID); makes the send idempotent.","type":"string"},"content":{"maxLength":10000,"type":"string"},"attachmentTokens":{"maxItems":10,"type":"array","items":{"minLength":1,"maxLength":64,"type":"string"}},"replyToId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"threadRootId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}}}}}},"/bff/team-chat/read":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatRead","tags":["Team chat"],"summary":"Move the caller read watermark forward (never backwards)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","position"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"position":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","position"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"position":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["roomId","position"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"position":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}}}}},"/bff/team-chat/read-all":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"marked":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["marked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"marked":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["marked"]}},"text/plain":{"schema":{"type":"object","properties":{"marked":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["marked"]}}}}},"operationId":"postBffTeam-chatRead-all","tags":["Team chat"],"summary":"Mark every conversation as read"}},"/bff/team-chat/room-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatRoom-update","tags":["Team chat"],"summary":"Rename a group, change the colour theme, add or remove members","description":"Any participant may rename and add members; only the group owner may remove others.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"title":{"minLength":1,"maxLength":100,"type":"string"},"theme":{"nullable":true,"anyOf":[{"anyOf":[{"const":"blue","type":"string"},{"const":"violet","type":"string"},{"const":"pink","type":"string"},{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"green","type":"string"},{"const":"teal","type":"string"},{"const":"slate","type":"string"}]},{"type":"null"}]},"addUserIds":{"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}},"removeUserIds":{"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"title":{"minLength":1,"maxLength":100,"type":"string"},"theme":{"nullable":true,"anyOf":[{"anyOf":[{"const":"blue","type":"string"},{"const":"violet","type":"string"},{"const":"pink","type":"string"},{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"green","type":"string"},{"const":"teal","type":"string"},{"const":"slate","type":"string"}]},{"type":"null"}]},"addUserIds":{"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}},"removeUserIds":{"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"title":{"minLength":1,"maxLength":100,"type":"string"},"theme":{"nullable":true,"anyOf":[{"anyOf":[{"const":"blue","type":"string"},{"const":"violet","type":"string"},{"const":"pink","type":"string"},{"const":"red","type":"string"},{"const":"orange","type":"string"},{"const":"green","type":"string"},{"const":"teal","type":"string"},{"const":"slate","type":"string"}]},{"type":"null"}]},"addUserIds":{"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}},"removeUserIds":{"maxItems":50,"type":"array","items":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"}}}}}}}}},"/bff/team-chat/leave":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatLeave","tags":["Team chat"],"summary":"Leave a group room","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}}}}}},"/bff/team-chat/flags":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatFlags","tags":["Team chat"],"summary":"Per-room personal flags: mute, pin, archive","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"muteForMinutes":{"nullable":true,"anyOf":[{"minimum":0,"description":"`null` unmutes, `0` mutes forever, n = minutes.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"`null` unmutes, `0` mutes forever, n = minutes.","type":"integer"}]},{"type":"null"}]},"pinned":{"type":"boolean"},"archived":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"muteForMinutes":{"nullable":true,"anyOf":[{"minimum":0,"description":"`null` unmutes, `0` mutes forever, n = minutes.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"`null` unmutes, `0` mutes forever, n = minutes.","type":"integer"}]},{"type":"null"}]},"pinned":{"type":"boolean"},"archived":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"muteForMinutes":{"nullable":true,"anyOf":[{"minimum":0,"description":"`null` unmutes, `0` mutes forever, n = minutes.","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"`null` unmutes, `0` mutes forever, n = minutes.","type":"integer"}]},{"type":"null"}]},"pinned":{"type":"boolean"},"archived":{"type":"boolean"}}}}}}}},"/bff/team-chat/edit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatEdit","tags":["Team chat"],"summary":"Edit own message (marks it edited, recomputes mentions)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","content"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","content"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","content"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"}}}}}}}},"/bff/team-chat/thread":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"roomId","required":true},{"description":"24-char message id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"messageId","required":false},{"description":"Alternative to messageId (search hits).","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Alternative to messageId (search hits).","type":"number"}]},"in":"query","name":"position","required":false}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","root","replies","hasMoreBefore"],"properties":{"state":{"const":"ok","type":"string"},"root":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"replies":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"hasMoreBefore":{"type":"boolean"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","root","replies","hasMoreBefore"],"properties":{"state":{"const":"ok","type":"string"},"root":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"replies":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"hasMoreBefore":{"type":"boolean"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","root","replies","hasMoreBefore"],"properties":{"state":{"const":"ok","type":"string"},"root":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"replies":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"hasMoreBefore":{"type":"boolean"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","root","replies","hasMoreBefore"],"properties":{"state":{"const":"ok","type":"string"},"root":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},"replies":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"hasMoreBefore":{"type":"boolean"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"getBffTeam-chatThread","tags":["Team chat"],"summary":"Thread of a message: root + replies (ascending, newest page)","description":"`messageId` (or room `position`) may be the root or any reply of the thread."}},"/bff/team-chat/pins":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"roomId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","position","kind","authorUserId","content","system","attachments","clientNonce","insertedDate","isDeleted","editedDate","replyTo","reactions","mentions","pinnedDate","isForwarded","poll","linkPreview","threadRootId","threadReplyCount","threadLastReplyDate"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"kind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"system":{"nullable":true,"anyOf":[{"type":"object","required":["event","actorUserId"],"properties":{"event":{"type":"string"},"actorUserId":{"type":"string"},"title":{"type":"string"},"userId":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"roomId":{"description":"`reminder`: room of the message.","type":"string"},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"issueKey":{"description":"`issue-created`: the new task.","type":"string"},"organisationName":{"type":"string"},"callId":{"type":"string"},"video":{"type":"boolean"},"outcome":{"anyOf":[{"const":"completed","type":"string"},{"const":"missed","type":"string"},{"const":"declined","type":"string"}]},"durationSec":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},{"type":"null"}]},"attachments":{"type":"array","items":{"type":"object","required":["token","filename","size","contentType","isImage"],"properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"}}}},"clientNonce":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"isDeleted":{"type":"boolean"},"editedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"replyTo":{"nullable":true,"anyOf":[{"type":"object","required":["id","position","authorUserId","preview","attachmentCount","isDeleted"],"properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"preview":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"isDeleted":{"type":"boolean"}}},{"type":"null"}]},"reactions":{"type":"array","items":{"type":"object","required":["emoji","userIds"],"properties":{"emoji":{"type":"string"},"userIds":{"type":"array","items":{"type":"string"}}}}},"mentions":{"type":"array","items":{"type":"string"}},"pinnedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isForwarded":{"type":"boolean"},"poll":{"nullable":true,"anyOf":[{"type":"object","required":["question","multiple","anonymous","closedDate","totalVoters","options"],"properties":{"question":{"type":"string"},"multiple":{"type":"boolean"},"anonymous":{"description":"Voters are hidden from everybody (`voterIds` empty).","type":"boolean"},"closedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalVoters":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"options":{"type":"array","items":{"type":"object","required":["id","text","count","voterIds"],"properties":{"id":{"type":"string"},"text":{"type":"string"},"count":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"voterIds":{"type":"array","items":{"type":"string"}}}}}}},{"type":"null"}]},"linkPreview":{"nullable":true,"anyOf":[{"type":"object","required":["url","title","description","image","siteName"],"properties":{"url":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"nullable":true,"anyOf":[{"description":"Third-party image URL; load it through proxy.bizkithub.com.","type":"string"},{"type":"null"}]},"siteName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"threadRootId":{"nullable":true,"anyOf":[{"description":"Thread reply: wire id of the root message.","type":"string"},{"type":"null"}]},"threadReplyCount":{"description":"Thread root: live replies.","anyOf":[{"format":"integer","default":0,"type":"string"},{"description":"Thread root: live replies.","type":"integer"}]},"threadLastReplyDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getBffTeam-chatPins","tags":["Team chat"],"summary":"Pinned messages of a team chat room (ascending by position)"}},"/bff/team-chat/pin":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"pinned":{"type":"boolean"}},"required":["pinned"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"pinned":{"type":"boolean"}},"required":["pinned"]}},"text/plain":{"schema":{"type":"object","properties":{"pinned":{"type":"boolean"}},"required":["pinned"]}}}}},"operationId":"postBffTeam-chatPin","tags":["Team chat"],"summary":"Pin or unpin a message in its room","description":"Any participant. Pinning posts a \"pinned a message\" system event; at most 20 pins per room.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","pinned"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"pinned":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","pinned"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"pinned":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","pinned"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"pinned":{"type":"boolean"}}}}}}}},"/bff/team-chat/forward":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"roomId":{"type":"string"},"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["roomId","id","position"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"roomId":{"type":"string"},"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["roomId","id","position"]}},"text/plain":{"schema":{"type":"object","properties":{"roomId":{"type":"string"},"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["roomId","id","position"]}}}}},"operationId":"postBffTeam-chatForward","tags":["Team chat"],"summary":"Forward a message (text + attachments) to another room or person","description":"Copies the content and re-links the same attachments; the copy is marked forwarded without naming the original author. Mentions are not carried over. Target: `targetRoomId`, or `targetUserId` (1:1, created when you share an organisation).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"targetRoomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"targetUserId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},"clientNonce":{"minLength":8,"maxLength":36,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"targetRoomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"targetUserId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},"clientNonce":{"minLength":8,"maxLength":36,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"targetRoomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"targetUserId":{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},"clientNonce":{"minLength":8,"maxLength":36,"type":"string"}}}}}}}},"/bff/team-chat/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatDelete","tags":["Team chat"],"summary":"Delete own message (soft delete)","description":"The bubble stays as a \"message deleted\" placeholder; content, attachments and reactions are gone.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}}}}}},"/bff/team-chat/react":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]}},"text/plain":{"schema":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]}}}}},"operationId":"postBffTeam-chatReact","tags":["Team chat"],"summary":"Toggle own emoji reaction on a message","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","emoji"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"emoji":{"minLength":1,"maxLength":32,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","emoji"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"emoji":{"minLength":1,"maxLength":32,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","emoji"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"emoji":{"minLength":1,"maxLength":32,"type":"string"}}}}}}}},"/bff/team-chat/summary":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state","summary","forYou","fromPosition","toPosition","messageCount","truncated","mode"],"properties":{"state":{"const":"ok","type":"string"},"summary":{"type":"array","items":{"type":"string"}},"forYou":{"type":"array","items":{"type":"string"}},"fromPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"toPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"truncated":{"type":"boolean"},"mode":{"anyOf":[{"const":"unread","type":"string"},{"const":"recent","type":"string"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"empty","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","summary","forYou","fromPosition","toPosition","messageCount","truncated","mode"],"properties":{"state":{"const":"ok","type":"string"},"summary":{"type":"array","items":{"type":"string"}},"forYou":{"type":"array","items":{"type":"string"}},"fromPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"toPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"truncated":{"type":"boolean"},"mode":{"anyOf":[{"const":"unread","type":"string"},{"const":"recent","type":"string"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"empty","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","summary","forYou","fromPosition","toPosition","messageCount","truncated","mode"],"properties":{"state":{"const":"ok","type":"string"},"summary":{"type":"array","items":{"type":"string"}},"forYou":{"type":"array","items":{"type":"string"}},"fromPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"toPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"truncated":{"type":"boolean"},"mode":{"anyOf":[{"const":"unread","type":"string"},{"const":"recent","type":"string"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"empty","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","summary","forYou","fromPosition","toPosition","messageCount","truncated","mode"],"properties":{"state":{"const":"ok","type":"string"},"summary":{"type":"array","items":{"type":"string"}},"forYou":{"type":"array","items":{"type":"string"}},"fromPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"toPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"messageCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"truncated":{"type":"boolean"},"mode":{"anyOf":[{"const":"unread","type":"string"},{"const":"recent","type":"string"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"empty","type":"string"}}}]}}}}},"operationId":"postBffTeam-chatSummary","tags":["Team chat"],"summary":"AI summary of my unread messages (\"what did I miss\")","description":"Summarises unread messages of the room (or the latest 60 when nothing is unread) with a Gemini model. The conversation is not stored: ai__question only records a redacted placeholder for billing. Max 20 per member per hour.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}}}}}},"/bff/team-chat/search":{"get":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"in":"query","name":"q","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["roomId","roomType","roomTitle","messageId","position","authorUserId","content","insertedDate"],"properties":{"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["roomId","roomType","roomTitle","messageId","position","authorUserId","content","insertedDate"],"properties":{"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["roomId","roomType","roomTitle","messageId","position","authorUserId","content","insertedDate"],"properties":{"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"insertedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffTeam-chatSearch","tags":["Team chat"],"summary":"Search own team chat messages","description":"Accent-insensitive, at least 3 characters, only rooms where the caller is an active participant. Newest first, max 30."}},"/bff/team-chat/typing":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatTyping","tags":["Team chat"],"summary":"Typing ping (real-time only, nothing is stored)","description":"Clients send it at most every ~3 s while the composer changes; other participants show the bubbles for 6 s.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}}}}}},"/bff/team-chat/attachment-upload":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"blobToken":{"type":"string"}},"required":["token","filename","size","contentType","isImage","blobToken"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"blobToken":{"type":"string"}},"required":["token","filename","size","contentType","isImage","blobToken"]}},"text/plain":{"schema":{"type":"object","properties":{"token":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"isImage":{"type":"boolean"},"blobToken":{"type":"string"}},"required":["token","filename","size","contentType","isImage","blobToken"]}}}}},"operationId":"postBffTeam-chatAttachment-upload","tags":["Team chat"],"summary":"Upload one team chat attachment before sending","description":"Stores the file privately under `user/{slug}/chat` with `tag = chat` (never listed in Drive). Pass the returned token in `/send` `attachmentTokens`. Until sent, only the uploader can open it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload (max 100 MB).","type":"string","format":"binary"},"blobPath":{"type":"string"},"tag":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload (max 100 MB).","type":"string","format":"binary"},"blobPath":{"type":"string"},"tag":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["file"],"properties":{"file":{"default":"File","description":"Binary file payload (max 100 MB).","type":"string","format":"binary"},"blobPath":{"type":"string"},"tag":{"type":"string"}}}}}}}},"/bff/team-chat/calls":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}},"required":["enabled","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}},"required":["enabled","items"]}},"text/plain":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}}},"required":["enabled","items"]}}}}},"operationId":"getBffTeam-chatCalls","tags":["Team chat"],"summary":"Calls ringing or running in my conversations","description":"Restores the call window and \"join\" banners after a reload. `enabled = false` hides call buttons."}},"/bff/team-chat/call-start":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"LiveKit signalling URL.","type":"string"},"token":{"description":"Participant access token for this call only.","type":"string"},"call":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["url","token","call"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"url":{"description":"LiveKit signalling URL.","type":"string"},"token":{"description":"Participant access token for this call only.","type":"string"},"call":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["url","token","call"]}},"text/plain":{"schema":{"type":"object","properties":{"url":{"description":"LiveKit signalling URL.","type":"string"},"token":{"description":"Participant access token for this call only.","type":"string"},"call":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["url","token","call"]}}}}},"operationId":"postBffTeam-chatCall-start","tags":["Team chat"],"summary":"Start a call in a conversation (rings everybody else)","description":"Direct or group rooms only. Joins the running call when the room already has one. Media goes to the LiveKit SFU, never through core; nothing is recorded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","video"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"video":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","video"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"video":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","video"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"video":{"type":"boolean"}}}}}}}},"/bff/team-chat/call-join":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"description":"LiveKit signalling URL.","type":"string"},"token":{"description":"Participant access token for this call only.","type":"string"},"call":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["url","token","call"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"url":{"description":"LiveKit signalling URL.","type":"string"},"token":{"description":"Participant access token for this call only.","type":"string"},"call":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["url","token","call"]}},"text/plain":{"schema":{"type":"object","properties":{"url":{"description":"LiveKit signalling URL.","type":"string"},"token":{"description":"Participant access token for this call only.","type":"string"},"call":{"type":"object","required":["id","roomId","roomType","startedBy","startedAt","answeredAt","video","participants","present","declined","ringSeconds"],"properties":{"id":{"description":"16-char call id.","type":"string"},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"startedBy":{"description":"Caller user wire id.","type":"string"},"startedAt":{"type":"string"},"answeredAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"video":{"description":"The caller started with the camera on.","type":"boolean"},"participants":{"description":"User wire ids that are rung / may join.","type":"array","items":{"type":"string"}},"present":{"description":"User wire ids connected right now.","type":"array","items":{"type":"string"}},"declined":{"type":"array","items":{"type":"string"}},"ringSeconds":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["url","token","call"]}}}}},"operationId":"postBffTeam-chatCall-join","tags":["Team chat"],"summary":"Answer / join a running call","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/team-chat/call-decline":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatCall-decline","tags":["Team chat"],"summary":"Decline a ringing call","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/team-chat/call-leave":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatCall-leave","tags":["Team chat"],"summary":"Hang up","description":"Ends a direct or unanswered call for everybody; a group call continues while somebody is connected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","callId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"callId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/team-chat/call-webhook":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatCall-webhook","tags":["Team chat"],"summary":"LiveKit webhook (server to server)","description":"Signed by the LiveKit API secret (JWT with the body SHA-256). Presence and room end of calls."}},"/bff/team-chat/link-image":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"roomId","required":true},{"description":"24-char message id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"messageId","required":true}],"operationId":"getBffTeam-chatLink-image","tags":["Team chat"],"summary":"Thumbnail of a message link preview","description":"Served by core so the browser never contacts the third-party site. Only the image stored in the message's preview, only for room participants; raster images up to 3 MB.","responses":{"200":{}}}},"/bff/team-chat/poll-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"duplicate":{"type":"boolean"}},"required":["id","position","duplicate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"duplicate":{"type":"boolean"}},"required":["id","position","duplicate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"duplicate":{"type":"boolean"}},"required":["id","position","duplicate"]}}}}},"operationId":"postBffTeam-chatPoll-create","tags":["Team chat"],"summary":"Post a poll to a conversation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","question","options","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"question":{"minLength":1,"maxLength":300,"type":"string"},"options":{"minItems":2,"maxItems":10,"type":"array","items":{"maxLength":120,"type":"string"}},"multiple":{"type":"boolean"},"anonymous":{"type":"boolean"},"clientNonce":{"minLength":1,"maxLength":64,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","question","options","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"question":{"minLength":1,"maxLength":300,"type":"string"},"options":{"minItems":2,"maxItems":10,"type":"array","items":{"maxLength":120,"type":"string"}},"multiple":{"type":"boolean"},"anonymous":{"type":"boolean"},"clientNonce":{"minLength":1,"maxLength":64,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","question","options","clientNonce"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"question":{"minLength":1,"maxLength":300,"type":"string"},"options":{"minItems":2,"maxItems":10,"type":"array","items":{"maxLength":120,"type":"string"}},"multiple":{"type":"boolean"},"anonymous":{"type":"boolean"},"clientNonce":{"minLength":1,"maxLength":64,"type":"string"}}}}}}}},"/bff/team-chat/poll-vote":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatPoll-vote","tags":["Team chat"],"summary":"Answer a poll (replaces my answer; empty = retract)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","optionIds"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"optionIds":{"maxItems":10,"type":"array","items":{"maxLength":8,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","optionIds"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"optionIds":{"maxItems":10,"type":"array","items":{"maxLength":8,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","optionIds"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"optionIds":{"maxItems":10,"type":"array","items":{"maxLength":8,"type":"string"}}}}}}}}},"/bff/team-chat/poll-close":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatPoll-close","tags":["Team chat"],"summary":"Close a poll (author only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"}}}}}}}},"/bff/team-chat/poll-mine":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"roomId","required":true},{"description":"24-char message id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"messageId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"optionIds":{"type":"array","items":{"type":"string"}}},"required":["optionIds"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"optionIds":{"type":"array","items":{"type":"string"}}},"required":["optionIds"]}},"text/plain":{"schema":{"type":"object","properties":{"optionIds":{"type":"array","items":{"type":"string"}}},"required":["optionIds"]}}}}},"operationId":"getBffTeam-chatPoll-mine","tags":["Team chat"],"summary":"My answer to an anonymous poll"}},"/bff/team-chat/message-to-issue":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"issueKey":{"type":"string"}},"required":["issueKey"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"issueKey":{"type":"string"}},"required":["issueKey"]}},"text/plain":{"schema":{"type":"object","properties":{"issueKey":{"type":"string"}},"required":["issueKey"]}}}}},"operationId":"postBffTeam-chatMessage-to-issue","tags":["Team chat"],"summary":"Create a task (issue) from a message","description":"In the caller’s active organisation; the message is quoted with a deep link back. Posts an `issue-created` note into the room.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","subject"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"subject":{"maxLength":250,"type":"string"},"assigneeUserId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","subject"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"subject":{"maxLength":250,"type":"string"},"assigneeUserId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","subject"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"subject":{"maxLength":250,"type":"string"},"assigneeUserId":{"nullable":true,"anyOf":[{"minLength":1,"maxLength":32,"description":"User wire id (`cas__user.external_id`).","type":"string"},{"type":"null"}]}}}}}}}},"/bff/team-chat/reminders":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","remindDate","roomId","position","preview","authorUserId"],"properties":{"id":{"type":"string"},"remindDate":{"type":"string"},"roomId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","remindDate","roomId","position","preview","authorUserId"],"properties":{"id":{"type":"string"},"remindDate":{"type":"string"},"roomId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","remindDate","roomId","position","preview","authorUserId"],"properties":{"id":{"type":"string"},"remindDate":{"type":"string"},"roomId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"preview":{"type":"string"},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getBffTeam-chatReminders","tags":["Team chat"],"summary":"My pending message reminders"}},"/bff/team-chat/reminder-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"remindDate":{"type":"string"}},"required":["id","remindDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"remindDate":{"type":"string"}},"required":["id","remindDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"remindDate":{"type":"string"}},"required":["id","remindDate"]}}}}},"operationId":"postBffTeam-chatReminder-create","tags":["Team chat"],"summary":"Remind me about a message","description":"Delivered within a minute as a card in my notes-to-self room plus a Web Push.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","remindAt"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"remindAt":{"description":"ISO date-time.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","remindAt"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"remindAt":{"description":"ISO date-time.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","remindAt"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"remindAt":{"description":"ISO date-time.","type":"string"}}}}}}}},"/bff/team-chat/reminder-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatReminder-delete","tags":["Team chat"],"summary":"Cancel a pending reminder","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/team-chat/saved":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["roomId","roomType","roomTitle","messageId","position","authorUserId","content","attachmentCount","insertedDate","savedDate"],"properties":{"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"},"savedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["roomId","roomType","roomTitle","messageId","position","authorUserId","content","attachmentCount","insertedDate","savedDate"],"properties":{"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"},"savedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["roomId","roomType","roomTitle","messageId","position","authorUserId","content","attachmentCount","insertedDate","savedDate"],"properties":{"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"authorUserId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"content":{"type":"string"},"attachmentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"insertedDate":{"type":"string"},"savedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffTeam-chatSaved","tags":["Team chat"],"summary":"My saved messages (newest saved first, max 200)"}},"/bff/team-chat/save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatSave","tags":["Team chat"],"summary":"Save / unsave a message (personal bookmark)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","saved"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"saved":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","saved"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"saved":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","saved"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"saved":{"type":"boolean"}}}}}}}},"/bff/team-chat/scheduled":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"roomId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","roomId","content","sendDate","failedReason"],"properties":{"id":{"type":"string"},"roomId":{"type":"string"},"content":{"type":"string"},"sendDate":{"type":"string"},"failedReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","roomId","content","sendDate","failedReason"],"properties":{"id":{"type":"string"},"roomId":{"type":"string"},"content":{"type":"string"},"sendDate":{"type":"string"},"failedReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","roomId","content","sendDate","failedReason"],"properties":{"id":{"type":"string"},"roomId":{"type":"string"},"content":{"type":"string"},"sendDate":{"type":"string"},"failedReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["items"]}}}}},"operationId":"getBffTeam-chatScheduled","tags":["Team chat"],"summary":"My scheduled (\"send later\") messages"}},"/bff/team-chat/schedule-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"roomId":{"type":"string"},"content":{"type":"string"},"sendDate":{"type":"string"},"failedReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","roomId","content","sendDate","failedReason"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"roomId":{"type":"string"},"content":{"type":"string"},"sendDate":{"type":"string"},"failedReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","roomId","content","sendDate","failedReason"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"roomId":{"type":"string"},"content":{"type":"string"},"sendDate":{"type":"string"},"failedReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","roomId","content","sendDate","failedReason"]}}}}},"operationId":"postBffTeam-chatSchedule-create","tags":["Team chat"],"summary":"Schedule a message (\"send later\")","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","content","sendAt"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"},"sendAt":{"description":"ISO date-time, 1 minute to 90 days ahead.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","content","sendAt"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"},"sendAt":{"description":"ISO date-time, 1 minute to 90 days ahead.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","content","sendAt"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"},"sendAt":{"description":"ISO date-time, 1 minute to 90 days ahead.","type":"string"}}}}}}}},"/bff/team-chat/schedule-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatSchedule-update","tags":["Team chat"],"summary":"Edit a scheduled message (text / time)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"},"sendAt":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"},"sendAt":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"content":{"minLength":1,"maxLength":10000,"type":"string"},"sendAt":{"type":"string"}}}}}}}},"/bff/team-chat/schedule-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatSchedule-delete","tags":["Team chat"],"summary":"Cancel a scheduled message","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/team-chat/translate":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"sourceLanguage":{"type":"string"},"sameLanguage":{"type":"boolean"}},"required":["text","sourceLanguage","sameLanguage"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"text":{"type":"string"},"sourceLanguage":{"type":"string"},"sameLanguage":{"type":"boolean"}},"required":["text","sourceLanguage","sameLanguage"]}},"text/plain":{"schema":{"type":"object","properties":{"text":{"type":"string"},"sourceLanguage":{"type":"string"},"sameLanguage":{"type":"boolean"}},"required":["text","sourceLanguage","sameLanguage"]}}}}},"operationId":"postBffTeam-chatTranslate","tags":["Team chat"],"summary":"Translate one message into the reader language (AI, not stored)","description":"Gemini through the private team chat AI path: the text is never logged or written to ai__question. Cached 24 h in Redis. Max 120 per member per hour.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","messageId","locale"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","messageId","locale"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["roomId","messageId","locale"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"messageId":{"minLength":24,"maxLength":24,"description":"24-char message id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}}}}}},"/bff/team-chat/suggest-replies":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"replies":{"type":"array","items":{"type":"string"}}},"required":["replies"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"replies":{"type":"array","items":{"type":"string"}}},"required":["replies"]}},"text/plain":{"schema":{"type":"object","properties":{"replies":{"type":"array","items":{"type":"string"}}},"required":["replies"]}}}}},"operationId":"postBffTeam-chatSuggest-replies","tags":["Team chat"],"summary":"Up to 3 suggested replies to the latest messages (AI, on demand, not stored)","description":"Empty when the latest message is mine. Max 60 per member per hour.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","locale"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","locale"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["roomId","locale"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"locale":{"anyOf":[{"const":"cs","type":"string"},{"const":"sk","type":"string"},{"const":"en","type":"string"},{"const":"de","type":"string"},{"const":"pl","type":"string"},{"const":"it","type":"string"}]}}}}}}}},"/bff/team-chat/meetings":{"get":{"parameters":[{"description":"24-char room id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"roomId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","roomId","title","description","startDate","endDate","createdByUserId","cancelled","roomTitle"],"properties":{"id":{"type":"string"},"roomId":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":"string"},"createdByUserId":{"type":"string"},"cancelled":{"type":"boolean"},"roomTitle":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","roomId","title","description","startDate","endDate","createdByUserId","cancelled","roomTitle"],"properties":{"id":{"type":"string"},"roomId":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":"string"},"createdByUserId":{"type":"string"},"cancelled":{"type":"boolean"},"roomTitle":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","roomId","title","description","startDate","endDate","createdByUserId","cancelled","roomTitle"],"properties":{"id":{"type":"string"},"roomId":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":"string"},"createdByUserId":{"type":"string"},"cancelled":{"type":"boolean"},"roomTitle":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffTeam-chatMeetings","tags":["Team chat"],"summary":"Upcoming and running meetings (one room, or mine across rooms for 14 days)"}},"/bff/team-chat/meeting-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"roomId":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":"string"},"createdByUserId":{"type":"string"},"cancelled":{"type":"boolean"}},"required":["id","roomId","title","description","startDate","endDate","createdByUserId","cancelled"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"roomId":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":"string"},"createdByUserId":{"type":"string"},"cancelled":{"type":"boolean"}},"required":["id","roomId","title","description","startDate","endDate","createdByUserId","cancelled"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"roomId":{"type":"string"},"title":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"type":"string"},"endDate":{"type":"string"},"createdByUserId":{"type":"string"},"cancelled":{"type":"boolean"}},"required":["id","roomId","title","description","startDate","endDate","createdByUserId","cancelled"]}}}}},"operationId":"postBffTeam-chatMeeting-create","tags":["Team chat"],"summary":"Schedule a meeting in a conversation (card, 5-minute reminder, join = room call)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","title","startAt","durationMinutes"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"type":"string"},{"type":"null"}]},"startAt":{"description":"ISO date-time; at most 5 minutes in the past, a year ahead.","type":"string"},"durationMinutes":{"minimum":5,"maximum":480,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":5,"maximum":480,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","title","startAt","durationMinutes"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"type":"string"},{"type":"null"}]},"startAt":{"description":"ISO date-time; at most 5 minutes in the past, a year ahead.","type":"string"},"durationMinutes":{"minimum":5,"maximum":480,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":5,"maximum":480,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["roomId","title","startAt","durationMinutes"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"type":"string"},{"type":"null"}]},"startAt":{"description":"ISO date-time; at most 5 minutes in the past, a year ahead.","type":"string"},"durationMinutes":{"minimum":5,"maximum":480,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":5,"maximum":480,"type":"integer"}]}}}}}}}},"/bff/team-chat/meeting-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatMeeting-update","tags":["Team chat"],"summary":"Reschedule / rename a meeting","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"type":"string"},{"type":"null"}]},"startAt":{"type":"string"},"durationMinutes":{"minimum":5,"maximum":480,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":5,"maximum":480,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"type":"string"},{"type":"null"}]},"startAt":{"type":"string"},"durationMinutes":{"minimum":5,"maximum":480,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":5,"maximum":480,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"title":{"minLength":1,"maxLength":200,"type":"string"},"description":{"nullable":true,"anyOf":[{"maxLength":4000,"type":"string"},{"type":"null"}]},"startAt":{"type":"string"},"durationMinutes":{"minimum":5,"maximum":480,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":5,"maximum":480,"type":"integer"}]}}}}}}}},"/bff/team-chat/meeting-cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatMeeting-cancel","tags":["Team chat"],"summary":"Cancel a meeting","description":"Direct conversation: either side. Group: the organiser or the group owner.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","id"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","id"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId","id"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"id":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/team-chat/meeting-ics":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"id","required":true}],"operationId":"getBffTeam-chatMeeting-ics","tags":["Team chat"],"summary":"Meeting as an iCalendar file (\"Add to calendar\")","responses":{"200":{}}}},"/bff/team-chat/activity":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["kind","roomId","roomType","roomTitle","messageId","position","threadRootPosition","actorUserId","preview","emoji","date","isNew"],"properties":{"kind":{"anyOf":[{"const":"mention","type":"string"},{"const":"reply","type":"string"},{"const":"thread","type":"string"},{"const":"reaction","type":"string"}]},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"threadRootPosition":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"actorUserId":{"type":"string"},"preview":{"type":"string"},"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"date":{"type":"string"},"isNew":{"type":"boolean"}}}},"newCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","newCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["kind","roomId","roomType","roomTitle","messageId","position","threadRootPosition","actorUserId","preview","emoji","date","isNew"],"properties":{"kind":{"anyOf":[{"const":"mention","type":"string"},{"const":"reply","type":"string"},{"const":"thread","type":"string"},{"const":"reaction","type":"string"}]},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"threadRootPosition":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"actorUserId":{"type":"string"},"preview":{"type":"string"},"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"date":{"type":"string"},"isNew":{"type":"boolean"}}}},"newCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","newCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["kind","roomId","roomType","roomTitle","messageId","position","threadRootPosition","actorUserId","preview","emoji","date","isNew"],"properties":{"kind":{"anyOf":[{"const":"mention","type":"string"},{"const":"reply","type":"string"},{"const":"thread","type":"string"},{"const":"reaction","type":"string"}]},"roomId":{"type":"string"},"roomType":{"anyOf":[{"const":"self","type":"string"},{"const":"direct","type":"string"},{"const":"group","type":"string"}]},"roomTitle":{"type":"string"},"messageId":{"type":"string"},"position":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"threadRootPosition":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"actorUserId":{"type":"string"},"preview":{"type":"string"},"emoji":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"date":{"type":"string"},"isNew":{"type":"boolean"}}}},"newCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["items","newCount"]}}}}},"operationId":"getBffTeam-chatActivity","tags":["Team chat"],"summary":"My activity: mentions, replies, thread replies and reactions to my messages (30 days)"}},"/bff/team-chat/activity-seen":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatActivity-seen","tags":["Team chat"],"summary":"Mark my activity as seen (resets the new counter)"}},"/bff/team-chat/mark-unread":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["lastReadPosition"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["lastReadPosition"]}},"text/plain":{"schema":{"type":"object","properties":{"lastReadPosition":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["lastReadPosition"]}}}}},"operationId":"postBffTeam-chatMark-unread","tags":["Team chat"],"summary":"Mark a conversation as unread (Messenger / Slack)","description":"Moves my read watermark just before the newest message from someone else.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["roomId"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"}}}}}}}},"/bff/team-chat/draft":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTeam-chatDraft","tags":["Team chat"],"summary":"Save my unsent text in a conversation (synced across devices)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["roomId","text"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"text":{"maxLength":8000,"description":"Composer text (display form); blank clears.","type":"string"},"mentions":{"maxItems":50,"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"maxLength":32,"type":"string"},"name":{"maxLength":200,"type":"string"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["roomId","text"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"text":{"maxLength":8000,"description":"Composer text (display form); blank clears.","type":"string"},"mentions":{"maxItems":50,"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"maxLength":32,"type":"string"},"name":{"maxLength":200,"type":"string"}}}}}}},"text/plain":{"schema":{"type":"object","required":["roomId","text"],"properties":{"roomId":{"minLength":24,"maxLength":24,"description":"24-char room id.","type":"string"},"text":{"maxLength":8000,"description":"Composer text (display form); blank clears.","type":"string"},"mentions":{"maxItems":50,"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"maxLength":32,"type":"string"},"name":{"maxLength":200,"type":"string"}}}}}}}}}}},"/bff/realtime/stream":{"get":{"operationId":"getBffRealtimeStream","tags":["Realtime"],"summary":"Real-time event stream (Server-Sent Events)","description":"text/event-stream for the signed-in member of the active organisation. Events: `ready` (run catch-up), `chat.message`, `chat.read`, `chat.typing`, `chat.room`, `presence`, `sync`. The server closes the stream after ~85–100 s; EventSource reconnects on its own (`retry:` hint is sent first).","responses":{"200":{}}}},"/bff/web-push/config":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"publicKey":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["enabled","publicKey"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"publicKey":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["enabled","publicKey"]}},"text/plain":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"publicKey":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["enabled","publicKey"]}}}}},"operationId":"getBffWeb-pushConfig","tags":["Web push"],"summary":"Web Push availability and the VAPID public key"}},"/bff/web-push/subscribe":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWeb-pushSubscribe","tags":["Web push"],"summary":"Store this browser’s push subscription for the signed-in member","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["endpoint","keys"],"properties":{"endpoint":{"minLength":10,"maxLength":2000,"pattern":"^https://","description":"Push service endpoint URL.","type":"string"},"keys":{"type":"object","required":["p256dh","auth"],"properties":{"p256dh":{"minLength":10,"maxLength":200,"type":"string"},"auth":{"minLength":4,"maxLength":100,"type":"string"}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["endpoint","keys"],"properties":{"endpoint":{"minLength":10,"maxLength":2000,"pattern":"^https://","description":"Push service endpoint URL.","type":"string"},"keys":{"type":"object","required":["p256dh","auth"],"properties":{"p256dh":{"minLength":10,"maxLength":200,"type":"string"},"auth":{"minLength":4,"maxLength":100,"type":"string"}}}}}},"text/plain":{"schema":{"type":"object","required":["endpoint","keys"],"properties":{"endpoint":{"minLength":10,"maxLength":2000,"pattern":"^https://","description":"Push service endpoint URL.","type":"string"},"keys":{"type":"object","required":["p256dh","auth"],"properties":{"p256dh":{"minLength":10,"maxLength":200,"type":"string"},"auth":{"minLength":4,"maxLength":100,"type":"string"}}}}}}}}}},"/bff/web-push/unsubscribe":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWeb-pushUnsubscribe","tags":["Web push"],"summary":"Remove this browser’s push subscription","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["endpoint"],"properties":{"endpoint":{"minLength":10,"maxLength":2000,"pattern":"^https://","description":"Push service endpoint URL.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["endpoint"],"properties":{"endpoint":{"minLength":10,"maxLength":2000,"pattern":"^https://","description":"Push service endpoint URL.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["endpoint"],"properties":{"endpoint":{"minLength":10,"maxLength":2000,"pattern":"^https://","description":"Push service endpoint URL.","type":"string"}}}}}}}},"/bff/person/search":{"get":{"parameters":[{"description":"Free-text search query (name, email, or phone).","examples":["jan"],"schema":{"type":"string"},"in":"query","name":"query","required":false},{"description":"Comma-separated list of cuRefNo IDs used to resolve persons.","examples":["1cGIHvFoQDGLAbcA,1cGshrhn5DGLAbcA"],"schema":{"type":"string"},"in":"query","name":"ids","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Customer external ID (cuRefNo).","type":"string"},"name":{"description":"Full name of the person.","examples":["Jan Barášek"],"type":"string"},"memberId":{"description":"Organisation member ID, if the person is a member.","type":"number"},"customerId":{"description":"Customer record ID, if the person is a customer.","type":"number"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"description":"Display name for the avatar.","examples":["Jan Barášek"],"type":"string"},"avatarUrl":{"description":"URL of the avatar image.","examples":["https://storage.xhp.cz/brj%2Favatar%2Fha70t7we3kvkkby5wcdv16m0r9fhjt24.jpg"],"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"description":"Online status flag (\"t\" = online, \"f\" = offline).","examples":["f"],"type":"string"},"inActiveMinutes":{"description":"Minutes since last activity.","examples":[28.12595],"type":"number"},"lastActivity":{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Customer external ID (cuRefNo).","type":"string"},"name":{"description":"Full name of the person.","examples":["Jan Barášek"],"type":"string"},"memberId":{"description":"Organisation member ID, if the person is a member.","type":"number"},"customerId":{"description":"Customer record ID, if the person is a customer.","type":"number"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"description":"Display name for the avatar.","examples":["Jan Barášek"],"type":"string"},"avatarUrl":{"description":"URL of the avatar image.","examples":["https://storage.xhp.cz/brj%2Favatar%2Fha70t7we3kvkkby5wcdv16m0r9fhjt24.jpg"],"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"description":"Online status flag (\"t\" = online, \"f\" = offline).","examples":["f"],"type":"string"},"inActiveMinutes":{"description":"Minutes since last activity.","examples":[28.12595],"type":"number"},"lastActivity":{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name"],"properties":{"id":{"description":"Customer external ID (cuRefNo).","type":"string"},"name":{"description":"Full name of the person.","examples":["Jan Barášek"],"type":"string"},"memberId":{"description":"Organisation member ID, if the person is a member.","type":"number"},"customerId":{"description":"Customer record ID, if the person is a customer.","type":"number"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"description":"Display name for the avatar.","examples":["Jan Barášek"],"type":"string"},"avatarUrl":{"description":"URL of the avatar image.","examples":["https://storage.xhp.cz/brj%2Favatar%2Fha70t7we3kvkkby5wcdv16m0r9fhjt24.jpg"],"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"description":"Online status flag (\"t\" = online, \"f\" = offline).","examples":["f"],"type":"string"},"inActiveMinutes":{"description":"Minutes since last activity.","examples":[28.12595],"type":"number"},"lastActivity":{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}}}},"required":["items"]}}}}},"operationId":"getBffPersonSearch","tags":["Person"],"summary":"Search contacts / persons","description":"Searches organisation contacts by name, email, or phone. Alternatively resolves specific contacts by their external IDs. Returns matching persons with avatar and activity information when available. An empty query returns the top organisation contacts ordered by recent activity."}},"/bff/person/me":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"me":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"description":"Customer external ID (cuRefNo).","type":"string"},"name":{"description":"Full name of the person.","examples":["Jan Barášek"],"type":"string"},"memberId":{"description":"Organisation member ID, if the person is a member.","type":"number"},"customerId":{"description":"Customer record ID, if the person is a customer.","type":"number"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"description":"Display name for the avatar.","examples":["Jan Barášek"],"type":"string"},"avatarUrl":{"description":"URL of the avatar image.","examples":["https://storage.xhp.cz/brj%2Favatar%2Fha70t7we3kvkkby5wcdv16m0r9fhjt24.jpg"],"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"description":"Online status flag (\"t\" = online, \"f\" = offline).","examples":["f"],"type":"string"},"inActiveMinutes":{"description":"Minutes since last activity.","examples":[28.12595],"type":"number"},"lastActivity":{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}},{"type":"null"}]}},"required":["me"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"me":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"description":"Customer external ID (cuRefNo).","type":"string"},"name":{"description":"Full name of the person.","examples":["Jan Barášek"],"type":"string"},"memberId":{"description":"Organisation member ID, if the person is a member.","type":"number"},"customerId":{"description":"Customer record ID, if the person is a customer.","type":"number"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"description":"Display name for the avatar.","examples":["Jan Barášek"],"type":"string"},"avatarUrl":{"description":"URL of the avatar image.","examples":["https://storage.xhp.cz/brj%2Favatar%2Fha70t7we3kvkkby5wcdv16m0r9fhjt24.jpg"],"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"description":"Online status flag (\"t\" = online, \"f\" = offline).","examples":["f"],"type":"string"},"inActiveMinutes":{"description":"Minutes since last activity.","examples":[28.12595],"type":"number"},"lastActivity":{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}},{"type":"null"}]}},"required":["me"]}},"text/plain":{"schema":{"type":"object","properties":{"me":{"anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"description":"Customer external ID (cuRefNo).","type":"string"},"name":{"description":"Full name of the person.","examples":["Jan Barášek"],"type":"string"},"memberId":{"description":"Organisation member ID, if the person is a member.","type":"number"},"customerId":{"description":"Customer record ID, if the person is a customer.","type":"number"},"email":{"examples":["jan@barasek.com"],"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","type":"string"},"phone":{"examples":["+420 777123456"],"description":"Contact phone number in international (national) format.\n\n**Preferred format:** `+<country_code> <local_number>`  \n- Leading plus sign (`+`) is required\n- Followed by the country calling code (e.g. `420`)\n- One space after the country code\n- Full local number **without spaces**\n\n**Example:** `+420 777123456`  \nThis format ensures unambiguous storage, validation, and compatibility with SMS, calling, and third-party integrations (e.g. Twilio, WhatsApp, CRM systems).","type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"description":"Display name for the avatar.","examples":["Jan Barášek"],"type":"string"},"avatarUrl":{"description":"URL of the avatar image.","examples":["https://storage.xhp.cz/brj%2Favatar%2Fha70t7we3kvkkby5wcdv16m0r9fhjt24.jpg"],"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"description":"Online status flag (\"t\" = online, \"f\" = offline).","examples":["f"],"type":"string"},"inActiveMinutes":{"description":"Minutes since last activity.","examples":[28.12595],"type":"number"},"lastActivity":{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"anyOf":[{"description":"Timestamp of last recorded activity.","examples":["2025-01-10T16:19:40.150Z"],"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}}}},{"type":"null"}]}},"required":["me"]}}}}},"operationId":"getBffPersonMe","tags":["Person"],"summary":"Get current member as a person record","description":"Returns the current authenticated member as a PersonSearchItem — the same shape as /search. Used by UI selectors to offer \"assign to me\" as the first option."}},"/bff/post/author-filter-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","postCount"],"properties":{"id":{"description":"Author `content__author.external_id` (16-char string). Pass to /list?mainAuthorId=…","examples":["71E58E5SjdZN6ut3"],"type":"string"},"name":{"description":"Public byline name (author display name, else contact name). Falls back to `id` when empty.","examples":["Jan Barášek"],"type":"string"},"email":{"description":"Author contact email (`shop__contact.email`). Omitted when the contact row has no email set (nullable since the 2026-06-10 identity refactor). Used by the admin grid to disambiguate homonyms — two people literally named \"Jan Novák\" get their emails appended to the option label so the selectbox stays unambiguous.","examples":["jan.barasek@example.com"],"type":"string"},"postCount":{"description":"Count of non-deleted posts where this author is the main author.","examples":[12],"type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","postCount"],"properties":{"id":{"description":"Author `content__author.external_id` (16-char string). Pass to /list?mainAuthorId=…","examples":["71E58E5SjdZN6ut3"],"type":"string"},"name":{"description":"Public byline name (author display name, else contact name). Falls back to `id` when empty.","examples":["Jan Barášek"],"type":"string"},"email":{"description":"Author contact email (`shop__contact.email`). Omitted when the contact row has no email set (nullable since the 2026-06-10 identity refactor). Used by the admin grid to disambiguate homonyms — two people literally named \"Jan Novák\" get their emails appended to the option label so the selectbox stays unambiguous.","examples":["jan.barasek@example.com"],"type":"string"},"postCount":{"description":"Count of non-deleted posts where this author is the main author.","examples":[12],"type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","name","postCount"],"properties":{"id":{"description":"Author `content__author.external_id` (16-char string). Pass to /list?mainAuthorId=…","examples":["71E58E5SjdZN6ut3"],"type":"string"},"name":{"description":"Public byline name (author display name, else contact name). Falls back to `id` when empty.","examples":["Jan Barášek"],"type":"string"},"email":{"description":"Author contact email (`shop__contact.email`). Omitted when the contact row has no email set (nullable since the 2026-06-10 identity refactor). Used by the admin grid to disambiguate homonyms — two people literally named \"Jan Novák\" get their emails appended to the option label so the selectbox stays unambiguous.","examples":["jan.barasek@example.com"],"type":"string"},"postCount":{"description":"Count of non-deleted posts where this author is the main author.","examples":[12],"type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffPostAuthor-filter-list","tags":["Post"],"summary":"List main authors for the post grid filter","description":"Returns every distinct main author (`content__post.main_content_author_id` → `content__author`) that currently owns at least one non-deleted post in the organisation, together with the count of posts they main-author and their `email` (nullable — used to disambiguate homonyms in the filter label). Sorted by `postCount` DESC so the most prolific writers surface first. Feeds the \"Autor\" filter chip on the /post admin grid — small set by design (typical org has <20 authors), so no pagination."}},"/bff/post/status-count":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["status","postCount"],"properties":{"status":{"description":"Computed post status — mirrors `resolvePostStatus`.","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"postCount":{"description":"Number of posts (kind=post) in the organisation with this computed status.","examples":[42],"type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["status","postCount"],"properties":{"status":{"description":"Computed post status — mirrors `resolvePostStatus`.","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"postCount":{"description":"Number of posts (kind=post) in the organisation with this computed status.","examples":[42],"type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["status","postCount"],"properties":{"status":{"description":"Computed post status — mirrors `resolvePostStatus`.","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"postCount":{"description":"Number of posts (kind=post) in the organisation with this computed status.","examples":[42],"type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffPostStatus-count","tags":["Post"],"summary":"Post-count per computed status for the /post grid filter","description":"Returns the number of posts per computed status (`draft` / `scheduled` / `published` / `private` / `archived`) so the \"Stav\" filter chip can render `(N)` counts next to each option and sort by count DESC. Mirrors the exact CASE in `selectPostList` (soft-deleted → archived, future publish → scheduled, private visibility → draft/private depending on published_date, everything else → published) so the count and the grid rows stay consistent."}},"/bff/post/list":{"get":{"parameters":[{"description":"Filter posts by main category code. If not provided, all posts are returned.","schema":{"type":"string"},"in":"query","name":"mainCategoryCode","required":false},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false},{"description":"Filter by computed publication status (draft, scheduled, published, private, archived).","schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"in":"query","name":"status","required":false},{"description":"Filter by raw visibility column.","schema":{"anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"in":"query","name":"visibility","required":false},{"description":"\"true\" to keep only posts with a main image, \"false\" to keep only those without.","schema":{"type":"string"},"in":"query","name":"hasMainImage","required":false},{"description":"\"true\" to keep only posts missing a translation in at least one of the org's configured locales.","schema":{"type":"string"},"in":"query","name":"missingTranslation","required":false},{"description":"Filter posts by tag `code` (organisation-scoped). Only posts carrying this tag are returned.","schema":{"type":"string"},"in":"query","name":"tagCode","required":false},{"description":"Filter posts by main author `content__author.external_id` (16-char string). Only posts whose canonical main author (`main_content_author_id`) carries this external id in the caller organisation are returned. Populates the \"Autor\" chip in the admin post grid.","examples":["71E58E5SjdZN6ut3"],"schema":{"type":"string"},"in":"query","name":"mainAuthorId","required":false},{"description":"Discriminator filter. Default `post` — the admin blog grid never surfaces branch-owned documents. `branch` = only branch documents. `all` = every content record (diagnostic view).","schema":{"anyOf":[{"const":"post","type":"string"},{"const":"branch","type":"string"},{"const":"all","type":"string"}]},"in":"query","name":"kind","required":false},{"description":"Sort spec `<field>:<asc|desc>`. Allowed fields: publishedDate, updatedDate, insertedDate, title, wordCount, commentsCount, viewsCount, ratingAverage.","examples":["publishedDate:desc","wordCount:asc","viewsCount:desc","ratingAverage:desc"],"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Alias for orderBy (legacy).","schema":{"type":"string"},"in":"query","name":"sortBy","required":false}],"responses":{"200":{"description":"Paginated list of posts with metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of post items matching the query criteria.","type":"array","items":{"description":"Single post item in the list.","type":"object","required":["id","title","commentsCount","insertedDate","updatedDate","visibility","status","isStar","isDeleted","wordCount","readingTimeMinutes","hasPerex","tags","translatedLocales","staleLocales","viewsCount","ratingCount"],"properties":{"id":{"description":"Unique external identifier of the post (UUID format).","type":"string"},"title":{"description":"Post title, truncated to 140 characters for list view.","type":"string"},"mainCategoryId":{"description":"External ID of the main category this post belongs to.","type":"string"},"mainCategoryName":{"description":"Localized name of the main category.","type":"string"},"mainAuthorId":{"description":"`content__author.external_id` of the main author.","type":"string"},"mainAuthorContactId":{"description":"`shop__contact.external_id` behind the main author (CRM link).","type":"string"},"mainAuthorName":{"description":"Public byline name of the main author (author cascade).","type":"string"},"mainAuthorAvatarUrl":{"description":"Fully qualified avatar URL of the main author resolved through the author cascade (author override → contact → linked user). Omitted when no tier has one.","type":"string"},"commentsCount":{"description":"Total number of comments on this post.","type":"number"},"publishedDate":{"description":"Date when the post was published. Null if not yet published.","anyOf":[{"description":"Date when the post was published. Null if not yet published.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the post was created in the system.","anyOf":[{"description":"Date when the post was created in the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when `content__post.*` was last updated. Useful for an \"edited recently\" sort.","anyOf":[{"description":"Date when `content__post.*` was last updated. Useful for an \"edited recently\" sort.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"visibility":{"description":"Post visibility level. \"public\" = visible to everyone, \"private\" = visible only to author and admins, \"unlisted\" = accessible via direct link but not listed, \"subscribe\" = visible only to subscribers.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"status":{"description":"Computed publication status derived from (visibility, publishedDate, deletedDate). See `resolvePostStatus` in core for the precedence rules.","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"mainImageUrl":{"description":"URL of the main/featured image for the post.","type":"string"},"isStar":{"description":"Whether the post is starred/featured. Starred posts appear first in the list.","type":"boolean"},"isDeleted":{"description":"Whether the post has been soft-deleted.","type":"boolean"},"wordCount":{"description":"Approximate word count of the displayed locale's content (HTML stripped).","type":"number"},"readingTimeMinutes":{"description":"Approximate reading time in minutes (200 wpm). 0 when the post has no content.","type":"number"},"hasPerex":{"description":"Whether the displayed locale has a non-empty perex (used by SEO health indicator).","type":"boolean"},"tags":{"description":"Array of tags assigned to this post. Can be empty if no tags are assigned.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["id","name","code"],"properties":{"id":{"description":"Unique identifier of the tag.","type":"number"},"name":{"description":"Display name of the tag.","type":"string"},"code":{"description":"URL-friendly code/slug of the tag.","type":"string"},"color":{"description":"Hex color code for the tag (e.g., \"#FF5733\").","type":"string"}}}},"translatedLocales":{"description":"Locales for which a translation exists in content__post_locale.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"staleLocales":{"description":"Subset of `translatedLocales` where the row's `source_history_id` no longer matches the newest source-locale history entry (or is NULL / legacy) — the source article has been edited since this translation was produced. Empty for up-to-date posts and for legacy posts without any source history to compare against.","type":"array","items":{"description":"Locale code that is out of date.","type":"string"}},"viewsCount":{"description":"Cumulative number of times the post was served by /api/v1/post. Approximate; synced into content__post.views_count every 5 minutes.","type":"number"},"viewsRecentDelta":{"description":"Views gained in the last VIEWS_TREND_WINDOW_DAYS (currently 3, see selectPostList). Omitted when there is no view-count snapshot from that far back — usually a very fresh post or one whose views have always been zero. Never negative.","type":"number"},"viewsPriorDelta":{"description":"Views gained in the window immediately preceding `viewsRecentDelta`. Paired with `viewsRecentDelta` to render an up/down/flat trend indicator. Omitted when the older snapshot is missing (so the admin cell falls back to plain count).","type":"number"},"ratingAverage":{"description":"Average reader rating (1–5) from content__post_feedback. Omitted when the post has no feedback yet.","type":"number"},"ratingCount":{"description":"Number of reader feedback entries the rating average is based on.","type":"number"}}}},"itemCount":{"description":"Total number of posts matching the query (before pagination). Useful for pagination controls.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of post items matching the query criteria.","type":"array","items":{"description":"Single post item in the list.","type":"object","required":["id","title","commentsCount","insertedDate","updatedDate","visibility","status","isStar","isDeleted","wordCount","readingTimeMinutes","hasPerex","tags","translatedLocales","staleLocales","viewsCount","ratingCount"],"properties":{"id":{"description":"Unique external identifier of the post (UUID format).","type":"string"},"title":{"description":"Post title, truncated to 140 characters for list view.","type":"string"},"mainCategoryId":{"description":"External ID of the main category this post belongs to.","type":"string"},"mainCategoryName":{"description":"Localized name of the main category.","type":"string"},"mainAuthorId":{"description":"`content__author.external_id` of the main author.","type":"string"},"mainAuthorContactId":{"description":"`shop__contact.external_id` behind the main author (CRM link).","type":"string"},"mainAuthorName":{"description":"Public byline name of the main author (author cascade).","type":"string"},"mainAuthorAvatarUrl":{"description":"Fully qualified avatar URL of the main author resolved through the author cascade (author override → contact → linked user). Omitted when no tier has one.","type":"string"},"commentsCount":{"description":"Total number of comments on this post.","type":"number"},"publishedDate":{"description":"Date when the post was published. Null if not yet published.","anyOf":[{"description":"Date when the post was published. Null if not yet published.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the post was created in the system.","anyOf":[{"description":"Date when the post was created in the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when `content__post.*` was last updated. Useful for an \"edited recently\" sort.","anyOf":[{"description":"Date when `content__post.*` was last updated. Useful for an \"edited recently\" sort.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"visibility":{"description":"Post visibility level. \"public\" = visible to everyone, \"private\" = visible only to author and admins, \"unlisted\" = accessible via direct link but not listed, \"subscribe\" = visible only to subscribers.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"status":{"description":"Computed publication status derived from (visibility, publishedDate, deletedDate). See `resolvePostStatus` in core for the precedence rules.","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"mainImageUrl":{"description":"URL of the main/featured image for the post.","type":"string"},"isStar":{"description":"Whether the post is starred/featured. Starred posts appear first in the list.","type":"boolean"},"isDeleted":{"description":"Whether the post has been soft-deleted.","type":"boolean"},"wordCount":{"description":"Approximate word count of the displayed locale's content (HTML stripped).","type":"number"},"readingTimeMinutes":{"description":"Approximate reading time in minutes (200 wpm). 0 when the post has no content.","type":"number"},"hasPerex":{"description":"Whether the displayed locale has a non-empty perex (used by SEO health indicator).","type":"boolean"},"tags":{"description":"Array of tags assigned to this post. Can be empty if no tags are assigned.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["id","name","code"],"properties":{"id":{"description":"Unique identifier of the tag.","type":"number"},"name":{"description":"Display name of the tag.","type":"string"},"code":{"description":"URL-friendly code/slug of the tag.","type":"string"},"color":{"description":"Hex color code for the tag (e.g., \"#FF5733\").","type":"string"}}}},"translatedLocales":{"description":"Locales for which a translation exists in content__post_locale.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"staleLocales":{"description":"Subset of `translatedLocales` where the row's `source_history_id` no longer matches the newest source-locale history entry (or is NULL / legacy) — the source article has been edited since this translation was produced. Empty for up-to-date posts and for legacy posts without any source history to compare against.","type":"array","items":{"description":"Locale code that is out of date.","type":"string"}},"viewsCount":{"description":"Cumulative number of times the post was served by /api/v1/post. Approximate; synced into content__post.views_count every 5 minutes.","type":"number"},"viewsRecentDelta":{"description":"Views gained in the last VIEWS_TREND_WINDOW_DAYS (currently 3, see selectPostList). Omitted when there is no view-count snapshot from that far back — usually a very fresh post or one whose views have always been zero. Never negative.","type":"number"},"viewsPriorDelta":{"description":"Views gained in the window immediately preceding `viewsRecentDelta`. Paired with `viewsRecentDelta` to render an up/down/flat trend indicator. Omitted when the older snapshot is missing (so the admin cell falls back to plain count).","type":"number"},"ratingAverage":{"description":"Average reader rating (1–5) from content__post_feedback. Omitted when the post has no feedback yet.","type":"number"},"ratingCount":{"description":"Number of reader feedback entries the rating average is based on.","type":"number"}}}},"itemCount":{"description":"Total number of posts matching the query (before pagination). Useful for pagination controls.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of post items matching the query criteria.","type":"array","items":{"description":"Single post item in the list.","type":"object","required":["id","title","commentsCount","insertedDate","updatedDate","visibility","status","isStar","isDeleted","wordCount","readingTimeMinutes","hasPerex","tags","translatedLocales","staleLocales","viewsCount","ratingCount"],"properties":{"id":{"description":"Unique external identifier of the post (UUID format).","type":"string"},"title":{"description":"Post title, truncated to 140 characters for list view.","type":"string"},"mainCategoryId":{"description":"External ID of the main category this post belongs to.","type":"string"},"mainCategoryName":{"description":"Localized name of the main category.","type":"string"},"mainAuthorId":{"description":"`content__author.external_id` of the main author.","type":"string"},"mainAuthorContactId":{"description":"`shop__contact.external_id` behind the main author (CRM link).","type":"string"},"mainAuthorName":{"description":"Public byline name of the main author (author cascade).","type":"string"},"mainAuthorAvatarUrl":{"description":"Fully qualified avatar URL of the main author resolved through the author cascade (author override → contact → linked user). Omitted when no tier has one.","type":"string"},"commentsCount":{"description":"Total number of comments on this post.","type":"number"},"publishedDate":{"description":"Date when the post was published. Null if not yet published.","anyOf":[{"description":"Date when the post was published. Null if not yet published.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the post was created in the system.","anyOf":[{"description":"Date when the post was created in the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when `content__post.*` was last updated. Useful for an \"edited recently\" sort.","anyOf":[{"description":"Date when `content__post.*` was last updated. Useful for an \"edited recently\" sort.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"visibility":{"description":"Post visibility level. \"public\" = visible to everyone, \"private\" = visible only to author and admins, \"unlisted\" = accessible via direct link but not listed, \"subscribe\" = visible only to subscribers.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"status":{"description":"Computed publication status derived from (visibility, publishedDate, deletedDate). See `resolvePostStatus` in core for the precedence rules.","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"mainImageUrl":{"description":"URL of the main/featured image for the post.","type":"string"},"isStar":{"description":"Whether the post is starred/featured. Starred posts appear first in the list.","type":"boolean"},"isDeleted":{"description":"Whether the post has been soft-deleted.","type":"boolean"},"wordCount":{"description":"Approximate word count of the displayed locale's content (HTML stripped).","type":"number"},"readingTimeMinutes":{"description":"Approximate reading time in minutes (200 wpm). 0 when the post has no content.","type":"number"},"hasPerex":{"description":"Whether the displayed locale has a non-empty perex (used by SEO health indicator).","type":"boolean"},"tags":{"description":"Array of tags assigned to this post. Can be empty if no tags are assigned.","type":"array","items":{"description":"Tag associated with the post.","type":"object","required":["id","name","code"],"properties":{"id":{"description":"Unique identifier of the tag.","type":"number"},"name":{"description":"Display name of the tag.","type":"string"},"code":{"description":"URL-friendly code/slug of the tag.","type":"string"},"color":{"description":"Hex color code for the tag (e.g., \"#FF5733\").","type":"string"}}}},"translatedLocales":{"description":"Locales for which a translation exists in content__post_locale.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"staleLocales":{"description":"Subset of `translatedLocales` where the row's `source_history_id` no longer matches the newest source-locale history entry (or is NULL / legacy) — the source article has been edited since this translation was produced. Empty for up-to-date posts and for legacy posts without any source history to compare against.","type":"array","items":{"description":"Locale code that is out of date.","type":"string"}},"viewsCount":{"description":"Cumulative number of times the post was served by /api/v1/post. Approximate; synced into content__post.views_count every 5 minutes.","type":"number"},"viewsRecentDelta":{"description":"Views gained in the last VIEWS_TREND_WINDOW_DAYS (currently 3, see selectPostList). Omitted when there is no view-count snapshot from that far back — usually a very fresh post or one whose views have always been zero. Never negative.","type":"number"},"viewsPriorDelta":{"description":"Views gained in the window immediately preceding `viewsRecentDelta`. Paired with `viewsRecentDelta` to render an up/down/flat trend indicator. Omitted when the older snapshot is missing (so the admin cell falls back to plain count).","type":"number"},"ratingAverage":{"description":"Average reader rating (1–5) from content__post_feedback. Omitted when the post has no feedback yet.","type":"number"},"ratingCount":{"description":"Number of reader feedback entries the rating average is based on.","type":"number"}}}},"itemCount":{"description":"Total number of posts matching the query (before pagination). Useful for pagination controls.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPostList","tags":["Post"],"summary":"List posts","description":"Returns a paginated list of posts for the authenticated organisation. Default ordering: starred-first, archived-last, then newest published. Each post includes basic metadata, derived publication status, word count, reading time, main image URL, and associated tags."}},"/bff/post/detail":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Post external ID.","type":"string"},"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"metaTitle":{"description":"SEO `<title>` for the displayed locale. Empty string when not set.","type":"string"},"metaDescription":{"description":"SEO `<meta description>` for the displayed locale. Empty string when not set.","type":"string"},"visibility":{"description":"Post visibility level.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"status":{"description":"Computed publication status (draft/scheduled/published/private/archived).","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"mainCategoryId":{"description":"External ID of the main category.","type":"string"},"authorIds":{"description":"Ordered list of author IDs. First is the main author.","type":"array","items":{"description":"Author `content__author.external_id`.","type":"string"}},"isStar":{"description":"Whether the post is starred/featured.","type":"boolean"},"publishedDate":{"description":"Date when the post was published.","anyOf":[{"description":"Date when the post was published.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the post was created.","anyOf":[{"description":"Date when the post was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when the post was last updated.","anyOf":[{"description":"Date when the post was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"wordCount":{"description":"Approximate word count of the displayed locale's content.","type":"number"},"readingTimeMinutes":{"description":"Approximate reading time in minutes (200 wpm). 0 when the post has no content.","type":"number"},"translatedLocales":{"description":"Locales for which a translation exists in content__post_locale.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"staleLocales":{"description":"Subset of `translatedLocales` whose `source_history_id` no longer matches the newest source-locale history entry (or is NULL / legacy). The admin post-detail auto-translate button surfaces this so a manual refresh regenerates each out-of-date locale.","type":"array","items":{"description":"Locale code that is out of date.","type":"string"}},"viewsCount":{"description":"Cumulative number of times the post was served by /api/v1/post. Buffered and flushed into content__post.views_count every 5 min, so values may briefly lag.","type":"number"},"attachments":{"description":"Files attached to the post (separate from the gallery). Newest first.","type":"array","items":{"type":"object","required":["id","filename","downloadUrl","size","contentType","insertedDate"],"properties":{"id":{"description":"Attachment row id (used by /post-attachment-delete).","type":"number"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL on blob storage.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"description":"MIME content type.","type":"string"},"insertedDate":{"description":"When the file was attached.","anyOf":[{"description":"When the file was attached.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"mainImageUrl":{"description":"Fully qualified URL of the post's main image blob (the one flagged as hero in content__post_media). Omitted for posts without a main image.","type":"string"}},"required":["id","title","content","perex","metaTitle","metaDescription","visibility","status","authorIds","isStar","insertedDate","updatedDate","wordCount","readingTimeMinutes","translatedLocales","staleLocales","viewsCount","attachments"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Post external ID.","type":"string"},"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"metaTitle":{"description":"SEO `<title>` for the displayed locale. Empty string when not set.","type":"string"},"metaDescription":{"description":"SEO `<meta description>` for the displayed locale. Empty string when not set.","type":"string"},"visibility":{"description":"Post visibility level.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"status":{"description":"Computed publication status (draft/scheduled/published/private/archived).","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"mainCategoryId":{"description":"External ID of the main category.","type":"string"},"authorIds":{"description":"Ordered list of author IDs. First is the main author.","type":"array","items":{"description":"Author `content__author.external_id`.","type":"string"}},"isStar":{"description":"Whether the post is starred/featured.","type":"boolean"},"publishedDate":{"description":"Date when the post was published.","anyOf":[{"description":"Date when the post was published.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the post was created.","anyOf":[{"description":"Date when the post was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when the post was last updated.","anyOf":[{"description":"Date when the post was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"wordCount":{"description":"Approximate word count of the displayed locale's content.","type":"number"},"readingTimeMinutes":{"description":"Approximate reading time in minutes (200 wpm). 0 when the post has no content.","type":"number"},"translatedLocales":{"description":"Locales for which a translation exists in content__post_locale.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"staleLocales":{"description":"Subset of `translatedLocales` whose `source_history_id` no longer matches the newest source-locale history entry (or is NULL / legacy). The admin post-detail auto-translate button surfaces this so a manual refresh regenerates each out-of-date locale.","type":"array","items":{"description":"Locale code that is out of date.","type":"string"}},"viewsCount":{"description":"Cumulative number of times the post was served by /api/v1/post. Buffered and flushed into content__post.views_count every 5 min, so values may briefly lag.","type":"number"},"attachments":{"description":"Files attached to the post (separate from the gallery). Newest first.","type":"array","items":{"type":"object","required":["id","filename","downloadUrl","size","contentType","insertedDate"],"properties":{"id":{"description":"Attachment row id (used by /post-attachment-delete).","type":"number"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL on blob storage.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"description":"MIME content type.","type":"string"},"insertedDate":{"description":"When the file was attached.","anyOf":[{"description":"When the file was attached.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"mainImageUrl":{"description":"Fully qualified URL of the post's main image blob (the one flagged as hero in content__post_media). Omitted for posts without a main image.","type":"string"}},"required":["id","title","content","perex","metaTitle","metaDescription","visibility","status","authorIds","isStar","insertedDate","updatedDate","wordCount","readingTimeMinutes","translatedLocales","staleLocales","viewsCount","attachments"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Post external ID.","type":"string"},"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"metaTitle":{"description":"SEO `<title>` for the displayed locale. Empty string when not set.","type":"string"},"metaDescription":{"description":"SEO `<meta description>` for the displayed locale. Empty string when not set.","type":"string"},"visibility":{"description":"Post visibility level.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]},"status":{"description":"Computed publication status (draft/scheduled/published/private/archived).","anyOf":[{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"archived","type":"string"}]},"mainCategoryId":{"description":"External ID of the main category.","type":"string"},"authorIds":{"description":"Ordered list of author IDs. First is the main author.","type":"array","items":{"description":"Author `content__author.external_id`.","type":"string"}},"isStar":{"description":"Whether the post is starred/featured.","type":"boolean"},"publishedDate":{"description":"Date when the post was published.","anyOf":[{"description":"Date when the post was published.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when the post was created.","anyOf":[{"description":"Date when the post was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when the post was last updated.","anyOf":[{"description":"Date when the post was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"wordCount":{"description":"Approximate word count of the displayed locale's content.","type":"number"},"readingTimeMinutes":{"description":"Approximate reading time in minutes (200 wpm). 0 when the post has no content.","type":"number"},"translatedLocales":{"description":"Locales for which a translation exists in content__post_locale.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"staleLocales":{"description":"Subset of `translatedLocales` whose `source_history_id` no longer matches the newest source-locale history entry (or is NULL / legacy). The admin post-detail auto-translate button surfaces this so a manual refresh regenerates each out-of-date locale.","type":"array","items":{"description":"Locale code that is out of date.","type":"string"}},"viewsCount":{"description":"Cumulative number of times the post was served by /api/v1/post. Buffered and flushed into content__post.views_count every 5 min, so values may briefly lag.","type":"number"},"attachments":{"description":"Files attached to the post (separate from the gallery). Newest first.","type":"array","items":{"type":"object","required":["id","filename","downloadUrl","size","contentType","insertedDate"],"properties":{"id":{"description":"Attachment row id (used by /post-attachment-delete).","type":"number"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL on blob storage.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"description":"MIME content type.","type":"string"},"insertedDate":{"description":"When the file was attached.","anyOf":[{"description":"When the file was attached.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"mainImageUrl":{"description":"Fully qualified URL of the post's main image blob (the one flagged as hero in content__post_media). Omitted for posts without a main image.","type":"string"}},"required":["id","title","content","perex","metaTitle","metaDescription","visibility","status","authorIds","isStar","insertedDate","updatedDate","wordCount","readingTimeMinutes","translatedLocales","staleLocales","viewsCount","attachments"]}}}}},"operationId":"getBffPostDetail","tags":["Post"],"summary":"Get post detail","description":"Returns full post detail including title, content, visibility, authors, and available translations. Content is returned in the default locale (or first available translation)."}},"/bff/post/export-pdf":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"operationId":"getBffPostExport-pdf","tags":["Post"],"summary":"Export post as PDF","description":"Renders the post as a printable A4 PDF (title, perex, metadata, HTML body and external-id reference) and returns the binary inline so the browser displays it in a new tab. Not persisted to blob storage.","responses":{"200":{}}}},"/bff/post/add":{"post":{"parameters":[],"operationId":"postBffPostAdd","tags":["Post"],"summary":"Create a new post","description":"Creates a new post for the authenticated organisation. The authenticated member is set as the main author. Returns the external ID of the created post.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","content","visibility","locale"],"properties":{"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"visibility":{"description":"Post visibility level: public, private, unlisted, or subscribe.","type":"string"},"mainCategory":{"description":"Code of the main category to assign.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["title","content","visibility","locale"],"properties":{"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"visibility":{"description":"Post visibility level: public, private, unlisted, or subscribe.","type":"string"},"mainCategory":{"description":"Code of the main category to assign.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["title","content","visibility","locale"],"properties":{"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"visibility":{"description":"Post visibility level: public, private, unlisted, or subscribe.","type":"string"},"mainCategory":{"description":"Code of the main category to assign.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/post/save":{"post":{"parameters":[],"operationId":"postBffPostSave","tags":["Post"],"summary":"Update an existing post","description":"Saves changes to an existing post including title, content, visibility, category, authors, and publish date. The content is saved for the specified locale.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["locale","id","title","content","visibility","authorIds"],"properties":{"locale":{"description":"Locale code for the content being saved (e.g. \"cs\", \"en\").","type":"string"},"id":{"description":"Post external ID.","type":"string"},"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"metaTitle":{"description":"SEO <title> for the locale. Empty string clears it. Omit to leave unchanged.","type":"string"},"metaDescription":{"description":"SEO <meta description> for the locale. Empty string clears it. Omit to leave unchanged.","type":"string"},"visibility":{"description":"Post visibility level: public, private, unlisted, or subscribe.","type":"string"},"mainCategoryId":{"description":"External ID of the main category to assign.","type":"string"},"authorIds":{"description":"Ordered list of author external IDs (`content__author`, see /bff/post-author/list). First is the main author.","type":"array","items":{"description":"`content__author.external_id`.","type":"string"}},"publishedDate":{"description":"ISO date string for the publish date. Omit or null to leave unpublished.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["locale","id","title","content","visibility","authorIds"],"properties":{"locale":{"description":"Locale code for the content being saved (e.g. \"cs\", \"en\").","type":"string"},"id":{"description":"Post external ID.","type":"string"},"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"metaTitle":{"description":"SEO <title> for the locale. Empty string clears it. Omit to leave unchanged.","type":"string"},"metaDescription":{"description":"SEO <meta description> for the locale. Empty string clears it. Omit to leave unchanged.","type":"string"},"visibility":{"description":"Post visibility level: public, private, unlisted, or subscribe.","type":"string"},"mainCategoryId":{"description":"External ID of the main category to assign.","type":"string"},"authorIds":{"description":"Ordered list of author external IDs (`content__author`, see /bff/post-author/list). First is the main author.","type":"array","items":{"description":"`content__author.external_id`.","type":"string"}},"publishedDate":{"description":"ISO date string for the publish date. Omit or null to leave unpublished.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["locale","id","title","content","visibility","authorIds"],"properties":{"locale":{"description":"Locale code for the content being saved (e.g. \"cs\", \"en\").","type":"string"},"id":{"description":"Post external ID.","type":"string"},"title":{"description":"Post title.","type":"string"},"content":{"description":"Post content (HTML).","type":"string"},"perex":{"description":"Short summary/teaser of the post.","type":"string"},"metaTitle":{"description":"SEO <title> for the locale. Empty string clears it. Omit to leave unchanged.","type":"string"},"metaDescription":{"description":"SEO <meta description> for the locale. Empty string clears it. Omit to leave unchanged.","type":"string"},"visibility":{"description":"Post visibility level: public, private, unlisted, or subscribe.","type":"string"},"mainCategoryId":{"description":"External ID of the main category to assign.","type":"string"},"authorIds":{"description":"Ordered list of author external IDs (`content__author`, see /bff/post-author/list). First is the main author.","type":"array","items":{"description":"`content__author.external_id`.","type":"string"}},"publishedDate":{"description":"ISO date string for the publish date. Omit or null to leave unpublished.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/post/post-gallery-link-blob":{"get":{"parameters":[{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Blob token of the uploaded file to link.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the image was linked successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the image was linked successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the image was linked successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffPostPost-gallery-link-blob","tags":["Post"],"summary":"Add image to post gallery","description":"Links an uploaded blob to the post gallery. The image is appended at the end of the gallery. If the post has no main image yet, this image is automatically set as main."}},"/bff/post/post-gallery-list":{"get":{"parameters":[{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Gallery images sorted by active status then position.","type":"array","items":{"type":"object","required":["blob","title","position","deleted","active"],"properties":{"id":{"description":"Blob token (used as image identifier in other endpoints).","type":"string"},"url":{"description":"External URL if the media is not a blob.","type":"string"},"blob":{"description":"Blob file metadata (filename, URL, dimensions, size)."},"title":{"description":"Image alt text / title.","type":"string"},"position":{"description":"Display order position (1-based).","type":"number"},"deleted":{"description":"Whether the image is soft-deleted.","type":"boolean"},"active":{"description":"Whether the image is active (visible on the public site).","type":"boolean"}}}},"mainImageId":{"description":"Blob token of the current main/featured image.","type":"string"},"itemCount":{"description":"Total number of non-deleted images in the gallery.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Gallery images sorted by active status then position.","type":"array","items":{"type":"object","required":["blob","title","position","deleted","active"],"properties":{"id":{"description":"Blob token (used as image identifier in other endpoints).","type":"string"},"url":{"description":"External URL if the media is not a blob.","type":"string"},"blob":{"description":"Blob file metadata (filename, URL, dimensions, size)."},"title":{"description":"Image alt text / title.","type":"string"},"position":{"description":"Display order position (1-based).","type":"number"},"deleted":{"description":"Whether the image is soft-deleted.","type":"boolean"},"active":{"description":"Whether the image is active (visible on the public site).","type":"boolean"}}}},"mainImageId":{"description":"Blob token of the current main/featured image.","type":"string"},"itemCount":{"description":"Total number of non-deleted images in the gallery.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Gallery images sorted by active status then position.","type":"array","items":{"type":"object","required":["blob","title","position","deleted","active"],"properties":{"id":{"description":"Blob token (used as image identifier in other endpoints).","type":"string"},"url":{"description":"External URL if the media is not a blob.","type":"string"},"blob":{"description":"Blob file metadata (filename, URL, dimensions, size)."},"title":{"description":"Image alt text / title.","type":"string"},"position":{"description":"Display order position (1-based).","type":"number"},"deleted":{"description":"Whether the image is soft-deleted.","type":"boolean"},"active":{"description":"Whether the image is active (visible on the public site).","type":"boolean"}}}},"mainImageId":{"description":"Blob token of the current main/featured image.","type":"string"},"itemCount":{"description":"Total number of non-deleted images in the gallery.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPostPost-gallery-list","tags":["Post"],"summary":"List post gallery images","description":"Returns all non-deleted images in the post gallery sorted by active status and position. Includes blob metadata (URL, dimensions) and identifies the main/featured image."}},"/bff/post/post-image-active-toggle":{"get":{"parameters":[{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Blob token of the image to toggle.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"imageId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the toggle was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the toggle was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the toggle was successful.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffPostPost-image-active-toggle","tags":["Post"],"summary":"Toggle image active status","description":"Toggles the active/inactive status of a gallery image. Inactive images are hidden on the public site but remain in the gallery for re-activation. If the main image is deactivated, the first remaining active image becomes the new main."}},"/bff/post/post-image-delete":{"get":{"parameters":[{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Blob token of the image to delete.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"imageId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the deletion was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the deletion was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the deletion was successful.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffPostPost-image-delete","tags":["Post"],"summary":"Delete gallery image","description":"Soft-deletes an image from the post gallery (sets deleted flag, does not remove the blob). If the deleted image was the main image, the first remaining active image becomes the new main."}},"/bff/post/post-image-mark-main":{"get":{"parameters":[{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Blob token of the image to set as main.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"imageId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffPostPost-image-mark-main","tags":["Post"],"summary":"Set main post image","description":"Sets the specified image as the main/featured image for the post. The main image is used as the post thumbnail in lists and social sharing."}},"/bff/post/post-gallery-reorder":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostPost-gallery-reorder","tags":["Post"],"summary":"Reorder post gallery","description":"Sets the display order of the post gallery (drag & drop in admin). Positions are rewritten 1..n.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","imageIds"],"properties":{"id":{"description":"Post external ID.","type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","imageIds"],"properties":{"id":{"description":"Post external ID.","type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["id","imageIds"],"properties":{"id":{"description":"Post external ID.","type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}}}}}},"/bff/post/post-image-update-meta":{"get":{"parameters":[{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Blob token of the image to update.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"imageId","required":true},{"description":"New alt text / title for the image (used for SEO and accessibility).","examples":["Sunset over Prague Castle"],"schema":{"type":"string"},"in":"query","name":"title","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the metadata was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the metadata was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the metadata was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffPostPost-image-update-meta","tags":["Post"],"summary":"Update image metadata","description":"Updates the alt text / title of a gallery image. Alt text is important for SEO and accessibility. Pass an empty string to clear it."}},"/bff/post/post-image-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update succeeded.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update succeeded.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update succeeded.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostPost-image-update","tags":["Post"],"summary":"Update a gallery image (title/active/main/delete)","description":"Single POST endpoint for inline-editable gallery grids. Dispatches to the underlying gallery helper based on `property`. Used by the admin post-detail Gallery tab where every column edits in place. The individual GET variants (`/post-image-update-meta`, `/post-image-active-toggle`, `/post-image-mark-main`, `/post-image-delete`) remain for the lightbox and legacy callers.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","postExternalId","property"],"properties":{"id":{"description":"Blob token of the gallery image.","examples":["abc123def456"],"type":"string"},"postExternalId":{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"type":"string"},"property":{"description":"Which aspect of the image to update.","anyOf":[{"const":"title","type":"string"},{"const":"active","type":"string"},{"const":"main","type":"string"},{"const":"delete","type":"string"}]},"haystack":{"description":"New value. Required for `title` (string) and `active` (boolean); ignored for `main` and `delete`.","anyOf":[{"type":"string"},{"type":"boolean"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","postExternalId","property"],"properties":{"id":{"description":"Blob token of the gallery image.","examples":["abc123def456"],"type":"string"},"postExternalId":{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"type":"string"},"property":{"description":"Which aspect of the image to update.","anyOf":[{"const":"title","type":"string"},{"const":"active","type":"string"},{"const":"main","type":"string"},{"const":"delete","type":"string"}]},"haystack":{"description":"New value. Required for `title` (string) and `active` (boolean); ignored for `main` and `delete`.","anyOf":[{"type":"string"},{"type":"boolean"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","postExternalId","property"],"properties":{"id":{"description":"Blob token of the gallery image.","examples":["abc123def456"],"type":"string"},"postExternalId":{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"type":"string"},"property":{"description":"Which aspect of the image to update.","anyOf":[{"const":"title","type":"string"},{"const":"active","type":"string"},{"const":"main","type":"string"},{"const":"delete","type":"string"}]},"haystack":{"description":"New value. Required for `title` (string) and `active` (boolean); ignored for `main` and `delete`.","anyOf":[{"type":"string"},{"type":"boolean"}]}}}}}}}},"/bff/post/media-library-list":{"get":{"parameters":[{"description":"Full-text filter over the image title and filename.","schema":{"type":"string"},"in":"query","name":"query","required":false},{"description":"`unused` = not in any live post gallery yet; `used` = in at least one.","schema":{"anyOf":[{"const":"all","type":"string"},{"const":"unused","type":"string"},{"const":"used","type":"string"}]},"in":"query","name":"usage","required":false},{"description":"Post external ID. When set, each item reports `inCurrentPost`.","schema":{"type":"string"},"in":"query","name":"postId","required":false},{"description":"Page size (default 60).","schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"description":"Page size (default 60).","type":"number"}]},"in":"query","name":"limit","required":false},{"description":"Rows to skip.","schema":{"minimum":0,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":0,"description":"Rows to skip.","type":"number"}]},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","insertedDate","blobToken","downloadUrl","filename","size","contentType","usageCount","mainUsageCount","inCurrentPost"],"properties":{"id":{"description":"Library item id.","type":"string"},"title":{"description":"Default alt text. Empty when not set.","type":"string"},"insertedDate":{"type":"string"},"blobToken":{"type":"string"},"downloadUrl":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"usageCount":{"description":"Live posts whose gallery contains the image.","type":"number"},"mainUsageCount":{"description":"Live posts that use the image as their main image.","type":"number"},"inCurrentPost":{"description":"Already in the gallery of `postId` (false when not given).","type":"boolean"}}}},"itemCount":{"description":"Total items matching the filter.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","insertedDate","blobToken","downloadUrl","filename","size","contentType","usageCount","mainUsageCount","inCurrentPost"],"properties":{"id":{"description":"Library item id.","type":"string"},"title":{"description":"Default alt text. Empty when not set.","type":"string"},"insertedDate":{"type":"string"},"blobToken":{"type":"string"},"downloadUrl":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"usageCount":{"description":"Live posts whose gallery contains the image.","type":"number"},"mainUsageCount":{"description":"Live posts that use the image as their main image.","type":"number"},"inCurrentPost":{"description":"Already in the gallery of `postId` (false when not given).","type":"boolean"}}}},"itemCount":{"description":"Total items matching the filter.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","title","insertedDate","blobToken","downloadUrl","filename","size","contentType","usageCount","mainUsageCount","inCurrentPost"],"properties":{"id":{"description":"Library item id.","type":"string"},"title":{"description":"Default alt text. Empty when not set.","type":"string"},"insertedDate":{"type":"string"},"blobToken":{"type":"string"},"downloadUrl":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"contentType":{"type":"string"},"usageCount":{"description":"Live posts whose gallery contains the image.","type":"number"},"mainUsageCount":{"description":"Live posts that use the image as their main image.","type":"number"},"inCurrentPost":{"description":"Already in the gallery of `postId` (false when not given).","type":"boolean"}}}},"itemCount":{"description":"Total items matching the filter.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPostMedia-library-list","tags":["Post"],"summary":"List the post media library","description":"Returns org-wide library images, newest first, with live usage counters derived from post galleries. Blobs that were deleted or moved to Drive trash are hidden."}},"/bff/post/media-library-link-blob":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Library item id.","type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Library item id.","type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Library item id.","type":"string"}},"required":["id"]}}}}},"operationId":"postBffPostMedia-library-link-blob","tags":["Post"],"summary":"Add an uploaded image to the post media library","description":"Idempotent per blob: registering the same blob twice returns the existing item.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token returned by /bff/blob/upload. Must be an image.","type":"string"},"title":{"maxLength":1000,"description":"Optional default alt text.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token returned by /bff/blob/upload. Must be an image.","type":"string"},"title":{"maxLength":1000,"description":"Optional default alt text.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token returned by /bff/blob/upload. Must be an image.","type":"string"},"title":{"maxLength":1000,"description":"Optional default alt text.","type":"string"}}}}}}}},"/bff/post/media-library-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostMedia-library-update","tags":["Post"],"summary":"Update the default alt text of a library image","description":"Affects only future attachments; galleries that already use the image keep their own alt text.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Library item id.","type":"string"},"haystack":{"maxLength":1000,"description":"New default alt text. Empty clears it.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Library item id.","type":"string"},"haystack":{"maxLength":1000,"description":"New default alt text. Empty clears it.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Library item id.","type":"string"},"haystack":{"maxLength":1000,"description":"New default alt text. Empty clears it.","type":"string"}}}}}}}},"/bff/post/media-library-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"type":"number"}},"required":["success","deleted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"type":"number"}},"required":["success","deleted"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deleted":{"type":"number"}},"required":["success","deleted"]}}}}},"operationId":"postBffPostMedia-library-delete","tags":["Post"],"summary":"Remove images from the post media library","description":"Soft-deletes library entries. The files are kept, so posts that already use them keep rendering.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"minItems":1,"maxItems":500,"description":"Library item ids.","type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"minItems":1,"maxItems":500,"description":"Library item ids.","type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"minItems":1,"maxItems":500,"description":"Library item ids.","type":"array","items":{"type":"string"}}}}}}}}},"/bff/post/media-library-attach":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"linked":{"description":"Number of library items attached.","type":"number"},"blobTokens":{"description":"Gallery image ids (blob tokens) of the attached items.","type":"array","items":{"type":"string"}}},"required":["success","linked","blobTokens"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"linked":{"description":"Number of library items attached.","type":"number"},"blobTokens":{"description":"Gallery image ids (blob tokens) of the attached items.","type":"array","items":{"type":"string"}}},"required":["success","linked","blobTokens"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"linked":{"description":"Number of library items attached.","type":"number"},"blobTokens":{"description":"Gallery image ids (blob tokens) of the attached items.","type":"array","items":{"type":"string"}}},"required":["success","linked","blobTokens"]}}}}},"operationId":"postBffPostMedia-library-attach","tags":["Post"],"summary":"Attach library images to a post gallery","description":"Appends the selected images to the post gallery without copying files. Images removed from the gallery earlier are restored. The library title becomes the gallery alt text when the gallery has none.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","ids"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"ids":{"maxItems":500,"description":"Library item ids to append to the post gallery, in order.","type":"array","items":{"type":"string"}},"mainId":{"description":"Library item id to set as the post main image (attached if needed).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","ids"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"ids":{"maxItems":500,"description":"Library item ids to append to the post gallery, in order.","type":"array","items":{"type":"string"}},"mainId":{"description":"Library item id to set as the post main image (attached if needed).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["postId","ids"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"ids":{"maxItems":500,"description":"Library item ids to append to the post gallery, in order.","type":"array","items":{"type":"string"}},"mainId":{"description":"Library item id to set as the post main image (attached if needed).","type":"string"}}}}}}}},"/bff/post/post-attachment-list":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","token","filename","downloadUrl","size","contentType","tag","insertedDate"],"properties":{"id":{"description":"Attachment row id.","type":"number"},"token":{"description":"Underlying blob token — feed into `/bff/drive/detail` for previews.","minLength":32,"maxLength":32,"type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL on blob storage.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"description":"MIME content type.","type":"string"},"tag":{"nullable":true,"anyOf":[{"description":"Optional categorisation tag from core__blob.tag.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the file was attached.","anyOf":[{"description":"When the file was attached.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Number of non-deleted attachments.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","token","filename","downloadUrl","size","contentType","tag","insertedDate"],"properties":{"id":{"description":"Attachment row id.","type":"number"},"token":{"description":"Underlying blob token — feed into `/bff/drive/detail` for previews.","minLength":32,"maxLength":32,"type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL on blob storage.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"description":"MIME content type.","type":"string"},"tag":{"nullable":true,"anyOf":[{"description":"Optional categorisation tag from core__blob.tag.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the file was attached.","anyOf":[{"description":"When the file was attached.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Number of non-deleted attachments.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","token","filename","downloadUrl","size","contentType","tag","insertedDate"],"properties":{"id":{"description":"Attachment row id.","type":"number"},"token":{"description":"Underlying blob token — feed into `/bff/drive/detail` for previews.","minLength":32,"maxLength":32,"type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL on blob storage.","type":"string"},"size":{"description":"File size in bytes.","type":"number"},"contentType":{"description":"MIME content type.","type":"string"},"tag":{"nullable":true,"anyOf":[{"description":"Optional categorisation tag from core__blob.tag.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"When the file was attached.","anyOf":[{"description":"When the file was attached.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Number of non-deleted attachments.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPostPost-attachment-list","tags":["Post"],"summary":"List post attachments","description":"Returns all non-deleted files attached to the post (separate from the gallery), newest first. Each item carries the filename, public download URL, byte size and content type."}},"/bff/post/post-attachment-link-blob":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Blob token returned by /bff/blob/upload.","schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffPostPost-attachment-link-blob","tags":["Post"],"summary":"Attach uploaded file to post","description":"Idempotently links an uploaded blob to the post as an attachment. Calling it twice with the same blob token returns success without creating a duplicate; if the same blob was previously detached, the row is undeleted."}},"/bff/post/post-attachment-delete":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Attachment row id returned by /post-attachment-list.","schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"description":"Attachment row id returned by /post-attachment-list.","type":"number"}]},"in":"query","name":"attachmentId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the detach was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the detach was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the detach was successful.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffPostPost-attachment-delete","tags":["Post"],"summary":"Detach file from post","description":"Soft-deletes the post↔blob relation. The underlying blob is kept (it may be referenced elsewhere). The same file can be re-attached later via /post-attachment-link-blob."}},"/bff/post/post-meta-list":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"description":"Metadata key (`content__post_meta.key`, max 64 chars).","type":"string"},"value":{"description":"Metadata value (`content__post_meta.value`, free text).","type":"string"}}}},"itemCount":{"description":"Number of metadata entries.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"description":"Metadata key (`content__post_meta.key`, max 64 chars).","type":"string"},"value":{"description":"Metadata value (`content__post_meta.value`, free text).","type":"string"}}}},"itemCount":{"description":"Number of metadata entries.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"description":"Metadata key (`content__post_meta.key`, max 64 chars).","type":"string"},"value":{"description":"Metadata value (`content__post_meta.value`, free text).","type":"string"}}}},"itemCount":{"description":"Number of metadata entries.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPostPost-meta-list","tags":["Post"],"summary":"List post metadata entries (content__post_meta)","description":"Returns the post key/value metadata bag sorted by key, in a grid-friendly shape."}},"/bff/post/view-history":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["date","viewCount"],"properties":{"date":{"description":"ISO calendar day (YYYY-MM-DD) the snapshot was recorded for.","examples":["2026-07-26"],"type":"string"},"viewCount":{"description":"Cumulative view count as of the snapshot day.","examples":[1234],"type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["date","viewCount"],"properties":{"date":{"description":"ISO calendar day (YYYY-MM-DD) the snapshot was recorded for.","examples":["2026-07-26"],"type":"string"},"viewCount":{"description":"Cumulative view count as of the snapshot day.","examples":[1234],"type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["date","viewCount"],"properties":{"date":{"description":"ISO calendar day (YYYY-MM-DD) the snapshot was recorded for.","examples":["2026-07-26"],"type":"string"},"viewCount":{"description":"Cumulative view count as of the snapshot day.","examples":[1234],"type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffPostView-history","tags":["Post"],"summary":"List daily view-count snapshots for a post","description":"Returns one row per day for which a snapshot was recorded (rows are only written when the cumulative `content__post.views_count` actually changed since the previous snapshot, so gaps are legitimate — the value is the same as on the preceding row). Rows are chronological (oldest first) so the admin sidebar chart can plot them without additional sorting."}},"/bff/post/view-geo":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["country","city","count"],"properties":{"country":{"examples":["Czech Republic"],"type":"string"},"city":{"examples":["Prague"],"type":"string"},"count":{"examples":[25],"type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["country","city","count"],"properties":{"country":{"examples":["Czech Republic"],"type":"string"},"city":{"examples":["Prague"],"type":"string"},"count":{"examples":[25],"type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["country","city","count"],"properties":{"country":{"examples":["Czech Republic"],"type":"string"},"city":{"examples":["Prague"],"type":"string"},"count":{"examples":[25],"type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffPostView-geo","tags":["Post"],"summary":"Top-10 countries and cities for a post (from contact view records)","description":"Aggregates `content__post_contact_view` through `brj__geo_ip` → `brj__geo_ip_city` and returns the ten (country, city) pairs with the highest unique-contact view count. Rows are only present when logged-in contacts viewed the post with geo data resolved. Returns an empty `items` array when no data exists yet."}},"/bff/post/post-meta-upsert":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostPost-meta-upsert","tags":["Post"],"summary":"Create or update one metadata entry","description":"Idempotent upsert against `content__post_meta(post_id, key)`. Calling with the same key overwrites the value.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","key","value"],"properties":{"id":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"key":{"minLength":1,"maxLength":64,"description":"Metadata key. 1–64 chars (matches `content__post_meta.key` column).","type":"string"},"value":{"description":"Metadata value. Free text; long values are allowed.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","key","value"],"properties":{"id":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"key":{"minLength":1,"maxLength":64,"description":"Metadata key. 1–64 chars (matches `content__post_meta.key` column).","type":"string"},"value":{"description":"Metadata value. Free text; long values are allowed.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","key","value"],"properties":{"id":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"key":{"minLength":1,"maxLength":64,"description":"Metadata key. 1–64 chars (matches `content__post_meta.key` column).","type":"string"},"value":{"description":"Metadata value. Free text; long values are allowed.","type":"string"}}}}}}}},"/bff/post/post-meta-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostPost-meta-delete","tags":["Post"],"summary":"Delete one metadata entry by key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","key"],"properties":{"id":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"key":{"minLength":1,"maxLength":64,"description":"Metadata key to delete.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","key"],"properties":{"id":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"key":{"minLength":1,"maxLength":64,"description":"Metadata key to delete.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","key"],"properties":{"id":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"key":{"minLength":1,"maxLength":64,"description":"Metadata key to delete.","type":"string"}}}}}}}},"/bff/post/post-toggle-star":{"post":{"parameters":[],"operationId":"postBffPostPost-toggle-star","tags":["Post"],"summary":"Toggle post star status","description":"Sets or clears the starred/featured flag on a post. Starred posts appear first in the post list.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","value"],"properties":{"id":{"description":"Post external ID.","type":"string"},"value":{"description":"True to star the post, false to unstar it.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","value"],"properties":{"id":{"description":"Post external ID.","type":"string"},"value":{"description":"True to star the post, false to unstar it.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","value"],"properties":{"id":{"description":"Post external ID.","type":"string"},"value":{"description":"True to star the post, false to unstar it.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/post/post-auto-translate":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"translatedLocales":{"description":"Union of `createdLocales` + `updatedLocales`, kept for backward wire compatibility. Empty when every configured target locale was already in sync with the source version.","type":"array","items":{"description":"Locale code that was written (created or refreshed).","type":"string"}},"createdLocales":{"description":"Target locales that had no `content__post_locale` row before this call.","type":"array","items":{"description":"Locale code that received a brand-new translation row.","type":"string"}},"updatedLocales":{"description":"Target locales whose translation existed but was regenerated because `source_history_id` no longer matched the newest source-locale history row.","type":"array","items":{"description":"Locale code whose translation was refreshed.","type":"string"}}},"required":["translatedLocales","createdLocales","updatedLocales"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"translatedLocales":{"description":"Union of `createdLocales` + `updatedLocales`, kept for backward wire compatibility. Empty when every configured target locale was already in sync with the source version.","type":"array","items":{"description":"Locale code that was written (created or refreshed).","type":"string"}},"createdLocales":{"description":"Target locales that had no `content__post_locale` row before this call.","type":"array","items":{"description":"Locale code that received a brand-new translation row.","type":"string"}},"updatedLocales":{"description":"Target locales whose translation existed but was regenerated because `source_history_id` no longer matched the newest source-locale history row.","type":"array","items":{"description":"Locale code whose translation was refreshed.","type":"string"}}},"required":["translatedLocales","createdLocales","updatedLocales"]}},"text/plain":{"schema":{"type":"object","properties":{"translatedLocales":{"description":"Union of `createdLocales` + `updatedLocales`, kept for backward wire compatibility. Empty when every configured target locale was already in sync with the source version.","type":"array","items":{"description":"Locale code that was written (created or refreshed).","type":"string"}},"createdLocales":{"description":"Target locales that had no `content__post_locale` row before this call.","type":"array","items":{"description":"Locale code that received a brand-new translation row.","type":"string"}},"updatedLocales":{"description":"Target locales whose translation existed but was regenerated because `source_history_id` no longer matched the newest source-locale history row.","type":"array","items":{"description":"Locale code whose translation was refreshed.","type":"string"}}},"required":["translatedLocales","createdLocales","updatedLocales"]}}}}},"operationId":"postBffPostPost-auto-translate","tags":["Post"],"summary":"Auto-translate post","description":"Translates the post title + content from the organisation default locale into every other configured organisation locale. For each target locale: creates the translation if missing, refreshes it when the source article has been edited since (detected via `content__post_locale.source_history_id` vs. the newest source-locale history row), skips when already up to date. Canonical routes are ensured per locale.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external ID to auto-translate.","examples":["aBcDeFgH12345678"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external ID to auto-translate.","examples":["aBcDeFgH12345678"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external ID to auto-translate.","examples":["aBcDeFgH12345678"],"type":"string"}}}}}}}},"/bff/post/resolve-category-by-ai":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"description":"Whether the category was changed.","type":"boolean"},"category":{"nullable":true,"anyOf":[{"type":"object","required":["categoryId","categoryName"],"properties":{"categoryId":{"description":"Internal ID of the selected category.","type":"number"},"categoryName":{"description":"Name of the selected category.","type":"string"}}},{"type":"null"}]}},"required":["success","changed","category"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"description":"Whether the category was changed.","type":"boolean"},"category":{"nullable":true,"anyOf":[{"type":"object","required":["categoryId","categoryName"],"properties":{"categoryId":{"description":"Internal ID of the selected category.","type":"number"},"categoryName":{"description":"Name of the selected category.","type":"string"}}},{"type":"null"}]}},"required":["success","changed","category"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"description":"Whether the category was changed.","type":"boolean"},"category":{"nullable":true,"anyOf":[{"type":"object","required":["categoryId","categoryName"],"properties":{"categoryId":{"description":"Internal ID of the selected category.","type":"number"},"categoryName":{"description":"Name of the selected category.","type":"string"}}},{"type":"null"}]}},"required":["success","changed","category"]}}}}},"operationId":"postBffPostResolve-category-by-ai","tags":["Post"],"summary":"Auto-categorize post by AI","description":"Uses AI to analyze the post title and content and select the best matching category from all active categories in the organisation. If no category is a good fit, the current category remains unchanged.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"}}}}}}}},"/bff/post/delete":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}}}}},"operationId":"postBffPostDelete","tags":["Post"],"summary":"Soft-delete a post","description":"Sets deleted_date on the post. The post is hidden from all public views but remains in the admin list.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID to soft-delete.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID to soft-delete.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID to soft-delete.","type":"string"}}}}}}}},"/bff/post/bulk-visibility":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"How many posts were actually updated.","type":"number"},"requested":{"description":"How many ids the caller submitted.","type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"How many posts were actually updated.","type":"number"},"requested":{"description":"How many ids the caller submitted.","type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"description":"How many posts were actually updated.","type":"number"},"requested":{"description":"How many ids the caller submitted.","type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffPostBulk-visibility","tags":["Post"],"summary":"Bulk-update visibility on many posts","description":"Sets the `visibility` field on every post whose `external_id` is in the supplied list. Single UPDATE on the DB; scoped to the caller organisation. Does not touch `published_date` — that is the editorial \"first published\" moment and should not be reset by a bulk toggle.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids","visibility"],"properties":{"ids":{"description":"External IDs of the posts to update. Silently skips ids that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"visibility":{"description":"Target visibility level applied to every post in the list.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids","visibility"],"properties":{"ids":{"description":"External IDs of the posts to update. Silently skips ids that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"visibility":{"description":"Target visibility level applied to every post in the list.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["ids","visibility"],"properties":{"ids":{"description":"External IDs of the posts to update. Silently skips ids that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"visibility":{"description":"Target visibility level applied to every post in the list.","anyOf":[{"const":"public","type":"string"},{"const":"private","type":"string"},{"const":"unlisted","type":"string"},{"const":"subscribe","type":"string"}]}}}}}}}},"/bff/post/bulk-publish-now":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffPostBulk-publish-now","tags":["Post"],"summary":"Bulk publish-now on many posts","description":"Sets `visibility = public` and, for posts that have not gone live yet (`published_date` is NULL or in the future), fast-forwards `published_date` to `NOW()`. Posts that were already live keep their editorial `published_date`. Single UPDATE on the DB; scoped to the caller organisation. Use this instead of `/bulk-visibility` when the intent is \"make these scheduled/draft posts live right now\" rather than \"unhide something that was already public once\".","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"External IDs of the posts to publish immediately. Silently skips ids that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"External IDs of the posts to publish immediately. Silently skips ids that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"External IDs of the posts to publish immediately. Silently skips ids that do not belong to the caller organisation.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}}}}}}}}},"/bff/post/bulk-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffPostBulk-delete","tags":["Post"],"summary":"Bulk soft-delete many posts","description":"Sets `deleted_date = NOW()` on every post whose `external_id` is in the supplied list and is not already deleted. Single UPDATE on the DB; scoped to the caller organisation. Reversible via the existing `/restore` endpoint on a per-post basis.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"External IDs of the posts to soft-delete. Ids that are unknown or already deleted are silently skipped.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"External IDs of the posts to soft-delete. Ids that are unknown or already deleted are silently skipped.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"description":"External IDs of the posts to soft-delete. Ids that are unknown or already deleted are silently skipped.","minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}}}}}}}}},"/bff/post/restore":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["success"],"properties":{"success":{"const":true,"type":"boolean"}}},{"type":"object","required":["success","message"],"properties":{"success":{"const":false,"type":"boolean"},"message":{"type":"string"}}}]}}}}},"operationId":"postBffPostRestore","tags":["Post"],"summary":"Restore a soft-deleted post","description":"Clears deleted_date on the post, making it visible again in public views.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID to restore.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID to restore.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID to restore.","type":"string"}}}}}}}},"/bff/post/history-list":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Optional locale filter (e.g. \"cs\", \"en\"). When omitted, the response mixes all languages. Each entry always carries its own `locale` field regardless.","examples":["cs"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"postId":{"description":"Echo of the post external id the history belongs to.","type":"string"},"locale":{"nullable":true,"anyOf":[{"description":"Echo of the locale filter, or null when none was applied.","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","insertedDate","locale","title","commitMessage","kind","contentSize","author"],"properties":{"id":{"description":"History version handle (16 chars). Pass to /history-detail.","type":"string"},"insertedDate":{"description":"When this revision was recorded.","anyOf":[{"description":"When this revision was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"description":"Locale code of this revision (e.g. \"cs\", \"en\").","type":"string"},"title":{"description":"Snapshot of the post title at this revision.","type":"string"},"commitMessage":{"nullable":true,"anyOf":[{"description":"Optional human commit message; null for auto-versions.","type":"string"},{"type":"null"}]},"kind":{"description":"Coarse classification of what caused the revision, so the UI can render a badge without parsing the commit message.","anyOf":[{"const":"manual","type":"string"},{"const":"auto","type":"string"},{"const":"auto-translate-initial","type":"string"},{"const":"auto-translate-refresh","type":"string"},{"const":"restore","type":"string"}]},"contentSize":{"description":"Byte size of the content blob.","type":"number"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"description":"cuRefNo of the author contact.","type":"string"},{"type":"null"}]},"name":{"description":"Display name of the author.","type":"string"}}}}}}},"required":["postId","locale","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"postId":{"description":"Echo of the post external id the history belongs to.","type":"string"},"locale":{"nullable":true,"anyOf":[{"description":"Echo of the locale filter, or null when none was applied.","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","insertedDate","locale","title","commitMessage","kind","contentSize","author"],"properties":{"id":{"description":"History version handle (16 chars). Pass to /history-detail.","type":"string"},"insertedDate":{"description":"When this revision was recorded.","anyOf":[{"description":"When this revision was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"description":"Locale code of this revision (e.g. \"cs\", \"en\").","type":"string"},"title":{"description":"Snapshot of the post title at this revision.","type":"string"},"commitMessage":{"nullable":true,"anyOf":[{"description":"Optional human commit message; null for auto-versions.","type":"string"},{"type":"null"}]},"kind":{"description":"Coarse classification of what caused the revision, so the UI can render a badge without parsing the commit message.","anyOf":[{"const":"manual","type":"string"},{"const":"auto","type":"string"},{"const":"auto-translate-initial","type":"string"},{"const":"auto-translate-refresh","type":"string"},{"const":"restore","type":"string"}]},"contentSize":{"description":"Byte size of the content blob.","type":"number"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"description":"cuRefNo of the author contact.","type":"string"},{"type":"null"}]},"name":{"description":"Display name of the author.","type":"string"}}}}}}},"required":["postId","locale","items"]}},"text/plain":{"schema":{"type":"object","properties":{"postId":{"description":"Echo of the post external id the history belongs to.","type":"string"},"locale":{"nullable":true,"anyOf":[{"description":"Echo of the locale filter, or null when none was applied.","type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","required":["id","insertedDate","locale","title","commitMessage","kind","contentSize","author"],"properties":{"id":{"description":"History version handle (16 chars). Pass to /history-detail.","type":"string"},"insertedDate":{"description":"When this revision was recorded.","anyOf":[{"description":"When this revision was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"locale":{"description":"Locale code of this revision (e.g. \"cs\", \"en\").","type":"string"},"title":{"description":"Snapshot of the post title at this revision.","type":"string"},"commitMessage":{"nullable":true,"anyOf":[{"description":"Optional human commit message; null for auto-versions.","type":"string"},{"type":"null"}]},"kind":{"description":"Coarse classification of what caused the revision, so the UI can render a badge without parsing the commit message.","anyOf":[{"const":"manual","type":"string"},{"const":"auto","type":"string"},{"const":"auto-translate-initial","type":"string"},{"const":"auto-translate-refresh","type":"string"},{"const":"restore","type":"string"}]},"contentSize":{"description":"Byte size of the content blob.","type":"number"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"description":"cuRefNo of the author contact.","type":"string"},{"type":"null"}]},"name":{"description":"Display name of the author.","type":"string"}}}}}}},"required":["postId","locale","items"]}}}}},"operationId":"getBffPostHistory-list","tags":["Post"],"summary":"List post version history","description":"Returns the commit log for a post: every revision recorded in content__post_history, newest first. Each item carries the version handle, timestamp, locale, author, optional commit message, snapshot title and the byte size of the stored content blob (so the UI can render \"1.2 MB\" without fetching the body). The actual HTML body lives in blob storage and is only loaded by /history-detail. Pass `?locale=cs` to scope to one language."}},"/bff/post/history-detail":{"get":{"parameters":[{"description":"History version handle returned by /history-list.","examples":["vErSiOnHaNdLe123"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"History version handle (echo).","type":"string"},"postId":{"description":"External id of the parent post.","type":"string"},"locale":{"description":"Locale code of this revision.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"content":{"description":"Full HTML content snapshot at this revision.","type":"string"},"contentSize":{"type":"number"},"commitMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}},"required":["id","postId","locale","insertedDate","title","content","contentSize","commitMessage","author"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"History version handle (echo).","type":"string"},"postId":{"description":"External id of the parent post.","type":"string"},"locale":{"description":"Locale code of this revision.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"content":{"description":"Full HTML content snapshot at this revision.","type":"string"},"contentSize":{"type":"number"},"commitMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}},"required":["id","postId","locale","insertedDate","title","content","contentSize","commitMessage","author"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"History version handle (echo).","type":"string"},"postId":{"description":"External id of the parent post.","type":"string"},"locale":{"description":"Locale code of this revision.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"content":{"description":"Full HTML content snapshot at this revision.","type":"string"},"contentSize":{"type":"number"},"commitMessage":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}},"required":["id","postId","locale","insertedDate","title","content","contentSize","commitMessage","author"]}}}}},"operationId":"getBffPostHistory-detail","tags":["Post"],"summary":"Get post history version detail","description":"Returns one specific revision in full, with the title and HTML content snapshot (content body is fetched from blob storage on demand)."}},"/bff/post/history-restore":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"postId":{"description":"External id of the post that was restored.","type":"string"},"locale":{"description":"Locale code that was restored.","type":"string"},"restoredFromVersionId":{"description":"External id of the source revision (the snapshot put back live).","type":"string"},"newVersionId":{"description":"External id of the new history entry created by the restore. Use this to roll the restore back via another /history-restore call.","type":"string"}},"required":["success","postId","locale","restoredFromVersionId","newVersionId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"postId":{"description":"External id of the post that was restored.","type":"string"},"locale":{"description":"Locale code that was restored.","type":"string"},"restoredFromVersionId":{"description":"External id of the source revision (the snapshot put back live).","type":"string"},"newVersionId":{"description":"External id of the new history entry created by the restore. Use this to roll the restore back via another /history-restore call.","type":"string"}},"required":["success","postId","locale","restoredFromVersionId","newVersionId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"postId":{"description":"External id of the post that was restored.","type":"string"},"locale":{"description":"Locale code that was restored.","type":"string"},"restoredFromVersionId":{"description":"External id of the source revision (the snapshot put back live).","type":"string"},"newVersionId":{"description":"External id of the new history entry created by the restore. Use this to roll the restore back via another /history-restore call.","type":"string"}},"required":["success","postId","locale","restoredFromVersionId","newVersionId"]}}}}},"operationId":"postBffPostHistory-restore","tags":["Post"],"summary":"Restore a post to a historical revision","description":"Overwrites the live `content__post_locale` row for the post + locale of the source revision with that revision's title and content body, then writes a new history entry (\"Restored from version X\") authored by the caller.\n\nThe restore is itself a versioned act — the new history entry it produces can be the target of a later restore, so an \"undo my undo\" is just another /history-restore call. Coalescing is disabled for restore writes so they always land as distinct landmarks in the commit log even if the same author was editing seconds before.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"History version handle to restore (16 chars).","examples":["vErSiOnHaNdLe123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"History version handle to restore (16 chars).","examples":["vErSiOnHaNdLe123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"History version handle to restore (16 chars).","examples":["vErSiOnHaNdLe123"],"type":"string"}}}}}}}},"/bff/post/history-diff":{"get":{"parameters":[{"description":"Older revision handle (left side of the diff).","examples":["vErSiOnHaNdLe123"],"schema":{"type":"string"},"in":"query","name":"from","required":true},{"description":"Newer revision handle (right side of the diff).","examples":["vErSiOnHaNdLe456"],"schema":{"type":"string"},"in":"query","name":"to","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"description":"Version handle.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"to":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"description":"Version handle.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"titleDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"description":"context = unchanged region, add = present only in `to`, remove = present only in `from`.","anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"description":"Verbatim slice of the document. Whitespace preserved.","type":"string"}}}},"contentDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"description":"context = unchanged region, add = present only in `to`, remove = present only in `from`.","anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"description":"Verbatim slice of the document. Whitespace preserved.","type":"string"}}}},"stats":{"type":"object","required":["titleAdded","titleRemoved","contentAddedLines","contentRemovedLines"],"properties":{"titleAdded":{"description":"Words added to the title.","type":"number"},"titleRemoved":{"description":"Words removed from the title.","type":"number"},"contentAddedLines":{"description":"Lines added to the content.","type":"number"},"contentRemovedLines":{"description":"Lines removed from the content.","type":"number"}}}},"required":["from","to","titleDiff","contentDiff","stats"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"from":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"description":"Version handle.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"to":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"description":"Version handle.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"titleDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"description":"context = unchanged region, add = present only in `to`, remove = present only in `from`.","anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"description":"Verbatim slice of the document. Whitespace preserved.","type":"string"}}}},"contentDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"description":"context = unchanged region, add = present only in `to`, remove = present only in `from`.","anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"description":"Verbatim slice of the document. Whitespace preserved.","type":"string"}}}},"stats":{"type":"object","required":["titleAdded","titleRemoved","contentAddedLines","contentRemovedLines"],"properties":{"titleAdded":{"description":"Words added to the title.","type":"number"},"titleRemoved":{"description":"Words removed from the title.","type":"number"},"contentAddedLines":{"description":"Lines added to the content.","type":"number"},"contentRemovedLines":{"description":"Lines removed from the content.","type":"number"}}}},"required":["from","to","titleDiff","contentDiff","stats"]}},"text/plain":{"schema":{"type":"object","properties":{"from":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"description":"Version handle.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"to":{"type":"object","required":["id","insertedDate","title","contentSize","locale","author"],"properties":{"id":{"description":"Version handle.","type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"title":{"type":"string"},"contentSize":{"type":"number"},"locale":{"type":"string"},"author":{"type":"object","required":["id","name"],"properties":{"id":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"}}}}},"titleDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"description":"context = unchanged region, add = present only in `to`, remove = present only in `from`.","anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"description":"Verbatim slice of the document. Whitespace preserved.","type":"string"}}}},"contentDiff":{"type":"array","items":{"type":"object","required":["type","value"],"properties":{"type":{"description":"context = unchanged region, add = present only in `to`, remove = present only in `from`.","anyOf":[{"const":"context","type":"string"},{"const":"add","type":"string"},{"const":"remove","type":"string"}]},"value":{"description":"Verbatim slice of the document. Whitespace preserved.","type":"string"}}}},"stats":{"type":"object","required":["titleAdded","titleRemoved","contentAddedLines","contentRemovedLines"],"properties":{"titleAdded":{"description":"Words added to the title.","type":"number"},"titleRemoved":{"description":"Words removed from the title.","type":"number"},"contentAddedLines":{"description":"Lines added to the content.","type":"number"},"contentRemovedLines":{"description":"Lines removed from the content.","type":"number"}}}},"required":["from","to","titleDiff","contentDiff","stats"]}}}}},"operationId":"getBffPostHistory-diff","tags":["Post"],"summary":"Diff two post revisions","description":"Returns a structured diff between two revisions of the same post + locale. Title is word-grain (titles are short, word grain reads naturally), content is line-grain (HTML/markdown bodies — line grain keeps block edits readable). Both revisions must belong to the same post and locale; cross-post or cross-locale diffs are rejected as caller errors."}},"/bff/post/comment-list":{"get":{"parameters":[{"description":"Optional post external_id. When set, only comments under that post are returned. Used by the post-detail \"Comments\" tab.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"postId","required":false},{"description":"Optional fulltext filter — case-insensitive LIKE across comment body, author name and author email. Whitespace-only values are treated as empty. Alternative to the standard datagrid `filterFulltextQuery` parameter; either wins.","examples":["spam"],"schema":{"type":"string"},"in":"query","name":"q","required":false}],"responses":{"200":{"description":"Paginated list of comments.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","postId","postTitle","authorId","authorName","authorEmail","authorAvatarUrl","content","insertedDate","isDeleted"],"properties":{"id":{"description":"Comment ID.","type":"string"},"postId":{"description":"External ID of the post this comment belongs to.","type":"string"},"postTitle":{"description":"Title of the post.","type":"string"},"authorId":{"description":"External ID of the comment author (customer/contact).","type":"string"},"authorName":{"description":"Display name of the author.","type":"string"},"authorEmail":{"description":"Email of the author.","type":"string"},"authorAvatarUrl":{"nullable":true,"anyOf":[{"description":"Public URL of the author avatar image, resolved server-side via the canonical person order (linked `cas__user.avatar_blob_id` only; `shop__contact.avatar_blob_id` for contacts without a user). Null when unset.","type":"string"},{"type":"null"}]},"content":{"description":"Comment text content.","type":"string"},"insertedDate":{"description":"ISO timestamp when the comment was created.","type":"string"},"isDeleted":{"description":"Whether the comment has been soft-deleted.","type":"boolean"}}}},"itemCount":{"description":"Total number of comments matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","postId","postTitle","authorId","authorName","authorEmail","authorAvatarUrl","content","insertedDate","isDeleted"],"properties":{"id":{"description":"Comment ID.","type":"string"},"postId":{"description":"External ID of the post this comment belongs to.","type":"string"},"postTitle":{"description":"Title of the post.","type":"string"},"authorId":{"description":"External ID of the comment author (customer/contact).","type":"string"},"authorName":{"description":"Display name of the author.","type":"string"},"authorEmail":{"description":"Email of the author.","type":"string"},"authorAvatarUrl":{"nullable":true,"anyOf":[{"description":"Public URL of the author avatar image, resolved server-side via the canonical person order (linked `cas__user.avatar_blob_id` only; `shop__contact.avatar_blob_id` for contacts without a user). Null when unset.","type":"string"},{"type":"null"}]},"content":{"description":"Comment text content.","type":"string"},"insertedDate":{"description":"ISO timestamp when the comment was created.","type":"string"},"isDeleted":{"description":"Whether the comment has been soft-deleted.","type":"boolean"}}}},"itemCount":{"description":"Total number of comments matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","postId","postTitle","authorId","authorName","authorEmail","authorAvatarUrl","content","insertedDate","isDeleted"],"properties":{"id":{"description":"Comment ID.","type":"string"},"postId":{"description":"External ID of the post this comment belongs to.","type":"string"},"postTitle":{"description":"Title of the post.","type":"string"},"authorId":{"description":"External ID of the comment author (customer/contact).","type":"string"},"authorName":{"description":"Display name of the author.","type":"string"},"authorEmail":{"description":"Email of the author.","type":"string"},"authorAvatarUrl":{"nullable":true,"anyOf":[{"description":"Public URL of the author avatar image, resolved server-side via the canonical person order (linked `cas__user.avatar_blob_id` only; `shop__contact.avatar_blob_id` for contacts without a user). Null when unset.","type":"string"},{"type":"null"}]},"content":{"description":"Comment text content.","type":"string"},"insertedDate":{"description":"ISO timestamp when the comment was created.","type":"string"},"isDeleted":{"description":"Whether the comment has been soft-deleted.","type":"boolean"}}}},"itemCount":{"description":"Total number of comments matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPostComment-list","tags":["Post"],"summary":"List post comments","description":"Returns a paginated list of comments for the authenticated organisation. Without `postId`, returns comments across all posts. With `postId`, scopes to one post. Comments are ordered by inserted date (newest first). Supports standard datagrid pagination via ?page= and ?limit= query params."}},"/bff/post/comment-delete":{"post":{"parameters":[],"operationId":"postBffPostComment-delete","tags":["Post"],"summary":"Delete a post comment","description":"Soft-deletes a comment by setting its deleted_date. The comment must exist and not be already deleted.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External ID of the comment to soft-delete.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External ID of the comment to soft-delete.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"External ID of the comment to soft-delete.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/post/category-opportunities":{"get":{"parameters":[{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"categories":{"type":"array","items":{"type":"object","required":["externalId","name","description","totalPublished","daysSinceLastPost","opportunityScore","recommended"],"properties":{"externalId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalPublished":{"type":"number"},"daysSinceLastPost":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"opportunityScore":{"type":"number"},"recommended":{"type":"boolean"}}}}},"required":["success","categories"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"categories":{"type":"array","items":{"type":"object","required":["externalId","name","description","totalPublished","daysSinceLastPost","opportunityScore","recommended"],"properties":{"externalId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalPublished":{"type":"number"},"daysSinceLastPost":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"opportunityScore":{"type":"number"},"recommended":{"type":"boolean"}}}}},"required":["success","categories"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"categories":{"type":"array","items":{"type":"object","required":["externalId","name","description","totalPublished","daysSinceLastPost","opportunityScore","recommended"],"properties":{"externalId":{"type":"string"},"name":{"type":"string"},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"totalPublished":{"type":"number"},"daysSinceLastPost":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"opportunityScore":{"type":"number"},"recommended":{"type":"boolean"}}}}},"required":["success","categories"]}}}}},"operationId":"getBffPostCategory-opportunities","tags":["Post"],"summary":"Per-category opportunity score for AI topic brainstorming","description":"Returns all active categories with totalPublished, daysSinceLastPost, opportunityScore and a recommended flag. Pure DB heuristic (no AI call). Used by the admin AI topic modal to pre-select categories with the biggest content gaps when the user clicks \"Recommend\"."}},"/bff/post/ai-suggest-topics":{"post":{"parameters":[],"operationId":"postBffPostAi-suggest-topics","tags":["Post"],"summary":"AI-suggest blog topics from existing categories and recent titles","description":"Reads the active categories (optionally restricted to a subset) and the most recent public article titles per category, then asks the AI to brainstorm fresh topic ideas that fill content gaps. Synchronous: typical response time 5-15s. Token usage is logged automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["locale"],"properties":{"categoryExternalIds":{"description":"Restrict brainstorming to these category externalIds. Omit for all active categories.","type":"array","items":{"minLength":1,"maxLength":32,"type":"string"}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"count":{"minimum":3,"maximum":12,"description":"How many topic ideas the AI should return (default 6).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":3,"maximum":12,"description":"How many topic ideas the AI should return (default 6).","type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["locale"],"properties":{"categoryExternalIds":{"description":"Restrict brainstorming to these category externalIds. Omit for all active categories.","type":"array","items":{"minLength":1,"maxLength":32,"type":"string"}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"count":{"minimum":3,"maximum":12,"description":"How many topic ideas the AI should return (default 6).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":3,"maximum":12,"description":"How many topic ideas the AI should return (default 6).","type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["locale"],"properties":{"categoryExternalIds":{"description":"Restrict brainstorming to these category externalIds. Omit for all active categories.","type":"array","items":{"minLength":1,"maxLength":32,"type":"string"}},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"count":{"minimum":3,"maximum":12,"description":"How many topic ideas the AI should return (default 6).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":3,"maximum":12,"description":"How many topic ideas the AI should return (default 6).","type":"integer"}]}}}}}},"responses":{"200":{}}}},"/bff/post/ai-create-from-topic":{"post":{"parameters":[],"operationId":"postBffPostAi-create-from-topic","tags":["Post"],"summary":"AI-generate a private draft article from a suggested topic","description":"Drafts the full article body via AI (title, perex, content as Markdown), saves it as a private draft (visibility=private, published_date=NULL) via the existing addPost() pipeline. Returns the new post externalId so the caller can redirect to /post/<id>. Synchronous: typical 15-40s.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["topicTitle","topicAngle","categoryExternalId","locale"],"properties":{"topicTitle":{"minLength":3,"maxLength":300,"description":"Selected topic title from /ai-suggest-topics.","type":"string"},"topicAngle":{"minLength":3,"maxLength":500,"description":"Editorial angle/hook for the topic.","type":"string"},"categoryExternalId":{"minLength":1,"maxLength":32,"description":"External ID of the category the article belongs to.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["topicTitle","topicAngle","categoryExternalId","locale"],"properties":{"topicTitle":{"minLength":3,"maxLength":300,"description":"Selected topic title from /ai-suggest-topics.","type":"string"},"topicAngle":{"minLength":3,"maxLength":500,"description":"Editorial angle/hook for the topic.","type":"string"},"categoryExternalId":{"minLength":1,"maxLength":32,"description":"External ID of the category the article belongs to.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["topicTitle","topicAngle","categoryExternalId","locale"],"properties":{"topicTitle":{"minLength":3,"maxLength":300,"description":"Selected topic title from /ai-suggest-topics.","type":"string"},"topicAngle":{"minLength":3,"maxLength":500,"description":"Editorial angle/hook for the topic.","type":"string"},"categoryExternalId":{"minLength":1,"maxLength":32,"description":"External ID of the category the article belongs to.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/post/ai-fact-check":{"post":{"parameters":[],"operationId":"postBffPostAi-fact-check","tags":["Post"],"summary":"AI fact-check of an existing post","description":"Reads the post body for the given locale and asks AI to flag major factual errors, fake news, and improvement recommendations. Each finding is grouped by category, scored by severity and carries a one-sentence justification (so the editor sees *why*, not just *what*). The endpoint never rewrites the post — admin decides what to apply. Synchronous, ~15-40s. No response schema.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/post/ai-apply-fact-check-fix":{"post":{"parameters":[],"operationId":"postBffPostAi-apply-fact-check-fix","tags":["Post"],"summary":"AI-apply a single fact-check finding to a post body","description":"Reads the full current article (title, perex, content) for the given locale, asks the AI to produce the **smallest possible** edit that addresses the supplied fact-check finding, and commits the result through the existing savePost() pipeline (so a normal version-history entry is created). The AI may decline to apply (sets applied=false) when the suggested fix is unsafe or ambiguous; in that case no DB write happens. Synchronous, ~15-30s. No response schema — hand-rolls the Response to dodge Elysia's auto-serialization edge cases on AI endpoints.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","locale","finding"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"finding":{"type":"object","required":["category","severity","issue","justification"],"properties":{"category":{"description":"\"error\" | \"falsehood\" | \"recommendation\"","type":"string"},"severity":{"description":"\"low\" | \"medium\" | \"high\"","type":"string"},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"issue":{"minLength":1,"maxLength":2000,"type":"string"},"justification":{"minLength":1,"maxLength":2000,"type":"string"},"suggestedFix":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","locale","finding"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"finding":{"type":"object","required":["category","severity","issue","justification"],"properties":{"category":{"description":"\"error\" | \"falsehood\" | \"recommendation\"","type":"string"},"severity":{"description":"\"low\" | \"medium\" | \"high\"","type":"string"},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"issue":{"minLength":1,"maxLength":2000,"type":"string"},"justification":{"minLength":1,"maxLength":2000,"type":"string"},"suggestedFix":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"text/plain":{"schema":{"type":"object","required":["postId","locale","finding"],"properties":{"postId":{"description":"Post external ID.","type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"finding":{"type":"object","required":["category","severity","issue","justification"],"properties":{"category":{"description":"\"error\" | \"falsehood\" | \"recommendation\"","type":"string"},"severity":{"description":"\"low\" | \"medium\" | \"high\"","type":"string"},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}]},"issue":{"minLength":1,"maxLength":2000,"type":"string"},"justification":{"minLength":1,"maxLength":2000,"type":"string"},"suggestedFix":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"responses":{"200":{}}}},"/bff/post/reference-image-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","isActive","insertedDate","blobToken","downloadUrl","filename","size","contentType"],"properties":{"id":{"description":"Reference image record id.","type":"string"},"isActive":{"description":"Whether this image is fed to the generator.","type":"boolean"},"insertedDate":{"description":"When the image was uploaded.","type":"string"},"blobToken":{"description":"Underlying blob token.","type":"string"},"downloadUrl":{"description":"Public URL to display the thumbnail.","type":"string"},"filename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"type":"number"},"contentType":{"type":"string"}}}},"moodPrompt":{"description":"Mood prompt injected into every generation request. Empty when not configured.","type":"string"},"aspectRatio":{"description":"Aspect ratio the generator uses for post thumbnails. One of \"3:2\" (default), \"16:9\", \"4:3\", \"1:1\", \"9:16\".","type":"string"},"hasActive":{"description":"True if at least one reference image is active.","type":"boolean"}},"required":["items","moodPrompt","aspectRatio","hasActive"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","isActive","insertedDate","blobToken","downloadUrl","filename","size","contentType"],"properties":{"id":{"description":"Reference image record id.","type":"string"},"isActive":{"description":"Whether this image is fed to the generator.","type":"boolean"},"insertedDate":{"description":"When the image was uploaded.","type":"string"},"blobToken":{"description":"Underlying blob token.","type":"string"},"downloadUrl":{"description":"Public URL to display the thumbnail.","type":"string"},"filename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"type":"number"},"contentType":{"type":"string"}}}},"moodPrompt":{"description":"Mood prompt injected into every generation request. Empty when not configured.","type":"string"},"aspectRatio":{"description":"Aspect ratio the generator uses for post thumbnails. One of \"3:2\" (default), \"16:9\", \"4:3\", \"1:1\", \"9:16\".","type":"string"},"hasActive":{"description":"True if at least one reference image is active.","type":"boolean"}},"required":["items","moodPrompt","aspectRatio","hasActive"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","isActive","insertedDate","blobToken","downloadUrl","filename","size","contentType"],"properties":{"id":{"description":"Reference image record id.","type":"string"},"isActive":{"description":"Whether this image is fed to the generator.","type":"boolean"},"insertedDate":{"description":"When the image was uploaded.","type":"string"},"blobToken":{"description":"Underlying blob token.","type":"string"},"downloadUrl":{"description":"Public URL to display the thumbnail.","type":"string"},"filename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"size":{"type":"number"},"contentType":{"type":"string"}}}},"moodPrompt":{"description":"Mood prompt injected into every generation request. Empty when not configured.","type":"string"},"aspectRatio":{"description":"Aspect ratio the generator uses for post thumbnails. One of \"3:2\" (default), \"16:9\", \"4:3\", \"1:1\", \"9:16\".","type":"string"},"hasActive":{"description":"True if at least one reference image is active.","type":"boolean"}},"required":["items","moodPrompt","aspectRatio","hasActive"]}}}}},"operationId":"getBffPostReference-image-list","tags":["Post"],"summary":"List organisation reference images and AI-image generation settings","description":"Returns the org-wide reference image library plus the configured mood prompt and aspect ratio. Used by /settings/posts to render the AI-image management panel and by the per-article gallery view to decide whether the \"Generate image\" button should be enabled."}},"/bff/post/reference-image-link-blob":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"Reference image record id.","type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"Reference image record id.","type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"description":"Reference image record id.","type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffPostReference-image-link-blob","tags":["Post"],"summary":"Link an uploaded blob as a reference image","description":"Registers a previously uploaded blob (token from /bff/blob/upload) as an org-level reference image for the AI thumbnail generator. New reference images are inactive by default; the admin opts each one in explicitly via /reference-image-toggle-active.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token returned by /bff/blob/upload.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token returned by /bff/blob/upload.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token returned by /bff/blob/upload.","type":"string"}}}}}}}},"/bff/post/reference-image-toggle-active":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostReference-image-toggle-active","tags":["Post"],"summary":"Toggle reference image active flag","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Reference image record id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Reference image record id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Reference image record id.","type":"string"}}}}}}}},"/bff/post/reference-image-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostReference-image-delete","tags":["Post"],"summary":"Soft-delete a reference image","description":"Marks the reference image as deleted (deleted_date is set, is_active is forced to false). The underlying blob is not removed; it can still be referenced by past generations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Reference image record id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Reference image record id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Reference image record id.","type":"string"}}}}}}}},"/bff/post/mood-prompt-save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostMood-prompt-save","tags":["Post"],"summary":"Save organisation mood prompt","description":"Persists the mood / style instruction that is injected into every AI image generation request for this organisation. Empty string removes the value (back to model-default behaviour).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"Mood prompt text. Empty string clears the configured value.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"Mood prompt text. Empty string clears the configured value.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"Mood prompt text. Empty string clears the configured value.","type":"string"}}}}}}}},"/bff/post/aspect-ratio-save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostAspect-ratio-save","tags":["Post"],"summary":"Save organisation AI image aspect ratio","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"Aspect ratio, one of \"3:2\", \"16:9\", \"4:3\", \"1:1\", \"9:16\". Empty string clears the config so the generator falls back to its \"3:2\" default.","anyOf":[{"const":"","type":"string"},{"const":"3:2","type":"string"},{"const":"16:9","type":"string"},{"const":"4:3","type":"string"},{"const":"1:1","type":"string"},{"const":"9:16","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"Aspect ratio, one of \"3:2\", \"16:9\", \"4:3\", \"1:1\", \"9:16\". Empty string clears the config so the generator falls back to its \"3:2\" default.","anyOf":[{"const":"","type":"string"},{"const":"3:2","type":"string"},{"const":"16:9","type":"string"},{"const":"4:3","type":"string"},{"const":"1:1","type":"string"},{"const":"9:16","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"Aspect ratio, one of \"3:2\", \"16:9\", \"4:3\", \"1:1\", \"9:16\". Empty string clears the config so the generator falls back to its \"3:2\" default.","anyOf":[{"const":"","type":"string"},{"const":"3:2","type":"string"},{"const":"16:9","type":"string"},{"const":"4:3","type":"string"},{"const":"1:1","type":"string"},{"const":"9:16","type":"string"}]}}}}}}}},"/bff/post/publishing-settings":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"paywallEnabled":{"type":"boolean"},"paywallDefaultParagraphs":{"description":"0 = no default cut.","type":"number"},"paywallOlderThanDays":{"description":"0 = every public article.","type":"number"},"paywallTags":{"description":"Tag codes the default cut is limited to; [] = all.","type":"array","items":{"type":"string"}},"availableTags":{"type":"array","items":{"type":"object","required":["code","label"],"properties":{"code":{"type":"string"},"label":{"type":"string"}}}},"feedDefaultOrder":{"type":"string"}},"required":["paywallEnabled","paywallDefaultParagraphs","paywallOlderThanDays","paywallTags","availableTags","feedDefaultOrder"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"paywallEnabled":{"type":"boolean"},"paywallDefaultParagraphs":{"description":"0 = no default cut.","type":"number"},"paywallOlderThanDays":{"description":"0 = every public article.","type":"number"},"paywallTags":{"description":"Tag codes the default cut is limited to; [] = all.","type":"array","items":{"type":"string"}},"availableTags":{"type":"array","items":{"type":"object","required":["code","label"],"properties":{"code":{"type":"string"},"label":{"type":"string"}}}},"feedDefaultOrder":{"type":"string"}},"required":["paywallEnabled","paywallDefaultParagraphs","paywallOlderThanDays","paywallTags","availableTags","feedDefaultOrder"]}},"text/plain":{"schema":{"type":"object","properties":{"paywallEnabled":{"type":"boolean"},"paywallDefaultParagraphs":{"description":"0 = no default cut.","type":"number"},"paywallOlderThanDays":{"description":"0 = every public article.","type":"number"},"paywallTags":{"description":"Tag codes the default cut is limited to; [] = all.","type":"array","items":{"type":"string"}},"availableTags":{"type":"array","items":{"type":"object","required":["code","label"],"properties":{"code":{"type":"string"},"label":{"type":"string"}}}},"feedDefaultOrder":{"type":"string"}},"required":["paywallEnabled","paywallDefaultParagraphs","paywallOlderThanDays","paywallTags","availableTags","feedDefaultOrder"]}}}}},"operationId":"getBffPostPublishing-settings","tags":["Post"],"summary":"Read article paywall and feed order settings","description":"Effective values of post_paywall_* and post_feed_default_order for /settings/posts."}},"/bff/post/publishing-settings-save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPostPublishing-settings-save","tags":["Post"],"summary":"Save article paywall and feed order settings","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["paywallEnabled","paywallDefaultParagraphs","paywallOlderThanDays","feedDefaultOrder"],"properties":{"paywallEnabled":{"type":"boolean"},"paywallDefaultParagraphs":{"minimum":0,"maximum":100,"type":"number"},"paywallOlderThanDays":{"minimum":0,"maximum":36500,"type":"number"},"paywallTags":{"maxItems":50,"type":"array","items":{"maxLength":128,"type":"string"}},"feedDefaultOrder":{"anyOf":[{"const":"updatedDate:desc","type":"string"},{"const":"publishedDate:desc","type":"string"},{"const":"publishedDate:asc","type":"string"},{"const":"views:desc","type":"string"},{"const":"commentCount:desc","type":"string"},{"const":"title:asc","type":"string"},{"const":"title:desc","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["paywallEnabled","paywallDefaultParagraphs","paywallOlderThanDays","feedDefaultOrder"],"properties":{"paywallEnabled":{"type":"boolean"},"paywallDefaultParagraphs":{"minimum":0,"maximum":100,"type":"number"},"paywallOlderThanDays":{"minimum":0,"maximum":36500,"type":"number"},"paywallTags":{"maxItems":50,"type":"array","items":{"maxLength":128,"type":"string"}},"feedDefaultOrder":{"anyOf":[{"const":"updatedDate:desc","type":"string"},{"const":"publishedDate:desc","type":"string"},{"const":"publishedDate:asc","type":"string"},{"const":"views:desc","type":"string"},{"const":"commentCount:desc","type":"string"},{"const":"title:asc","type":"string"},{"const":"title:desc","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["paywallEnabled","paywallDefaultParagraphs","paywallOlderThanDays","feedDefaultOrder"],"properties":{"paywallEnabled":{"type":"boolean"},"paywallDefaultParagraphs":{"minimum":0,"maximum":100,"type":"number"},"paywallOlderThanDays":{"minimum":0,"maximum":36500,"type":"number"},"paywallTags":{"maxItems":50,"type":"array","items":{"maxLength":128,"type":"string"}},"feedDefaultOrder":{"anyOf":[{"const":"updatedDate:desc","type":"string"},{"const":"publishedDate:desc","type":"string"},{"const":"publishedDate:asc","type":"string"},{"const":"views:desc","type":"string"},{"const":"commentCount:desc","type":"string"},{"const":"title:asc","type":"string"},{"const":"title:desc","type":"string"}]}}}}}}}},"/bff/post/generate-thumbnail":{"post":{"parameters":[],"operationId":"postBffPostGenerate-thumbnail","tags":["Post"],"summary":"AI-generate a thumbnail for a post","description":"Generates a new thumbnail image for the given post using OpenAI gpt-image-1. Inputs to the model: (a) one active reference image from the organisation library, (b) the post title and a short body excerpt in the org primary locale, (c) the organisation name, (d) the optional mood prompt. The generated image is stored in blob storage, linked to the post gallery, and becomes the main image if the post does not have one yet. Token spend is logged against the organisation monthly counter. Synchronous, ~10-30s. Returns 409 when no active reference image exists.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Post external ID.","examples":["a1b2c3d4-e5f6-7890"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/post/git-export":{"get":{"operationId":"getBffPostGit-export","tags":["Post"],"summary":"Export all posts as a Markdown ZIP (Git repo seed)","description":"Streams a ZIP archive containing every non-deleted post of kind \"post\" for the caller organisation, rendered as .md files in a directory tree that mirrors the category hierarchy. Each file carries a YAML frontmatter header (with the stable 16-char post id used to round-trip the file back into the DB), followed by the title as an underlined H1 and the primary-locale Markdown body. Includes README.md, INSTRUCTIONS.md, and .gitignore at the archive root so the resulting folder can be initialised as a Git repository as-is. Only the organisation primary locale is exported; translations to other locales remain in the database and are regenerated on import.","responses":{"200":{}}}},"/bff/post/git-import-defaults":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"repoUrl":{"description":"Last-used GitHub repository URL, or empty string if never imported.","type":"string"},"branch":{"description":"Last-used branch override, or empty string when none was specified.","type":"string"}},"required":["repoUrl","branch"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"repoUrl":{"description":"Last-used GitHub repository URL, or empty string if never imported.","type":"string"},"branch":{"description":"Last-used branch override, or empty string when none was specified.","type":"string"}},"required":["repoUrl","branch"]}},"text/plain":{"schema":{"type":"object","properties":{"repoUrl":{"description":"Last-used GitHub repository URL, or empty string if never imported.","type":"string"},"branch":{"description":"Last-used branch override, or empty string when none was specified.","type":"string"}},"required":["repoUrl","branch"]}}}}},"operationId":"getBffPostGit-import-defaults","tags":["Post"],"summary":"Get last-used repository URL and branch for the git importer","description":"Returns the repoUrl and branch this organisation used for its most recent successful git import, so the import modal can pre-fill its form. Empty strings when the organisation has never imported."}},"/bff/post/git-import":{"post":{"parameters":[],"operationId":"postBffPostGit-import","tags":["Post"],"summary":"Import posts from a public GitHub repository","description":"Downloads the repository tarball, parses every .md file, and upserts them as posts in the caller organisation. Matching key is the frontmatter `id` (`content__post.external_id`) with `code` as a fallback; unmatched files become new posts (visibility defaults to `private`). Files without an H1 title, without a body, or referencing a non-existent category are skipped and reported per-file in the response. The whole import aborts only when two files inside the repo carry the same frontmatter `id`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["repoUrl"],"properties":{"repoUrl":{"description":"Public GitHub repository URL — accepts the plain repo URL, an /tree/{branch} URL, or a `.git` suffix.","examples":["https://github.com/acme/docs","https://github.com/acme/docs/tree/main"],"type":"string"},"branch":{"description":"Branch override. When omitted, the branch parsed from the URL wins, else GitHub default.","examples":["main"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["repoUrl"],"properties":{"repoUrl":{"description":"Public GitHub repository URL — accepts the plain repo URL, an /tree/{branch} URL, or a `.git` suffix.","examples":["https://github.com/acme/docs","https://github.com/acme/docs/tree/main"],"type":"string"},"branch":{"description":"Branch override. When omitted, the branch parsed from the URL wins, else GitHub default.","examples":["main"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["repoUrl"],"properties":{"repoUrl":{"description":"Public GitHub repository URL — accepts the plain repo URL, an /tree/{branch} URL, or a `.git` suffix.","examples":["https://github.com/acme/docs","https://github.com/acme/docs/tree/main"],"type":"string"},"branch":{"description":"Branch override. When omitted, the branch parsed from the URL wins, else GitHub default.","examples":["main"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/post/translation-analytics":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"defaultLocale":{"type":"object","required":["id","code"],"properties":{"id":{"type":"number"},"code":{"description":"Locale code, e.g. \"cs\", \"en\".","type":"string"}}},"enabledLocales":{"type":"array","items":{"type":"object","required":["id","code","isSource"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"isSource":{"description":"True for the org's primary (source) locale — everything is translated FROM this one.","type":"boolean"}}}},"totals":{"type":"object","required":["livePosts","fullyTranslatedPosts","partiallyTranslatedPosts","untranslatedPosts"],"properties":{"livePosts":{"description":"Non-deleted posts of kind=\"post\".","type":"number"},"fullyTranslatedPosts":{"description":"Post has an OK translation in every enabled non-source locale. Single-locale orgs count as fully translated.","type":"number"},"partiallyTranslatedPosts":{"description":"Post has at least one OK translation AND at least one missing / partial locale.","type":"number"},"untranslatedPosts":{"description":"Post has no translation in any non-source locale.","type":"number"}}},"perLocale":{"type":"array","items":{"type":"object","required":["localeId","locale","isSource","postsWithTranslation","postsMissing","postsStale","postsFresh","postsPartialByLength","canonicalRoutes","orphanedRoutes"],"properties":{"localeId":{"type":"number"},"locale":{"type":"string"},"isSource":{"type":"boolean"},"postsWithTranslation":{"description":"Live posts with a content__post_locale row for this locale (any state).","type":"number"},"postsMissing":{"description":"Live posts with no row for this locale. Always 0 for the source locale.","type":"number"},"postsStale":{"description":"Row exists but source_history_id is NULL or points at an older source-history entry. Always 0 for the source locale.","type":"number"},"postsFresh":{"description":"Row exists and source_history_id matches the newest source-history entry. Legacy posts without any source history also count here.","type":"number"},"postsPartialByLength":{"description":"Row exists but plain-text content < 30 % of source (source ≥ 200 plain chars). Diagnostic — overlaps with fresh / stale, does not double-count.","type":"number"},"canonicalRoutes":{"description":"Number of canonical article routes in core__route for this locale.","type":"number"},"orphanedRoutes":{"description":"Canonical routes whose referenced post no longer has a content__post_locale row in this locale.","type":"number"}}}},"historyCoverage":{"type":"object","required":["postsWithHistory","postsWithoutHistory","avgHistoryEntriesPerPost"],"properties":{"postsWithHistory":{"description":"Live posts with at least one content__post_history entry in any locale.","type":"number"},"postsWithoutHistory":{"description":"Live posts predating the content__post_history table — stale detection cannot fire for these, admin should trigger auto-translate once to seed a snapshot.","type":"number"},"avgHistoryEntriesPerPost":{"description":"Average number of history entries per post that has any, across all locales.","type":"number"}}}},"required":["defaultLocale","enabledLocales","totals","perLocale","historyCoverage"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"defaultLocale":{"type":"object","required":["id","code"],"properties":{"id":{"type":"number"},"code":{"description":"Locale code, e.g. \"cs\", \"en\".","type":"string"}}},"enabledLocales":{"type":"array","items":{"type":"object","required":["id","code","isSource"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"isSource":{"description":"True for the org's primary (source) locale — everything is translated FROM this one.","type":"boolean"}}}},"totals":{"type":"object","required":["livePosts","fullyTranslatedPosts","partiallyTranslatedPosts","untranslatedPosts"],"properties":{"livePosts":{"description":"Non-deleted posts of kind=\"post\".","type":"number"},"fullyTranslatedPosts":{"description":"Post has an OK translation in every enabled non-source locale. Single-locale orgs count as fully translated.","type":"number"},"partiallyTranslatedPosts":{"description":"Post has at least one OK translation AND at least one missing / partial locale.","type":"number"},"untranslatedPosts":{"description":"Post has no translation in any non-source locale.","type":"number"}}},"perLocale":{"type":"array","items":{"type":"object","required":["localeId","locale","isSource","postsWithTranslation","postsMissing","postsStale","postsFresh","postsPartialByLength","canonicalRoutes","orphanedRoutes"],"properties":{"localeId":{"type":"number"},"locale":{"type":"string"},"isSource":{"type":"boolean"},"postsWithTranslation":{"description":"Live posts with a content__post_locale row for this locale (any state).","type":"number"},"postsMissing":{"description":"Live posts with no row for this locale. Always 0 for the source locale.","type":"number"},"postsStale":{"description":"Row exists but source_history_id is NULL or points at an older source-history entry. Always 0 for the source locale.","type":"number"},"postsFresh":{"description":"Row exists and source_history_id matches the newest source-history entry. Legacy posts without any source history also count here.","type":"number"},"postsPartialByLength":{"description":"Row exists but plain-text content < 30 % of source (source ≥ 200 plain chars). Diagnostic — overlaps with fresh / stale, does not double-count.","type":"number"},"canonicalRoutes":{"description":"Number of canonical article routes in core__route for this locale.","type":"number"},"orphanedRoutes":{"description":"Canonical routes whose referenced post no longer has a content__post_locale row in this locale.","type":"number"}}}},"historyCoverage":{"type":"object","required":["postsWithHistory","postsWithoutHistory","avgHistoryEntriesPerPost"],"properties":{"postsWithHistory":{"description":"Live posts with at least one content__post_history entry in any locale.","type":"number"},"postsWithoutHistory":{"description":"Live posts predating the content__post_history table — stale detection cannot fire for these, admin should trigger auto-translate once to seed a snapshot.","type":"number"},"avgHistoryEntriesPerPost":{"description":"Average number of history entries per post that has any, across all locales.","type":"number"}}}},"required":["defaultLocale","enabledLocales","totals","perLocale","historyCoverage"]}},"text/plain":{"schema":{"type":"object","properties":{"defaultLocale":{"type":"object","required":["id","code"],"properties":{"id":{"type":"number"},"code":{"description":"Locale code, e.g. \"cs\", \"en\".","type":"string"}}},"enabledLocales":{"type":"array","items":{"type":"object","required":["id","code","isSource"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"isSource":{"description":"True for the org's primary (source) locale — everything is translated FROM this one.","type":"boolean"}}}},"totals":{"type":"object","required":["livePosts","fullyTranslatedPosts","partiallyTranslatedPosts","untranslatedPosts"],"properties":{"livePosts":{"description":"Non-deleted posts of kind=\"post\".","type":"number"},"fullyTranslatedPosts":{"description":"Post has an OK translation in every enabled non-source locale. Single-locale orgs count as fully translated.","type":"number"},"partiallyTranslatedPosts":{"description":"Post has at least one OK translation AND at least one missing / partial locale.","type":"number"},"untranslatedPosts":{"description":"Post has no translation in any non-source locale.","type":"number"}}},"perLocale":{"type":"array","items":{"type":"object","required":["localeId","locale","isSource","postsWithTranslation","postsMissing","postsStale","postsFresh","postsPartialByLength","canonicalRoutes","orphanedRoutes"],"properties":{"localeId":{"type":"number"},"locale":{"type":"string"},"isSource":{"type":"boolean"},"postsWithTranslation":{"description":"Live posts with a content__post_locale row for this locale (any state).","type":"number"},"postsMissing":{"description":"Live posts with no row for this locale. Always 0 for the source locale.","type":"number"},"postsStale":{"description":"Row exists but source_history_id is NULL or points at an older source-history entry. Always 0 for the source locale.","type":"number"},"postsFresh":{"description":"Row exists and source_history_id matches the newest source-history entry. Legacy posts without any source history also count here.","type":"number"},"postsPartialByLength":{"description":"Row exists but plain-text content < 30 % of source (source ≥ 200 plain chars). Diagnostic — overlaps with fresh / stale, does not double-count.","type":"number"},"canonicalRoutes":{"description":"Number of canonical article routes in core__route for this locale.","type":"number"},"orphanedRoutes":{"description":"Canonical routes whose referenced post no longer has a content__post_locale row in this locale.","type":"number"}}}},"historyCoverage":{"type":"object","required":["postsWithHistory","postsWithoutHistory","avgHistoryEntriesPerPost"],"properties":{"postsWithHistory":{"description":"Live posts with at least one content__post_history entry in any locale.","type":"number"},"postsWithoutHistory":{"description":"Live posts predating the content__post_history table — stale detection cannot fire for these, admin should trigger auto-translate once to seed a snapshot.","type":"number"},"avgHistoryEntriesPerPost":{"description":"Average number of history entries per post that has any, across all locales.","type":"number"}}}},"required":["defaultLocale","enabledLocales","totals","perLocale","historyCoverage"]}}}}},"operationId":"getBffPostTranslation-analytics","tags":["Post"],"summary":"Translation analytics for the /post admin dashboard","description":"Aggregated counters powering the \"Překlady\" tab: default locale, enabled locales, live-post total, per-locale coverage (fresh vs. stale vs. missing vs. partial-by-length), canonical-route counts + orphaned-route indicator, and history coverage. `stale` uses the `content__post_locale.source_history_id` → `content__post_history.id` invariant introduced alongside the auto-translate refresh flow. Partial-by-length mirrors the terminal `post list` heuristic (source ≥ 200 plain chars, target < 30 %). Purely read-only."}},"/bff/post/statistics":{"get":{"operationId":"getBffPostStatistics","tags":["Post"],"summary":"Compact post readership statistics for the /post list chart","description":"Powers the activity dashboard above the /post DataGrid. Returns a 30-day tail with three parallel per-day series (reads / posts published / comments received), 30-day medians for each metric (\"typical day this month\" baseline rendered as a dashed reference line on the chart), best-day markers, Pearson correlations between every pair (feeds the click-through correlation modal), plus the legacy 7d trend chips (views + posts) and the all-time cumulative KPIs. Daily reads are per-post view deltas, not the cumulative counter, so the chart honestly shows \"was today better than yesterday?\" rather than a monotonic climb.","responses":{"200":{}}}},"/bff/post/analytics":{"get":{"parameters":[{"description":"Rolling window for KPIs, top posts, trending, category readership and viewsOverTime. Publication cadence + freshness always cover 12 months / all live posts respectively.","schema":{"default":"30d","anyOf":[{"const":"30d","type":"string"},{"const":"90d","type":"string"},{"const":"365d","type":"string"}]},"in":"query","name":"period","required":false},{"description":"Aggregation step for the viewsOverTime, publication and comment timeseries. Default `week` reads well for 30d/90d; switch to `month` for 365d.","schema":{"default":"week","anyOf":[{"const":"week","type":"string"},{"const":"month","type":"string"}]},"in":"query","name":"bucket","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"anyOf":[{"const":"30d","type":"string"},{"const":"90d","type":"string"},{"const":"365d","type":"string"}]},"bucket":{"anyOf":[{"const":"week","type":"string"},{"const":"month","type":"string"}]},"generatedAt":{"description":"ISO timestamp of when the snapshot was computed (useful for a \"poslední aktualizace\" badge).","type":"string"},"kpis":{"type":"object","required":["totalViews","publishedPosts","livePosts","avgRating","newComments","starPosts"],"properties":{"totalViews":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"description":"Percentage change vs. previous window of equal length. `null` when the previous window was empty and the current one isn't (no meaningful % — UI renders a \"new\" badge). `0` when both windows are empty.","anyOf":[{"type":"number"},{"type":"null"}]}}},"publishedPosts":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"livePosts":{"type":"object","required":["value"],"properties":{"value":{"type":"number"}}},"avgRating":{"type":"object","required":["value","count"],"properties":{"value":{"description":"Mean feedback score (1..5). 0 when no feedback rows exist.","type":"number"},"count":{"type":"number"}}},"newComments":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"starPosts":{"type":"object","required":["value"],"properties":{"value":{"type":"number"}}}}},"viewsOverTime":{"type":"array","items":{"type":"object","required":["bucket","views","publishedCount","commentCount"],"properties":{"bucket":{"description":"Bucket anchor date in ISO YYYY-MM-DD (start of week or month).","type":"string"},"views":{"type":"number"},"publishedCount":{"type":"number"},"commentCount":{"type":"number"}}}},"topPosts":{"type":"array","items":{"type":"object","required":["externalId","title","categoryName","viewsPeriod","viewsTotal","ratingAvg","ratingCount","commentsCount","trend","isStar"],"properties":{"externalId":{"description":"16-char external post id (wire identifier). Internal bigserial is never exposed.","type":"string"},"title":{"type":"string"},"categoryName":{"anyOf":[{"type":"string"},{"type":"null"}]},"viewsPeriod":{"type":"number"},"viewsTotal":{"type":"number"},"ratingAvg":{"anyOf":[{"type":"number"},{"type":"null"}]},"ratingCount":{"type":"number"},"commentsCount":{"type":"number"},"trend":{"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"const":"flat","type":"string"}]},"isStar":{"type":"boolean"}}}},"trendingPosts":{"type":"array","items":{"type":"object","required":["externalId","title","viewsRecent","viewsPrior","deltaPercent"],"properties":{"externalId":{"type":"string"},"title":{"type":"string"},"viewsRecent":{"type":"number"},"viewsPrior":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"categoryOccupancy":{"type":"array","items":{"type":"object","required":["externalId","name","postCount","avgViewsPerPost"],"properties":{"externalId":{"description":"16-char external category id (wire identifier).","type":"string"},"name":{"type":"string"},"postCount":{"type":"number"},"avgViewsPerPost":{"description":"Average of `content__post.views_count` across posts in this category (cumulative).","type":"number"}}}},"categoryReadership":{"type":"array","items":{"type":"object","required":["externalId","name","viewsPeriod","share"],"properties":{"externalId":{"description":"16-char external category id, or `null` for posts without a category.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"viewsPeriod":{"type":"number"},"share":{"description":"Percentage share of category views out of the top-15 total (0..100).","type":"number"}}}},"publicationCadence":{"type":"array","items":{"type":"object","required":["month","publishedCount"],"properties":{"month":{"description":"YYYY-MM anchor for the month bucket.","type":"string"},"publishedCount":{"type":"number"}}}},"ratingDistribution":{"type":"array","items":{"type":"object","required":["score","count"],"properties":{"score":{"description":"Integer feedback score 1..5.","type":"number"},"count":{"type":"number"}}}},"tagPopularity":{"type":"array","items":{"type":"object","required":["code","label","color","postCount"],"properties":{"code":{"description":"Organisation-scoped tag code (wire identifier — content__tag has no external_id column).","type":"string"},"label":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"postCount":{"type":"number"}}}},"authorLeaderboard":{"type":"array","items":{"type":"object","required":["externalId","name","postCount","viewsPeriod"],"properties":{"externalId":{"description":"16-char external shop__contact id (wire identifier).","type":"string"},"name":{"type":"string"},"postCount":{"type":"number"},"viewsPeriod":{"type":"number"}}}},"visibilityBreakdown":{"type":"array","items":{"type":"object","required":["visibility","count"],"properties":{"visibility":{"anyOf":[{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"archived","type":"string"}]},"count":{"type":"number"}}}},"freshness":{"type":"object","required":["updatedLast30d","staleOver180d","medianAgeDays"],"properties":{"updatedLast30d":{"type":"number"},"staleOver180d":{"type":"number"},"medianAgeDays":{"type":"number"}}}},"required":["period","bucket","generatedAt","kpis","viewsOverTime","topPosts","trendingPosts","categoryOccupancy","categoryReadership","publicationCadence","ratingDistribution","tagPopularity","authorLeaderboard","visibilityBreakdown","freshness"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"period":{"anyOf":[{"const":"30d","type":"string"},{"const":"90d","type":"string"},{"const":"365d","type":"string"}]},"bucket":{"anyOf":[{"const":"week","type":"string"},{"const":"month","type":"string"}]},"generatedAt":{"description":"ISO timestamp of when the snapshot was computed (useful for a \"poslední aktualizace\" badge).","type":"string"},"kpis":{"type":"object","required":["totalViews","publishedPosts","livePosts","avgRating","newComments","starPosts"],"properties":{"totalViews":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"description":"Percentage change vs. previous window of equal length. `null` when the previous window was empty and the current one isn't (no meaningful % — UI renders a \"new\" badge). `0` when both windows are empty.","anyOf":[{"type":"number"},{"type":"null"}]}}},"publishedPosts":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"livePosts":{"type":"object","required":["value"],"properties":{"value":{"type":"number"}}},"avgRating":{"type":"object","required":["value","count"],"properties":{"value":{"description":"Mean feedback score (1..5). 0 when no feedback rows exist.","type":"number"},"count":{"type":"number"}}},"newComments":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"starPosts":{"type":"object","required":["value"],"properties":{"value":{"type":"number"}}}}},"viewsOverTime":{"type":"array","items":{"type":"object","required":["bucket","views","publishedCount","commentCount"],"properties":{"bucket":{"description":"Bucket anchor date in ISO YYYY-MM-DD (start of week or month).","type":"string"},"views":{"type":"number"},"publishedCount":{"type":"number"},"commentCount":{"type":"number"}}}},"topPosts":{"type":"array","items":{"type":"object","required":["externalId","title","categoryName","viewsPeriod","viewsTotal","ratingAvg","ratingCount","commentsCount","trend","isStar"],"properties":{"externalId":{"description":"16-char external post id (wire identifier). Internal bigserial is never exposed.","type":"string"},"title":{"type":"string"},"categoryName":{"anyOf":[{"type":"string"},{"type":"null"}]},"viewsPeriod":{"type":"number"},"viewsTotal":{"type":"number"},"ratingAvg":{"anyOf":[{"type":"number"},{"type":"null"}]},"ratingCount":{"type":"number"},"commentsCount":{"type":"number"},"trend":{"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"const":"flat","type":"string"}]},"isStar":{"type":"boolean"}}}},"trendingPosts":{"type":"array","items":{"type":"object","required":["externalId","title","viewsRecent","viewsPrior","deltaPercent"],"properties":{"externalId":{"type":"string"},"title":{"type":"string"},"viewsRecent":{"type":"number"},"viewsPrior":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"categoryOccupancy":{"type":"array","items":{"type":"object","required":["externalId","name","postCount","avgViewsPerPost"],"properties":{"externalId":{"description":"16-char external category id (wire identifier).","type":"string"},"name":{"type":"string"},"postCount":{"type":"number"},"avgViewsPerPost":{"description":"Average of `content__post.views_count` across posts in this category (cumulative).","type":"number"}}}},"categoryReadership":{"type":"array","items":{"type":"object","required":["externalId","name","viewsPeriod","share"],"properties":{"externalId":{"description":"16-char external category id, or `null` for posts without a category.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"viewsPeriod":{"type":"number"},"share":{"description":"Percentage share of category views out of the top-15 total (0..100).","type":"number"}}}},"publicationCadence":{"type":"array","items":{"type":"object","required":["month","publishedCount"],"properties":{"month":{"description":"YYYY-MM anchor for the month bucket.","type":"string"},"publishedCount":{"type":"number"}}}},"ratingDistribution":{"type":"array","items":{"type":"object","required":["score","count"],"properties":{"score":{"description":"Integer feedback score 1..5.","type":"number"},"count":{"type":"number"}}}},"tagPopularity":{"type":"array","items":{"type":"object","required":["code","label","color","postCount"],"properties":{"code":{"description":"Organisation-scoped tag code (wire identifier — content__tag has no external_id column).","type":"string"},"label":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"postCount":{"type":"number"}}}},"authorLeaderboard":{"type":"array","items":{"type":"object","required":["externalId","name","postCount","viewsPeriod"],"properties":{"externalId":{"description":"16-char external shop__contact id (wire identifier).","type":"string"},"name":{"type":"string"},"postCount":{"type":"number"},"viewsPeriod":{"type":"number"}}}},"visibilityBreakdown":{"type":"array","items":{"type":"object","required":["visibility","count"],"properties":{"visibility":{"anyOf":[{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"archived","type":"string"}]},"count":{"type":"number"}}}},"freshness":{"type":"object","required":["updatedLast30d","staleOver180d","medianAgeDays"],"properties":{"updatedLast30d":{"type":"number"},"staleOver180d":{"type":"number"},"medianAgeDays":{"type":"number"}}}},"required":["period","bucket","generatedAt","kpis","viewsOverTime","topPosts","trendingPosts","categoryOccupancy","categoryReadership","publicationCadence","ratingDistribution","tagPopularity","authorLeaderboard","visibilityBreakdown","freshness"]}},"text/plain":{"schema":{"type":"object","properties":{"period":{"anyOf":[{"const":"30d","type":"string"},{"const":"90d","type":"string"},{"const":"365d","type":"string"}]},"bucket":{"anyOf":[{"const":"week","type":"string"},{"const":"month","type":"string"}]},"generatedAt":{"description":"ISO timestamp of when the snapshot was computed (useful for a \"poslední aktualizace\" badge).","type":"string"},"kpis":{"type":"object","required":["totalViews","publishedPosts","livePosts","avgRating","newComments","starPosts"],"properties":{"totalViews":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"description":"Percentage change vs. previous window of equal length. `null` when the previous window was empty and the current one isn't (no meaningful % — UI renders a \"new\" badge). `0` when both windows are empty.","anyOf":[{"type":"number"},{"type":"null"}]}}},"publishedPosts":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"livePosts":{"type":"object","required":["value"],"properties":{"value":{"type":"number"}}},"avgRating":{"type":"object","required":["value","count"],"properties":{"value":{"description":"Mean feedback score (1..5). 0 when no feedback rows exist.","type":"number"},"count":{"type":"number"}}},"newComments":{"type":"object","required":["value","previousValue","deltaPercent"],"properties":{"value":{"type":"number"},"previousValue":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"starPosts":{"type":"object","required":["value"],"properties":{"value":{"type":"number"}}}}},"viewsOverTime":{"type":"array","items":{"type":"object","required":["bucket","views","publishedCount","commentCount"],"properties":{"bucket":{"description":"Bucket anchor date in ISO YYYY-MM-DD (start of week or month).","type":"string"},"views":{"type":"number"},"publishedCount":{"type":"number"},"commentCount":{"type":"number"}}}},"topPosts":{"type":"array","items":{"type":"object","required":["externalId","title","categoryName","viewsPeriod","viewsTotal","ratingAvg","ratingCount","commentsCount","trend","isStar"],"properties":{"externalId":{"description":"16-char external post id (wire identifier). Internal bigserial is never exposed.","type":"string"},"title":{"type":"string"},"categoryName":{"anyOf":[{"type":"string"},{"type":"null"}]},"viewsPeriod":{"type":"number"},"viewsTotal":{"type":"number"},"ratingAvg":{"anyOf":[{"type":"number"},{"type":"null"}]},"ratingCount":{"type":"number"},"commentsCount":{"type":"number"},"trend":{"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"const":"flat","type":"string"}]},"isStar":{"type":"boolean"}}}},"trendingPosts":{"type":"array","items":{"type":"object","required":["externalId","title","viewsRecent","viewsPrior","deltaPercent"],"properties":{"externalId":{"type":"string"},"title":{"type":"string"},"viewsRecent":{"type":"number"},"viewsPrior":{"type":"number"},"deltaPercent":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"categoryOccupancy":{"type":"array","items":{"type":"object","required":["externalId","name","postCount","avgViewsPerPost"],"properties":{"externalId":{"description":"16-char external category id (wire identifier).","type":"string"},"name":{"type":"string"},"postCount":{"type":"number"},"avgViewsPerPost":{"description":"Average of `content__post.views_count` across posts in this category (cumulative).","type":"number"}}}},"categoryReadership":{"type":"array","items":{"type":"object","required":["externalId","name","viewsPeriod","share"],"properties":{"externalId":{"description":"16-char external category id, or `null` for posts without a category.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"viewsPeriod":{"type":"number"},"share":{"description":"Percentage share of category views out of the top-15 total (0..100).","type":"number"}}}},"publicationCadence":{"type":"array","items":{"type":"object","required":["month","publishedCount"],"properties":{"month":{"description":"YYYY-MM anchor for the month bucket.","type":"string"},"publishedCount":{"type":"number"}}}},"ratingDistribution":{"type":"array","items":{"type":"object","required":["score","count"],"properties":{"score":{"description":"Integer feedback score 1..5.","type":"number"},"count":{"type":"number"}}}},"tagPopularity":{"type":"array","items":{"type":"object","required":["code","label","color","postCount"],"properties":{"code":{"description":"Organisation-scoped tag code (wire identifier — content__tag has no external_id column).","type":"string"},"label":{"type":"string"},"color":{"anyOf":[{"type":"string"},{"type":"null"}]},"postCount":{"type":"number"}}}},"authorLeaderboard":{"type":"array","items":{"type":"object","required":["externalId","name","postCount","viewsPeriod"],"properties":{"externalId":{"description":"16-char external shop__contact id (wire identifier).","type":"string"},"name":{"type":"string"},"postCount":{"type":"number"},"viewsPeriod":{"type":"number"}}}},"visibilityBreakdown":{"type":"array","items":{"type":"object","required":["visibility","count"],"properties":{"visibility":{"anyOf":[{"const":"published","type":"string"},{"const":"private","type":"string"},{"const":"draft","type":"string"},{"const":"scheduled","type":"string"},{"const":"archived","type":"string"}]},"count":{"type":"number"}}}},"freshness":{"type":"object","required":["updatedLast30d","staleOver180d","medianAgeDays"],"properties":{"updatedLast30d":{"type":"number"},"staleOver180d":{"type":"number"},"medianAgeDays":{"type":"number"}}}},"required":["period","bucket","generatedAt","kpis","viewsOverTime","topPosts","trendingPosts","categoryOccupancy","categoryReadership","publicationCadence","ratingDistribution","tagPopularity","authorLeaderboard","visibilityBreakdown","freshness"]}}}}},"operationId":"getBffPostAnalytics","tags":["Post"],"summary":"Post analytics dashboard for the /post admin \"Analytika\" tab","description":"Aggregated read-only counters powering the Analytika tab: KPIs with period-over-period delta (views, published, comments), views/publications/comments timeseries bucketised by week or month, top posts + trending (biggest half-period growth), category occupancy + readership, publication cadence (12 months), rating histogram, tag popularity, author leaderboard, visibility breakdown and content freshness. \"Views in period\" is computed as the incremental delta of content__post_view_history (LAG per post_id) so we count only traffic during the window, not the cumulative all-time counter. Scoped to kind=\"post\" so branch documents never appear."}},"/bff/post/locales":{"get":{"parameters":[{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"postId":{"description":"Echoed external ID of the post.","type":"string"},"primaryLocale":{"description":"Organisation default locale (ISO 639-1). Every stale check compares translations against this.","type":"string"},"locales":{"type":"array","items":{"type":"object","required":["locale","isPrimary","inOrganisation","exists","hasContent","isStale","lastEditedAt"],"properties":{"locale":{"description":"ISO 639-1 code.","type":"string"},"isPrimary":{"description":"True for the organisation default locale — always emitted first.","type":"boolean"},"inOrganisation":{"description":"True when the locale is enabled via cas__organisation_locale. False = orphan translation.","type":"boolean"},"exists":{"description":"True when a content__post_locale row exists.","type":"boolean"},"hasContent":{"description":"True when the locale row has non-empty title AND content (after trim).","type":"boolean"},"isStale":{"description":"True when the non-primary translation was generated from an older source-locale history entry than the current one. Always false for the primary locale.","type":"boolean"},"lastEditedAt":{"nullable":true,"anyOf":[{"description":"Most recent content__post_history row for this locale.","anyOf":[{"description":"Most recent content__post_history row for this locale.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}}},"required":["postId","primaryLocale","locales"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"postId":{"description":"Echoed external ID of the post.","type":"string"},"primaryLocale":{"description":"Organisation default locale (ISO 639-1). Every stale check compares translations against this.","type":"string"},"locales":{"type":"array","items":{"type":"object","required":["locale","isPrimary","inOrganisation","exists","hasContent","isStale","lastEditedAt"],"properties":{"locale":{"description":"ISO 639-1 code.","type":"string"},"isPrimary":{"description":"True for the organisation default locale — always emitted first.","type":"boolean"},"inOrganisation":{"description":"True when the locale is enabled via cas__organisation_locale. False = orphan translation.","type":"boolean"},"exists":{"description":"True when a content__post_locale row exists.","type":"boolean"},"hasContent":{"description":"True when the locale row has non-empty title AND content (after trim).","type":"boolean"},"isStale":{"description":"True when the non-primary translation was generated from an older source-locale history entry than the current one. Always false for the primary locale.","type":"boolean"},"lastEditedAt":{"nullable":true,"anyOf":[{"description":"Most recent content__post_history row for this locale.","anyOf":[{"description":"Most recent content__post_history row for this locale.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}}},"required":["postId","primaryLocale","locales"]}},"text/plain":{"schema":{"type":"object","properties":{"postId":{"description":"Echoed external ID of the post.","type":"string"},"primaryLocale":{"description":"Organisation default locale (ISO 639-1). Every stale check compares translations against this.","type":"string"},"locales":{"type":"array","items":{"type":"object","required":["locale","isPrimary","inOrganisation","exists","hasContent","isStale","lastEditedAt"],"properties":{"locale":{"description":"ISO 639-1 code.","type":"string"},"isPrimary":{"description":"True for the organisation default locale — always emitted first.","type":"boolean"},"inOrganisation":{"description":"True when the locale is enabled via cas__organisation_locale. False = orphan translation.","type":"boolean"},"exists":{"description":"True when a content__post_locale row exists.","type":"boolean"},"hasContent":{"description":"True when the locale row has non-empty title AND content (after trim).","type":"boolean"},"isStale":{"description":"True when the non-primary translation was generated from an older source-locale history entry than the current one. Always false for the primary locale.","type":"boolean"},"lastEditedAt":{"nullable":true,"anyOf":[{"description":"Most recent content__post_history row for this locale.","anyOf":[{"description":"Most recent content__post_history row for this locale.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]}}}}},"required":["postId","primaryLocale","locales"]}}}}},"operationId":"getBffPostLocales","tags":["Post"],"summary":"Get post locale states","description":"Returns the per-locale state matrix for the post: primary locale, every organisation locale (existence / staleness / last-edited timestamp), and any orphan locales that have a content__post_locale row but are no longer enabled for the organisation. Powers the locale strip in the admin post detail."}},"/bff/post/locale-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"description":"The locale that was created.","type":"string"},"mode":{"anyOf":[{"const":"empty","type":"string"},{"const":"copy-from-source","type":"string"},{"const":"ai-translate","type":"string"}]},"routeCreated":{"description":"True when a canonical route was added; false when one already existed.","type":"boolean"}},"required":["success","locale","mode","routeCreated"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"description":"The locale that was created.","type":"string"},"mode":{"anyOf":[{"const":"empty","type":"string"},{"const":"copy-from-source","type":"string"},{"const":"ai-translate","type":"string"}]},"routeCreated":{"description":"True when a canonical route was added; false when one already existed.","type":"boolean"}},"required":["success","locale","mode","routeCreated"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"description":"The locale that was created.","type":"string"},"mode":{"anyOf":[{"const":"empty","type":"string"},{"const":"copy-from-source","type":"string"},{"const":"ai-translate","type":"string"}]},"routeCreated":{"description":"True when a canonical route was added; false when one already existed.","type":"boolean"}},"required":["success","locale","mode","routeCreated"]}}}}},"operationId":"postBffPostLocale-create","tags":["Post"],"summary":"Create translation for a post locale","description":"Adds a content__post_locale row for a target locale on an existing post. Refuses when the locale is not enabled for the organisation or a translation already exists. Also ensures a canonical core__route row for the new locale so the translation is reachable.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","locale","mode"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Target locale code (ISO 639-1). Must be enabled for the organisation.","examples":["cs","de"],"type":"string"},"mode":{"description":"empty = placeholder row, editor fills in; copy-from-source = verbatim copy of the primary locale text (no translation model); ai-translate = translated via translatePostTexts() with Markdown/HTML preservation.","anyOf":[{"const":"empty","type":"string"},{"const":"copy-from-source","type":"string"},{"const":"ai-translate","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","locale","mode"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Target locale code (ISO 639-1). Must be enabled for the organisation.","examples":["cs","de"],"type":"string"},"mode":{"description":"empty = placeholder row, editor fills in; copy-from-source = verbatim copy of the primary locale text (no translation model); ai-translate = translated via translatePostTexts() with Markdown/HTML preservation.","anyOf":[{"const":"empty","type":"string"},{"const":"copy-from-source","type":"string"},{"const":"ai-translate","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["postId","locale","mode"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Target locale code (ISO 639-1). Must be enabled for the organisation.","examples":["cs","de"],"type":"string"},"mode":{"description":"empty = placeholder row, editor fills in; copy-from-source = verbatim copy of the primary locale text (no translation model); ai-translate = translated via translatePostTexts() with Markdown/HTML preservation.","anyOf":[{"const":"empty","type":"string"},{"const":"copy-from-source","type":"string"},{"const":"ai-translate","type":"string"}]}}}}}}}},"/bff/post/locale-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"type":"string"},"deletedHistoryRows":{"description":"Number of content__post_history rows removed.","type":"number"},"deletedRoutes":{"description":"Number of canonical core__route rows removed.","type":"number"}},"required":["success","locale","deletedHistoryRows","deletedRoutes"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"type":"string"},"deletedHistoryRows":{"description":"Number of content__post_history rows removed.","type":"number"},"deletedRoutes":{"description":"Number of canonical core__route rows removed.","type":"number"}},"required":["success","locale","deletedHistoryRows","deletedRoutes"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"type":"string"},"deletedHistoryRows":{"description":"Number of content__post_history rows removed.","type":"number"},"deletedRoutes":{"description":"Number of canonical core__route rows removed.","type":"number"}},"required":["success","locale","deletedHistoryRows","deletedRoutes"]}}}}},"operationId":"postBffPostLocale-delete","tags":["Post"],"summary":"Delete a post locale","description":"Removes the content__post_locale row plus every per-locale history entry and canonical route in a single transaction. Refuses on the organisation primary locale — every post must retain its source translation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Locale to delete.","examples":["de"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Locale to delete.","examples":["de"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Locale to delete.","examples":["de"],"type":"string"}}}}}}}},"/bff/post/locale-mark-up-to-date":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"type":"string"},"pinnedToHistoryId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"wasStale":{"description":"True when the locale was actually stale before this call.","type":"boolean"}},"required":["success","locale","pinnedToHistoryId","wasStale"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"type":"string"},"pinnedToHistoryId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"wasStale":{"description":"True when the locale was actually stale before this call.","type":"boolean"}},"required":["success","locale","pinnedToHistoryId","wasStale"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"locale":{"type":"string"},"pinnedToHistoryId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"wasStale":{"description":"True when the locale was actually stale before this call.","type":"boolean"}},"required":["success","locale","pinnedToHistoryId","wasStale"]}}}}},"operationId":"postBffPostLocale-mark-up-to-date","tags":["Post"],"summary":"Mark a post locale as up-to-date","description":"Re-anchors content__post_locale.source_history_id to the current newest source-locale history entry — signalling the translation content is a correct rendering of the current source version. The translation text itself is not modified. Refuses on the primary locale (nothing to pin) and when the source has no history yet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Locale to mark as up-to-date.","examples":["de"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Locale to mark as up-to-date.","examples":["de"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["postId","locale"],"properties":{"postId":{"description":"Post external ID.","examples":["aBcDeFgH12345678"],"type":"string"},"locale":{"description":"Locale to mark as up-to-date.","examples":["de"],"type":"string"}}}}}}}},"/bff/post-category/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Filter by main category code.","examples":["blog"],"schema":{"type":"string"},"in":"query","name":"mainCategoryCode","required":false}],"responses":{"200":{"description":"Paginated list of post categories.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of category items matching the query criteria.","type":"array","items":{"description":"Single category item in the list.","type":"object","required":["id","title","insertedDate","active","postCount"],"properties":{"id":{"description":"Category external ID (16-char unique identifier).","examples":["abc123def456ghij"],"type":"string"},"parentId":{"description":"External ID of the parent category. Omitted for top-level categories.","examples":["abc123def456ghij"],"type":"string"},"title":{"description":"Localized category name, truncated to 140 characters for list view.","examples":["Tech News"],"type":"string"},"insertedDate":{"description":"Date when the category was created.","anyOf":[{"description":"Date when the category was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the category is currently active.","examples":[true],"type":"boolean"},"postCount":{"description":"Total number of posts in this category and all its descendant categories (recursive count).","examples":[42],"type":"number"}}}},"itemCount":{"description":"Total number of categories matching the query (before pagination).","examples":[15],"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of category items matching the query criteria.","type":"array","items":{"description":"Single category item in the list.","type":"object","required":["id","title","insertedDate","active","postCount"],"properties":{"id":{"description":"Category external ID (16-char unique identifier).","examples":["abc123def456ghij"],"type":"string"},"parentId":{"description":"External ID of the parent category. Omitted for top-level categories.","examples":["abc123def456ghij"],"type":"string"},"title":{"description":"Localized category name, truncated to 140 characters for list view.","examples":["Tech News"],"type":"string"},"insertedDate":{"description":"Date when the category was created.","anyOf":[{"description":"Date when the category was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the category is currently active.","examples":[true],"type":"boolean"},"postCount":{"description":"Total number of posts in this category and all its descendant categories (recursive count).","examples":[42],"type":"number"}}}},"itemCount":{"description":"Total number of categories matching the query (before pagination).","examples":[15],"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of category items matching the query criteria.","type":"array","items":{"description":"Single category item in the list.","type":"object","required":["id","title","insertedDate","active","postCount"],"properties":{"id":{"description":"Category external ID (16-char unique identifier).","examples":["abc123def456ghij"],"type":"string"},"parentId":{"description":"External ID of the parent category. Omitted for top-level categories.","examples":["abc123def456ghij"],"type":"string"},"title":{"description":"Localized category name, truncated to 140 characters for list view.","examples":["Tech News"],"type":"string"},"insertedDate":{"description":"Date when the category was created.","anyOf":[{"description":"Date when the category was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"active":{"description":"Whether the category is currently active.","examples":[true],"type":"boolean"},"postCount":{"description":"Total number of posts in this category and all its descendant categories (recursive count).","examples":[42],"type":"number"}}}},"itemCount":{"description":"Total number of categories matching the query (before pagination).","examples":[15],"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPost-categoryList","tags":["Post Category"],"summary":"List all post categories","description":"Returns a paginated list of all post categories for the organisation. Supports data grid query parameters for filtering and pagination."}},"/bff/post-category/list-selector":{"get":{"parameters":[{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":true}],"responses":{"200":{"description":"Simplified category list for selector components.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of active categories with localized labels.","type":"array","items":{"description":"Category option for selectbox/dropdown.","type":"object","required":["id","label"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"label":{"description":"Localized category name suitable for display in a selectbox.","examples":["Tech News"],"type":"string"}}}},"itemCount":{"description":"Total number of active categories.","examples":[8],"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of active categories with localized labels.","type":"array","items":{"description":"Category option for selectbox/dropdown.","type":"object","required":["id","label"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"label":{"description":"Localized category name suitable for display in a selectbox.","examples":["Tech News"],"type":"string"}}}},"itemCount":{"description":"Total number of active categories.","examples":[8],"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of active categories with localized labels.","type":"array","items":{"description":"Category option for selectbox/dropdown.","type":"object","required":["id","label"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"label":{"description":"Localized category name suitable for display in a selectbox.","examples":["Tech News"],"type":"string"}}}},"itemCount":{"description":"Total number of active categories.","examples":[8],"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPost-categoryList-selector","tags":["Post Category"],"summary":"List categories for selector","description":"Returns a simplified list of categories suitable for selectbox/dropdown components. Includes only active categories with their localized names."}},"/bff/post-category/tree":{"get":{"parameters":[{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"description":"Nested tree structure of all post categories.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Top-level category nodes. Each node contains a nested children array forming the full tree.","type":"array","items":{"description":"Recursive tree node. Each node has: id (external ID), title (localized name), slug (URL slug), active (boolean), postCount (number of posts), children (array of child nodes with the same shape)."}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Top-level category nodes. Each node contains a nested children array forming the full tree.","type":"array","items":{"description":"Recursive tree node. Each node has: id (external ID), title (localized name), slug (URL slug), active (boolean), postCount (number of posts), children (array of child nodes with the same shape)."}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Top-level category nodes. Each node contains a nested children array forming the full tree.","type":"array","items":{"description":"Recursive tree node. Each node has: id (external ID), title (localized name), slug (URL slug), active (boolean), postCount (number of posts), children (array of child nodes with the same shape)."}}},"required":["items"]}}}}},"operationId":"getBffPost-categoryTree","tags":["Post Category"],"summary":"Get category tree","description":"Returns all post categories as a nested tree structure. Each node includes its children, post count, and localized title/slug. Node shape: { id: string, title: string, slug: string, active: boolean, postCount: number, children: Node[] }."}},"/bff/post-category/detail":{"get":{"parameters":[{"description":"Category external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"title":{"description":"Localized category name.","examples":["Tech News"],"type":"string"},"description":{"description":"Category description.","examples":["Latest technology news and updates."],"type":"string"},"metaDescription":{"description":"SEO meta description.","examples":["Tech news, tutorials, and insights."],"type":"string"},"slug":{"description":"Canonical URL slug in the requested locale. Empty when the locale has no translation yet.","examples":["tech-news"],"type":"string"},"hasTranslation":{"description":"Whether the category has its own translation in the requested locale. When false, text fields are a fallback from `sourceLocale` and saving creates the translation.","examples":[true],"type":"boolean"},"sourceLocale":{"description":"Locale the fallback text fields come from (only when hasTranslation=false).","examples":["cs"],"type":"string"},"parentId":{"description":"Parent category external ID.","examples":["abc123def456ghij"],"type":"string"},"parentTitle":{"description":"Parent category name.","examples":["Technology"],"type":"string"},"active":{"description":"Whether the category is active.","examples":[true],"type":"boolean"},"position":{"description":"Manual order among siblings (ASC).","examples":[0],"type":"number"},"insertedDate":{"description":"When the category was created.","anyOf":[{"description":"When the category was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When the category was last changed.","anyOf":[{"description":"When the category was last changed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Number of non-deleted posts directly in this category.","examples":[42],"type":"number"},"childCount":{"description":"Number of non-deleted direct subcategories.","examples":[3],"type":"number"},"translations":{"description":"All available locale translations for this category.","type":"array","items":{"type":"object","required":["locale","name"],"properties":{"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","examples":["en"],"type":"string"},"name":{"description":"Category name in this locale.","examples":["Tech News"],"type":"string"},"slug":{"description":"Canonical slug in this locale.","examples":["tech-news"],"type":"string"}}}}},"required":["id","title","description","metaDescription","slug","hasTranslation","active","position","insertedDate","postCount","childCount","translations"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"title":{"description":"Localized category name.","examples":["Tech News"],"type":"string"},"description":{"description":"Category description.","examples":["Latest technology news and updates."],"type":"string"},"metaDescription":{"description":"SEO meta description.","examples":["Tech news, tutorials, and insights."],"type":"string"},"slug":{"description":"Canonical URL slug in the requested locale. Empty when the locale has no translation yet.","examples":["tech-news"],"type":"string"},"hasTranslation":{"description":"Whether the category has its own translation in the requested locale. When false, text fields are a fallback from `sourceLocale` and saving creates the translation.","examples":[true],"type":"boolean"},"sourceLocale":{"description":"Locale the fallback text fields come from (only when hasTranslation=false).","examples":["cs"],"type":"string"},"parentId":{"description":"Parent category external ID.","examples":["abc123def456ghij"],"type":"string"},"parentTitle":{"description":"Parent category name.","examples":["Technology"],"type":"string"},"active":{"description":"Whether the category is active.","examples":[true],"type":"boolean"},"position":{"description":"Manual order among siblings (ASC).","examples":[0],"type":"number"},"insertedDate":{"description":"When the category was created.","anyOf":[{"description":"When the category was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When the category was last changed.","anyOf":[{"description":"When the category was last changed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Number of non-deleted posts directly in this category.","examples":[42],"type":"number"},"childCount":{"description":"Number of non-deleted direct subcategories.","examples":[3],"type":"number"},"translations":{"description":"All available locale translations for this category.","type":"array","items":{"type":"object","required":["locale","name"],"properties":{"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","examples":["en"],"type":"string"},"name":{"description":"Category name in this locale.","examples":["Tech News"],"type":"string"},"slug":{"description":"Canonical slug in this locale.","examples":["tech-news"],"type":"string"}}}}},"required":["id","title","description","metaDescription","slug","hasTranslation","active","position","insertedDate","postCount","childCount","translations"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"title":{"description":"Localized category name.","examples":["Tech News"],"type":"string"},"description":{"description":"Category description.","examples":["Latest technology news and updates."],"type":"string"},"metaDescription":{"description":"SEO meta description.","examples":["Tech news, tutorials, and insights."],"type":"string"},"slug":{"description":"Canonical URL slug in the requested locale. Empty when the locale has no translation yet.","examples":["tech-news"],"type":"string"},"hasTranslation":{"description":"Whether the category has its own translation in the requested locale. When false, text fields are a fallback from `sourceLocale` and saving creates the translation.","examples":[true],"type":"boolean"},"sourceLocale":{"description":"Locale the fallback text fields come from (only when hasTranslation=false).","examples":["cs"],"type":"string"},"parentId":{"description":"Parent category external ID.","examples":["abc123def456ghij"],"type":"string"},"parentTitle":{"description":"Parent category name.","examples":["Technology"],"type":"string"},"active":{"description":"Whether the category is active.","examples":[true],"type":"boolean"},"position":{"description":"Manual order among siblings (ASC).","examples":[0],"type":"number"},"insertedDate":{"description":"When the category was created.","anyOf":[{"description":"When the category was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When the category was last changed.","anyOf":[{"description":"When the category was last changed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Number of non-deleted posts directly in this category.","examples":[42],"type":"number"},"childCount":{"description":"Number of non-deleted direct subcategories.","examples":[3],"type":"number"},"translations":{"description":"All available locale translations for this category.","type":"array","items":{"type":"object","required":["locale","name"],"properties":{"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","examples":["en"],"type":"string"},"name":{"description":"Category name in this locale.","examples":["Tech News"],"type":"string"},"slug":{"description":"Canonical slug in this locale.","examples":["tech-news"],"type":"string"}}}}},"required":["id","title","description","metaDescription","slug","hasTranslation","active","position","insertedDate","postCount","childCount","translations"]}}}}},"operationId":"getBffPost-categoryDetail","tags":["Post Category"],"summary":"Get category detail","description":"Returns full detail of a post category including title, description, meta description, slug, parent info, post count, and all available translations."}},"/bff/post-category/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"id":{"description":"External ID of the newly created category.","examples":["abc123def456ghij"],"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"id":{"description":"External ID of the newly created category.","examples":["abc123def456ghij"],"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"id":{"description":"External ID of the newly created category.","examples":["abc123def456ghij"],"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffPost-categoryCreate","tags":["Post Category"],"summary":"Create new post category","description":"Creates a new post category with localization and route. Automatically generates a unique external ID and URL slug from the name.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","locale"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Category name.","examples":["Tech News"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"parentId":{"description":"Parent category external ID. If not provided, creates a top-level category.","examples":["abc123def456ghij"],"type":"string"},"description":{"description":"Category description.","examples":["Latest technology news and updates."],"type":"string"},"metaDescription":{"maxLength":500,"description":"SEO meta description (max 500 characters).","examples":["Tech news, tutorials, and insights."],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","locale"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Category name.","examples":["Tech News"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"parentId":{"description":"Parent category external ID. If not provided, creates a top-level category.","examples":["abc123def456ghij"],"type":"string"},"description":{"description":"Category description.","examples":["Latest technology news and updates."],"type":"string"},"metaDescription":{"maxLength":500,"description":"SEO meta description (max 500 characters).","examples":["Tech news, tutorials, and insights."],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["name","locale"],"properties":{"name":{"minLength":1,"maxLength":255,"description":"Category name.","examples":["Tech News"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"parentId":{"description":"Parent category external ID. If not provided, creates a top-level category.","examples":["abc123def456ghij"],"type":"string"},"description":{"description":"Category description.","examples":["Latest technology news and updates."],"type":"string"},"metaDescription":{"maxLength":500,"description":"SEO meta description (max 500 characters).","examples":["Tech news, tutorials, and insights."],"type":"string"}}}}}}}},"/bff/post-category/save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPost-categorySave","tags":["Post Category"],"summary":"Edit post category","description":"Updates an existing post category. All fields except id and locale are optional — only provided fields are changed. Supports renaming, changing slug, description, and re-parenting (moving under a different parent or to top-level).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Category external ID to edit.","examples":["abc123def456ghij"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"name":{"minLength":1,"maxLength":255,"description":"New category name.","examples":["Tech News"],"type":"string"},"description":{"description":"New category description.","examples":["Latest technology news."],"type":"string"},"metaDescription":{"maxLength":500,"description":"New SEO meta description (max 500 characters).","examples":["Tech news."],"type":"string"},"slug":{"description":"New URL slug for the category route in this locale. Empty string = regenerate from name. Made unique within the organisation; the previous slug stays as a non-canonical route (old URLs keep working). Only applied when name is also provided. A locale without a route gets one automatically on save.","examples":["tech-news"],"type":"string"},"parentId":{"nullable":true,"anyOf":[{"description":"External ID of the new parent category. Pass null to make it a top-level category. Omit to keep unchanged.","examples":["abc123def456ghij"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Category external ID to edit.","examples":["abc123def456ghij"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"name":{"minLength":1,"maxLength":255,"description":"New category name.","examples":["Tech News"],"type":"string"},"description":{"description":"New category description.","examples":["Latest technology news."],"type":"string"},"metaDescription":{"maxLength":500,"description":"New SEO meta description (max 500 characters).","examples":["Tech news."],"type":"string"},"slug":{"description":"New URL slug for the category route in this locale. Empty string = regenerate from name. Made unique within the organisation; the previous slug stays as a non-canonical route (old URLs keep working). Only applied when name is also provided. A locale without a route gets one automatically on save.","examples":["tech-news"],"type":"string"},"parentId":{"nullable":true,"anyOf":[{"description":"External ID of the new parent category. Pass null to make it a top-level category. Omit to keep unchanged.","examples":["abc123def456ghij"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"description":"Category external ID to edit.","examples":["abc123def456ghij"],"type":"string"},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"name":{"minLength":1,"maxLength":255,"description":"New category name.","examples":["Tech News"],"type":"string"},"description":{"description":"New category description.","examples":["Latest technology news."],"type":"string"},"metaDescription":{"maxLength":500,"description":"New SEO meta description (max 500 characters).","examples":["Tech news."],"type":"string"},"slug":{"description":"New URL slug for the category route in this locale. Empty string = regenerate from name. Made unique within the organisation; the previous slug stays as a non-canonical route (old URLs keep working). Only applied when name is also provided. A locale without a route gets one automatically on save.","examples":["tech-news"],"type":"string"},"parentId":{"nullable":true,"anyOf":[{"description":"External ID of the new parent category. Pass null to make it a top-level category. Omit to keep unchanged.","examples":["abc123def456ghij"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/post-category/toggle-active":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"active":{"description":"New active status after toggle.","examples":[true],"type":"boolean"}},"required":["success","active"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"active":{"description":"New active status after toggle.","examples":[true],"type":"boolean"}},"required":["success","active"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"active":{"description":"New active status after toggle.","examples":[true],"type":"boolean"}},"required":["success","active"]}}}}},"operationId":"postBffPost-categoryToggle-active","tags":["Post Category"],"summary":"Toggle category active status","description":"Toggles the active/inactive status of a post category.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"}}}}}}}},"/bff/post-category/move":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"moved":{"description":"False when the category was already at the requested edge.","type":"boolean"}},"required":["success","moved"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"moved":{"description":"False when the category was already at the requested edge.","type":"boolean"}},"required":["success","moved"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"},"moved":{"description":"False when the category was already at the requested edge.","type":"boolean"}},"required":["success","moved"]}}}}},"operationId":"postBffPost-categoryMove","tags":["Post Category"],"summary":"Reorder post category","description":"Moves a category within its siblings (same parent). The whole sibling level is renumbered 0..n-1. The order drives the admin tree, the category selector, the public `/api/v1/post/category-tree` and subcategory listings. Use `/save` with `parentId` to move a category under another parent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","direction"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"direction":{"description":"Where to move the category within its sibling list.","examples":["up"],"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"const":"first","type":"string"},{"const":"last","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","direction"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"direction":{"description":"Where to move the category within its sibling list.","examples":["up"],"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"const":"first","type":"string"},{"const":"last","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","direction"],"properties":{"id":{"description":"Category external ID.","examples":["abc123def456ghij"],"type":"string"},"direction":{"description":"Where to move the category within its sibling list.","examples":["up"],"anyOf":[{"const":"up","type":"string"},{"const":"down","type":"string"},{"const":"first","type":"string"},{"const":"last","type":"string"}]}}}}}}}},"/bff/post-category/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true on success.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPost-categoryDelete","tags":["Post Category"],"summary":"Delete post category","description":"Soft-deletes a post category by setting deleted_date. The category disappears from all listings. Fails if the category has non-deleted child categories or assigned posts — these must be moved or deleted first. This is different from toggle-active, which only hides the category without removing it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Category external ID to delete.","examples":["abc123def456ghij"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Category external ID to delete.","examples":["abc123def456ghij"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Category external ID to delete.","examples":["abc123def456ghij"],"type":"string"}}}}}}}},"/bff/post-tag/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Internal tag ID.","type":"number"},"code":{"description":"Tag code (URL-friendly).","type":"string"},"label":{"description":"Tag display name.","type":"string"},"color":{"nullable":true,"anyOf":[{"description":"Tag color in #RRGGBB format.","type":"string"},{"type":"null"}]},"internal":{"description":"Whether the tag is internal (private).","type":"boolean"}},"required":["id","code","label","color","internal"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Internal tag ID.","type":"number"},"code":{"description":"Tag code (URL-friendly).","type":"string"},"label":{"description":"Tag display name.","type":"string"},"color":{"nullable":true,"anyOf":[{"description":"Tag color in #RRGGBB format.","type":"string"},{"type":"null"}]},"internal":{"description":"Whether the tag is internal (private).","type":"boolean"}},"required":["id","code","label","color","internal"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Internal tag ID.","type":"number"},"code":{"description":"Tag code (URL-friendly).","type":"string"},"label":{"description":"Tag display name.","type":"string"},"color":{"nullable":true,"anyOf":[{"description":"Tag color in #RRGGBB format.","type":"string"},{"type":"null"}]},"internal":{"description":"Whether the tag is internal (private).","type":"boolean"}},"required":["id","code","label","color","internal"]}}}}},"operationId":"postBffPost-tagCreate","tags":["Post Tags"],"summary":"Create new tag","description":"Creates a new tag for posts including route. Tag code is automatically normalized to URL-friendly format. Tag must have a unique code within the organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","label","locale"],"properties":{"code":{"minLength":1,"maxLength":100,"description":"Unique tag code (URL-friendly, automatically normalized)","type":"string"},"label":{"minLength":1,"maxLength":200,"description":"Display name of the tag","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Tag color in #RRGGBB format (optional)","type":"string"},"internal":{"description":"Mark the tag as internal (private). Internal tags are never returned from public surfaces (post feed, post detail, search). Default: false.","type":"boolean"},"locale":{"minLength":2,"maxLength":2,"description":"Locale code for route creation (e.g., cs, en, sk)","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","label","locale"],"properties":{"code":{"minLength":1,"maxLength":100,"description":"Unique tag code (URL-friendly, automatically normalized)","type":"string"},"label":{"minLength":1,"maxLength":200,"description":"Display name of the tag","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Tag color in #RRGGBB format (optional)","type":"string"},"internal":{"description":"Mark the tag as internal (private). Internal tags are never returned from public surfaces (post feed, post detail, search). Default: false.","type":"boolean"},"locale":{"minLength":2,"maxLength":2,"description":"Locale code for route creation (e.g., cs, en, sk)","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code","label","locale"],"properties":{"code":{"minLength":1,"maxLength":100,"description":"Unique tag code (URL-friendly, automatically normalized)","type":"string"},"label":{"minLength":1,"maxLength":200,"description":"Display name of the tag","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"Tag color in #RRGGBB format (optional)","type":"string"},"internal":{"description":"Mark the tag as internal (private). Internal tags are never returned from public surfaces (post feed, post detail, search). Default: false.","type":"boolean"},"locale":{"minLength":2,"maxLength":2,"description":"Locale code for route creation (e.g., cs, en, sk)","type":"string"}}}}}}}},"/bff/post-tag/list":{"get":{"operationId":"getBffPost-tagList","tags":["Post Tags"],"summary":"List all organisation tags","description":"Returns a list of all tags including their usage count in posts. Contains both active and inactive tags.","responses":{"200":{}}}},"/bff/post-tag/detail":{"get":{"parameters":[{"description":"Tag ID","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffPost-tagDetail","tags":["Post Tags"],"summary":"Tag detail","description":"Returns detail of a specific tag including its settings.","responses":{"200":{}}}},"/bff/post-tag/post-tags":{"get":{"parameters":[{"description":"Post external ID","schema":{"type":"string"},"in":"query","name":"postId","required":true}],"operationId":"getBffPost-tagPost-tags","tags":["Post Tags"],"summary":"List post tags","description":"Returns a list of all active tags assigned to the given post.","responses":{"200":{}}}},"/bff/post-tag/sync":{"post":{"parameters":[],"operationId":"postBffPost-tagSync","tags":["Post Tags"],"summary":"Sync post tags","description":"Sets post tags according to the provided array. Removes all previous tags and adds only those in the array. All IDs must be valid and belong to the same organisation as the post.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId","tagIds"],"properties":{"postId":{"description":"Post external ID","type":"string"},"tagIds":{"description":"Array of tag IDs to be assigned to the post. All previous associations will be removed and replaced with this list. Empty array removes all tags from the post.","type":"array","items":{"type":"number"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId","tagIds"],"properties":{"postId":{"description":"Post external ID","type":"string"},"tagIds":{"description":"Array of tag IDs to be assigned to the post. All previous associations will be removed and replaced with this list. Empty array removes all tags from the post.","type":"array","items":{"type":"number"}}}}},"text/plain":{"schema":{"type":"object","required":["postId","tagIds"],"properties":{"postId":{"description":"Post external ID","type":"string"},"tagIds":{"description":"Array of tag IDs to be assigned to the post. All previous associations will be removed and replaced with this list. Empty array removes all tags from the post.","type":"array","items":{"type":"number"}}}}}}},"responses":{"200":{}}}},"/bff/post-tag/update":{"post":{"parameters":[],"operationId":"postBffPost-tagUpdate","tags":["Post Tags"],"summary":"Update tag","description":"Updates properties of an existing tag. Can update name, color, active status, or the internal (private) flag. Tag code cannot be changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID","type":"number"},"label":{"minLength":1,"maxLength":200,"description":"New tag name","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"New tag color in #RRGGBB format","type":"string"},"active":{"description":"Tag status (active/inactive)","type":"boolean"},"internal":{"description":"Mark the tag as internal (private). Internal tags are never returned from public surfaces.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID","type":"number"},"label":{"minLength":1,"maxLength":200,"description":"New tag name","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"New tag color in #RRGGBB format","type":"string"},"active":{"description":"Tag status (active/inactive)","type":"boolean"},"internal":{"description":"Mark the tag as internal (private). Internal tags are never returned from public surfaces.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Tag ID","type":"number"},"label":{"minLength":1,"maxLength":200,"description":"New tag name","type":"string"},"color":{"pattern":"^#[0-9A-Fa-f]{6}$","description":"New tag color in #RRGGBB format","type":"string"},"active":{"description":"Tag status (active/inactive)","type":"boolean"},"internal":{"description":"Mark the tag as internal (private). Internal tags are never returned from public surfaces.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/post-tag/delete":{"delete":{"parameters":[{"description":"Tag ID","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"deleteBffPost-tagDelete","tags":["Post Tags"],"summary":"Deactivate tag","description":"Deactivates a tag (sets active = false). Tag remains in the database but will not appear in lists. Associations with posts are preserved.","responses":{"200":{}}}},"/bff/post-author/list":{"get":{"parameters":[{"description":"Locale for localized fields (job title).","schema":{"type":"string"},"in":"query","name":"locale","required":false},{"description":"Name / e-mail / job title / slug / member search.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Page size; omit for the full list (author picker).","schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false}],"operationId":"getBffPost-authorList","tags":["Post Authors"],"summary":"List author profiles","description":"Every non-deleted `content__author` of the organisation with resolved byline (name / avatar after the cascade + source tier), status, linked member, post counts and canonical slug. Small set by design (sliced in memory); without `limit` returns the full list for the post editor author picker.","responses":{"200":{}}}},"/bff/post-author/detail":{"get":{"parameters":[{"description":"`content__author.external_id`.","schema":{"type":"string","minLength":1,"maxLength":16},"in":"query","name":"id","required":true}],"operationId":"getBffPost-authorDetail","tags":["Post Authors"],"summary":"Author profile detail","description":"List-item fields + raw overrides, inherited values (what would show without overrides), contact identity, every locale override row, organisation locales and all author routes (canonical + demoted).","responses":{"200":{}}}},"/bff/post-author/member-options":{"get":{"operationId":"getBffPost-authorMember-options","tags":["Post Authors"],"summary":"Members that can be linked to an author","description":"Organisation members (handle = member contact external id) for the \"inherit from member\" picker.","responses":{"200":{}}}},"/bff/post-author/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"restored":{"type":"boolean"}},"required":["id","restored"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"restored":{"type":"boolean"}},"required":["id","restored"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"restored":{"type":"boolean"}},"required":["id","restored"]}}}}},"operationId":"postBffPost-authorCreate","tags":["Post Authors"],"summary":"Create author profile","description":"Identity: `memberId` (linked) → `contactId` → `email` (existing contact, else a new one). Pseudonymous authors are never auto-linked to a member. Re-creating a deleted author restores it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contactId":{"description":"Existing contact external id.","type":"string"},"memberId":{"description":"Existing member handle (linked author).","type":"string"},"email":{"description":"E-mail of an existing or new contact.","type":"string"},"firstName":{"maxLength":120,"type":"string"},"lastName":{"maxLength":120,"type":"string"},"displayName":{"maxLength":128,"description":"Public byline name / pseudonym.","type":"string"},"isPseudonym":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"contactId":{"description":"Existing contact external id.","type":"string"},"memberId":{"description":"Existing member handle (linked author).","type":"string"},"email":{"description":"E-mail of an existing or new contact.","type":"string"},"firstName":{"maxLength":120,"type":"string"},"lastName":{"maxLength":120,"type":"string"},"displayName":{"maxLength":128,"description":"Public byline name / pseudonym.","type":"string"},"isPseudonym":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","properties":{"contactId":{"description":"Existing contact external id.","type":"string"},"memberId":{"description":"Existing member handle (linked author).","type":"string"},"email":{"description":"E-mail of an existing or new contact.","type":"string"},"firstName":{"maxLength":120,"type":"string"},"lastName":{"maxLength":120,"type":"string"},"displayName":{"maxLength":128,"description":"Public byline name / pseudonym.","type":"string"},"isPseudonym":{"type":"boolean"}}}}}}}},"/bff/post-author/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPost-authorUpdate","tags":["Post Authors"],"summary":"Update author profile (non-localized fields)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"displayName":{"nullable":true,"anyOf":[{"description":"Byline override; null / empty = inherit.","type":"string"},{"type":"null"}]},"isPseudonym":{"type":"boolean"},"profileHidden":{"type":"boolean"},"endedDate":{"nullable":true,"anyOf":[{"description":"ISO date — former contributor from this date; null = active.","type":"string"},{"type":"null"}]},"position":{"nullable":true,"anyOf":[{"minimum":-100000,"maximum":100000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-100000,"maximum":100000,"type":"integer"}]},{"type":"null"}]},"socialLinks":{"maxItems":20,"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"maxLength":32,"description":"Lower-case platform slug (telegram, x, linkedin, website, …).","type":"string"},"url":{"maxLength":500,"description":"http(s):// or mailto: URL.","type":"string"}}}},"memberId":{"nullable":true,"anyOf":[{"description":"Member handle to inherit from; null = unlink.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"displayName":{"nullable":true,"anyOf":[{"description":"Byline override; null / empty = inherit.","type":"string"},{"type":"null"}]},"isPseudonym":{"type":"boolean"},"profileHidden":{"type":"boolean"},"endedDate":{"nullable":true,"anyOf":[{"description":"ISO date — former contributor from this date; null = active.","type":"string"},{"type":"null"}]},"position":{"nullable":true,"anyOf":[{"minimum":-100000,"maximum":100000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-100000,"maximum":100000,"type":"integer"}]},{"type":"null"}]},"socialLinks":{"maxItems":20,"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"maxLength":32,"description":"Lower-case platform slug (telegram, x, linkedin, website, …).","type":"string"},"url":{"maxLength":500,"description":"http(s):// or mailto: URL.","type":"string"}}}},"memberId":{"nullable":true,"anyOf":[{"description":"Member handle to inherit from; null = unlink.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"displayName":{"nullable":true,"anyOf":[{"description":"Byline override; null / empty = inherit.","type":"string"},{"type":"null"}]},"isPseudonym":{"type":"boolean"},"profileHidden":{"type":"boolean"},"endedDate":{"nullable":true,"anyOf":[{"description":"ISO date — former contributor from this date; null = active.","type":"string"},{"type":"null"}]},"position":{"nullable":true,"anyOf":[{"minimum":-100000,"maximum":100000,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":-100000,"maximum":100000,"type":"integer"}]},{"type":"null"}]},"socialLinks":{"maxItems":20,"type":"array","items":{"type":"object","required":["platform","url"],"properties":{"platform":{"maxLength":32,"description":"Lower-case platform slug (telegram, x, linkedin, website, …).","type":"string"},"url":{"maxLength":500,"description":"http(s):// or mailto: URL.","type":"string"}}}},"memberId":{"nullable":true,"anyOf":[{"description":"Member handle to inherit from; null = unlink.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/post-author/save-locale":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPost-authorSave-locale","tags":["Post Authors"],"summary":"Save localized author texts","description":"Replaces the locale override row. Empty values clear the override (→ inherit).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"locale":{"minLength":2,"maxLength":8,"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"description":"Job title override.","type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"description":"Short plain-text bio override.","type":"string"},{"type":"null"}]},"about":{"nullable":true,"anyOf":[{"description":"Long Markdown \"about the author\".","type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"description":"SEO title override.","type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"description":"SEO description override.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"locale":{"minLength":2,"maxLength":8,"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"description":"Job title override.","type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"description":"Short plain-text bio override.","type":"string"},{"type":"null"}]},"about":{"nullable":true,"anyOf":[{"description":"Long Markdown \"about the author\".","type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"description":"SEO title override.","type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"description":"SEO description override.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"locale":{"minLength":2,"maxLength":8,"type":"string"},"jobTitle":{"nullable":true,"anyOf":[{"description":"Job title override.","type":"string"},{"type":"null"}]},"bio":{"nullable":true,"anyOf":[{"description":"Short plain-text bio override.","type":"string"},{"type":"null"}]},"about":{"nullable":true,"anyOf":[{"description":"Long Markdown \"about the author\".","type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"description":"SEO title override.","type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"description":"SEO description override.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/post-author/translate-locale":{"post":{"parameters":[],"operationId":"postBffPost-authorTranslate-locale","tags":["Post Authors"],"summary":"AI-translate author texts from the primary locale","description":"Translates the primary-locale override row and stores it as the target locale override.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"locale":{"minLength":2,"maxLength":8,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"locale":{"minLength":2,"maxLength":8,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","locale"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"locale":{"minLength":2,"maxLength":8,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/post-author/upload-avatar":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPost-authorUpload-avatar","tags":["Post Authors"],"summary":"Upload author avatar override","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","file"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"file":{"default":"File","description":"Image file.","type":"string","format":"binary"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","file"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"file":{"default":"File","description":"Image file.","type":"string","format":"binary"}}}},"text/plain":{"schema":{"type":"object","required":["id","file"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"},"file":{"default":"File","description":"Image file.","type":"string","format":"binary"}}}}}}}},"/bff/post-author/remove-avatar":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPost-authorRemove-avatar","tags":["Post Authors"],"summary":"Remove author avatar override","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}}}}}},"/bff/post-author/refresh-slug":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"changed":{"type":"boolean"}},"required":["slug","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"changed":{"type":"boolean"}},"required":["slug","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"changed":{"type":"boolean"}},"required":["slug","changed"]}}}}},"operationId":"postBffPost-authorRefresh-slug","tags":["Post Authors"],"summary":"Regenerate profile URL from the current name","description":"Old canonical routes are demoted (still resolve; consumers redirect).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}}}}}},"/bff/post-author/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPost-authorDelete","tags":["Post Authors"],"summary":"Delete author profile","description":"Soft delete; refused while any post still credits the author.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":1,"maxLength":16,"description":"`content__author.external_id`.","type":"string"}}}}}}}},"/bff/post-geo/hints":{"get":{"parameters":[{"description":"Post external id (content__post.external_id).","schema":{"type":"string"},"in":"query","name":"postId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"postLanguages":{"type":"array","items":{"examples":["de"],"type":"string"}},"suggestedCountryCodes":{"type":"array","items":{"examples":["DE","AT","CH"],"type":"string"}},"countryLanguages":{"description":"Country code → organisation languages official in that country.","type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"string"}}}}},"required":["postLanguages","suggestedCountryCodes","countryLanguages"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"postLanguages":{"type":"array","items":{"examples":["de"],"type":"string"}},"suggestedCountryCodes":{"type":"array","items":{"examples":["DE","AT","CH"],"type":"string"}},"countryLanguages":{"description":"Country code → organisation languages official in that country.","type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"string"}}}}},"required":["postLanguages","suggestedCountryCodes","countryLanguages"]}},"text/plain":{"schema":{"type":"object","properties":{"postLanguages":{"type":"array","items":{"examples":["de"],"type":"string"}},"suggestedCountryCodes":{"type":"array","items":{"examples":["DE","AT","CH"],"type":"string"}},"countryLanguages":{"description":"Country code → organisation languages official in that country.","type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"string"}}}}},"required":["postLanguages","suggestedCountryCodes","countryLanguages"]}}}}},"operationId":"getBffPost-geoHints","tags":["Post Geo"],"summary":"Region hints for the post geo picker","description":"From the real-world country × language matrix (`core__country_language`): the organisation languages the post is translated into, the countries where one of them is official (suggested regions, most speakers first), and for every country the organisation languages official there. A post restricted to a country where none of its translations is official has no regional edition there."}},"/bff/post-geo/targets":{"get":{"parameters":[{"description":"Post external id (content__post.external_id).","schema":{"type":"string"},"in":"query","name":"postId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"countryCodes":{"type":"array","items":{"description":"Uppercase ISO 3166-1 alpha-2 code (matches `core__country.code`).","examples":["CZ","DE"],"type":"string"}},"continentCodes":{"type":"array","items":{"description":"Uppercase 2-char continent code (matches `core__continent.id`).","examples":["EU","NA"],"type":"string"}}},"required":["countryCodes","continentCodes"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"countryCodes":{"type":"array","items":{"description":"Uppercase ISO 3166-1 alpha-2 code (matches `core__country.code`).","examples":["CZ","DE"],"type":"string"}},"continentCodes":{"type":"array","items":{"description":"Uppercase 2-char continent code (matches `core__continent.id`).","examples":["EU","NA"],"type":"string"}}},"required":["countryCodes","continentCodes"]}},"text/plain":{"schema":{"type":"object","properties":{"countryCodes":{"type":"array","items":{"description":"Uppercase ISO 3166-1 alpha-2 code (matches `core__country.code`).","examples":["CZ","DE"],"type":"string"}},"continentCodes":{"type":"array","items":{"description":"Uppercase 2-char continent code (matches `core__continent.id`).","examples":["EU","NA"],"type":"string"}}},"required":["countryCodes","continentCodes"]}}}}},"operationId":"getBffPost-geoTargets","tags":["Post Geo"],"summary":"Read post geo-availability allowlists","description":"Returns the post's per-country and per-continent allowlists as ISO codes. Empty arrays on both axes mean \"globally available\" (the default)."}},"/bff/post-geo/sync":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"countryCodes":{"type":"array","items":{"type":"string"}},"continentCodes":{"type":"array","items":{"type":"string"}}},"required":["success","countryCodes","continentCodes"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"countryCodes":{"type":"array","items":{"type":"string"}},"continentCodes":{"type":"array","items":{"type":"string"}}},"required":["success","countryCodes","continentCodes"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"countryCodes":{"type":"array","items":{"type":"string"}},"continentCodes":{"type":"array","items":{"type":"string"}}},"required":["success","countryCodes","continentCodes"]}}}}},"operationId":"postBffPost-geoSync","tags":["Post Geo"],"summary":"Sync post geo-availability allowlists","description":"Replace-all writer for a post's per-country and per-continent allowlists. Unknown codes abort the whole request before any DELETE, so a typo can never leave the post in a partially-cleared state. Passing empty arrays clears every rule (post becomes globally available); omitting a field entirely leaves that axis untouched. Only supported for `kind='post'` — branch documents reject the call because their geo availability makes no semantic sense.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external id.","type":"string"},"countryCodes":{"description":"Full replacement set of country allowlist entries. Empty array clears all per-country rules. Omit the field entirely to leave the country axis untouched (partial edits — e.g. change only the continent list without touching country entries).","type":"array","items":{"minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 code (uppercase or lowercase — server normalises).","type":"string"}},"continentCodes":{"description":"Full replacement set of continent allowlist entries. Empty array clears all per-continent rules. Omit to leave the continent axis untouched.","type":"array","items":{"minLength":2,"maxLength":2,"description":"2-char continent code (AF/AN/AS/EU/NA/OC/SA).","type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external id.","type":"string"},"countryCodes":{"description":"Full replacement set of country allowlist entries. Empty array clears all per-country rules. Omit the field entirely to leave the country axis untouched (partial edits — e.g. change only the continent list without touching country entries).","type":"array","items":{"minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 code (uppercase or lowercase — server normalises).","type":"string"}},"continentCodes":{"description":"Full replacement set of continent allowlist entries. Empty array clears all per-continent rules. Omit to leave the continent axis untouched.","type":"array","items":{"minLength":2,"maxLength":2,"description":"2-char continent code (AF/AN/AS/EU/NA/OC/SA).","type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["postId"],"properties":{"postId":{"description":"Post external id.","type":"string"},"countryCodes":{"description":"Full replacement set of country allowlist entries. Empty array clears all per-country rules. Omit the field entirely to leave the country axis untouched (partial edits — e.g. change only the continent list without touching country entries).","type":"array","items":{"minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 code (uppercase or lowercase — server normalises).","type":"string"}},"continentCodes":{"description":"Full replacement set of continent allowlist entries. Empty array clears all per-continent rules. Omit to leave the continent axis untouched.","type":"array","items":{"minLength":2,"maxLength":2,"description":"2-char continent code (AF/AN/AS/EU/NA/OC/SA).","type":"string"}}}}}}}}},"/bff/post-geo/catalog":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"object","required":["code","name","continent","isEu"],"properties":{"code":{"description":"ISO 3166-1 alpha-2 (uppercase).","examples":["CZ"],"type":"string"},"name":{"examples":["Czech Republic"],"type":"string"},"continent":{"description":"Continent code this country belongs to (`core__country.continent`).","examples":["EU"],"type":"string"},"isEu":{"description":"True when the country is an EU member state.","type":"boolean"}}}},"continents":{"type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["EU"],"type":"string"},"name":{"examples":["Europe"],"type":"string"}}}}},"required":["countries","continents"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"object","required":["code","name","continent","isEu"],"properties":{"code":{"description":"ISO 3166-1 alpha-2 (uppercase).","examples":["CZ"],"type":"string"},"name":{"examples":["Czech Republic"],"type":"string"},"continent":{"description":"Continent code this country belongs to (`core__country.continent`).","examples":["EU"],"type":"string"},"isEu":{"description":"True when the country is an EU member state.","type":"boolean"}}}},"continents":{"type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["EU"],"type":"string"},"name":{"examples":["Europe"],"type":"string"}}}}},"required":["countries","continents"]}},"text/plain":{"schema":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"object","required":["code","name","continent","isEu"],"properties":{"code":{"description":"ISO 3166-1 alpha-2 (uppercase).","examples":["CZ"],"type":"string"},"name":{"examples":["Czech Republic"],"type":"string"},"continent":{"description":"Continent code this country belongs to (`core__country.continent`).","examples":["EU"],"type":"string"},"isEu":{"description":"True when the country is an EU member state.","type":"boolean"}}}},"continents":{"type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"examples":["EU"],"type":"string"},"name":{"examples":["Europe"],"type":"string"}}}}},"required":["countries","continents"]}}}}},"operationId":"getBffPost-geoCatalog","tags":["Post Geo"],"summary":"Post geo picker catalog","description":"Returns the full country + continent reference data used to render the geo-availability picker. Names come from `core__country.name` / `core__continent.name` (currently English). Response is safe to cache client-side (staleTime: Infinity) — reference data is stable."}},"/bff/product/list":{"get":{"parameters":[{"description":"Full-text search (accent-insensitive, every word must match) across product code, EAN, SKU, slug, external ID, internal note, translated name and descriptions in all locales, variant code / EAN / SKU / name, main category name and brand name.","examples":["tričko modré","8594000000000"],"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Filter products by main category code, or pass the literal \"__none__\" to return products that have no main category. Omit for all products.","examples":["electronics","__none__"],"schema":{"type":"string"},"in":"query","name":"mainCategoryCode","required":false},{"description":"Locale code for translated product names and descriptions (e.g. \"cs\", \"en\").","examples":["cs"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"description":"\"true\" → active products only, \"false\" → inactive only. Omit for both.","examples":["true","false"],"schema":{"type":"string"},"in":"query","name":"active","required":false},{"description":"\"available\" = in stock & not sold-out (NULL qty = unlimited); \"lowStock\" = qty > 0 AND qty ≤ warehouse_limit (limit required); \"soldOut\" = sold_out flag set OR qty = 0.","examples":["available","lowStock","soldOut"],"schema":{"type":"string"},"in":"query","name":"stockStatus","required":false},{"description":"\"inFeed\" = show_in_feed=true; \"notInFeed\" = show_in_feed=false; \"b2bOnly\" = b2b=true.","examples":["inFeed","notInFeed","b2bOnly"],"schema":{"type":"string"},"in":"query","name":"visibility","required":false},{"description":"\"missingImage\" = no main image; \"missingEan\" = empty EAN.","examples":["missingImage","missingEan"],"schema":{"type":"string"},"in":"query","name":"dataQuality","required":false},{"description":"Only products without a manual price in this currency (ISO code).","examples":["CZK"],"schema":{"type":"string"},"in":"query","name":"missingCurrencyPrice","required":false},{"description":"Only products whose manual price in this currency is further from the conversion by the shop rate than the drift threshold (`shop_currency_drift_threshold`, default 8 %).","examples":["CZK"],"schema":{"type":"string"},"in":"query","name":"currencyDrift","required":false},{"description":"\"onSale\" = a sale is running; \"scheduled\" = a sale or price change waits to start.","examples":["onSale","scheduled"],"schema":{"type":"string"},"in":"query","name":"priceSchedule","required":false},{"description":"Soft-delete view: \"hide\" (default) = live only, \"only\" = soft-deleted only (recycle bin), \"include\" = both. Anything else is treated as \"hide\".","examples":["hide","only","include"],"schema":{"type":"string"},"in":"query","name":"deletedView","required":false}],"responses":{"200":{"description":"Paginated list of products.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of products matching the query criteria.","type":"array","items":{"description":"Single product item in the list.","type":"object","required":["id","code","name","slug","mainImageLqipBase64","position","active","b2b","showInFeed","soldOut","variantCount","isVariantProduct","voucherTemplateCount","subscriptionPlanCount","bundleItemCount","translatedLocales"],"properties":{"id":{"description":"Product code (used as unique identifier).","type":"string"},"code":{"description":"URL-friendly unique product code.","type":"string"},"name":{"description":"Product name (translated if locale is specified).","type":"string"},"slug":{"description":"URL slug for the product.","type":"string"},"ean":{"description":"EAN barcode (13 digits).","type":"string"},"description":{"description":"Short plain-text description, truncated to 200 characters.","type":"string"},"internalNote":{"description":"Internal note visible only in admin.","type":"string"},"mainCategory":{"description":"Main category the product belongs to.","type":"object","required":["code","name"],"properties":{"code":{"description":"Category code.","type":"string"},"name":{"description":"Category display name.","type":"string"}}},"mainImageUrl":{"description":"URL of the main product image (full-resolution source blob).","type":"string"},"mainImageLqipBase64":{"description":"32×32 WebP q40 base64 data URI placeholder for the main image (issue #80). Populated inline on upload — always present. Empty string when the product has no main image.","type":"string"},"mainImageThumbUrl":{"description":"URL of the scout-generated 128×128 WebP thumbnail (issue #80). Absent while scout is still generating variants for the row — FE keeps rendering the LQIP blur alone.","type":"string"},"position":{"description":"Display order position.","type":"number"},"active":{"description":"Whether the product is active and visible.","type":"boolean"},"deletedDate":{"description":"ISO timestamp when the product was soft-deleted. Absent on live products.","type":"string"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds (e.g. Google Shopping).","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"price":{"description":"Price object with priceWithVat, priceWithoutVat, vat, currency."},"otherCurrencyPrices":{"description":"The price in the other selling currencies.","type":"array","items":{"type":"object","required":["currency","price","source","cost","margin","drift","drifting"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"price":{"description":"Price with VAT in this currency.","type":"number"},"source":{"description":"`manual` = set on the product, `converted` = default price by the shop rate and rounding.","anyOf":[{"const":"manual","type":"string"},{"const":"converted","type":"string"}]},"cost":{"description":"Product cost in this currency (shop rate); null = no cost.","anyOf":[{"type":"number"},{"type":"null"}]},"margin":{"description":"price - cost; null without a cost.","anyOf":[{"type":"number"},{"type":"null"}]},"drift":{"description":"Manual price only: % from the conversion by the shop rate (+12.3 = above); null otherwise.","anyOf":[{"type":"number"},{"type":"null"}]},"drifting":{"description":"`drift` is over the organisation threshold (default 8 %).","type":"boolean"}}}},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","type":"number"},"variantCount":{"description":"Number of variants attached to this product (0 = plain product).","type":"number"},"isVariantProduct":{"description":"Convenience flag equal to variantCount > 0.","type":"boolean"},"voucherTemplateCount":{"description":"Number of voucher templates linked to this product.","type":"number"},"subscriptionPlanCount":{"description":"Number of subscription plans linked to this product.","type":"number"},"bundleItemCount":{"description":"Number of bundle (sada) components; 0 = ordinary product.","type":"number"},"statistic":{"description":"Order statistics aggregated by status type."},"translatedLocales":{"description":"Locales for which a translation exists.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}}}}},"itemCount":{"description":"Total number of products matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of products matching the query criteria.","type":"array","items":{"description":"Single product item in the list.","type":"object","required":["id","code","name","slug","mainImageLqipBase64","position","active","b2b","showInFeed","soldOut","variantCount","isVariantProduct","voucherTemplateCount","subscriptionPlanCount","bundleItemCount","translatedLocales"],"properties":{"id":{"description":"Product code (used as unique identifier).","type":"string"},"code":{"description":"URL-friendly unique product code.","type":"string"},"name":{"description":"Product name (translated if locale is specified).","type":"string"},"slug":{"description":"URL slug for the product.","type":"string"},"ean":{"description":"EAN barcode (13 digits).","type":"string"},"description":{"description":"Short plain-text description, truncated to 200 characters.","type":"string"},"internalNote":{"description":"Internal note visible only in admin.","type":"string"},"mainCategory":{"description":"Main category the product belongs to.","type":"object","required":["code","name"],"properties":{"code":{"description":"Category code.","type":"string"},"name":{"description":"Category display name.","type":"string"}}},"mainImageUrl":{"description":"URL of the main product image (full-resolution source blob).","type":"string"},"mainImageLqipBase64":{"description":"32×32 WebP q40 base64 data URI placeholder for the main image (issue #80). Populated inline on upload — always present. Empty string when the product has no main image.","type":"string"},"mainImageThumbUrl":{"description":"URL of the scout-generated 128×128 WebP thumbnail (issue #80). Absent while scout is still generating variants for the row — FE keeps rendering the LQIP blur alone.","type":"string"},"position":{"description":"Display order position.","type":"number"},"active":{"description":"Whether the product is active and visible.","type":"boolean"},"deletedDate":{"description":"ISO timestamp when the product was soft-deleted. Absent on live products.","type":"string"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds (e.g. Google Shopping).","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"price":{"description":"Price object with priceWithVat, priceWithoutVat, vat, currency."},"otherCurrencyPrices":{"description":"The price in the other selling currencies.","type":"array","items":{"type":"object","required":["currency","price","source","cost","margin","drift","drifting"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"price":{"description":"Price with VAT in this currency.","type":"number"},"source":{"description":"`manual` = set on the product, `converted` = default price by the shop rate and rounding.","anyOf":[{"const":"manual","type":"string"},{"const":"converted","type":"string"}]},"cost":{"description":"Product cost in this currency (shop rate); null = no cost.","anyOf":[{"type":"number"},{"type":"null"}]},"margin":{"description":"price - cost; null without a cost.","anyOf":[{"type":"number"},{"type":"null"}]},"drift":{"description":"Manual price only: % from the conversion by the shop rate (+12.3 = above); null otherwise.","anyOf":[{"type":"number"},{"type":"null"}]},"drifting":{"description":"`drift` is over the organisation threshold (default 8 %).","type":"boolean"}}}},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","type":"number"},"variantCount":{"description":"Number of variants attached to this product (0 = plain product).","type":"number"},"isVariantProduct":{"description":"Convenience flag equal to variantCount > 0.","type":"boolean"},"voucherTemplateCount":{"description":"Number of voucher templates linked to this product.","type":"number"},"subscriptionPlanCount":{"description":"Number of subscription plans linked to this product.","type":"number"},"bundleItemCount":{"description":"Number of bundle (sada) components; 0 = ordinary product.","type":"number"},"statistic":{"description":"Order statistics aggregated by status type."},"translatedLocales":{"description":"Locales for which a translation exists.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}}}}},"itemCount":{"description":"Total number of products matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of products matching the query criteria.","type":"array","items":{"description":"Single product item in the list.","type":"object","required":["id","code","name","slug","mainImageLqipBase64","position","active","b2b","showInFeed","soldOut","variantCount","isVariantProduct","voucherTemplateCount","subscriptionPlanCount","bundleItemCount","translatedLocales"],"properties":{"id":{"description":"Product code (used as unique identifier).","type":"string"},"code":{"description":"URL-friendly unique product code.","type":"string"},"name":{"description":"Product name (translated if locale is specified).","type":"string"},"slug":{"description":"URL slug for the product.","type":"string"},"ean":{"description":"EAN barcode (13 digits).","type":"string"},"description":{"description":"Short plain-text description, truncated to 200 characters.","type":"string"},"internalNote":{"description":"Internal note visible only in admin.","type":"string"},"mainCategory":{"description":"Main category the product belongs to.","type":"object","required":["code","name"],"properties":{"code":{"description":"Category code.","type":"string"},"name":{"description":"Category display name.","type":"string"}}},"mainImageUrl":{"description":"URL of the main product image (full-resolution source blob).","type":"string"},"mainImageLqipBase64":{"description":"32×32 WebP q40 base64 data URI placeholder for the main image (issue #80). Populated inline on upload — always present. Empty string when the product has no main image.","type":"string"},"mainImageThumbUrl":{"description":"URL of the scout-generated 128×128 WebP thumbnail (issue #80). Absent while scout is still generating variants for the row — FE keeps rendering the LQIP blur alone.","type":"string"},"position":{"description":"Display order position.","type":"number"},"active":{"description":"Whether the product is active and visible.","type":"boolean"},"deletedDate":{"description":"ISO timestamp when the product was soft-deleted. Absent on live products.","type":"string"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds (e.g. Google Shopping).","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"price":{"description":"Price object with priceWithVat, priceWithoutVat, vat, currency."},"otherCurrencyPrices":{"description":"The price in the other selling currencies.","type":"array","items":{"type":"object","required":["currency","price","source","cost","margin","drift","drifting"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"price":{"description":"Price with VAT in this currency.","type":"number"},"source":{"description":"`manual` = set on the product, `converted` = default price by the shop rate and rounding.","anyOf":[{"const":"manual","type":"string"},{"const":"converted","type":"string"}]},"cost":{"description":"Product cost in this currency (shop rate); null = no cost.","anyOf":[{"type":"number"},{"type":"null"}]},"margin":{"description":"price - cost; null without a cost.","anyOf":[{"type":"number"},{"type":"null"}]},"drift":{"description":"Manual price only: % from the conversion by the shop rate (+12.3 = above); null otherwise.","anyOf":[{"type":"number"},{"type":"null"}]},"drifting":{"description":"`drift` is over the organisation threshold (default 8 %).","type":"boolean"}}}},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","type":"number"},"variantCount":{"description":"Number of variants attached to this product (0 = plain product).","type":"number"},"isVariantProduct":{"description":"Convenience flag equal to variantCount > 0.","type":"boolean"},"voucherTemplateCount":{"description":"Number of voucher templates linked to this product.","type":"number"},"subscriptionPlanCount":{"description":"Number of subscription plans linked to this product.","type":"number"},"bundleItemCount":{"description":"Number of bundle (sada) components; 0 = ordinary product.","type":"number"},"statistic":{"description":"Order statistics aggregated by status type."},"translatedLocales":{"description":"Locales for which a translation exists.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}}}}},"itemCount":{"description":"Total number of products matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProductList","tags":["Product"],"summary":"List products","description":"Returns a list of products for the authenticated organisation. Products are ordered by active status (active first) and then by position. Each product includes basic metadata, main image URL, category, price, and order statistics."}},"/bff/product/product-detail":{"get":{"parameters":[{"description":"Unique product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true},{"description":"Locale code for translated fields. Falls back to primary locale if not provided.","examples":["cs"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Product code (used as identifier).","type":"string"},"code":{"description":"Unique product code.","type":"string"},"name":{"description":"Product name (translated if locale is specified).","type":"string"},"slug":{"description":"URL slug.","type":"string"},"ean":{"description":"EAN barcode.","type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"longDescription":{"description":"Long HTML description.","type":"string"},"internalNote":{"description":"Internal note (admin only).","type":"string"},"active":{"description":"Whether the product is active.","type":"boolean"},"deleted":{"description":"Whether the product is soft-deleted (legacy boolean — prefer `deletedDate`).","type":"boolean"},"deletedDate":{"description":"ISO timestamp when the product was soft-deleted. Canonical signal for soft-delete; absent on live products.","type":"string"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"mainImageUrl":{"description":"URL of the main product image (source blob).","type":"string"},"mainImage":{"description":"Full main-image payload with all pre-rendered variants (issue #80).\n\n**Rendering contract for the FE:** always paint `lqip` immediately as a CSS background, then progressively enhance with whichever sharp variant matches the intended display size — `thumbUrl` (≤ 128 px), `cardUrl` (≤ 480 px), `heroUrl` (≤ 1280 px), `zoomUrl` (≤ 2048 px). Fall back to `originalUrl` only for lightbox / download-as-image cases where the pre-rendered variants are insufficient.\n\n**Nullable slots vs. progressive rendering:** every variant slot is present on the wire; `null` means scout hasn't rendered that particular size yet. The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return the URLs — usually within seconds of a fresh upload, longer under scout backlog. Never fall back to `originalUrl` for a null variant in list UIs — that would defeat the whole point of pre-generating right-sized derivatives.","type":"object","required":["id","originalUrl","lqip","thumbUrl","cardUrl","heroUrl","zoomUrl"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"External blob token of the source image (stable across variant regenerations). Use this to correlate frontend cache keys and re-request the payload after an update.","type":"string"},"originalUrl":{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.jpg"],"description":"Public CDN URL of the original upload — always present when the product has a main image.\n\n**Format:** whatever the operator uploaded (typically JPEG or PNG, occasionally WebP or AVIF). Dimensions and byte size are unbounded and depend on the source; expect anywhere from 200 KB to several MB.\n\n**Use cases:**\n- Lightbox / zoom UI that needs the highest fidelity available (fallback for zoom variant).\n- Downloadable \"original\" link.\n- Feeds for third parties that expect an unmodified source.\n\n**Do not** use the original for above-the-fold rendering or list thumbnails — the pipeline exists precisely so those cases can bind to a pre-rendered, right-sized WebP variant instead.","type":"string"},"lqip":{"examples":["data:image/webp;base64,UklGRi4AAABXRUJQVlA4ICI…"],"description":"**Low-Quality Image Placeholder** — a 32×32 WebP q40 blur encoded as a base64 data URI. Populated inline the moment the image is uploaded, so it is always present when a main image exists.\n\n**Byte range:** typically 400–1400 bytes. Ships inside the JSON payload — no extra HTTP request needed to render it.\n\n**Intended use:** paint immediately as a CSS `background-image` on the wrapper element. Once one of the sharp variants (`thumbUrl`, `cardUrl`, `heroUrl`, `zoomUrl`) finishes loading, fade it in on top; the LQIP remains behind and covers any transparent pixels.\n\n**Edge case:** an empty string is possible only if the source blob was unreadable when the LQIP was generated (sharp threw and no fallback was stored). Treat empty as \"no LQIP available\" and skip the background paint.","type":"string"},"thumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"cardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"heroUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.hero-webp.webp"],"description":"Scout-generated **1280×1280 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 1280×1280 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~50–150 KB per file.\n\n**Intended use:** large product previews — desktop product-detail hero image (520–1280 px), homepage feature slots, campaign landing pages, retina 2× rendering for card-sized cells.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If falling back, prefer `cardUrl` over `thumbUrl` when the intended display size is > ~480 px.","type":"string"},{"type":"null"}]},"zoomUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.zoom-webp.webp"],"description":"Scout-generated **2048×2048 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 2048×2048 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~150–400 KB per file.\n\n**Intended use:** lightbox / product-image zoom UI, retina 2× rendering for hero-sized cells, download-as-image feature. The largest pre-rendered variant — for anything sharper, fall back to `originalUrl` (unbounded, unmodified source).\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If a lightbox request comes in before `zoomUrl` is ready, use `originalUrl` as an interim fallback so the feature still works.","type":"string"},{"type":"null"}]}}},"mainCategoryId":{"description":"Internal ID of the main category.","type":"number"},"brandId":{"description":"Internal ID of the brand.","type":"number"},"defaultCurrency":{"description":"Organisation default currency code; `price` and `cost` are in it.","type":"string"},"otherCurrencyPrices":{"description":"The price in every other selling currency (shop currency settings + manual prices).","type":"array","items":{"type":"object","required":["currency","price","source","cost","margin","drift","drifting"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"price":{"description":"Price with VAT in this currency.","type":"number"},"source":{"description":"`manual` = set on the product, `converted` = default price by the shop rate and rounding.","anyOf":[{"const":"manual","type":"string"},{"const":"converted","type":"string"}]},"cost":{"description":"Product cost in this currency (shop rate); null = no cost.","anyOf":[{"type":"number"},{"type":"null"}]},"margin":{"description":"price - cost; null without a cost.","anyOf":[{"type":"number"},{"type":"null"}]},"drift":{"description":"Manual price only: % from the conversion by the shop rate (+12.3 = above); null otherwise.","anyOf":[{"type":"number"},{"type":"null"}]},"drifting":{"description":"`drift` is over the organisation threshold (default 8 %).","type":"boolean"}}}},"price":{"description":"Price with VAT as a number.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency. 0 when not set. Snapshotted onto shop__order_item.cost at order creation, FX-converted to the order currency.","type":"number"},"standardPricePercentage":{"description":"Standard price percentage for discount calculation.","type":"number"},"vat":{"description":"VAT rate percentage.","type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","type":"number"},"weightGrams":{"description":"Product weight in grams.","type":"number"},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","type":"number"},"stockUnit":{"description":"Warehouse stock unit (\"m\", \"kg\"…). Missing = pieces.","type":"string"},"trackLots":{"description":"Warehouse tracks lots (šarže) for this product.","type":"boolean"},"stockTracked":{"description":"FALSE = service / digital item: orders neither reserve nor check its warehouse stock.","type":"boolean"},"defaultWarehouseId":{"description":"Preselected warehouse (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"description":"Supplier lead time in days (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"defaultVendor":{"description":"Default supplier (BIZKIT-168).","anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"description":"Contact external id.","type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168).","anyOf":[{"type":"string"},{"type":"null"}]},"isVariantProduct":{"description":"Whether the product has variants.","type":"boolean"},"variantCount":{"description":"Number of product variants.","type":"number"},"customFields":{"description":"Custom fields attached to the product.","type":"array","items":{"type":"object","required":["key","value","active","insertedDate"],"properties":{"key":{"description":"Custom field key identifier.","type":"string"},"value":{"description":"Custom field value.","type":"string"},"active":{"description":"Whether the field is active.","type":"boolean"},"insertedDate":{"description":"Date when the field was created/updated.","anyOf":[{"description":"Date when the field was created/updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"customFieldsDefinition":{"description":"Available custom field definitions for the product category.","type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"description":"Field key identifier.","type":"string"},"type":{"description":"Field type: text, textarea, number, or boolean.","type":"string"},"label":{"description":"Display label for the field.","type":"string"},"helperText":{"description":"Helper text shown below the field.","type":"string"},"placeholder":{"description":"Placeholder text for the input.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"validationPattern":{"description":"Regex pattern for validation.","type":"string"}}}},"eventList":{"description":"Calendar events linked to this product.","type":"array","items":{"type":"object","required":["id","type","title","isStorno","startTime","endTime"],"properties":{"id":{"description":"Event code.","type":"string"},"type":{"description":"How the event is linked: directly or via event type.","anyOf":[{"const":"direct","type":"string"},{"const":"eventType","type":"string"}]},"title":{"description":"Event title.","type":"string"},"isStorno":{"description":"Whether the event is cancelled.","type":"boolean"},"startTime":{"description":"Event start time.","anyOf":[{"description":"Event start time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time.","anyOf":[{"description":"Event end time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"typeCode":{"description":"Event type code.","type":"string"},"typeLabel":{"description":"Event type label.","type":"string"},"typeColor":{"description":"Event type color (hex, e.g. \"#FF5733\").","type":"string"}}}},"translatedLocales":{"description":"Locales for which a translation exists in shop__product_translation.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"voucherTemplateCount":{"description":"Number of voucher templates linked to this product.","type":"number"},"subscriptionPlanCount":{"description":"Number of subscription plans linked to this product.","type":"number"},"bundleItemCount":{"description":"Number of bundle (sada) components; 0 = ordinary product.","type":"number"},"pricelistRules":{"description":"Dynamic pricing rules. Empty array on products with static pricing.","type":"array","items":{"type":"object","required":["id","name","enabled","priority","validFrom","validTo","weekdays","timeFrom","timeTo","variantCode","price"],"properties":{"id":{"description":"Stable UUID — preserved across edits.","type":"string"},"name":{"description":"Human label shown in the rule grid.","type":"string"},"enabled":{"description":"Whether the resolver considers this rule.","type":"boolean"},"priority":{"description":"Higher value wins; ties broken by specificity.","type":"number"},"validFrom":{"description":"Inclusive lower date bound (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"Inclusive upper date bound (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"weekdays":{"description":"Allowed ISO weekdays (Mon=1 … Sun=7), or null for every day.","anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"timeFrom":{"description":"Inclusive lower time-of-day bound (HH:mm).","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"Inclusive upper time-of-day bound (HH:mm). When < timeFrom the window crosses midnight.","anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"description":"Variant code scope, or null for all variants.","anyOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Price applied when this rule wins.","type":"number"}}}}},"required":["id","code","name","slug","shortDescription","longDescription","internalNote","active","deleted","b2b","showInFeed","soldOut","defaultCurrency","otherCurrencyPrices","price","cost","trackLots","stockTracked","defaultWarehouseId","purchaseLeadTimeDays","defaultVendor","vendorItemCode","isVariantProduct","variantCount","customFields","customFieldsDefinition","eventList","translatedLocales","voucherTemplateCount","subscriptionPlanCount","bundleItemCount","pricelistRules"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Product code (used as identifier).","type":"string"},"code":{"description":"Unique product code.","type":"string"},"name":{"description":"Product name (translated if locale is specified).","type":"string"},"slug":{"description":"URL slug.","type":"string"},"ean":{"description":"EAN barcode.","type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"longDescription":{"description":"Long HTML description.","type":"string"},"internalNote":{"description":"Internal note (admin only).","type":"string"},"active":{"description":"Whether the product is active.","type":"boolean"},"deleted":{"description":"Whether the product is soft-deleted (legacy boolean — prefer `deletedDate`).","type":"boolean"},"deletedDate":{"description":"ISO timestamp when the product was soft-deleted. Canonical signal for soft-delete; absent on live products.","type":"string"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"mainImageUrl":{"description":"URL of the main product image (source blob).","type":"string"},"mainImage":{"description":"Full main-image payload with all pre-rendered variants (issue #80).\n\n**Rendering contract for the FE:** always paint `lqip` immediately as a CSS background, then progressively enhance with whichever sharp variant matches the intended display size — `thumbUrl` (≤ 128 px), `cardUrl` (≤ 480 px), `heroUrl` (≤ 1280 px), `zoomUrl` (≤ 2048 px). Fall back to `originalUrl` only for lightbox / download-as-image cases where the pre-rendered variants are insufficient.\n\n**Nullable slots vs. progressive rendering:** every variant slot is present on the wire; `null` means scout hasn't rendered that particular size yet. The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return the URLs — usually within seconds of a fresh upload, longer under scout backlog. Never fall back to `originalUrl` for a null variant in list UIs — that would defeat the whole point of pre-generating right-sized derivatives.","type":"object","required":["id","originalUrl","lqip","thumbUrl","cardUrl","heroUrl","zoomUrl"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"External blob token of the source image (stable across variant regenerations). Use this to correlate frontend cache keys and re-request the payload after an update.","type":"string"},"originalUrl":{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.jpg"],"description":"Public CDN URL of the original upload — always present when the product has a main image.\n\n**Format:** whatever the operator uploaded (typically JPEG or PNG, occasionally WebP or AVIF). Dimensions and byte size are unbounded and depend on the source; expect anywhere from 200 KB to several MB.\n\n**Use cases:**\n- Lightbox / zoom UI that needs the highest fidelity available (fallback for zoom variant).\n- Downloadable \"original\" link.\n- Feeds for third parties that expect an unmodified source.\n\n**Do not** use the original for above-the-fold rendering or list thumbnails — the pipeline exists precisely so those cases can bind to a pre-rendered, right-sized WebP variant instead.","type":"string"},"lqip":{"examples":["data:image/webp;base64,UklGRi4AAABXRUJQVlA4ICI…"],"description":"**Low-Quality Image Placeholder** — a 32×32 WebP q40 blur encoded as a base64 data URI. Populated inline the moment the image is uploaded, so it is always present when a main image exists.\n\n**Byte range:** typically 400–1400 bytes. Ships inside the JSON payload — no extra HTTP request needed to render it.\n\n**Intended use:** paint immediately as a CSS `background-image` on the wrapper element. Once one of the sharp variants (`thumbUrl`, `cardUrl`, `heroUrl`, `zoomUrl`) finishes loading, fade it in on top; the LQIP remains behind and covers any transparent pixels.\n\n**Edge case:** an empty string is possible only if the source blob was unreadable when the LQIP was generated (sharp threw and no fallback was stored). Treat empty as \"no LQIP available\" and skip the background paint.","type":"string"},"thumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"cardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"heroUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.hero-webp.webp"],"description":"Scout-generated **1280×1280 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 1280×1280 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~50–150 KB per file.\n\n**Intended use:** large product previews — desktop product-detail hero image (520–1280 px), homepage feature slots, campaign landing pages, retina 2× rendering for card-sized cells.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If falling back, prefer `cardUrl` over `thumbUrl` when the intended display size is > ~480 px.","type":"string"},{"type":"null"}]},"zoomUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.zoom-webp.webp"],"description":"Scout-generated **2048×2048 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 2048×2048 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~150–400 KB per file.\n\n**Intended use:** lightbox / product-image zoom UI, retina 2× rendering for hero-sized cells, download-as-image feature. The largest pre-rendered variant — for anything sharper, fall back to `originalUrl` (unbounded, unmodified source).\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If a lightbox request comes in before `zoomUrl` is ready, use `originalUrl` as an interim fallback so the feature still works.","type":"string"},{"type":"null"}]}}},"mainCategoryId":{"description":"Internal ID of the main category.","type":"number"},"brandId":{"description":"Internal ID of the brand.","type":"number"},"defaultCurrency":{"description":"Organisation default currency code; `price` and `cost` are in it.","type":"string"},"otherCurrencyPrices":{"description":"The price in every other selling currency (shop currency settings + manual prices).","type":"array","items":{"type":"object","required":["currency","price","source","cost","margin","drift","drifting"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"price":{"description":"Price with VAT in this currency.","type":"number"},"source":{"description":"`manual` = set on the product, `converted` = default price by the shop rate and rounding.","anyOf":[{"const":"manual","type":"string"},{"const":"converted","type":"string"}]},"cost":{"description":"Product cost in this currency (shop rate); null = no cost.","anyOf":[{"type":"number"},{"type":"null"}]},"margin":{"description":"price - cost; null without a cost.","anyOf":[{"type":"number"},{"type":"null"}]},"drift":{"description":"Manual price only: % from the conversion by the shop rate (+12.3 = above); null otherwise.","anyOf":[{"type":"number"},{"type":"null"}]},"drifting":{"description":"`drift` is over the organisation threshold (default 8 %).","type":"boolean"}}}},"price":{"description":"Price with VAT as a number.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency. 0 when not set. Snapshotted onto shop__order_item.cost at order creation, FX-converted to the order currency.","type":"number"},"standardPricePercentage":{"description":"Standard price percentage for discount calculation.","type":"number"},"vat":{"description":"VAT rate percentage.","type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","type":"number"},"weightGrams":{"description":"Product weight in grams.","type":"number"},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","type":"number"},"stockUnit":{"description":"Warehouse stock unit (\"m\", \"kg\"…). Missing = pieces.","type":"string"},"trackLots":{"description":"Warehouse tracks lots (šarže) for this product.","type":"boolean"},"stockTracked":{"description":"FALSE = service / digital item: orders neither reserve nor check its warehouse stock.","type":"boolean"},"defaultWarehouseId":{"description":"Preselected warehouse (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"description":"Supplier lead time in days (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"defaultVendor":{"description":"Default supplier (BIZKIT-168).","anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"description":"Contact external id.","type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168).","anyOf":[{"type":"string"},{"type":"null"}]},"isVariantProduct":{"description":"Whether the product has variants.","type":"boolean"},"variantCount":{"description":"Number of product variants.","type":"number"},"customFields":{"description":"Custom fields attached to the product.","type":"array","items":{"type":"object","required":["key","value","active","insertedDate"],"properties":{"key":{"description":"Custom field key identifier.","type":"string"},"value":{"description":"Custom field value.","type":"string"},"active":{"description":"Whether the field is active.","type":"boolean"},"insertedDate":{"description":"Date when the field was created/updated.","anyOf":[{"description":"Date when the field was created/updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"customFieldsDefinition":{"description":"Available custom field definitions for the product category.","type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"description":"Field key identifier.","type":"string"},"type":{"description":"Field type: text, textarea, number, or boolean.","type":"string"},"label":{"description":"Display label for the field.","type":"string"},"helperText":{"description":"Helper text shown below the field.","type":"string"},"placeholder":{"description":"Placeholder text for the input.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"validationPattern":{"description":"Regex pattern for validation.","type":"string"}}}},"eventList":{"description":"Calendar events linked to this product.","type":"array","items":{"type":"object","required":["id","type","title","isStorno","startTime","endTime"],"properties":{"id":{"description":"Event code.","type":"string"},"type":{"description":"How the event is linked: directly or via event type.","anyOf":[{"const":"direct","type":"string"},{"const":"eventType","type":"string"}]},"title":{"description":"Event title.","type":"string"},"isStorno":{"description":"Whether the event is cancelled.","type":"boolean"},"startTime":{"description":"Event start time.","anyOf":[{"description":"Event start time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time.","anyOf":[{"description":"Event end time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"typeCode":{"description":"Event type code.","type":"string"},"typeLabel":{"description":"Event type label.","type":"string"},"typeColor":{"description":"Event type color (hex, e.g. \"#FF5733\").","type":"string"}}}},"translatedLocales":{"description":"Locales for which a translation exists in shop__product_translation.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"voucherTemplateCount":{"description":"Number of voucher templates linked to this product.","type":"number"},"subscriptionPlanCount":{"description":"Number of subscription plans linked to this product.","type":"number"},"bundleItemCount":{"description":"Number of bundle (sada) components; 0 = ordinary product.","type":"number"},"pricelistRules":{"description":"Dynamic pricing rules. Empty array on products with static pricing.","type":"array","items":{"type":"object","required":["id","name","enabled","priority","validFrom","validTo","weekdays","timeFrom","timeTo","variantCode","price"],"properties":{"id":{"description":"Stable UUID — preserved across edits.","type":"string"},"name":{"description":"Human label shown in the rule grid.","type":"string"},"enabled":{"description":"Whether the resolver considers this rule.","type":"boolean"},"priority":{"description":"Higher value wins; ties broken by specificity.","type":"number"},"validFrom":{"description":"Inclusive lower date bound (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"Inclusive upper date bound (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"weekdays":{"description":"Allowed ISO weekdays (Mon=1 … Sun=7), or null for every day.","anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"timeFrom":{"description":"Inclusive lower time-of-day bound (HH:mm).","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"Inclusive upper time-of-day bound (HH:mm). When < timeFrom the window crosses midnight.","anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"description":"Variant code scope, or null for all variants.","anyOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Price applied when this rule wins.","type":"number"}}}}},"required":["id","code","name","slug","shortDescription","longDescription","internalNote","active","deleted","b2b","showInFeed","soldOut","defaultCurrency","otherCurrencyPrices","price","cost","trackLots","stockTracked","defaultWarehouseId","purchaseLeadTimeDays","defaultVendor","vendorItemCode","isVariantProduct","variantCount","customFields","customFieldsDefinition","eventList","translatedLocales","voucherTemplateCount","subscriptionPlanCount","bundleItemCount","pricelistRules"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Product code (used as identifier).","type":"string"},"code":{"description":"Unique product code.","type":"string"},"name":{"description":"Product name (translated if locale is specified).","type":"string"},"slug":{"description":"URL slug.","type":"string"},"ean":{"description":"EAN barcode.","type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"longDescription":{"description":"Long HTML description.","type":"string"},"internalNote":{"description":"Internal note (admin only).","type":"string"},"active":{"description":"Whether the product is active.","type":"boolean"},"deleted":{"description":"Whether the product is soft-deleted (legacy boolean — prefer `deletedDate`).","type":"boolean"},"deletedDate":{"description":"ISO timestamp when the product was soft-deleted. Canonical signal for soft-delete; absent on live products.","type":"string"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"mainImageUrl":{"description":"URL of the main product image (source blob).","type":"string"},"mainImage":{"description":"Full main-image payload with all pre-rendered variants (issue #80).\n\n**Rendering contract for the FE:** always paint `lqip` immediately as a CSS background, then progressively enhance with whichever sharp variant matches the intended display size — `thumbUrl` (≤ 128 px), `cardUrl` (≤ 480 px), `heroUrl` (≤ 1280 px), `zoomUrl` (≤ 2048 px). Fall back to `originalUrl` only for lightbox / download-as-image cases where the pre-rendered variants are insufficient.\n\n**Nullable slots vs. progressive rendering:** every variant slot is present on the wire; `null` means scout hasn't rendered that particular size yet. The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return the URLs — usually within seconds of a fresh upload, longer under scout backlog. Never fall back to `originalUrl` for a null variant in list UIs — that would defeat the whole point of pre-generating right-sized derivatives.","type":"object","required":["id","originalUrl","lqip","thumbUrl","cardUrl","heroUrl","zoomUrl"],"properties":{"id":{"examples":["a1b2c3d4e5f6g7h8"],"description":"External blob token of the source image (stable across variant regenerations). Use this to correlate frontend cache keys and re-request the payload after an update.","type":"string"},"originalUrl":{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.jpg"],"description":"Public CDN URL of the original upload — always present when the product has a main image.\n\n**Format:** whatever the operator uploaded (typically JPEG or PNG, occasionally WebP or AVIF). Dimensions and byte size are unbounded and depend on the source; expect anywhere from 200 KB to several MB.\n\n**Use cases:**\n- Lightbox / zoom UI that needs the highest fidelity available (fallback for zoom variant).\n- Downloadable \"original\" link.\n- Feeds for third parties that expect an unmodified source.\n\n**Do not** use the original for above-the-fold rendering or list thumbnails — the pipeline exists precisely so those cases can bind to a pre-rendered, right-sized WebP variant instead.","type":"string"},"lqip":{"examples":["data:image/webp;base64,UklGRi4AAABXRUJQVlA4ICI…"],"description":"**Low-Quality Image Placeholder** — a 32×32 WebP q40 blur encoded as a base64 data URI. Populated inline the moment the image is uploaded, so it is always present when a main image exists.\n\n**Byte range:** typically 400–1400 bytes. Ships inside the JSON payload — no extra HTTP request needed to render it.\n\n**Intended use:** paint immediately as a CSS `background-image` on the wrapper element. Once one of the sharp variants (`thumbUrl`, `cardUrl`, `heroUrl`, `zoomUrl`) finishes loading, fade it in on top; the LQIP remains behind and covers any transparent pixels.\n\n**Edge case:** an empty string is possible only if the source blob was unreadable when the LQIP was generated (sharp threw and no fallback was stored). Treat empty as \"no LQIP available\" and skip the background paint.","type":"string"},"thumbUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.thumb-webp.webp"],"description":"Scout-generated **128×128 WebP** thumbnail URL, or `null` while the variant hasn't been rendered yet (see § \"When null\" below).\n\n**Dimensions:** 128×128 px, square, `cover`-cropped. **Format:** WebP q75. **Byte range:** ~4–14 KB per file.\n\n**Intended use:** row-level thumbnails in lists, autocomplete dropdowns, chat message previews, notification cards, mobile grid cells (60–120 px). At this size no other variant is worth requesting.\n\n**When null:** the source image has been uploaded but the scout worker on the Contabo VPS hasn't finished rendering this variant yet. Fall back to the LQIP blur alone (with an optional \"processing\" overlay for cells ≥ 80 px). The read model is rebuilt automatically the moment all four variants land, so a subsequent fetch will return a non-null URL — usually within seconds for a fresh upload, longer under scout backlog.","type":"string"},{"type":"null"}]},"cardUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.card-webp.webp"],"description":"Scout-generated **480×480 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 480×480 px, square, `cover`-cropped. **Format:** WebP q80. **Byte range:** ~15–45 KB per file.\n\n**Intended use:** medium-sized product previews — product-detail sidebar (240–520 px), category grid tiles on mobile / small desktop, storefront cards, hover popovers, e-mail template thumbnails. The single most-used variant in typical e-shop UI.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. Prefer `thumbUrl` (if available) as a temporary substitute over the LQIP blur alone.","type":"string"},{"type":"null"}]},"heroUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.hero-webp.webp"],"description":"Scout-generated **1280×1280 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 1280×1280 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~50–150 KB per file.\n\n**Intended use:** large product previews — desktop product-detail hero image (520–1280 px), homepage feature slots, campaign landing pages, retina 2× rendering for card-sized cells.\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If falling back, prefer `cardUrl` over `thumbUrl` when the intended display size is > ~480 px.","type":"string"},{"type":"null"}]},"zoomUrl":{"nullable":true,"anyOf":[{"examples":["https://storage.xhp.cz/org-slug/product/2026-08/abc123.zoom-webp.webp"],"description":"Scout-generated **2048×2048 WebP** URL, or `null` while the variant hasn't been rendered yet.\n\n**Dimensions:** 2048×2048 px, square, `cover`-cropped. **Format:** WebP q82. **Byte range:** ~150–400 KB per file.\n\n**Intended use:** lightbox / product-image zoom UI, retina 2× rendering for hero-sized cells, download-as-image feature. The largest pre-rendered variant — for anything sharper, fall back to `originalUrl` (unbounded, unmodified source).\n\n**When null:** same story as `thumbUrl` — variant not yet rendered by scout. If a lightbox request comes in before `zoomUrl` is ready, use `originalUrl` as an interim fallback so the feature still works.","type":"string"},{"type":"null"}]}}},"mainCategoryId":{"description":"Internal ID of the main category.","type":"number"},"brandId":{"description":"Internal ID of the brand.","type":"number"},"defaultCurrency":{"description":"Organisation default currency code; `price` and `cost` are in it.","type":"string"},"otherCurrencyPrices":{"description":"The price in every other selling currency (shop currency settings + manual prices).","type":"array","items":{"type":"object","required":["currency","price","source","cost","margin","drift","drifting"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"price":{"description":"Price with VAT in this currency.","type":"number"},"source":{"description":"`manual` = set on the product, `converted` = default price by the shop rate and rounding.","anyOf":[{"const":"manual","type":"string"},{"const":"converted","type":"string"}]},"cost":{"description":"Product cost in this currency (shop rate); null = no cost.","anyOf":[{"type":"number"},{"type":"null"}]},"margin":{"description":"price - cost; null without a cost.","anyOf":[{"type":"number"},{"type":"null"}]},"drift":{"description":"Manual price only: % from the conversion by the shop rate (+12.3 = above); null otherwise.","anyOf":[{"type":"number"},{"type":"null"}]},"drifting":{"description":"`drift` is over the organisation threshold (default 8 %).","type":"boolean"}}}},"price":{"description":"Price with VAT as a number.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency. 0 when not set. Snapshotted onto shop__order_item.cost at order creation, FX-converted to the order currency.","type":"number"},"standardPricePercentage":{"description":"Standard price percentage for discount calculation.","type":"number"},"vat":{"description":"VAT rate percentage.","type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","type":"number"},"weightGrams":{"description":"Product weight in grams.","type":"number"},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","type":"number"},"stockUnit":{"description":"Warehouse stock unit (\"m\", \"kg\"…). Missing = pieces.","type":"string"},"trackLots":{"description":"Warehouse tracks lots (šarže) for this product.","type":"boolean"},"stockTracked":{"description":"FALSE = service / digital item: orders neither reserve nor check its warehouse stock.","type":"boolean"},"defaultWarehouseId":{"description":"Preselected warehouse (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"description":"Supplier lead time in days (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"defaultVendor":{"description":"Default supplier (BIZKIT-168).","anyOf":[{"type":"object","required":["id","name"],"properties":{"id":{"description":"Contact external id.","type":"string"},"name":{"type":"string"}}},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168).","anyOf":[{"type":"string"},{"type":"null"}]},"isVariantProduct":{"description":"Whether the product has variants.","type":"boolean"},"variantCount":{"description":"Number of product variants.","type":"number"},"customFields":{"description":"Custom fields attached to the product.","type":"array","items":{"type":"object","required":["key","value","active","insertedDate"],"properties":{"key":{"description":"Custom field key identifier.","type":"string"},"value":{"description":"Custom field value.","type":"string"},"active":{"description":"Whether the field is active.","type":"boolean"},"insertedDate":{"description":"Date when the field was created/updated.","anyOf":[{"description":"Date when the field was created/updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"customFieldsDefinition":{"description":"Available custom field definitions for the product category.","type":"array","items":{"type":"object","required":["key","type","label","required"],"properties":{"key":{"description":"Field key identifier.","type":"string"},"type":{"description":"Field type: text, textarea, number, or boolean.","type":"string"},"label":{"description":"Display label for the field.","type":"string"},"helperText":{"description":"Helper text shown below the field.","type":"string"},"placeholder":{"description":"Placeholder text for the input.","type":"string"},"required":{"description":"Whether the field is required.","type":"boolean"},"validationPattern":{"description":"Regex pattern for validation.","type":"string"}}}},"eventList":{"description":"Calendar events linked to this product.","type":"array","items":{"type":"object","required":["id","type","title","isStorno","startTime","endTime"],"properties":{"id":{"description":"Event code.","type":"string"},"type":{"description":"How the event is linked: directly or via event type.","anyOf":[{"const":"direct","type":"string"},{"const":"eventType","type":"string"}]},"title":{"description":"Event title.","type":"string"},"isStorno":{"description":"Whether the event is cancelled.","type":"boolean"},"startTime":{"description":"Event start time.","anyOf":[{"description":"Event start time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"endTime":{"description":"Event end time.","anyOf":[{"description":"Event end time.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"typeCode":{"description":"Event type code.","type":"string"},"typeLabel":{"description":"Event type label.","type":"string"},"typeColor":{"description":"Event type color (hex, e.g. \"#FF5733\").","type":"string"}}}},"translatedLocales":{"description":"Locales for which a translation exists in shop__product_translation.","type":"array","items":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"}},"voucherTemplateCount":{"description":"Number of voucher templates linked to this product.","type":"number"},"subscriptionPlanCount":{"description":"Number of subscription plans linked to this product.","type":"number"},"bundleItemCount":{"description":"Number of bundle (sada) components; 0 = ordinary product.","type":"number"},"pricelistRules":{"description":"Dynamic pricing rules. Empty array on products with static pricing.","type":"array","items":{"type":"object","required":["id","name","enabled","priority","validFrom","validTo","weekdays","timeFrom","timeTo","variantCode","price"],"properties":{"id":{"description":"Stable UUID — preserved across edits.","type":"string"},"name":{"description":"Human label shown in the rule grid.","type":"string"},"enabled":{"description":"Whether the resolver considers this rule.","type":"boolean"},"priority":{"description":"Higher value wins; ties broken by specificity.","type":"number"},"validFrom":{"description":"Inclusive lower date bound (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"Inclusive upper date bound (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"weekdays":{"description":"Allowed ISO weekdays (Mon=1 … Sun=7), or null for every day.","anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]},"timeFrom":{"description":"Inclusive lower time-of-day bound (HH:mm).","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"Inclusive upper time-of-day bound (HH:mm). When < timeFrom the window crosses midnight.","anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"description":"Variant code scope, or null for all variants.","anyOf":[{"type":"string"},{"type":"null"}]},"price":{"description":"Price applied when this rule wins.","type":"number"}}}}},"required":["id","code","name","slug","shortDescription","longDescription","internalNote","active","deleted","b2b","showInFeed","soldOut","defaultCurrency","otherCurrencyPrices","price","cost","trackLots","stockTracked","defaultWarehouseId","purchaseLeadTimeDays","defaultVendor","vendorItemCode","isVariantProduct","variantCount","customFields","customFieldsDefinition","eventList","translatedLocales","voucherTemplateCount","subscriptionPlanCount","bundleItemCount","pricelistRules"]}}}}},"operationId":"getBffProductProduct-detail","tags":["Product"],"summary":"Get product detail","description":"Returns full product detail including all editable fields, custom fields, field definitions, and linked events. Translatable fields (name, descriptions) are resolved from the translation table with locale fallback."}},"/bff/product/price-schedule-list":{"get":{"parameters":[{"examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"defaultCurrency":{"type":"string"},"currencies":{"type":"array","items":{"type":"string"}},"items":{"type":"array","items":{"type":"object","required":["id","currency","kind","price","validFrom","validTo","state","regularPrice","lowestPrice30Days","note","resultNote","memberName","insertedDate","startedDate","endedDate"],"properties":{"id":{"type":"number"},"currency":{"type":"string"},"kind":{"examples":["sale","change"],"type":"string"},"price":{"anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"examples":["scheduled","active","done","cancelled","failed"],"type":"string"},"regularPrice":{"description":"Sale: price before it (null = followed the rate).","anyOf":[{"type":"number"},{"type":"null"}]},"lowestPrice30Days":{"description":"Sale: the legal reference price at its start.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"resultNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"memberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"endedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","currencies","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"defaultCurrency":{"type":"string"},"currencies":{"type":"array","items":{"type":"string"}},"items":{"type":"array","items":{"type":"object","required":["id","currency","kind","price","validFrom","validTo","state","regularPrice","lowestPrice30Days","note","resultNote","memberName","insertedDate","startedDate","endedDate"],"properties":{"id":{"type":"number"},"currency":{"type":"string"},"kind":{"examples":["sale","change"],"type":"string"},"price":{"anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"examples":["scheduled","active","done","cancelled","failed"],"type":"string"},"regularPrice":{"description":"Sale: price before it (null = followed the rate).","anyOf":[{"type":"number"},{"type":"null"}]},"lowestPrice30Days":{"description":"Sale: the legal reference price at its start.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"resultNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"memberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"endedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","currencies","items"]}},"text/plain":{"schema":{"type":"object","properties":{"defaultCurrency":{"type":"string"},"currencies":{"type":"array","items":{"type":"string"}},"items":{"type":"array","items":{"type":"object","required":["id","currency","kind","price","validFrom","validTo","state","regularPrice","lowestPrice30Days","note","resultNote","memberName","insertedDate","startedDate","endedDate"],"properties":{"id":{"type":"number"},"currency":{"type":"string"},"kind":{"examples":["sale","change"],"type":"string"},"price":{"anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"state":{"examples":["scheduled","active","done","cancelled","failed"],"type":"string"},"regularPrice":{"description":"Sale: price before it (null = followed the rate).","anyOf":[{"type":"number"},{"type":"null"}]},"lowestPrice30Days":{"description":"Sale: the legal reference price at its start.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"resultNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"memberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"endedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["defaultCurrency","currencies","items"]}}}}},"operationId":"getBffProductPrice-schedule-list","tags":["Product"],"summary":"Sales and scheduled price changes of a product","description":"Open schedules first, then the latest 50 finished ones. `currency` is always an ISO code (the default currency for product-price schedules). `currencies` = what a new schedule may use (default first)."}},"/bff/product/price-schedule-preview":{"post":{"parameters":[],"operationId":"postBffProductPrice-schedule-preview","tags":["Product"],"summary":"Preview a sale / scheduled price change","description":"Current price, the lowest price of the last 30 days, the discount measured from both and the \"fake discount\" warnings (`notBelowRegular`, `notBelowLowest`, `regularAboveLowest`), plus a conflict with another schedule. Nothing is stored.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","currency","kind","price","validFrom"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["EUR"],"type":"string"},"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"price":{"description":"null = remove the manual price (change only).","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"validFrom":{"description":"ISO date-time.","examples":["2027-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date-time; sales only.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","currency","kind","price","validFrom"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["EUR"],"type":"string"},"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"price":{"description":"null = remove the manual price (change only).","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"validFrom":{"description":"ISO date-time.","examples":["2027-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date-time; sales only.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["productCode","currency","kind","price","validFrom"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["EUR"],"type":"string"},"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"price":{"description":"null = remove the manual price (change only).","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"validFrom":{"description":"ISO date-time.","examples":["2027-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date-time; sales only.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/product/price-schedule-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"}},"required":["id"]}}}}},"operationId":"postBffProductPrice-schedule-create","tags":["Product"],"summary":"Schedule a sale or a price change","description":"A sale sets `price` from `validFrom` to `validTo` and then brings the regular price back; a change sets it for good at `validFrom` (`price: null` = remove the manual price). Applied by the cron every 2 minutes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","currency","kind","price","validFrom"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["EUR"],"type":"string"},"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"price":{"description":"null = remove the manual price (change only).","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"validFrom":{"description":"ISO date-time.","examples":["2027-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date-time; sales only.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","currency","kind","price","validFrom"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["EUR"],"type":"string"},"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"price":{"description":"null = remove the manual price (change only).","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"validFrom":{"description":"ISO date-time.","examples":["2027-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date-time; sales only.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["productCode","currency","kind","price","validFrom"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["EUR"],"type":"string"},"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"price":{"description":"null = remove the manual price (change only).","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"validFrom":{"description":"ISO date-time.","examples":["2027-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date-time; sales only.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/product/price-schedule-cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"examples":["cancelled","done"],"type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"examples":["cancelled","done"],"type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"examples":["cancelled","done"],"type":"string"}},"required":["state"]}}}}},"operationId":"postBffProductPrice-schedule-cancel","tags":["Product"],"summary":"Cancel a scheduled price / end a running sale now","description":"A running sale ends right away and the regular price comes back.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}}}},"/bff/product/price-history":{"get":{"parameters":[{"description":"Product code to get price history for.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["EUR"],"type":"string"},"series":{"description":"One timeline per selling currency (default first).","type":"array","items":{"type":"object","required":["currency","points","current","lowest30Days","sales"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"points":{"description":"Price in effect from `at` on (manual where set, else converted at today's rate).","type":"array","items":{"type":"object","required":["at","price"],"properties":{"at":{"type":"string"},"price":{"type":"number"}}}},"current":{"anyOf":[{"type":"number"},{"type":"null"}]},"lowest30Days":{"description":"Lowest price of the last 30 days, the same figure as the public API.","anyOf":[{"type":"number"},{"type":"null"}]},"sales":{"description":"Sale periods in this currency (`to` null = running).","type":"array","items":{"type":"object","required":["from","to","price"],"properties":{"from":{"type":"string"},"to":{"anyOf":[{"type":"string"},{"type":"null"}]},"price":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},"changes":{"description":"Latest 100 changes, newest first.","type":"array","items":{"type":"object","required":["at","currency","price","memberName"],"properties":{"at":{"type":"string"},"currency":{"type":"string"},"price":{"description":"null = manual price removed (back to the rate).","anyOf":[{"type":"number"},{"type":"null"}]},"memberName":{"description":"Who changed it; null = system / before 2026-11-30.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"priceItems":{"description":"Price history entries ordered by date descending.","type":"array","items":{"type":"object","required":["price","inserted_date"],"properties":{"price":{"description":"Price with VAT at that point in time.","type":"number"},"inserted_date":{"description":"Date when the price was recorded.","anyOf":[{"description":"Date when the price was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["defaultCurrency","series","changes","priceItems"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["EUR"],"type":"string"},"series":{"description":"One timeline per selling currency (default first).","type":"array","items":{"type":"object","required":["currency","points","current","lowest30Days","sales"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"points":{"description":"Price in effect from `at` on (manual where set, else converted at today's rate).","type":"array","items":{"type":"object","required":["at","price"],"properties":{"at":{"type":"string"},"price":{"type":"number"}}}},"current":{"anyOf":[{"type":"number"},{"type":"null"}]},"lowest30Days":{"description":"Lowest price of the last 30 days, the same figure as the public API.","anyOf":[{"type":"number"},{"type":"null"}]},"sales":{"description":"Sale periods in this currency (`to` null = running).","type":"array","items":{"type":"object","required":["from","to","price"],"properties":{"from":{"type":"string"},"to":{"anyOf":[{"type":"string"},{"type":"null"}]},"price":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},"changes":{"description":"Latest 100 changes, newest first.","type":"array","items":{"type":"object","required":["at","currency","price","memberName"],"properties":{"at":{"type":"string"},"currency":{"type":"string"},"price":{"description":"null = manual price removed (back to the rate).","anyOf":[{"type":"number"},{"type":"null"}]},"memberName":{"description":"Who changed it; null = system / before 2026-11-30.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"priceItems":{"description":"Price history entries ordered by date descending.","type":"array","items":{"type":"object","required":["price","inserted_date"],"properties":{"price":{"description":"Price with VAT at that point in time.","type":"number"},"inserted_date":{"description":"Date when the price was recorded.","anyOf":[{"description":"Date when the price was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["defaultCurrency","series","changes","priceItems"]}},"text/plain":{"schema":{"type":"object","properties":{"defaultCurrency":{"examples":["EUR"],"type":"string"},"series":{"description":"One timeline per selling currency (default first).","type":"array","items":{"type":"object","required":["currency","points","current","lowest30Days","sales"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"points":{"description":"Price in effect from `at` on (manual where set, else converted at today's rate).","type":"array","items":{"type":"object","required":["at","price"],"properties":{"at":{"type":"string"},"price":{"type":"number"}}}},"current":{"anyOf":[{"type":"number"},{"type":"null"}]},"lowest30Days":{"description":"Lowest price of the last 30 days, the same figure as the public API.","anyOf":[{"type":"number"},{"type":"null"}]},"sales":{"description":"Sale periods in this currency (`to` null = running).","type":"array","items":{"type":"object","required":["from","to","price"],"properties":{"from":{"type":"string"},"to":{"anyOf":[{"type":"string"},{"type":"null"}]},"price":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},"changes":{"description":"Latest 100 changes, newest first.","type":"array","items":{"type":"object","required":["at","currency","price","memberName"],"properties":{"at":{"type":"string"},"currency":{"type":"string"},"price":{"description":"null = manual price removed (back to the rate).","anyOf":[{"type":"number"},{"type":"null"}]},"memberName":{"description":"Who changed it; null = system / before 2026-11-30.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"priceItems":{"description":"Price history entries ordered by date descending.","type":"array","items":{"type":"object","required":["price","inserted_date"],"properties":{"price":{"description":"Price with VAT at that point in time.","type":"number"},"inserted_date":{"description":"Date when the price was recorded.","anyOf":[{"description":"Date when the price was recorded.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}}},"required":["defaultCurrency","series","changes","priceItems"]}}}}},"operationId":"getBffProductPrice-history","tags":["Product"],"summary":"Get product price history","description":"Price history per selling currency (timeline, lowest price of 30 days) and the latest changes with who made them. `priceItems` = default-currency rows, most recent first (legacy shape)."}},"/bff/product/search-related-products":{"get":{"parameters":[{"description":"Product code to search related products for.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true},{"description":"Search query to filter potential related products by name, code, EAN, or description.","schema":{"type":"string"},"in":"query","name":"query","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Matching products (same structure as product list items).","type":"array","items":{}},"itemCount":{"description":"Total matching products.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Matching products (same structure as product list items).","type":"array","items":{}},"itemCount":{"description":"Total matching products.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Matching products (same structure as product list items).","type":"array","items":{}},"itemCount":{"description":"Total matching products.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProductSearch-related-products","tags":["Product"],"summary":"Search products for relating","description":"Searches for products that can be added as related to the given product. Excludes the product itself. Returns up to 20 matching products."}},"/bff/product/analytics":{"get":{"parameters":[{"description":"Unique product code.","schema":{"type":"string"},"in":"query","name":"productCode","required":true},{"description":"Rolling window in months for the time-series (default 24, clamped to [1, 60]). KPIs and top-N lists are always LIFETIME regardless of this window.","schema":{"type":"string"},"in":"query","name":"monthCount","required":false}],"operationId":"getBffProductAnalytics","tags":["Product"],"summary":"Product analytics — KPIs, monthly time-series, top customers, top branches","description":"One-shot analytics payload for the product detail \"Analytika\" tab. Revenue uses `real_money_price` on non-storno order-items (identical to the branch Finance grid). Monthly buckets are keyed on `COALESCE(calendar_event.start_time, order_item.inserted_date)` so calendar-linked items land in the month they HAPPENED, not the month they were paid.","responses":{"200":{}}}},"/bff/product/product-detail-related":{"get":{"parameters":[{"description":"Product code to list related products for.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Related products (same structure as product list items).","type":"array","items":{}},"itemCount":{"description":"Total number of related products.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Related products (same structure as product list items).","type":"array","items":{}},"itemCount":{"description":"Total number of related products.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Related products (same structure as product list items).","type":"array","items":{}},"itemCount":{"description":"Total number of related products.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProductProduct-detail-related","tags":["Product"],"summary":"List related products","description":"Returns all products related to the given product (bidirectional relation). Related products are shown as recommendations on the product page."}},"/bff/product/connect-related-product":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the relation was created successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the relation was created successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the relation was created successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductConnect-related-product","tags":["Product"],"summary":"Connect related product","description":"Creates a bidirectional relation between two products. Both products will show each other as related. Regenerates read models for both products.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","relatedCode"],"properties":{"productCode":{"description":"Product code to add a relation to.","examples":["my-product"],"type":"string"},"relatedCode":{"description":"Product code of the related product.","examples":["related-product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","relatedCode"],"properties":{"productCode":{"description":"Product code to add a relation to.","examples":["my-product"],"type":"string"},"relatedCode":{"description":"Product code of the related product.","examples":["related-product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","relatedCode"],"properties":{"productCode":{"description":"Product code to add a relation to.","examples":["my-product"],"type":"string"},"relatedCode":{"description":"Product code of the related product.","examples":["related-product"],"type":"string"}}}}}}}},"/bff/product/disconnect-related-product":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the relation was removed successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the relation was removed successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the relation was removed successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductDisconnect-related-product","tags":["Product"],"summary":"Disconnect related product","description":"Removes the bidirectional relation between two products.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","relatedCode"],"properties":{"productCode":{"description":"Product code to remove the relation from.","examples":["my-product"],"type":"string"},"relatedCode":{"description":"Product code of the related product to disconnect.","examples":["related-product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","relatedCode"],"properties":{"productCode":{"description":"Product code to remove the relation from.","examples":["my-product"],"type":"string"},"relatedCode":{"description":"Product code of the related product to disconnect.","examples":["related-product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","relatedCode"],"properties":{"productCode":{"description":"Product code to remove the relation from.","examples":["my-product"],"type":"string"},"relatedCode":{"description":"Product code of the related product to disconnect.","examples":["related-product"],"type":"string"}}}}}}}},"/bff/product/product-detail-bundle":{"get":{"parameters":[{"description":"Bundle product code.","examples":["starter-set"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true},{"description":"Locale for component names.","examples":["cs"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","variantCode","variantName","bundleVariantCode","bundleVariantName","quantity","unitPrice","totalPrice","vat","soldOut","active","isDeleted","availableQuantity"],"properties":{"productCode":{"type":"string"},"productName":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleVariantCode":{"description":"Variant of the bundle the component belongs to; null = every variant.","anyOf":[{"type":"string"},{"type":"null"}]},"bundleVariantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Units of the component in one bundle.","type":"number"},"unitPrice":{"description":"Component list price (variant price when pinned).","type":"number"},"totalPrice":{"description":"unitPrice × quantity.","type":"number"},"vat":{"type":"number"},"soldOut":{"type":"boolean"},"active":{"type":"boolean"},"isDeleted":{"type":"boolean"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"bundleVariants":{"description":"Variants of the bundle with their own composition; empty when the bundle has none.","type":"array","items":{"type":"object","required":["code","name","itemCount","componentsPriceSum","availableQuantity"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"itemCount":{"description":"Components this variant packs (shared + its own).","type":"number"},"componentsPriceSum":{"type":"number"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"},"componentsPriceSum":{"type":"number"},"bundlePrice":{"type":"number"},"savingAmount":{"description":"componentsPriceSum − bundlePrice (negative = bundle is pricier).","type":"number"},"savingPercentage":{"anyOf":[{"type":"number"},{"type":"null"}]},"bundleVat":{"type":"number"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedInBundles":{"type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"type":"string"},"name":{"type":"string"}}}}},"required":["items","bundleVariants","itemCount","componentsPriceSum","bundlePrice","savingAmount","savingPercentage","bundleVat","availableQuantity","usedInBundles"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","variantCode","variantName","bundleVariantCode","bundleVariantName","quantity","unitPrice","totalPrice","vat","soldOut","active","isDeleted","availableQuantity"],"properties":{"productCode":{"type":"string"},"productName":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleVariantCode":{"description":"Variant of the bundle the component belongs to; null = every variant.","anyOf":[{"type":"string"},{"type":"null"}]},"bundleVariantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Units of the component in one bundle.","type":"number"},"unitPrice":{"description":"Component list price (variant price when pinned).","type":"number"},"totalPrice":{"description":"unitPrice × quantity.","type":"number"},"vat":{"type":"number"},"soldOut":{"type":"boolean"},"active":{"type":"boolean"},"isDeleted":{"type":"boolean"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"bundleVariants":{"description":"Variants of the bundle with their own composition; empty when the bundle has none.","type":"array","items":{"type":"object","required":["code","name","itemCount","componentsPriceSum","availableQuantity"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"itemCount":{"description":"Components this variant packs (shared + its own).","type":"number"},"componentsPriceSum":{"type":"number"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"},"componentsPriceSum":{"type":"number"},"bundlePrice":{"type":"number"},"savingAmount":{"description":"componentsPriceSum − bundlePrice (negative = bundle is pricier).","type":"number"},"savingPercentage":{"anyOf":[{"type":"number"},{"type":"null"}]},"bundleVat":{"type":"number"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedInBundles":{"type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"type":"string"},"name":{"type":"string"}}}}},"required":["items","bundleVariants","itemCount","componentsPriceSum","bundlePrice","savingAmount","savingPercentage","bundleVat","availableQuantity","usedInBundles"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","variantCode","variantName","bundleVariantCode","bundleVariantName","quantity","unitPrice","totalPrice","vat","soldOut","active","isDeleted","availableQuantity"],"properties":{"productCode":{"type":"string"},"productName":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"bundleVariantCode":{"description":"Variant of the bundle the component belongs to; null = every variant.","anyOf":[{"type":"string"},{"type":"null"}]},"bundleVariantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Units of the component in one bundle.","type":"number"},"unitPrice":{"description":"Component list price (variant price when pinned).","type":"number"},"totalPrice":{"description":"unitPrice × quantity.","type":"number"},"vat":{"type":"number"},"soldOut":{"type":"boolean"},"active":{"type":"boolean"},"isDeleted":{"type":"boolean"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"bundleVariants":{"description":"Variants of the bundle with their own composition; empty when the bundle has none.","type":"array","items":{"type":"object","required":["code","name","itemCount","componentsPriceSum","availableQuantity"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"itemCount":{"description":"Components this variant packs (shared + its own).","type":"number"},"componentsPriceSum":{"type":"number"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"},"componentsPriceSum":{"type":"number"},"bundlePrice":{"type":"number"},"savingAmount":{"description":"componentsPriceSum − bundlePrice (negative = bundle is pricier).","type":"number"},"savingPercentage":{"anyOf":[{"type":"number"},{"type":"null"}]},"bundleVat":{"type":"number"},"availableQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"usedInBundles":{"type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"type":"string"},"name":{"type":"string"}}}}},"required":["items","bundleVariants","itemCount","componentsPriceSum","bundlePrice","savingAmount","savingPercentage","bundleVat","availableQuantity","usedInBundles"]}}}}},"operationId":"getBffProductProduct-detail-bundle","tags":["Product"],"summary":"Get product bundle (sada) composition","description":"Returns the components of a bundle product, the sum of their list prices (to compare with the bundle price), assemblable quantity from component stock, and the bundles this product is a component of. An empty `items` list means the product is not a bundle."}},"/bff/product/bundle-item-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductBundle-item-add","tags":["Product"],"summary":"Add component to product bundle","description":"Adds a component to a bundle (sada), or increases its quantity when already present. Rejected (400) for nested bundles, unpinned components with variants, and mixed VAT rates. A bundle with variants can pin a component to one of its variants via `bundleVariantCode`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","componentCode","quantity"],"properties":{"productCode":{"description":"Bundle product code.","examples":["starter-set"],"type":"string"},"componentCode":{"description":"Component product code.","examples":["shaker"],"type":"string"},"componentVariantCode":{"description":"Component variant code. Required when the component has variants.","type":"string"},"bundleVariantCode":{"description":"Variant of the bundle the component belongs to. Empty = packed into every variant of the bundle.","type":"string"},"quantity":{"minimum":1,"description":"Units of the component in one bundle.","examples":[2],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","componentCode","quantity"],"properties":{"productCode":{"description":"Bundle product code.","examples":["starter-set"],"type":"string"},"componentCode":{"description":"Component product code.","examples":["shaker"],"type":"string"},"componentVariantCode":{"description":"Component variant code. Required when the component has variants.","type":"string"},"bundleVariantCode":{"description":"Variant of the bundle the component belongs to. Empty = packed into every variant of the bundle.","type":"string"},"quantity":{"minimum":1,"description":"Units of the component in one bundle.","examples":[2],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","componentCode","quantity"],"properties":{"productCode":{"description":"Bundle product code.","examples":["starter-set"],"type":"string"},"componentCode":{"description":"Component product code.","examples":["shaker"],"type":"string"},"componentVariantCode":{"description":"Component variant code. Required when the component has variants.","type":"string"},"bundleVariantCode":{"description":"Variant of the bundle the component belongs to. Empty = packed into every variant of the bundle.","type":"string"},"quantity":{"minimum":1,"description":"Units of the component in one bundle.","examples":[2],"type":"number"}}}}}}}},"/bff/product/bundle-item-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductBundle-item-update","tags":["Product"],"summary":"Change component quantity in product bundle","description":"Sets the quantity of one bundle component. Existing orders are not affected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","componentCode","quantity"],"properties":{"productCode":{"description":"Bundle product code.","type":"string"},"componentCode":{"description":"Component product code.","type":"string"},"componentVariantCode":{"description":"Component variant code, when pinned.","type":"string"},"bundleVariantCode":{"description":"Bundle variant code, when the row is pinned to one.","type":"string"},"quantity":{"minimum":1,"description":"New units of the component in one bundle.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","componentCode","quantity"],"properties":{"productCode":{"description":"Bundle product code.","type":"string"},"componentCode":{"description":"Component product code.","type":"string"},"componentVariantCode":{"description":"Component variant code, when pinned.","type":"string"},"bundleVariantCode":{"description":"Bundle variant code, when the row is pinned to one.","type":"string"},"quantity":{"minimum":1,"description":"New units of the component in one bundle.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","componentCode","quantity"],"properties":{"productCode":{"description":"Bundle product code.","type":"string"},"componentCode":{"description":"Component product code.","type":"string"},"componentVariantCode":{"description":"Component variant code, when pinned.","type":"string"},"bundleVariantCode":{"description":"Bundle variant code, when the row is pinned to one.","type":"string"},"quantity":{"minimum":1,"description":"New units of the component in one bundle.","type":"number"}}}}}}}},"/bff/product/bundle-item-remove":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductBundle-item-remove","tags":["Product"],"summary":"Remove component from product bundle","description":"Removes one component from a bundle. Removing the last component turns the product back into an ordinary product. Existing orders are not affected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","componentCode"],"properties":{"productCode":{"description":"Bundle product code.","type":"string"},"componentCode":{"description":"Component product code.","type":"string"},"componentVariantCode":{"description":"Component variant code, when pinned.","type":"string"},"bundleVariantCode":{"description":"Bundle variant code, when the row is pinned to one.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","componentCode"],"properties":{"productCode":{"description":"Bundle product code.","type":"string"},"componentCode":{"description":"Component product code.","type":"string"},"componentVariantCode":{"description":"Component variant code, when pinned.","type":"string"},"bundleVariantCode":{"description":"Bundle variant code, when the row is pinned to one.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","componentCode"],"properties":{"productCode":{"description":"Bundle product code.","type":"string"},"componentCode":{"description":"Component product code.","type":"string"},"componentVariantCode":{"description":"Component variant code, when pinned.","type":"string"},"bundleVariantCode":{"description":"Bundle variant code, when the row is pinned to one.","type":"string"}}}}}}}},"/bff/product/search-product-list-autocomplete":{"get":{"parameters":[{"description":"Search query: product name or short description, or the code / SKU / EAN of the product or a variant.","examples":["blue shirt","1032"],"schema":{"type":"string"},"in":"query","name":"searchQuery","required":true},{"description":"Supplier contact external id: that supplier's products rank first (BIZKIT-168).","schema":{"type":"string"},"in":"query","name":"vendorContactId","required":false},{"description":"'true' = only the supplier's products (requires vendorContactId).","schema":{"type":"string"},"in":"query","name":"vendorOnly","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Products matching the autocomplete query.","type":"array","items":{"type":"object","required":["code","name","price","vat"],"properties":{"code":{"description":"Product code.","type":"string"},"sku":{"description":"Product SKU (internal part number).","type":"string"},"name":{"description":"Product name.","type":"string"},"shortDescription":{"description":"Short description, truncated to 150 characters.","type":"string"},"mainImageUrl":{"description":"Main product image URL.","type":"string"},"price":{"description":"Price with VAT.","type":"number"},"vat":{"description":"VAT rate percentage.","type":"number"},"matchedVariant":{"description":"Variant whose code / SKU / EAN matched the query.","type":"object","required":["code","name"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"sku":{"type":"string"}}},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168).","type":"string"},"isDefaultVendor":{"description":"The requested supplier is the default supplier.","type":"boolean"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Products matching the autocomplete query.","type":"array","items":{"type":"object","required":["code","name","price","vat"],"properties":{"code":{"description":"Product code.","type":"string"},"sku":{"description":"Product SKU (internal part number).","type":"string"},"name":{"description":"Product name.","type":"string"},"shortDescription":{"description":"Short description, truncated to 150 characters.","type":"string"},"mainImageUrl":{"description":"Main product image URL.","type":"string"},"price":{"description":"Price with VAT.","type":"number"},"vat":{"description":"VAT rate percentage.","type":"number"},"matchedVariant":{"description":"Variant whose code / SKU / EAN matched the query.","type":"object","required":["code","name"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"sku":{"type":"string"}}},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168).","type":"string"},"isDefaultVendor":{"description":"The requested supplier is the default supplier.","type":"boolean"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Products matching the autocomplete query.","type":"array","items":{"type":"object","required":["code","name","price","vat"],"properties":{"code":{"description":"Product code.","type":"string"},"sku":{"description":"Product SKU (internal part number).","type":"string"},"name":{"description":"Product name.","type":"string"},"shortDescription":{"description":"Short description, truncated to 150 characters.","type":"string"},"mainImageUrl":{"description":"Main product image URL.","type":"string"},"price":{"description":"Price with VAT.","type":"number"},"vat":{"description":"VAT rate percentage.","type":"number"},"matchedVariant":{"description":"Variant whose code / SKU / EAN matched the query.","type":"object","required":["code","name"],"properties":{"code":{"type":"string"},"name":{"type":"string"},"sku":{"type":"string"}}},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168).","type":"string"},"isDefaultVendor":{"description":"The requested supplier is the default supplier.","type":"boolean"}}}}},"required":["items"]}}}}},"operationId":"getBffProductSearch-product-list-autocomplete","tags":["Product"],"summary":"Autocomplete product search","description":"Returns up to 20 products matching the search query for autocomplete purposes. Searches by name and short description, and by code, SKU and EAN of the product and its variants; exact identifier matches come first. `matchedVariant` is the variant whose identifier matched. Includes thumbnail image and price."}},"/bff/product/connect-event":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was linked successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was linked successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was linked successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductConnect-event","tags":["Product"],"summary":"Connect calendar event","description":"Links a calendar event directly to a product. The event will appear in the product detail event list with type \"direct\".","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","eventCode"],"properties":{"productCode":{"description":"Product code to link the event to.","examples":["my-product"],"type":"string"},"eventCode":{"description":"Calendar event code to link.","examples":["event-2024-01"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","eventCode"],"properties":{"productCode":{"description":"Product code to link the event to.","examples":["my-product"],"type":"string"},"eventCode":{"description":"Calendar event code to link.","examples":["event-2024-01"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","eventCode"],"properties":{"productCode":{"description":"Product code to link the event to.","examples":["my-product"],"type":"string"},"eventCode":{"description":"Calendar event code to link.","examples":["event-2024-01"],"type":"string"}}}}}}}},"/bff/product/disconnect-event":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was unlinked successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was unlinked successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the event was unlinked successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductDisconnect-event","tags":["Product"],"summary":"Disconnect calendar event","description":"Removes the direct event link from a product. Events linked via event type are not affected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code to unlink the event from.","examples":["my-product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code to unlink the event from.","examples":["my-product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code to unlink the event from.","examples":["my-product"],"type":"string"}}}}}}}},"/bff/product/connect-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contact was linked successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contact was linked successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the contact was linked successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductConnect-contact","tags":["Product"],"summary":"Connect contact to product","description":"Links a customer/contact to a product. Used for tracking product-customer relationships.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","contactId"],"properties":{"productCode":{"description":"Product code to link the contact to.","examples":["my-product"],"type":"string"},"contactId":{"description":"Contact CU reference number.","examples":["CU-00123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","contactId"],"properties":{"productCode":{"description":"Product code to link the contact to.","examples":["my-product"],"type":"string"},"contactId":{"description":"Contact CU reference number.","examples":["CU-00123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","contactId"],"properties":{"productCode":{"description":"Product code to link the contact to.","examples":["my-product"],"type":"string"},"contactId":{"description":"Contact CU reference number.","examples":["CU-00123"],"type":"string"}}}}}}}},"/bff/product/detail-change-code":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"description":"The final product code after slugification and deduplication.","type":"string"}},"required":["code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"code":{"description":"The final product code after slugification and deduplication.","type":"string"}},"required":["code"]}},"text/plain":{"schema":{"type":"object","properties":{"code":{"description":"The final product code after slugification and deduplication.","type":"string"}},"required":["code"]}}}}},"operationId":"postBffProductDetail-change-code","tags":["Product"],"summary":"Change product code","description":"Changes the unique code of a product. The new code is automatically slugified and deduplicated. Includes an optimistic concurrency check: currentCode must match the actual code.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","currentCode","newCode"],"properties":{"id":{"description":"Current product code (used to look up the product).","examples":["my-product"],"type":"string"},"currentCode":{"description":"Expected current code (optimistic concurrency check).","examples":["my-product"],"type":"string"},"newCode":{"description":"New product code. Will be slugified and deduplicated.","examples":["my-new-product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","currentCode","newCode"],"properties":{"id":{"description":"Current product code (used to look up the product).","examples":["my-product"],"type":"string"},"currentCode":{"description":"Expected current code (optimistic concurrency check).","examples":["my-product"],"type":"string"},"newCode":{"description":"New product code. Will be slugified and deduplicated.","examples":["my-new-product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","currentCode","newCode"],"properties":{"id":{"description":"Current product code (used to look up the product).","examples":["my-product"],"type":"string"},"currentCode":{"description":"Expected current code (optimistic concurrency check).","examples":["my-product"],"type":"string"},"newCode":{"description":"New product code. Will be slugified and deduplicated.","examples":["my-new-product"],"type":"string"}}}}}}}},"/bff/product/product-reorder":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the reorder completed.","type":"boolean"},"reordered":{"description":"Number of products whose positions were swapped.","type":"number"},"totalProducts":{"description":"Total non-deleted products in the organisation.","type":"number"},"repacked":{"description":"Whether a global 1..N repack pass was applied (true if a gap was detected).","type":"boolean"}},"required":["success","reordered","totalProducts","repacked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the reorder completed.","type":"boolean"},"reordered":{"description":"Number of products whose positions were swapped.","type":"number"},"totalProducts":{"description":"Total non-deleted products in the organisation.","type":"number"},"repacked":{"description":"Whether a global 1..N repack pass was applied (true if a gap was detected).","type":"boolean"}},"required":["success","reordered","totalProducts","repacked"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the reorder completed.","type":"boolean"},"reordered":{"description":"Number of products whose positions were swapped.","type":"number"},"totalProducts":{"description":"Total non-deleted products in the organisation.","type":"number"},"repacked":{"description":"Whether a global 1..N repack pass was applied (true if a gap was detected).","type":"boolean"}},"required":["success","reordered","totalProducts","repacked"]}}}}},"operationId":"postBffProductProduct-reorder","tags":["Product"],"summary":"Reorder products by swapping positions","description":"Atomically redistributes existing `position` values among the listed products according to the new order. Verifies global density (positions 1..N without gaps) with a cheap aggregate query and runs a window-function repack only if needed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderedCodes"],"properties":{"orderedCodes":{"minItems":2,"description":"Product codes in their new visual order. Their existing `position` values are redistributed among them (swapped mutually); products outside this list keep their absolute positions. A global 1..N repack runs only if a position gap is detected after the swap.","examples":[["product-a","product-c","product-b"]],"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderedCodes"],"properties":{"orderedCodes":{"minItems":2,"description":"Product codes in their new visual order. Their existing `position` values are redistributed among them (swapped mutually); products outside this list keep their absolute positions. A global 1..N repack runs only if a position gap is detected after the swap.","examples":[["product-a","product-c","product-b"]],"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["orderedCodes"],"properties":{"orderedCodes":{"minItems":2,"description":"Product codes in their new visual order. Their existing `position` values are redistributed among them (swapped mutually); products outside this list keep their absolute positions. A global 1..N repack runs only if a position gap is detected after the swap.","examples":[["product-a","product-c","product-b"]],"type":"array","items":{"type":"string"}}}}}}}}},"/bff/product/product-move-to-end":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation completed.","type":"boolean"},"previousPosition":{"description":"Position the product held before the move.","type":"number"},"newPosition":{"description":"Position the product holds after the move.","type":"number"},"totalProducts":{"description":"Total non-deleted products in the organisation.","type":"number"},"shiftedCount":{"description":"How many other products were shifted down by one.","type":"number"},"repacked":{"description":"Whether a global 1..N repack pass was applied.","type":"boolean"}},"required":["success","previousPosition","newPosition","totalProducts","shiftedCount","repacked"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation completed.","type":"boolean"},"previousPosition":{"description":"Position the product held before the move.","type":"number"},"newPosition":{"description":"Position the product holds after the move.","type":"number"},"totalProducts":{"description":"Total non-deleted products in the organisation.","type":"number"},"shiftedCount":{"description":"How many other products were shifted down by one.","type":"number"},"repacked":{"description":"Whether a global 1..N repack pass was applied.","type":"boolean"}},"required":["success","previousPosition","newPosition","totalProducts","shiftedCount","repacked"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the operation completed.","type":"boolean"},"previousPosition":{"description":"Position the product held before the move.","type":"number"},"newPosition":{"description":"Position the product holds after the move.","type":"number"},"totalProducts":{"description":"Total non-deleted products in the organisation.","type":"number"},"shiftedCount":{"description":"How many other products were shifted down by one.","type":"number"},"repacked":{"description":"Whether a global 1..N repack pass was applied.","type":"boolean"}},"required":["success","previousPosition","newPosition","totalProducts","shiftedCount","repacked"]}}}}},"operationId":"postBffProductProduct-move-to-end","tags":["Product"],"summary":"Move product to the end of the list","description":"Shifts every product with a higher `position` down by one (single UPDATE) and then bumps the target product to the current max position. Preserves 1..N density by construction; a global repack pass is kept as a safety net for organisations whose positions were non-dense on entry.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Product code (as returned by /bff/product/list `id`) to move to the last position.","examples":["my-product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Product code (as returned by /bff/product/list `id`) to move to the last position.","examples":["my-product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Product code (as returned by /bff/product/list `id`) to move to the last position.","examples":["my-product"],"type":"string"}}}}}}}},"/bff/product/product-soft-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Product code (echoed back for client refetch).","type":"string"},"deletedDate":{"description":"ISO timestamp the deletion was stamped with.","type":"string"}},"required":["success","code","deletedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Product code (echoed back for client refetch).","type":"string"},"deletedDate":{"description":"ISO timestamp the deletion was stamped with.","type":"string"}},"required":["success","code","deletedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Product code (echoed back for client refetch).","type":"string"},"deletedDate":{"description":"ISO timestamp the deletion was stamped with.","type":"string"}},"required":["success","code","deletedDate"]}}}}},"operationId":"postBffProductProduct-soft-delete","tags":["Product"],"summary":"Soft-delete product","description":"Stamps `deleted_date = NOW()`, flips the legacy `deleted` boolean, and turns `active = false`. The product disappears from the default product list, public storefront, feeds and search. Idempotent at the DB layer — but the BFF returns 410 Gone if you call this on an already-deleted product (the resolver refuses to load it). Use `/product-restore` to undo.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"minLength":1,"description":"Product code to soft-delete.","examples":["my-product"],"type":"string"},"reason":{"description":"Free-form reason recorded in the activity log (no validation).","examples":["Removed from catalogue per supplier request"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"minLength":1,"description":"Product code to soft-delete.","examples":["my-product"],"type":"string"},"reason":{"description":"Free-form reason recorded in the activity log (no validation).","examples":["Removed from catalogue per supplier request"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"minLength":1,"description":"Product code to soft-delete.","examples":["my-product"],"type":"string"},"reason":{"description":"Free-form reason recorded in the activity log (no validation).","examples":["Removed from catalogue per supplier request"],"type":"string"}}}}}}}},"/bff/product/product-restore":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Product code (echoed back for client refetch).","type":"string"},"alreadyLive":{"description":"true if the product was not soft-deleted (no-op restore).","type":"boolean"}},"required":["success","code","alreadyLive"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Product code (echoed back for client refetch).","type":"string"},"alreadyLive":{"description":"true if the product was not soft-deleted (no-op restore).","type":"boolean"}},"required":["success","code","alreadyLive"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Product code (echoed back for client refetch).","type":"string"},"alreadyLive":{"description":"true if the product was not soft-deleted (no-op restore).","type":"boolean"}},"required":["success","code","alreadyLive"]}}}}},"operationId":"postBffProductProduct-restore","tags":["Product"],"summary":"Restore soft-deleted product","description":"Clears `deleted_date` and the legacy `deleted` boolean. `active` is intentionally NOT flipped back to true — the operator should re-publish explicitly so a stale catalogue does not silently come back online.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"minLength":1,"description":"Product code to restore.","examples":["my-product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"minLength":1,"description":"Product code to restore.","examples":["my-product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"minLength":1,"description":"Product code to restore.","examples":["my-product"],"type":"string"}}}}}}}},"/bff/product/bulk-soft-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffProductBulk-soft-delete","tags":["Product"],"summary":"Bulk soft-delete products","description":"Stamps `deleted_date = NOW()` and turns `active = false` on every matched product in a single UPDATE. Already-deleted rows are silently skipped (not counted in `matched`). Use `/bulk-restore` to undo.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCodes"],"properties":{"productCodes":{"description":"Product codes to soft-delete.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCodes"],"properties":{"productCodes":{"description":"Product codes to soft-delete.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["productCodes"],"properties":{"productCodes":{"description":"Product codes to soft-delete.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}}}}}}}}},"/bff/product/bulk-restore":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffProductBulk-restore","tags":["Product"],"summary":"Bulk restore soft-deleted products","description":"Clears `deleted_date` on every matched product. `active` is NOT flipped back — the operator must re-publish explicitly so a stale catalogue does not silently come back online.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCodes"],"properties":{"productCodes":{"description":"Product codes to restore from soft-delete.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCodes"],"properties":{"productCodes":{"description":"Product codes to restore from soft-delete.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["productCodes"],"properties":{"productCodes":{"description":"Product codes to restore from soft-delete.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}}}}}}}}},"/bff/product/bulk-set-active":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffProductBulk-set-active","tags":["Product"],"summary":"Bulk publish / unpublish products","description":"Flips `active` on every matched product in a single UPDATE. Soft-deleted rows are skipped so restore + publish stays a two-step decision.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCodes","active"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"active":{"description":"True = publish (active=true), false = unpublish (active=false).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCodes","active"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"active":{"description":"True = publish (active=true), false = unpublish (active=false).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["productCodes","active"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"active":{"description":"True = publish (active=true), false = unpublish (active=false).","type":"boolean"}}}}}}}},"/bff/product/bulk-set-show-in-feed":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffProductBulk-set-show-in-feed","tags":["Product"],"summary":"Bulk toggle XML feed visibility","description":"Flips `show_in_feed` on every matched product. Soft-deleted rows are skipped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCodes","showInFeed"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"showInFeed":{"description":"True = include in XML feed, false = exclude from feed.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCodes","showInFeed"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"showInFeed":{"description":"True = include in XML feed, false = exclude from feed.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["productCodes","showInFeed"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"showInFeed":{"description":"True = include in XML feed, false = exclude from feed.","type":"boolean"}}}}}}}},"/bff/product/bulk-set-main-category":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"matched":{"type":"number"},"requested":{"type":"number"}},"required":["success","matched","requested"]}}}}},"operationId":"postBffProductBulk-set-main-category","tags":["Product"],"summary":"Bulk set main product category","description":"Assigns the same main category to every matched product in a single UPDATE. Soft-deleted rows are skipped. Pass an empty `categoryCode` to unset. An unknown category is a 500 (the write helper throws).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCodes","categoryCode"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"categoryCode":{"description":"Category code to assign as main. Empty string clears the main category.","examples":["electronics"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCodes","categoryCode"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"categoryCode":{"description":"Category code to assign as main. Empty string clears the main category.","examples":["electronics"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCodes","categoryCode"],"properties":{"productCodes":{"description":"Product codes to update.","minItems":1,"maxItems":500,"type":"array","items":{"minLength":1,"examples":["my-product"],"type":"string"}},"categoryCode":{"description":"Category code to assign as main. Empty string clears the main category.","examples":["electronics"],"type":"string"}}}}}}}},"/bff/product/product-category-set-main":{"get":{"parameters":[{"description":"Product code to set the main category for.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true},{"description":"Category code to set as main. Pass empty string to unset.","examples":["electronics"],"schema":{"type":"string"},"in":"query","name":"categoryCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main category was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main category was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main category was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffProductProduct-category-set-main","tags":["Product"],"summary":"Set main product category","description":"Sets or changes the main category for a product. The main category determines which custom field definitions apply and affects product feed categorization."}},"/bff/product/product-copy":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was copied.","type":"boolean"},"code":{"description":"Code of the new product.","type":"string"},"slug":{"description":"URL slug of the new product.","type":"string"}},"required":["success","code","slug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was copied.","type":"boolean"},"code":{"description":"Code of the new product.","type":"string"},"slug":{"description":"URL slug of the new product.","type":"string"}},"required":["success","code","slug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was copied.","type":"boolean"},"code":{"description":"Code of the new product.","type":"string"},"slug":{"description":"URL slug of the new product.","type":"string"}},"required":["success","code","slug"]}}}}},"operationId":"postBffProductProduct-copy","tags":["Product"],"summary":"Copy product","description":"Creates a copy of an existing product with a new name, code, and optional EAN. Copies all properties, custom fields, variants, gallery images, category relations, and translations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","name","code"],"properties":{"productCode":{"description":"Source product code to copy from.","examples":["my-product"],"type":"string"},"name":{"minLength":1,"description":"Name for the new product.","examples":["My Product Copy"],"type":"string"},"code":{"minLength":1,"description":"Code for the new product (must be unique).","examples":["my-product-copy"],"type":"string"},"ean":{"description":"EAN barcode for the new product.","examples":["8594000000123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","name","code"],"properties":{"productCode":{"description":"Source product code to copy from.","examples":["my-product"],"type":"string"},"name":{"minLength":1,"description":"Name for the new product.","examples":["My Product Copy"],"type":"string"},"code":{"minLength":1,"description":"Code for the new product (must be unique).","examples":["my-product-copy"],"type":"string"},"ean":{"description":"EAN barcode for the new product.","examples":["8594000000123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","name","code"],"properties":{"productCode":{"description":"Source product code to copy from.","examples":["my-product"],"type":"string"},"name":{"minLength":1,"description":"Name for the new product.","examples":["My Product Copy"],"type":"string"},"code":{"minLength":1,"description":"Code for the new product (must be unique).","examples":["my-product-copy"],"type":"string"},"ean":{"description":"EAN barcode for the new product.","examples":["8594000000123"],"type":"string"}}}}}}}},"/bff/product/product-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was created.","type":"boolean"},"code":{"description":"Generated product code.","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"}},"required":["success","code","slug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was created.","type":"boolean"},"code":{"description":"Generated product code.","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"}},"required":["success","code","slug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was created.","type":"boolean"},"code":{"description":"Generated product code.","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"}},"required":["success","code","slug"]}}}}},"operationId":"postBffProductProduct-create","tags":["Product"],"summary":"Create product","description":"Creates a new product with default values (inactive, price 0, not sold out). Generates a unique code and slug, creates an initial price history entry, and writes the first translation row for the specified locale.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","locale"],"properties":{"name":{"minLength":1,"description":"Product name (will be normalized and capitalized).","examples":["My New Product"],"type":"string"},"code":{"minLength":1,"description":"Product code. If not provided, generated from name.","examples":["my-new-product"],"type":"string"},"slug":{"description":"URL slug. If not provided, generated from code or name.","examples":["my-new-product"],"type":"string"},"ean":{"description":"EAN barcode (validated, ignored if invalid).","examples":["8594000000123"],"type":"string"},"locale":{"description":"Locale code for the initial translation (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"mainCategoryCode":{"description":"Main category code to assign.","examples":["electronics"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","locale"],"properties":{"name":{"minLength":1,"description":"Product name (will be normalized and capitalized).","examples":["My New Product"],"type":"string"},"code":{"minLength":1,"description":"Product code. If not provided, generated from name.","examples":["my-new-product"],"type":"string"},"slug":{"description":"URL slug. If not provided, generated from code or name.","examples":["my-new-product"],"type":"string"},"ean":{"description":"EAN barcode (validated, ignored if invalid).","examples":["8594000000123"],"type":"string"},"locale":{"description":"Locale code for the initial translation (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"mainCategoryCode":{"description":"Main category code to assign.","examples":["electronics"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["name","locale"],"properties":{"name":{"minLength":1,"description":"Product name (will be normalized and capitalized).","examples":["My New Product"],"type":"string"},"code":{"minLength":1,"description":"Product code. If not provided, generated from name.","examples":["my-new-product"],"type":"string"},"slug":{"description":"URL slug. If not provided, generated from code or name.","examples":["my-new-product"],"type":"string"},"ean":{"description":"EAN barcode (validated, ignored if invalid).","examples":["8594000000123"],"type":"string"},"locale":{"description":"Locale code for the initial translation (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"mainCategoryCode":{"description":"Main category code to assign.","examples":["electronics"],"type":"string"}}}}}}}},"/bff/product/product-custom-field-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the field was created.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the field was created.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the field was created.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-custom-field-create","tags":["Product"],"summary":"Create custom field","description":"Adds a new custom field to a product. Custom fields store additional structured data (e.g. material, color).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","key"],"properties":{"productCode":{"description":"Product code to add the custom field to.","examples":["my-product"],"type":"string"},"key":{"minLength":1,"maxLength":32,"description":"Custom field key (unique per product).","examples":["material"],"type":"string"},"value":{"description":"Custom field value.","examples":["cotton"],"type":"string"},"active":{"description":"Whether the field is active. Defaults to false.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","key"],"properties":{"productCode":{"description":"Product code to add the custom field to.","examples":["my-product"],"type":"string"},"key":{"minLength":1,"maxLength":32,"description":"Custom field key (unique per product).","examples":["material"],"type":"string"},"value":{"description":"Custom field value.","examples":["cotton"],"type":"string"},"active":{"description":"Whether the field is active. Defaults to false.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","key"],"properties":{"productCode":{"description":"Product code to add the custom field to.","examples":["my-product"],"type":"string"},"key":{"minLength":1,"maxLength":32,"description":"Custom field key (unique per product).","examples":["material"],"type":"string"},"value":{"description":"Custom field value.","examples":["cotton"],"type":"string"},"active":{"description":"Whether the field is active. Defaults to false.","type":"boolean"}}}}}}}},"/bff/product/product-custom-field-definition-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the definition was created.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the definition was created.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the definition was created.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-custom-field-definition-create","tags":["Product"],"summary":"Create custom field definition","description":"Adds a new typed custom field definition to the organisation. When onlyCategoryCode is provided the field renders only for products in that main category; otherwise it renders for every product in the organisation. `key` must be unique per organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key","type","label"],"properties":{"key":{"minLength":1,"maxLength":32,"description":"Machine key (unique per organisation). Used as the JSON key on every product carrying a value.","examples":["material"],"type":"string"},"type":{"description":"Input type rendered in admin.","examples":["text"],"anyOf":[{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"}]},"label":{"minLength":1,"maxLength":128,"description":"Display label.","examples":["Material"],"type":"string"},"helperText":{"maxLength":500,"description":"Small helper text shown below the input.","type":"string"},"placeholder":{"maxLength":500,"description":"Placeholder text.","type":"string"},"onlyCategoryCode":{"description":"If set, definition applies only to products whose main category matches this code. Omit for global (org-wide).","examples":["t-shirts"],"type":"string"},"required":{"description":"Whether the value is required. Defaults to false.","type":"boolean"},"active":{"description":"Whether the definition is active. Defaults to true.","type":"boolean"},"validationPattern":{"maxLength":500,"description":"Regex string validated on submit (server-side check).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["key","type","label"],"properties":{"key":{"minLength":1,"maxLength":32,"description":"Machine key (unique per organisation). Used as the JSON key on every product carrying a value.","examples":["material"],"type":"string"},"type":{"description":"Input type rendered in admin.","examples":["text"],"anyOf":[{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"}]},"label":{"minLength":1,"maxLength":128,"description":"Display label.","examples":["Material"],"type":"string"},"helperText":{"maxLength":500,"description":"Small helper text shown below the input.","type":"string"},"placeholder":{"maxLength":500,"description":"Placeholder text.","type":"string"},"onlyCategoryCode":{"description":"If set, definition applies only to products whose main category matches this code. Omit for global (org-wide).","examples":["t-shirts"],"type":"string"},"required":{"description":"Whether the value is required. Defaults to false.","type":"boolean"},"active":{"description":"Whether the definition is active. Defaults to true.","type":"boolean"},"validationPattern":{"maxLength":500,"description":"Regex string validated on submit (server-side check).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["key","type","label"],"properties":{"key":{"minLength":1,"maxLength":32,"description":"Machine key (unique per organisation). Used as the JSON key on every product carrying a value.","examples":["material"],"type":"string"},"type":{"description":"Input type rendered in admin.","examples":["text"],"anyOf":[{"const":"text","type":"string"},{"const":"textarea","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"}]},"label":{"minLength":1,"maxLength":128,"description":"Display label.","examples":["Material"],"type":"string"},"helperText":{"maxLength":500,"description":"Small helper text shown below the input.","type":"string"},"placeholder":{"maxLength":500,"description":"Placeholder text.","type":"string"},"onlyCategoryCode":{"description":"If set, definition applies only to products whose main category matches this code. Omit for global (org-wide).","examples":["t-shirts"],"type":"string"},"required":{"description":"Whether the value is required. Defaults to false.","type":"boolean"},"active":{"description":"Whether the definition is active. Defaults to true.","type":"boolean"},"validationPattern":{"maxLength":500,"description":"Regex string validated on submit (server-side check).","type":"string"}}}}}}}},"/bff/product/product-custom-field-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the field was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the field was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the field was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-custom-field-update","tags":["Product"],"summary":"Update custom field","description":"Updates an existing custom field on a product. Any combination of key, value, and active can be changed. Fields not provided retain their current values.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","productCode"],"properties":{"id":{"description":"Current custom field key (used to find the field).","examples":["material"],"type":"string"},"productCode":{"description":"Product code the field belongs to.","examples":["my-product"],"type":"string"},"key":{"minLength":1,"maxLength":32,"description":"New key (to rename the field).","examples":["fabric"],"type":"string"},"value":{"description":"New value for the field.","examples":["silk"],"type":"string"},"active":{"description":"New active status.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","productCode"],"properties":{"id":{"description":"Current custom field key (used to find the field).","examples":["material"],"type":"string"},"productCode":{"description":"Product code the field belongs to.","examples":["my-product"],"type":"string"},"key":{"minLength":1,"maxLength":32,"description":"New key (to rename the field).","examples":["fabric"],"type":"string"},"value":{"description":"New value for the field.","examples":["silk"],"type":"string"},"active":{"description":"New active status.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","productCode"],"properties":{"id":{"description":"Current custom field key (used to find the field).","examples":["material"],"type":"string"},"productCode":{"description":"Product code the field belongs to.","examples":["my-product"],"type":"string"},"key":{"minLength":1,"maxLength":32,"description":"New key (to rename the field).","examples":["fabric"],"type":"string"},"value":{"description":"New value for the field.","examples":["silk"],"type":"string"},"active":{"description":"New active status.","type":"boolean"}}}}}}}},"/bff/product/product-detail-category":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"mainCategoryCode":{"description":"Code of the main category, if set.","type":"string"},"subCategories":{"description":"All categories the product belongs to.","type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"description":"Category code.","type":"string"},"name":{"description":"Category display name.","type":"string"}}}}},"required":["subCategories"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"mainCategoryCode":{"description":"Code of the main category, if set.","type":"string"},"subCategories":{"description":"All categories the product belongs to.","type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"description":"Category code.","type":"string"},"name":{"description":"Category display name.","type":"string"}}}}},"required":["subCategories"]}},"text/plain":{"schema":{"type":"object","properties":{"mainCategoryCode":{"description":"Code of the main category, if set.","type":"string"},"subCategories":{"description":"All categories the product belongs to.","type":"array","items":{"type":"object","required":["code","name"],"properties":{"code":{"description":"Category code.","type":"string"},"name":{"description":"Category display name.","type":"string"}}}}},"required":["subCategories"]}}}}},"operationId":"getBffProductProduct-detail-category","tags":["Product"],"summary":"Get product categories","description":"Returns the main category and all sub-categories associated with a product. Includes both the directly assigned main category and categories linked via the relation table."}},"/bff/product/product-gallery-link-blob":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Blob token of the uploaded file to link.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"blobToken","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the image was linked successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the image was linked successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the image was linked successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffProductProduct-gallery-link-blob","tags":["Product"],"summary":"Add image to product gallery","description":"Links an uploaded blob to the product gallery. The image is appended at the end of the gallery. If the product has no main image yet, this image is automatically set as main."}},"/bff/product/product-gallery-list":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Gallery images sorted by active status then position.","type":"array","items":{"type":"object","required":["blob","title","position","deleted","active","lqipBase64"],"properties":{"id":{"description":"Blob token (used as image identifier in other endpoints).","type":"string"},"url":{"description":"External URL if the media is not a blob.","type":"string"},"blob":{"description":"Blob file metadata (filename, URL, dimensions, size)."},"title":{"description":"Image alt text / title.","type":"string"},"position":{"description":"Display order position (1-based).","type":"number"},"deleted":{"description":"Whether the image is soft-deleted.","type":"boolean"},"active":{"description":"Whether the image is active (visible on the public site).","type":"boolean"},"lqipBase64":{"description":"32×32 WebP q40 base64 placeholder (issue #80). Always present; empty string when the source is unreadable.","type":"string"},"thumbUrl":{"description":"Scout-generated 128×128 WebP thumbnail URL (issue #80). Absent until scout finishes generating variants for the row.","type":"string"}}}},"mainImageId":{"description":"Blob token of the current main/featured image.","type":"string"},"itemCount":{"description":"Total number of non-deleted images in the gallery.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Gallery images sorted by active status then position.","type":"array","items":{"type":"object","required":["blob","title","position","deleted","active","lqipBase64"],"properties":{"id":{"description":"Blob token (used as image identifier in other endpoints).","type":"string"},"url":{"description":"External URL if the media is not a blob.","type":"string"},"blob":{"description":"Blob file metadata (filename, URL, dimensions, size)."},"title":{"description":"Image alt text / title.","type":"string"},"position":{"description":"Display order position (1-based).","type":"number"},"deleted":{"description":"Whether the image is soft-deleted.","type":"boolean"},"active":{"description":"Whether the image is active (visible on the public site).","type":"boolean"},"lqipBase64":{"description":"32×32 WebP q40 base64 placeholder (issue #80). Always present; empty string when the source is unreadable.","type":"string"},"thumbUrl":{"description":"Scout-generated 128×128 WebP thumbnail URL (issue #80). Absent until scout finishes generating variants for the row.","type":"string"}}}},"mainImageId":{"description":"Blob token of the current main/featured image.","type":"string"},"itemCount":{"description":"Total number of non-deleted images in the gallery.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Gallery images sorted by active status then position.","type":"array","items":{"type":"object","required":["blob","title","position","deleted","active","lqipBase64"],"properties":{"id":{"description":"Blob token (used as image identifier in other endpoints).","type":"string"},"url":{"description":"External URL if the media is not a blob.","type":"string"},"blob":{"description":"Blob file metadata (filename, URL, dimensions, size)."},"title":{"description":"Image alt text / title.","type":"string"},"position":{"description":"Display order position (1-based).","type":"number"},"deleted":{"description":"Whether the image is soft-deleted.","type":"boolean"},"active":{"description":"Whether the image is active (visible on the public site).","type":"boolean"},"lqipBase64":{"description":"32×32 WebP q40 base64 placeholder (issue #80). Always present; empty string when the source is unreadable.","type":"string"},"thumbUrl":{"description":"Scout-generated 128×128 WebP thumbnail URL (issue #80). Absent until scout finishes generating variants for the row.","type":"string"}}}},"mainImageId":{"description":"Blob token of the current main/featured image.","type":"string"},"itemCount":{"description":"Total number of non-deleted images in the gallery.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProductProduct-gallery-list","tags":["Product"],"summary":"List product gallery images","description":"Returns all non-deleted images in the product gallery sorted by active status and position. Includes blob metadata (URL, dimensions) and identifies the main/featured image."}},"/bff/product/product-image-active-toggle":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Blob token of the image to toggle.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"imageId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the toggle was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the toggle was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the toggle was successful.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffProductProduct-image-active-toggle","tags":["Product"],"summary":"Toggle image active status","description":"Toggles the active/inactive status of a gallery image. Inactive images are hidden on the public site but remain in the gallery for re-activation. If the main image is deactivated, the first remaining active image becomes the new main."}},"/bff/product/product-image-delete":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Blob token of the image to delete.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"imageId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the deletion was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the deletion was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the deletion was successful.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffProductProduct-image-delete","tags":["Product"],"summary":"Delete gallery image","description":"Soft-deletes an image from the product gallery (sets deleted flag, does not remove the blob). If the deleted image was the main image, the first remaining active image becomes the new main."}},"/bff/product/product-image-mark-main":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Blob token of the image to set as main.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"imageId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffProductProduct-image-mark-main","tags":["Product"],"summary":"Set main product image","description":"Sets the specified image as the main/featured image for the product. The main image is used as the product thumbnail in lists and social sharing."}},"/bff/product/product-gallery-reorder":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-gallery-reorder","tags":["Product"],"summary":"Reorder product gallery","description":"Sets the display order of the product gallery (drag & drop in admin). Positions are rewritten 1..n.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","imageIds"],"properties":{"code":{"description":"Product code.","examples":["my-product"],"type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","imageIds"],"properties":{"code":{"description":"Product code.","examples":["my-product"],"type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["code","imageIds"],"properties":{"code":{"description":"Product code.","examples":["my-product"],"type":"string"},"imageIds":{"description":"Blob tokens of the gallery images in the new display order. Unknown tokens are ignored; images not listed keep their relative order after the listed ones.","maxItems":500,"type":"array","items":{"type":"string"}}}}}}}}},"/bff/product/product-image-update-meta":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Blob token of the image to update.","examples":["abc123def456"],"schema":{"type":"string"},"in":"query","name":"imageId","required":true},{"description":"New alt text / title for the image (used for SEO and accessibility).","examples":["Product photo front view"],"schema":{"type":"string"},"in":"query","name":"title","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the metadata was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the metadata was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the metadata was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffProductProduct-image-update-meta","tags":["Product"],"summary":"Update image metadata","description":"Updates the alt text / title of a gallery image. Alt text is important for SEO and accessibility. Pass an empty string to clear it."}},"/bff/product/product-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was updated.","type":"boolean"},"customFieldsRaw":{"description":"Echo of the custom fields that were updated, if provided."}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was updated.","type":"boolean"},"customFieldsRaw":{"description":"Echo of the custom fields that were updated, if provided."}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the product was updated.","type":"boolean"},"customFieldsRaw":{"description":"Echo of the custom fields that were updated, if provided."}},"required":["success"]}}}}},"operationId":"postBffProductProduct-update","tags":["Product"],"summary":"Update product","description":"Updates all editable fields of a product. Locale determines which translation to write to. If saving in the primary locale, base product columns are also updated. If the price changes, a price history entry is created and watchdog notifications are triggered. Custom fields can be batch-updated via customFieldsRaw. Read models for all locales are regenerated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","code","locale"],"properties":{"name":{"minLength":1,"description":"Product name (will be normalized and capitalized).","examples":["My Product"],"type":"string"},"code":{"minLength":1,"description":"Product code (used to identify the product).","examples":["my-product"],"type":"string"},"locale":{"minLength":2,"maxLength":5,"description":"Locale code for translation (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"slug":{"description":"URL slug. If not provided, keeps existing slug.","examples":["my-product"],"type":"string"},"ean":{"description":"EAN barcode (validated, ignored if invalid).","examples":["8594000000123"],"type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"longDescription":{"description":"Long HTML description.","type":"string"},"internalNote":{"description":"Internal note (admin only).","type":"string"},"active":{"description":"Whether the product is active.","type":"boolean"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"price":{"description":"Price with VAT.","examples":[299.9],"type":"number"},"cost":{"description":"Internal cost in the organisation default currency. Defaults to 0 when omitted.","examples":[120],"type":"number"},"standardPricePercentage":{"description":"Standard price percentage for discount calculation.","examples":[100],"type":"number"},"vat":{"description":"VAT rate percentage.","examples":[21],"type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","examples":[150],"type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","examples":[200],"type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","examples":[50],"type":"number"},"weightGrams":{"description":"Product weight in grams.","examples":[500],"type":"number"},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","examples":[100],"type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","examples":[10],"type":"number"},"stockUnit":{"description":"Warehouse stock unit (\"m\", \"kg\"…). Empty = pieces.","examples":["m"],"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"trackLots":{"description":"Require and track lot numbers (šarže) in the warehouse.","type":"boolean"},"stockTracked":{"description":"FALSE = service / digital item (e.g. warranty, e-voucher): orders neither reserve nor check its warehouse stock and the warehouse sync leaves its stock numbers alone.","type":"boolean"},"defaultWarehouseId":{"description":"Preselected warehouse for stock operations / purchasing (BIZKIT-170). NULL clears.","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"description":"Supplier lead time in days; purchase-order lines without a date get sent date + this (BIZKIT-170).","anyOf":[{"minimum":0,"maximum":3650,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":3650,"type":"integer"}]},{"type":"null"}]},"defaultVendorContactId":{"description":"Default supplier: contact external id (BIZKIT-168). NULL clears.","anyOf":[{"type":"string"},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168). NULL clears.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"customFieldsRaw":{"description":"Custom fields key-value map for batch update.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","code","locale"],"properties":{"name":{"minLength":1,"description":"Product name (will be normalized and capitalized).","examples":["My Product"],"type":"string"},"code":{"minLength":1,"description":"Product code (used to identify the product).","examples":["my-product"],"type":"string"},"locale":{"minLength":2,"maxLength":5,"description":"Locale code for translation (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"slug":{"description":"URL slug. If not provided, keeps existing slug.","examples":["my-product"],"type":"string"},"ean":{"description":"EAN barcode (validated, ignored if invalid).","examples":["8594000000123"],"type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"longDescription":{"description":"Long HTML description.","type":"string"},"internalNote":{"description":"Internal note (admin only).","type":"string"},"active":{"description":"Whether the product is active.","type":"boolean"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"price":{"description":"Price with VAT.","examples":[299.9],"type":"number"},"cost":{"description":"Internal cost in the organisation default currency. Defaults to 0 when omitted.","examples":[120],"type":"number"},"standardPricePercentage":{"description":"Standard price percentage for discount calculation.","examples":[100],"type":"number"},"vat":{"description":"VAT rate percentage.","examples":[21],"type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","examples":[150],"type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","examples":[200],"type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","examples":[50],"type":"number"},"weightGrams":{"description":"Product weight in grams.","examples":[500],"type":"number"},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","examples":[100],"type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","examples":[10],"type":"number"},"stockUnit":{"description":"Warehouse stock unit (\"m\", \"kg\"…). Empty = pieces.","examples":["m"],"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"trackLots":{"description":"Require and track lot numbers (šarže) in the warehouse.","type":"boolean"},"stockTracked":{"description":"FALSE = service / digital item (e.g. warranty, e-voucher): orders neither reserve nor check its warehouse stock and the warehouse sync leaves its stock numbers alone.","type":"boolean"},"defaultWarehouseId":{"description":"Preselected warehouse for stock operations / purchasing (BIZKIT-170). NULL clears.","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"description":"Supplier lead time in days; purchase-order lines without a date get sent date + this (BIZKIT-170).","anyOf":[{"minimum":0,"maximum":3650,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":3650,"type":"integer"}]},{"type":"null"}]},"defaultVendorContactId":{"description":"Default supplier: contact external id (BIZKIT-168). NULL clears.","anyOf":[{"type":"string"},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168). NULL clears.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"customFieldsRaw":{"description":"Custom fields key-value map for batch update.","type":"object","patternProperties":{"^(.*)$":{}}}}}},"text/plain":{"schema":{"type":"object","required":["name","code","locale"],"properties":{"name":{"minLength":1,"description":"Product name (will be normalized and capitalized).","examples":["My Product"],"type":"string"},"code":{"minLength":1,"description":"Product code (used to identify the product).","examples":["my-product"],"type":"string"},"locale":{"minLength":2,"maxLength":5,"description":"Locale code for translation (e.g. \"cs\", \"en\").","examples":["cs"],"type":"string"},"slug":{"description":"URL slug. If not provided, keeps existing slug.","examples":["my-product"],"type":"string"},"ean":{"description":"EAN barcode (validated, ignored if invalid).","examples":["8594000000123"],"type":"string"},"shortDescription":{"description":"Short HTML description.","type":"string"},"longDescription":{"description":"Long HTML description.","type":"string"},"internalNote":{"description":"Internal note (admin only).","type":"string"},"active":{"description":"Whether the product is active.","type":"boolean"},"b2b":{"description":"Whether the product is B2B only.","type":"boolean"},"showInFeed":{"description":"Whether the product appears in product feeds.","type":"boolean"},"soldOut":{"description":"Whether the product is sold out.","type":"boolean"},"price":{"description":"Price with VAT.","examples":[299.9],"type":"number"},"cost":{"description":"Internal cost in the organisation default currency. Defaults to 0 when omitted.","examples":[120],"type":"number"},"standardPricePercentage":{"description":"Standard price percentage for discount calculation.","examples":[100],"type":"number"},"vat":{"description":"VAT rate percentage.","examples":[21],"type":"number"},"sizeWidthMm":{"description":"Product width in millimeters.","examples":[150],"type":"number"},"sizeHeightMm":{"description":"Product height in millimeters.","examples":[200],"type":"number"},"sizeDepthMm":{"description":"Product depth in millimeters.","examples":[50],"type":"number"},"weightGrams":{"description":"Product weight in grams.","examples":[500],"type":"number"},"warehouseAllQuantity":{"description":"Total warehouse stock quantity.","examples":[100],"type":"number"},"warehouseLimit":{"description":"Minimum stock level before reorder alert.","examples":[10],"type":"number"},"stockUnit":{"description":"Warehouse stock unit (\"m\", \"kg\"…). Empty = pieces.","examples":["m"],"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"trackLots":{"description":"Require and track lot numbers (šarže) in the warehouse.","type":"boolean"},"stockTracked":{"description":"FALSE = service / digital item (e.g. warranty, e-voucher): orders neither reserve nor check its warehouse stock and the warehouse sync leaves its stock numbers alone.","type":"boolean"},"defaultWarehouseId":{"description":"Preselected warehouse for stock operations / purchasing (BIZKIT-170). NULL clears.","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"description":"Supplier lead time in days; purchase-order lines without a date get sent date + this (BIZKIT-170).","anyOf":[{"minimum":0,"maximum":3650,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":3650,"type":"integer"}]},{"type":"null"}]},"defaultVendorContactId":{"description":"Default supplier: contact external id (BIZKIT-168). NULL clears.","anyOf":[{"type":"string"},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's code of the item (BIZKIT-168). NULL clears.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"customFieldsRaw":{"description":"Custom fields key-value map for batch update.","type":"object","patternProperties":{"^(.*)$":{}}}}}}}}}},"/bff/product/product-auto-translate":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"translatedLocales":{"description":"List of locale codes that were translated.","type":"array","items":{"description":"Locale code that was translated (e.g. \"en\", \"de\").","type":"string"}}},"required":["translatedLocales"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"translatedLocales":{"description":"List of locale codes that were translated.","type":"array","items":{"description":"Locale code that was translated (e.g. \"en\", \"de\").","type":"string"}}},"required":["translatedLocales"]}},"text/plain":{"schema":{"type":"object","properties":{"translatedLocales":{"description":"List of locale codes that were translated.","type":"array","items":{"description":"Locale code that was translated (e.g. \"en\", \"de\").","type":"string"}}},"required":["translatedLocales"]}}}}},"operationId":"postBffProductProduct-auto-translate","tags":["Product"],"summary":"Auto-translate product","description":"Automatically translates the product name, short description, and long description from the organisation default locale to all other configured organisation locales using AI. Existing translations are overwritten. After translation, the product read model is regenerated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code to auto-translate.","examples":["my-product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code to auto-translate.","examples":["my-product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code to auto-translate.","examples":["my-product"],"type":"string"}}}}}}}},"/bff/product/product-voucher-template-list":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Linked voucher templates.","type":"array","items":{"type":"object","required":["voucherId","code","typeId","value","active"],"properties":{"voucherId":{"description":"Voucher ID.","type":"number"},"code":{"description":"Voucher code.","type":"string"},"typeId":{"description":"Voucher type ID.","type":"number"},"value":{"description":"Voucher value (percentage or absolute).","type":"string"},"active":{"description":"Whether the voucher is active.","type":"boolean"},"usageLimit":{"description":"Maximum number of times this voucher can be used.","type":"number"},"validFrom":{"description":"Voucher validity start date.","type":"string"},"validTo":{"description":"Voucher validity end date.","type":"string"}}}},"itemCount":{"description":"Total number of linked voucher templates.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Linked voucher templates.","type":"array","items":{"type":"object","required":["voucherId","code","typeId","value","active"],"properties":{"voucherId":{"description":"Voucher ID.","type":"number"},"code":{"description":"Voucher code.","type":"string"},"typeId":{"description":"Voucher type ID.","type":"number"},"value":{"description":"Voucher value (percentage or absolute).","type":"string"},"active":{"description":"Whether the voucher is active.","type":"boolean"},"usageLimit":{"description":"Maximum number of times this voucher can be used.","type":"number"},"validFrom":{"description":"Voucher validity start date.","type":"string"},"validTo":{"description":"Voucher validity end date.","type":"string"}}}},"itemCount":{"description":"Total number of linked voucher templates.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Linked voucher templates.","type":"array","items":{"type":"object","required":["voucherId","code","typeId","value","active"],"properties":{"voucherId":{"description":"Voucher ID.","type":"number"},"code":{"description":"Voucher code.","type":"string"},"typeId":{"description":"Voucher type ID.","type":"number"},"value":{"description":"Voucher value (percentage or absolute).","type":"string"},"active":{"description":"Whether the voucher is active.","type":"boolean"},"usageLimit":{"description":"Maximum number of times this voucher can be used.","type":"number"},"validFrom":{"description":"Voucher validity start date.","type":"string"},"validTo":{"description":"Voucher validity end date.","type":"string"}}}},"itemCount":{"description":"Total number of linked voucher templates.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProductProduct-voucher-template-list","tags":["Product"],"summary":"List linked voucher templates","description":"Returns all voucher templates linked to the product."}},"/bff/product/product-voucher-template-link":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-voucher-template-link","tags":["Product"],"summary":"Link voucher template to product","description":"Links a voucher template to a product. Idempotent — re-linking the same voucher is a no-op.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","voucherCode"],"properties":{"productCode":{"description":"Product code to link the voucher to.","examples":["my-product"],"type":"string"},"voucherCode":{"description":"Voucher code to link.","examples":["SUMMER2024"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","voucherCode"],"properties":{"productCode":{"description":"Product code to link the voucher to.","examples":["my-product"],"type":"string"},"voucherCode":{"description":"Voucher code to link.","examples":["SUMMER2024"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","voucherCode"],"properties":{"productCode":{"description":"Product code to link the voucher to.","examples":["my-product"],"type":"string"},"voucherCode":{"description":"Voucher code to link.","examples":["SUMMER2024"],"type":"string"}}}}}}}},"/bff/product/product-voucher-template-unlink":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was removed.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was removed.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was removed.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-voucher-template-unlink","tags":["Product"],"summary":"Unlink voucher template from product","description":"Removes the link between a voucher template and a product.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","voucherCode"],"properties":{"productCode":{"description":"Product code to unlink the voucher from.","examples":["my-product"],"type":"string"},"voucherCode":{"description":"Voucher code to unlink.","examples":["SUMMER2024"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","voucherCode"],"properties":{"productCode":{"description":"Product code to unlink the voucher from.","examples":["my-product"],"type":"string"},"voucherCode":{"description":"Voucher code to unlink.","examples":["SUMMER2024"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","voucherCode"],"properties":{"productCode":{"description":"Product code to unlink the voucher from.","examples":["my-product"],"type":"string"},"voucherCode":{"description":"Voucher code to unlink.","examples":["SUMMER2024"],"type":"string"}}}}}}}},"/bff/product/product-subscription-plan-list":{"get":{"parameters":[{"description":"Product code.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Linked subscription plans.","type":"array","items":{"type":"object","required":["interval"],"properties":{"interval":{"description":"Subscription interval (e.g. \"1m\", \"6m\", \"12m\").","type":"string"}}}},"itemCount":{"description":"Total number of linked subscription plans.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Linked subscription plans.","type":"array","items":{"type":"object","required":["interval"],"properties":{"interval":{"description":"Subscription interval (e.g. \"1m\", \"6m\", \"12m\").","type":"string"}}}},"itemCount":{"description":"Total number of linked subscription plans.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Linked subscription plans.","type":"array","items":{"type":"object","required":["interval"],"properties":{"interval":{"description":"Subscription interval (e.g. \"1m\", \"6m\", \"12m\").","type":"string"}}}},"itemCount":{"description":"Total number of linked subscription plans.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProductProduct-subscription-plan-list","tags":["Product"],"summary":"List linked subscription plans","description":"Returns all subscription plans linked to the product, including variant details and intervals."}},"/bff/product/product-subscription-plan-link":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the plan was linked.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the plan was linked.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the plan was linked.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-subscription-plan-link","tags":["Product"],"summary":"Link subscription plan to product","description":"Links a subscription plan (interval) to a product. If the product already has a plan, the interval is updated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","interval"],"properties":{"productCode":{"description":"Product code.","examples":["my-product"],"type":"string"},"interval":{"description":"Subscription interval (e.g. \"1m\", \"6m\", \"12m\").","examples":["1m"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","interval"],"properties":{"productCode":{"description":"Product code.","examples":["my-product"],"type":"string"},"interval":{"description":"Subscription interval (e.g. \"1m\", \"6m\", \"12m\").","examples":["1m"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","interval"],"properties":{"productCode":{"description":"Product code.","examples":["my-product"],"type":"string"},"interval":{"description":"Subscription interval (e.g. \"1m\", \"6m\", \"12m\").","examples":["1m"],"type":"string"}}}}}}}},"/bff/product/product-subscription-plan-unlink":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the plan was removed.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the plan was removed.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the plan was removed.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-subscription-plan-unlink","tags":["Product"],"summary":"Unlink subscription plan from product","description":"Removes the subscription plan from a product.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code.","examples":["my-product"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code.","examples":["my-product"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode"],"properties":{"productCode":{"description":"Product code.","examples":["my-product"],"type":"string"}}}}}}}},"/bff/product/product-category-unset-main":{"get":{"parameters":[{"description":"Product code to unset the main category for.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main category was unset.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main category was unset.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main category was unset.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffProductProduct-category-unset-main","tags":["Product"],"summary":"Unset main product category","description":"Removes the main category from a product by setting it to null."}},"/bff/product/product-category-link":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was created.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-category-link","tags":["Product"],"summary":"Link category to product","description":"Links a related category to a product. Idempotent — re-linking the same category is a no-op.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","categoryCode"],"properties":{"productCode":{"description":"Product code to link the category to.","examples":["my-product"],"type":"string"},"categoryCode":{"description":"Category code to link.","examples":["electronics"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","categoryCode"],"properties":{"productCode":{"description":"Product code to link the category to.","examples":["my-product"],"type":"string"},"categoryCode":{"description":"Category code to link.","examples":["electronics"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","categoryCode"],"properties":{"productCode":{"description":"Product code to link the category to.","examples":["my-product"],"type":"string"},"categoryCode":{"description":"Category code to link.","examples":["electronics"],"type":"string"}}}}}}}},"/bff/product/product-category-unlink":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was removed.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was removed.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the link was removed.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-category-unlink","tags":["Product"],"summary":"Unlink category from product","description":"Removes the link between a related category and a product.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","categoryCode"],"properties":{"productCode":{"description":"Product code to unlink the category from.","examples":["my-product"],"type":"string"},"categoryCode":{"description":"Category code to unlink.","examples":["electronics"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","categoryCode"],"properties":{"productCode":{"description":"Product code to unlink the category from.","examples":["my-product"],"type":"string"},"categoryCode":{"description":"Category code to unlink.","examples":["electronics"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","categoryCode"],"properties":{"productCode":{"description":"Product code to unlink the category from.","examples":["my-product"],"type":"string"},"categoryCode":{"description":"Category code to unlink.","examples":["electronics"],"type":"string"}}}}}}}},"/bff/product/product-currency-prices":{"get":{"parameters":[{"examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"productCode":{"type":"string"},"defaultCurrency":{"examples":["CZK"],"type":"string"},"price":{"description":"Default-currency price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","code","name","price","currencyPrices"],"properties":{"relationHash":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"price":{"description":"Default-currency variant price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"required":["productCode","defaultCurrency","price","currencyPrices","variants"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"productCode":{"type":"string"},"defaultCurrency":{"examples":["CZK"],"type":"string"},"price":{"description":"Default-currency price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","code","name","price","currencyPrices"],"properties":{"relationHash":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"price":{"description":"Default-currency variant price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"required":["productCode","defaultCurrency","price","currencyPrices","variants"]}},"text/plain":{"schema":{"type":"object","properties":{"productCode":{"type":"string"},"defaultCurrency":{"examples":["CZK"],"type":"string"},"price":{"description":"Default-currency price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","code","name","price","currencyPrices"],"properties":{"relationHash":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"price":{"description":"Default-currency variant price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"required":["productCode","defaultCurrency","price","currencyPrices","variants"]}}}}},"operationId":"getBffProductProduct-currency-prices","tags":["Product"],"summary":"Manual product + variant prices in other currencies (BIZKIT-90)"}},"/bff/product/currency-drift-summary":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"threshold":{"description":"Drift threshold in %.","examples":[8],"type":"number"},"currencies":{"type":"array","items":{"type":"object","required":["currency","rate","manualCount","driftCount"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"rate":{"description":"Default-currency units per 1 unit.","anyOf":[{"type":"number"},{"type":"null"}]},"manualCount":{"type":"number"},"driftCount":{"type":"number"}}}}},"required":["threshold","currencies"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"threshold":{"description":"Drift threshold in %.","examples":[8],"type":"number"},"currencies":{"type":"array","items":{"type":"object","required":["currency","rate","manualCount","driftCount"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"rate":{"description":"Default-currency units per 1 unit.","anyOf":[{"type":"number"},{"type":"null"}]},"manualCount":{"type":"number"},"driftCount":{"type":"number"}}}}},"required":["threshold","currencies"]}},"text/plain":{"schema":{"type":"object","properties":{"threshold":{"description":"Drift threshold in %.","examples":[8],"type":"number"},"currencies":{"type":"array","items":{"type":"object","required":["currency","rate","manualCount","driftCount"],"properties":{"currency":{"examples":["CZK"],"type":"string"},"rate":{"description":"Default-currency units per 1 unit.","anyOf":[{"type":"number"},{"type":"null"}]},"manualCount":{"type":"number"},"driftCount":{"type":"number"}}}}},"required":["threshold","currencies"]}}}}},"operationId":"getBffProductCurrency-drift-summary","tags":["Product"],"summary":"Manual prices drifted from the exchange rate","description":"Per selling currency: live products with a manual price and how many of them are further from the conversion by the shop rate than the drift threshold. Feeds the warning above the product list."}},"/bff/product/bulk-price-preview":{"post":{"parameters":[],"operationId":"postBffProductBulk-price-preview","tags":["Product"],"summary":"Preview a bulk price change","description":"What a bulk price change would do, without doing it: how many products change, why the rest are skipped, the smallest and largest price move and the products that would sell under cost. At most 5000 products.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection","change"],"properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"change":{"type":"object","required":["currency","operation"],"properties":{"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"operation":{"description":"`percent` = current price ± %, `from-rate` = manual price from the rate, `round` = round to `ending`, `clear` = remove the manual price (other currencies only).","anyOf":[{"const":"percent","type":"string"},{"const":"from-rate","type":"string"},{"const":"round","type":"string"},{"const":"clear","type":"string"}]},"percent":{"examples":[10,-5],"type":"number"},"ending":{"anyOf":[{"description":"Price ending: the nearest step × k + ending, e.g. step 10 + ending 9 = 449.","type":"object","required":["step","ending"],"properties":{"step":{"exclusiveMinimum":0,"type":"number"},"ending":{"minimum":0,"type":"number"}}},{"type":"null"}]}}},"schedule":{"description":"Omitted / null = write the prices now. `change` = new prices from `validFrom` for good; `sale` = sale prices from `validFrom` to `validTo`, then the regular prices come back (multi-currency phase 5).","anyOf":[{"type":"object","required":["kind","validFrom"],"properties":{"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"validFrom":{"description":"ISO date-time.","type":"string"},"validTo":{"description":"Sales only.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection","change"],"properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"change":{"type":"object","required":["currency","operation"],"properties":{"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"operation":{"description":"`percent` = current price ± %, `from-rate` = manual price from the rate, `round` = round to `ending`, `clear` = remove the manual price (other currencies only).","anyOf":[{"const":"percent","type":"string"},{"const":"from-rate","type":"string"},{"const":"round","type":"string"},{"const":"clear","type":"string"}]},"percent":{"examples":[10,-5],"type":"number"},"ending":{"anyOf":[{"description":"Price ending: the nearest step × k + ending, e.g. step 10 + ending 9 = 449.","type":"object","required":["step","ending"],"properties":{"step":{"exclusiveMinimum":0,"type":"number"},"ending":{"minimum":0,"type":"number"}}},{"type":"null"}]}}},"schedule":{"description":"Omitted / null = write the prices now. `change` = new prices from `validFrom` for good; `sale` = sale prices from `validFrom` to `validTo`, then the regular prices come back (multi-currency phase 5).","anyOf":[{"type":"object","required":["kind","validFrom"],"properties":{"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"validFrom":{"description":"ISO date-time.","type":"string"},"validTo":{"description":"Sales only.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["selection","change"],"properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"change":{"type":"object","required":["currency","operation"],"properties":{"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"operation":{"description":"`percent` = current price ± %, `from-rate` = manual price from the rate, `round` = round to `ending`, `clear` = remove the manual price (other currencies only).","anyOf":[{"const":"percent","type":"string"},{"const":"from-rate","type":"string"},{"const":"round","type":"string"},{"const":"clear","type":"string"}]},"percent":{"examples":[10,-5],"type":"number"},"ending":{"anyOf":[{"description":"Price ending: the nearest step × k + ending, e.g. step 10 + ending 9 = 449.","type":"object","required":["step","ending"],"properties":{"step":{"exclusiveMinimum":0,"type":"number"},"ending":{"minimum":0,"type":"number"}}},{"type":"null"}]}}},"schedule":{"description":"Omitted / null = write the prices now. `change` = new prices from `validFrom` for good; `sale` = sale prices from `validFrom` to `validTo`, then the regular prices come back (multi-currency phase 5).","anyOf":[{"type":"object","required":["kind","validFrom"],"properties":{"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"validFrom":{"description":"ISO date-time.","type":"string"},"validTo":{"description":"Sales only.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/product/bulk-price-job-create":{"post":{"parameters":[],"operationId":"postBffProductBulk-price-job-create","tags":["Product"],"summary":"Start a bulk price change in the background","description":"Computes the new prices exactly as the preview does, stores them with the job and writes them in the background; a product whose price changed meanwhile fails instead of being overwritten. Follow it at `/bff/bulk-job/detail`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["selection","change"],"properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"change":{"type":"object","required":["currency","operation"],"properties":{"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"operation":{"description":"`percent` = current price ± %, `from-rate` = manual price from the rate, `round` = round to `ending`, `clear` = remove the manual price (other currencies only).","anyOf":[{"const":"percent","type":"string"},{"const":"from-rate","type":"string"},{"const":"round","type":"string"},{"const":"clear","type":"string"}]},"percent":{"examples":[10,-5],"type":"number"},"ending":{"anyOf":[{"description":"Price ending: the nearest step × k + ending, e.g. step 10 + ending 9 = 449.","type":"object","required":["step","ending"],"properties":{"step":{"exclusiveMinimum":0,"type":"number"},"ending":{"minimum":0,"type":"number"}}},{"type":"null"}]}}},"schedule":{"description":"Omitted / null = write the prices now. `change` = new prices from `validFrom` for good; `sale` = sale prices from `validFrom` to `validTo`, then the regular prices come back (multi-currency phase 5).","anyOf":[{"type":"object","required":["kind","validFrom"],"properties":{"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"validFrom":{"description":"ISO date-time.","type":"string"},"validTo":{"description":"Sales only.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["selection","change"],"properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"change":{"type":"object","required":["currency","operation"],"properties":{"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"operation":{"description":"`percent` = current price ± %, `from-rate` = manual price from the rate, `round` = round to `ending`, `clear` = remove the manual price (other currencies only).","anyOf":[{"const":"percent","type":"string"},{"const":"from-rate","type":"string"},{"const":"round","type":"string"},{"const":"clear","type":"string"}]},"percent":{"examples":[10,-5],"type":"number"},"ending":{"anyOf":[{"description":"Price ending: the nearest step × k + ending, e.g. step 10 + ending 9 = 449.","type":"object","required":["step","ending"],"properties":{"step":{"exclusiveMinimum":0,"type":"number"},"ending":{"minimum":0,"type":"number"}}},{"type":"null"}]}}},"schedule":{"description":"Omitted / null = write the prices now. `change` = new prices from `validFrom` for good; `sale` = sale prices from `validFrom` to `validTo`, then the regular prices come back (multi-currency phase 5).","anyOf":[{"type":"object","required":["kind","validFrom"],"properties":{"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"validFrom":{"description":"ISO date-time.","type":"string"},"validTo":{"description":"Sales only.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["selection","change"],"properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}},"change":{"type":"object","required":["currency","operation"],"properties":{"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"operation":{"description":"`percent` = current price ± %, `from-rate` = manual price from the rate, `round` = round to `ending`, `clear` = remove the manual price (other currencies only).","anyOf":[{"const":"percent","type":"string"},{"const":"from-rate","type":"string"},{"const":"round","type":"string"},{"const":"clear","type":"string"}]},"percent":{"examples":[10,-5],"type":"number"},"ending":{"anyOf":[{"description":"Price ending: the nearest step × k + ending, e.g. step 10 + ending 9 = 449.","type":"object","required":["step","ending"],"properties":{"step":{"exclusiveMinimum":0,"type":"number"},"ending":{"minimum":0,"type":"number"}}},{"type":"null"}]}}},"schedule":{"description":"Omitted / null = write the prices now. `change` = new prices from `validFrom` for good; `sale` = sale prices from `validFrom` to `validTo`, then the regular prices come back (multi-currency phase 5).","anyOf":[{"type":"object","required":["kind","validFrom"],"properties":{"kind":{"anyOf":[{"const":"sale","type":"string"},{"const":"change","type":"string"}]},"validFrom":{"description":"ISO date-time.","type":"string"},"validTo":{"description":"Sales only.","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/product/price-csv-export":{"post":{"parameters":[],"operationId":"postBffProductPrice-csv-export","tags":["Product"],"summary":"Export product prices per currency as CSV","description":"Semicolon CSV: code, name, the default currency (product price), the manual price per other selling currency (empty = converted at the rate) and informative \"<CUR> converted\" columns. Without a selection the whole live catalogue.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}},"text/plain":{"schema":{"type":"object","properties":{"selection":{"type":"object","properties":{"codes":{"description":"Picked rows (product codes).","type":"array","items":{"type":"string"}},"filter":{"description":"Every product matching the list filter (the `/product/list` query params). Ignored with `codes`.","type":"object","patternProperties":{"^(.*)$":{"type":"string"}}}}}}}}}},"responses":{"200":{}}}},"/bff/product/price-csv-import":{"post":{"parameters":[],"operationId":"postBffProductPrice-csv-import","tags":["Product"],"summary":"Import product prices per currency from CSV","description":"Matches products by code. A default-currency cell sets the product price (empty = unchanged); another currency sets the manual price (empty = removed, converts at the rate). Rows with errors are skipped.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"description":"Raw CSV (comma or semicolon separated).","type":"string"},"dryRun":{"description":"Default true: only the plan, nothing is written.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"description":"Raw CSV (comma or semicolon separated).","type":"string"},"dryRun":{"description":"Default true: only the plan, nothing is written.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"description":"Raw CSV (comma or semicolon separated).","type":"string"},"dryRun":{"description":"Default true: only the plan, nothing is written.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/product/currency-price-set":{"post":{"parameters":[],"operationId":"postBffProductCurrency-price-set","tags":["Product"],"summary":"Set the manual price of one currency on a product","description":"Other currencies and the variants keep their manual prices.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","currency","price"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"price":{"description":"Manual price with VAT; null = convert from the default price by the shop rate.","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","currency","price"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"price":{"description":"Manual price with VAT; null = convert from the default price by the shop rate.","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["productCode","currency","price"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currency":{"minLength":3,"maxLength":3,"examples":["CZK"],"type":"string"},"price":{"description":"Manual price with VAT; null = convert from the default price by the shop rate.","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/product/product-currency-prices-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"productCode":{"type":"string"},"defaultCurrency":{"examples":["CZK"],"type":"string"},"price":{"description":"Default-currency price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","code","name","price","currencyPrices"],"properties":{"relationHash":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"price":{"description":"Default-currency variant price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"required":["productCode","defaultCurrency","price","currencyPrices","variants"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"productCode":{"type":"string"},"defaultCurrency":{"examples":["CZK"],"type":"string"},"price":{"description":"Default-currency price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","code","name","price","currencyPrices"],"properties":{"relationHash":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"price":{"description":"Default-currency variant price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"required":["productCode","defaultCurrency","price","currencyPrices","variants"]}},"text/plain":{"schema":{"type":"object","properties":{"productCode":{"type":"string"},"defaultCurrency":{"examples":["CZK"],"type":"string"},"price":{"description":"Default-currency price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","code","name","price","currencyPrices"],"properties":{"relationHash":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"price":{"description":"Default-currency variant price incl. VAT.","type":"number"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"type":"number"}}}}}}},"required":["productCode","defaultCurrency","price","currencyPrices","variants"]}}}}},"operationId":"postBffProductProduct-currency-prices-update","tags":["Product"],"summary":"Save manual product + variant prices in other currencies (BIZKIT-90)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","currencyPrices"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currencyPrices":{"description":"ISO code → price incl. VAT. Null / omitted = converted from the default price.","type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","currencyPrices"],"properties":{"relationHash":{"type":"string"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","currencyPrices"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currencyPrices":{"description":"ISO code → price incl. VAT. Null / omitted = converted from the default price.","type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","currencyPrices"],"properties":{"relationHash":{"type":"string"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}}}}}}},"text/plain":{"schema":{"type":"object","required":["productCode","currencyPrices"],"properties":{"productCode":{"examples":["my-product"],"type":"string"},"currencyPrices":{"description":"ISO code → price incl. VAT. Null / omitted = converted from the default price.","type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}},"variants":{"type":"array","items":{"type":"object","required":["relationHash","currencyPrices"],"properties":{"relationHash":{"type":"string"},"currencyPrices":{"type":"object","patternProperties":{"^(.*)$":{"nullable":true,"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}}}}}}}}}}},"/bff/product/pricelist-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the rule list was persisted.","type":"boolean"},"ruleCount":{"description":"Number of rules now stored on the product.","type":"number"}},"required":["success","ruleCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the rule list was persisted.","type":"boolean"},"ruleCount":{"description":"Number of rules now stored on the product.","type":"number"}},"required":["success","ruleCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the rule list was persisted.","type":"boolean"},"ruleCount":{"description":"Number of rules now stored on the product.","type":"number"}},"required":["success","ruleCount"]}}}}},"operationId":"postBffProductPricelist-update","tags":["Product"],"summary":"Save product pricelist rules","description":"Replaces the full array of dynamic pricing rules on a product. Empty array clears all rules (column reset to NULL so most products bypass the resolver cheaply). Validation is server-side; the resolver itself never lets margin go negative, but admin should also warn before save.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","rules"],"properties":{"productCode":{"description":"Product code whose pricelist is being replaced.","examples":["my-product"],"type":"string"},"rules":{"description":"Full replacement of the rule list. Pass an empty array to clear all rules.","type":"array","items":{"type":"object","required":["id","name","enabled","priority","validFrom","validTo","weekdays","timeFrom","timeTo","variantCode","price"],"properties":{"id":{"minLength":1,"description":"Stable UUID assigned by the admin form.","type":"string"},"name":{"minLength":1,"maxLength":80,"description":"Human label for the rule.","type":"string"},"enabled":{"description":"Disabled rules are kept but ignored by the resolver.","type":"boolean"},"priority":{"description":"Higher value wins; ties broken by specificity.","type":"number"},"validFrom":{"description":"Inclusive lower date bound (YYYY-MM-DD) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"Inclusive upper date bound (YYYY-MM-DD) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"weekdays":{"description":"ISO weekdays (Mon=1 … Sun=7), or null for every day.","anyOf":[{"type":"array","items":{"minimum":1,"maximum":7,"type":"number"}},{"type":"null"}]},"timeFrom":{"description":"Inclusive lower time-of-day bound (HH:mm) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"Inclusive upper time-of-day bound (HH:mm) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"description":"Variant code scope, or null for all variants of this product.","anyOf":[{"type":"string"},{"type":"null"}]},"price":{"minimum":0,"description":"Price applied when this rule wins. Margin is clamped to >= 0 by the resolver.","type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","rules"],"properties":{"productCode":{"description":"Product code whose pricelist is being replaced.","examples":["my-product"],"type":"string"},"rules":{"description":"Full replacement of the rule list. Pass an empty array to clear all rules.","type":"array","items":{"type":"object","required":["id","name","enabled","priority","validFrom","validTo","weekdays","timeFrom","timeTo","variantCode","price"],"properties":{"id":{"minLength":1,"description":"Stable UUID assigned by the admin form.","type":"string"},"name":{"minLength":1,"maxLength":80,"description":"Human label for the rule.","type":"string"},"enabled":{"description":"Disabled rules are kept but ignored by the resolver.","type":"boolean"},"priority":{"description":"Higher value wins; ties broken by specificity.","type":"number"},"validFrom":{"description":"Inclusive lower date bound (YYYY-MM-DD) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"Inclusive upper date bound (YYYY-MM-DD) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"weekdays":{"description":"ISO weekdays (Mon=1 … Sun=7), or null for every day.","anyOf":[{"type":"array","items":{"minimum":1,"maximum":7,"type":"number"}},{"type":"null"}]},"timeFrom":{"description":"Inclusive lower time-of-day bound (HH:mm) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"Inclusive upper time-of-day bound (HH:mm) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"description":"Variant code scope, or null for all variants of this product.","anyOf":[{"type":"string"},{"type":"null"}]},"price":{"minimum":0,"description":"Price applied when this rule wins. Margin is clamped to >= 0 by the resolver.","type":"number"}}}}}}},"text/plain":{"schema":{"type":"object","required":["productCode","rules"],"properties":{"productCode":{"description":"Product code whose pricelist is being replaced.","examples":["my-product"],"type":"string"},"rules":{"description":"Full replacement of the rule list. Pass an empty array to clear all rules.","type":"array","items":{"type":"object","required":["id","name","enabled","priority","validFrom","validTo","weekdays","timeFrom","timeTo","variantCode","price"],"properties":{"id":{"minLength":1,"description":"Stable UUID assigned by the admin form.","type":"string"},"name":{"minLength":1,"maxLength":80,"description":"Human label for the rule.","type":"string"},"enabled":{"description":"Disabled rules are kept but ignored by the resolver.","type":"boolean"},"priority":{"description":"Higher value wins; ties broken by specificity.","type":"number"},"validFrom":{"description":"Inclusive lower date bound (YYYY-MM-DD) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"Inclusive upper date bound (YYYY-MM-DD) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"weekdays":{"description":"ISO weekdays (Mon=1 … Sun=7), or null for every day.","anyOf":[{"type":"array","items":{"minimum":1,"maximum":7,"type":"number"}},{"type":"null"}]},"timeFrom":{"description":"Inclusive lower time-of-day bound (HH:mm) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"timeTo":{"description":"Inclusive upper time-of-day bound (HH:mm) or null.","anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"description":"Variant code scope, or null for all variants of this product.","anyOf":[{"type":"string"},{"type":"null"}]},"price":{"minimum":0,"description":"Price applied when this rule wins. Margin is clamped to >= 0 by the resolver.","type":"number"}}}}}}}}}}},"/bff/product/pricelist-preview":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"basePrice":{"description":"Static product/variant price used as fallback.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency.","type":"number"},"resolvedPrice":{"description":"Final price after rules + margin clamp.","type":"number"},"marginAbs":{"description":"resolvedPrice - cost; guaranteed >= 0.","type":"number"},"matchedRuleId":{"description":"ID of the winning rule, or null if base price was used.","anyOf":[{"type":"string"},{"type":"null"}]},"matchedRuleName":{"description":"Name of the winning rule for display.","anyOf":[{"type":"string"},{"type":"null"}]},"clampedToCost":{"description":"True when the winning rule was under cost and pulled up to cost.","type":"boolean"}},"required":["basePrice","cost","resolvedPrice","marginAbs","matchedRuleId","matchedRuleName","clampedToCost"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"basePrice":{"description":"Static product/variant price used as fallback.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency.","type":"number"},"resolvedPrice":{"description":"Final price after rules + margin clamp.","type":"number"},"marginAbs":{"description":"resolvedPrice - cost; guaranteed >= 0.","type":"number"},"matchedRuleId":{"description":"ID of the winning rule, or null if base price was used.","anyOf":[{"type":"string"},{"type":"null"}]},"matchedRuleName":{"description":"Name of the winning rule for display.","anyOf":[{"type":"string"},{"type":"null"}]},"clampedToCost":{"description":"True when the winning rule was under cost and pulled up to cost.","type":"boolean"}},"required":["basePrice","cost","resolvedPrice","marginAbs","matchedRuleId","matchedRuleName","clampedToCost"]}},"text/plain":{"schema":{"type":"object","properties":{"basePrice":{"description":"Static product/variant price used as fallback.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency.","type":"number"},"resolvedPrice":{"description":"Final price after rules + margin clamp.","type":"number"},"marginAbs":{"description":"resolvedPrice - cost; guaranteed >= 0.","type":"number"},"matchedRuleId":{"description":"ID of the winning rule, or null if base price was used.","anyOf":[{"type":"string"},{"type":"null"}]},"matchedRuleName":{"description":"Name of the winning rule for display.","anyOf":[{"type":"string"},{"type":"null"}]},"clampedToCost":{"description":"True when the winning rule was under cost and pulled up to cost.","type":"boolean"}},"required":["basePrice","cost","resolvedPrice","marginAbs","matchedRuleId","matchedRuleName","clampedToCost"]}}}}},"operationId":"postBffProductPricelist-preview","tags":["Product"],"summary":"Preview pricelist resolver","description":"Evaluates an in-memory rule set against the live base price + cost of (product, variant) at the given instant. Echoes back the winning rule, the resolved price, and a flag if the rule was clamped up to cost to keep margin non-negative.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","rules"],"properties":{"productCode":{"description":"Product code to preview for.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code, or null for product-level preview.","anyOf":[{"type":"string"},{"type":"null"}]},"at":{"description":"ISO datetime at which to evaluate the rules. Defaults to now.","examples":["2026-06-20T15:30:00Z"],"type":"string"},"rules":{"description":"In-flight rule set to evaluate — typically the current admin form state. Letting the caller send the rules makes the preview work before the rules are saved.","type":"array","items":{}}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","rules"],"properties":{"productCode":{"description":"Product code to preview for.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code, or null for product-level preview.","anyOf":[{"type":"string"},{"type":"null"}]},"at":{"description":"ISO datetime at which to evaluate the rules. Defaults to now.","examples":["2026-06-20T15:30:00Z"],"type":"string"},"rules":{"description":"In-flight rule set to evaluate — typically the current admin form state. Letting the caller send the rules makes the preview work before the rules are saved.","type":"array","items":{}}}}},"text/plain":{"schema":{"type":"object","required":["productCode","rules"],"properties":{"productCode":{"description":"Product code to preview for.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code, or null for product-level preview.","anyOf":[{"type":"string"},{"type":"null"}]},"at":{"description":"ISO datetime at which to evaluate the rules. Defaults to now.","examples":["2026-06-20T15:30:00Z"],"type":"string"},"rules":{"description":"In-flight rule set to evaluate — typically the current admin form state. Letting the caller send the rules makes the preview work before the rules are saved.","type":"array","items":{}}}}}}}}},"/bff/product-import/from-url":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Generated product code (use for /product/{code}).","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"},"reused":{"description":"True when the product already existed and was not re-imported.","type":"boolean"}},"required":["success","code","slug","reused"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Generated product code (use for /product/{code}).","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"},"reused":{"description":"True when the product already existed and was not re-imported.","type":"boolean"}},"required":["success","code","slug","reused"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"code":{"description":"Generated product code (use for /product/{code}).","type":"string"},"slug":{"description":"Generated URL slug.","type":"string"},"reused":{"description":"True when the product already existed and was not re-imported.","type":"boolean"}},"required":["success","code","slug","reused"]}}}}},"operationId":"postBffProduct-importFrom-url","tags":["ProductImport"],"summary":"Import product from external URL","description":"Fetches the URL, runs an LLM to extract structured product data (name, description, price, images, attributes), creates a new `shop__product` row with a generated code/slug and queues its images for async blob storage. Deduplicated by (vendor, external_id) — repeated calls with the same listing return the existing product.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":8,"description":"Absolute http(s) URL of the source product/listing page.","examples":["https://www.sreality.cz/detail/pronajem/komercni/obchodni-prostor/brno/310894668"],"type":"string"},"mainCategoryCode":{"description":"Optional product category code to pre-assign to the imported product.","examples":["real-estate"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":8,"description":"Absolute http(s) URL of the source product/listing page.","examples":["https://www.sreality.cz/detail/pronajem/komercni/obchodni-prostor/brno/310894668"],"type":"string"},"mainCategoryCode":{"description":"Optional product category code to pre-assign to the imported product.","examples":["real-estate"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["url"],"properties":{"url":{"minLength":8,"description":"Absolute http(s) URL of the source product/listing page.","examples":["https://www.sreality.cz/detail/pronajem/komercni/obchodni-prostor/brno/310894668"],"type":"string"},"mainCategoryCode":{"description":"Optional product category code to pre-assign to the imported product.","examples":["real-estate"],"type":"string"}}}}}}}},"/bff/product-category/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Include soft-deleted categories (\"true\").","schema":{"type":"string"},"in":"query","name":"includeDeleted","required":false},{"description":"Return only soft-deleted categories (\"true\").","schema":{"type":"string"},"in":"query","name":"onlyDeleted","required":false}],"operationId":"getBffProduct-categoryList","tags":["Product Category"],"summary":"List product categories","description":"Returns a paginated flat list of product categories for datagrid display.","responses":{"200":{}}}},"/bff/product-category/list-selectbox":{"get":{"operationId":"getBffProduct-categoryList-selectbox","tags":["Product Category"],"summary":"List categories for selectbox","description":"Returns a lightweight list of categories formatted for select/dropdown components.","responses":{"200":{}}}},"/bff/product-category/list-with-counts":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Categories with at least one product, sorted by count DESC.","type":"array","items":{"type":"object","required":["code","name","productCount"],"properties":{"code":{"description":"Category code (used as filter value).","type":"string"},"name":{"description":"Category display name.","type":"string"},"productCount":{"description":"Number of non-deleted products with this main category.","type":"number"}}}},"noCategoryCount":{"description":"Number of non-deleted products with main_category_id IS NULL.","type":"number"},"totalCount":{"description":"Total number of non-deleted products in the organisation.","type":"number"}},"required":["items","noCategoryCount","totalCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Categories with at least one product, sorted by count DESC.","type":"array","items":{"type":"object","required":["code","name","productCount"],"properties":{"code":{"description":"Category code (used as filter value).","type":"string"},"name":{"description":"Category display name.","type":"string"},"productCount":{"description":"Number of non-deleted products with this main category.","type":"number"}}}},"noCategoryCount":{"description":"Number of non-deleted products with main_category_id IS NULL.","type":"number"},"totalCount":{"description":"Total number of non-deleted products in the organisation.","type":"number"}},"required":["items","noCategoryCount","totalCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Categories with at least one product, sorted by count DESC.","type":"array","items":{"type":"object","required":["code","name","productCount"],"properties":{"code":{"description":"Category code (used as filter value).","type":"string"},"name":{"description":"Category display name.","type":"string"},"productCount":{"description":"Number of non-deleted products with this main category.","type":"number"}}}},"noCategoryCount":{"description":"Number of non-deleted products with main_category_id IS NULL.","type":"number"},"totalCount":{"description":"Total number of non-deleted products in the organisation.","type":"number"}},"required":["items","noCategoryCount","totalCount"]}}}}},"operationId":"getBffProduct-categoryList-with-counts","tags":["Product Category"],"summary":"List categories with product counts","description":"Returns categories that have at least one non-deleted product assigned as their main category, sorted by product count DESC (then name ASC). Also returns the count of products with no main category and the grand total. Intended for the product-list filter dropdown."}},"/bff/product-category/tree":{"get":{"operationId":"getBffProduct-categoryTree","tags":["Product Category"],"summary":"Get category tree","description":"Returns the hierarchical tree structure of product categories with parent-child relationships.","responses":{"200":{}}}},"/bff/product-category/category-detail":{"get":{"parameters":[{"description":"Category unique code.","examples":["electronics"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"operationId":"getBffProduct-categoryCategory-detail","tags":["Product Category"],"summary":"Get category detail","description":"Returns full detail of a single product category by its code.","responses":{"200":{}}}},"/bff/product-category/category-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"type":"string"},"slug":{"type":"string"}},"required":["success","code","slug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"type":"string"},"slug":{"type":"string"}},"required":["success","code","slug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"type":"string"},"slug":{"type":"string"}},"required":["success","code","slug"]}}}}},"operationId":"postBffProduct-categoryCategory-create","tags":["Product Category"],"summary":"Create product category","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","code"],"properties":{"name":{"description":"Category display name.","examples":["Electronics"],"type":"string"},"code":{"description":"Unique category code (slug-like).","examples":["electronics"],"type":"string"},"slug":{"description":"URL slug. Auto-generated from name if not provided.","type":"string"},"parentCode":{"description":"Parent category code for nesting.","examples":["root"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","code"],"properties":{"name":{"description":"Category display name.","examples":["Electronics"],"type":"string"},"code":{"description":"Unique category code (slug-like).","examples":["electronics"],"type":"string"},"slug":{"description":"URL slug. Auto-generated from name if not provided.","type":"string"},"parentCode":{"description":"Parent category code for nesting.","examples":["root"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["name","code"],"properties":{"name":{"description":"Category display name.","examples":["Electronics"],"type":"string"},"code":{"description":"Unique category code (slug-like).","examples":["electronics"],"type":"string"},"slug":{"description":"URL slug. Auto-generated from name if not provided.","type":"string"},"parentCode":{"description":"Parent category code for nesting.","examples":["root"],"type":"string"}}}}}}}},"/bff/product-category/category-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-categoryCategory-update","tags":["Product Category"],"summary":"Update product category","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","code"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"parentCode":{"type":"string"},"description":{"type":"string"},"active":{"type":"boolean"},"internal":{"type":"boolean"},"b2b":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","code"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"parentCode":{"type":"string"},"description":{"type":"string"},"active":{"type":"boolean"},"internal":{"type":"boolean"},"b2b":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["name","code"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"slug":{"type":"string"},"parentCode":{"type":"string"},"description":{"type":"string"},"active":{"type":"boolean"},"internal":{"type":"boolean"},"b2b":{"type":"boolean"}}}}}}}},"/bff/product-category/category-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"affected":{"type":"number"}},"required":["affected"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"affected":{"type":"number"}},"required":["affected"]}},"text/plain":{"schema":{"type":"object","properties":{"affected":{"type":"number"}},"required":["affected"]}}}}},"operationId":"postBffProduct-categoryCategory-delete","tags":["Product Category"],"summary":"Soft-delete product category","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"cascade":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"cascade":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"cascade":{"type":"boolean"}}}}}}}},"/bff/product-category/category-restore":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"restored":{"type":"boolean"},"parentReset":{"type":"boolean"}},"required":["restored"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"restored":{"type":"boolean"},"parentReset":{"type":"boolean"}},"required":["restored"]}},"text/plain":{"schema":{"type":"object","properties":{"restored":{"type":"boolean"},"parentReset":{"type":"boolean"}},"required":["restored"]}}}}},"operationId":"postBffProduct-categoryCategory-restore","tags":["Product Category"],"summary":"Restore soft-deleted category","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}}}}}},"/bff/product-category/category-reorder":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"newPosition":{"type":"number"},"siblings":{"type":"number"}},"required":["newPosition","siblings"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"newPosition":{"type":"number"},"siblings":{"type":"number"}},"required":["newPosition","siblings"]}},"text/plain":{"schema":{"type":"object","properties":{"newPosition":{"type":"number"},"siblings":{"type":"number"}},"required":["newPosition","siblings"]}}}}},"operationId":"postBffProduct-categoryCategory-reorder","tags":["Product Category"],"summary":"Reorder / move category in tree","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","newPosition"],"properties":{"code":{"type":"string"},"newParentCode":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"newPosition":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","newPosition"],"properties":{"code":{"type":"string"},"newParentCode":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"newPosition":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["code","newPosition"],"properties":{"code":{"type":"string"},"newParentCode":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"newPosition":{"type":"number"}}}}}}}},"/bff/product-category/category-set-main-image":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-categoryCategory-set-main-image","tags":["Product Category"],"summary":"Set or remove category main image","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"blobToken":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"blobToken":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"blobToken":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/product-category/category-update-seo":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-categoryCategory-update-seo","tags":["Product Category"],"summary":"Update category SEO fields","description":"Updates meta_title, meta_description, canonical_url, noindex and og:image. Empty strings reset to NULL.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canonicalUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"noindex":{"type":"boolean"},"ogImageBlobToken":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canonicalUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"noindex":{"type":"boolean"},"ogImageBlobToken":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canonicalUrl":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"noindex":{"type":"boolean"},"ogImageBlobToken":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/product-category/category-locale-upsert":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-categoryCategory-locale-upsert","tags":["Product Category"],"summary":"Upsert a category translation","description":"Creates or updates a translation row in shop__product_category_locale for the given locale.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","locale"],"properties":{"code":{"type":"string"},"locale":{"examples":["en"],"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","locale"],"properties":{"code":{"type":"string"},"locale":{"examples":["en"],"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code","locale"],"properties":{"code":{"type":"string"},"locale":{"examples":["en"],"type":"string"},"name":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaTitle":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"metaDescription":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/product-category/category-locale-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-categoryCategory-locale-delete","tags":["Product Category"],"summary":"Delete a category translation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","locale"],"properties":{"code":{"type":"string"},"locale":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","locale"],"properties":{"code":{"type":"string"},"locale":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code","locale"],"properties":{"code":{"type":"string"},"locale":{"type":"string"}}}}}}}},"/bff/product-category/category-bulk":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["affected","skipped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["affected","skipped"]}},"text/plain":{"schema":{"type":"object","properties":{"affected":{"type":"number"},"skipped":{"type":"number"}},"required":["affected","skipped"]}}}}},"operationId":"postBffProduct-categoryCategory-bulk","tags":["Product Category"],"summary":"Bulk operation on categories","description":"Apply an action to a set of categories by their codes. Supported: activate, deactivate, mark-internal, unmark-internal, mark-b2b, unmark-b2b, delete (always cascades), restore, change-parent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["codes","action"],"properties":{"codes":{"description":"Codes of categories to act on.","type":"array","items":{"type":"string"}},"action":{"anyOf":[{"const":"activate","type":"string"},{"const":"deactivate","type":"string"},{"const":"mark-internal","type":"string"},{"const":"unmark-internal","type":"string"},{"const":"mark-b2b","type":"string"},{"const":"unmark-b2b","type":"string"},{"const":"delete","type":"string"},{"const":"restore","type":"string"},{"const":"change-parent","type":"string"}]},"newParentCode":{"nullable":true,"anyOf":[{"description":"Only used with change-parent.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["codes","action"],"properties":{"codes":{"description":"Codes of categories to act on.","type":"array","items":{"type":"string"}},"action":{"anyOf":[{"const":"activate","type":"string"},{"const":"deactivate","type":"string"},{"const":"mark-internal","type":"string"},{"const":"unmark-internal","type":"string"},{"const":"mark-b2b","type":"string"},{"const":"unmark-b2b","type":"string"},{"const":"delete","type":"string"},{"const":"restore","type":"string"},{"const":"change-parent","type":"string"}]},"newParentCode":{"nullable":true,"anyOf":[{"description":"Only used with change-parent.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["codes","action"],"properties":{"codes":{"description":"Codes of categories to act on.","type":"array","items":{"type":"string"}},"action":{"anyOf":[{"const":"activate","type":"string"},{"const":"deactivate","type":"string"},{"const":"mark-internal","type":"string"},{"const":"unmark-internal","type":"string"},{"const":"mark-b2b","type":"string"},{"const":"unmark-b2b","type":"string"},{"const":"delete","type":"string"},{"const":"restore","type":"string"},{"const":"change-parent","type":"string"}]},"newParentCode":{"nullable":true,"anyOf":[{"description":"Only used with change-parent.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/product-category/bulk-delete-preview":{"get":{"parameters":[{"description":"Comma-separated codes.","schema":{"type":"string"},"in":"query","name":"codes","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"direct":{"type":"number"},"descendants":{"type":"number"}},"required":["direct","descendants"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"direct":{"type":"number"},"descendants":{"type":"number"}},"required":["direct","descendants"]}},"text/plain":{"schema":{"type":"object","properties":{"direct":{"type":"number"},"descendants":{"type":"number"}},"required":["direct","descendants"]}}}}},"operationId":"getBffProduct-categoryBulk-delete-preview","tags":["Product Category"],"summary":"Preview cascade delete","description":"Returns how many categories total would be soft-deleted if the given codes were deleted with cascade."}},"/bff/product-category/export-csv":{"get":{"operationId":"getBffProduct-categoryExport-csv","tags":["Product Category"],"summary":"Export categories as CSV","description":"Streams a UTF-8 BOM CSV file with all non-deleted categories. Compatible with the importer.","responses":{"200":{}}}},"/bff/product-category/import-csv":{"post":{"parameters":[],"operationId":"postBffProduct-categoryImport-csv","tags":["Product Category"],"summary":"Import categories from CSV","description":"Validates and (if dryRun=false) applies the CSV. Existing categories are matched by `code` and updated; missing codes are inserted. The importer never deletes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"description":"Raw CSV content.","type":"string"},"dryRun":{"description":"If true, returns only the diff without applying.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"description":"Raw CSV content.","type":"string"},"dryRun":{"description":"If true, returns only the diff without applying.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["csv"],"properties":{"csv":{"description":"Raw CSV content.","type":"string"},"dryRun":{"description":"If true, returns only the diff without applying.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/product-category/assignable-products":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"categoryCode","required":true},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"examples":["unassigned"],"schema":{"type":"string"},"in":"query","name":"scope","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffProduct-categoryAssignable-products","tags":["Product Category"],"summary":"List products to (un)assign to/from a category","description":"Returns products with two flags: isMain (this category is product.main_category_id) and isInRel (it is linked via shop__product_rel_category). Use scope=unassigned (default) when adding, scope=assigned when removing.","responses":{"200":{}}}},"/bff/product-category/assign-products":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"affected":{"type":"number"},"missingProducts":{"type":"array","items":{"type":"string"}}},"required":["affected","missingProducts"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"affected":{"type":"number"},"missingProducts":{"type":"array","items":{"type":"string"}}},"required":["affected","missingProducts"]}},"text/plain":{"schema":{"type":"object","properties":{"affected":{"type":"number"},"missingProducts":{"type":"array","items":{"type":"string"}}},"required":["affected","missingProducts"]}}}}},"operationId":"postBffProduct-categoryAssign-products","tags":["Product Category"],"summary":"Bulk (un)assign products to a category","description":"mode=main sets the category as main_category_id (replaces existing); addRel links via shop__product_rel_category; removeRel removes the rel link.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["categoryCode","productCodes","mode"],"properties":{"categoryCode":{"type":"string"},"productCodes":{"type":"array","items":{"type":"string"}},"mode":{"anyOf":[{"const":"main","type":"string"},{"const":"addRel","type":"string"},{"const":"removeRel","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["categoryCode","productCodes","mode"],"properties":{"categoryCode":{"type":"string"},"productCodes":{"type":"array","items":{"type":"string"}},"mode":{"anyOf":[{"const":"main","type":"string"},{"const":"addRel","type":"string"},{"const":"removeRel","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["categoryCode","productCodes","mode"],"properties":{"categoryCode":{"type":"string"},"productCodes":{"type":"array","items":{"type":"string"}},"mode":{"anyOf":[{"const":"main","type":"string"},{"const":"addRel","type":"string"},{"const":"removeRel","type":"string"}]}}}}}}}},"/bff/product-category/category-analytics":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"code","required":true}],"operationId":"getBffProduct-categoryCategory-analytics","tags":["Product Category"],"summary":"Category KPIs","description":"Returns 30-day revenue, order counts, top products, sparkline and stock health for the category subtree.","responses":{"200":{}}}},"/bff/product-category/category-update-schedule":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-categoryCategory-update-schedule","tags":["Product Category"],"summary":"Update category schedule + visibility rules","description":"Sets active_from / active_to (cron auto-toggles `active`) and visibility_rules JSONB.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"activeFrom":{"nullable":true,"anyOf":[{"description":"ISO timestamp. Empty/null clears the schedule.","type":"string"},{"type":"null"}]},"activeTo":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibilityRules":{"nullable":true,"anyOf":[{"type":"object","properties":{"customerGroups":{"type":"array","items":{"type":"string"}},"branches":{"type":"array","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"activeFrom":{"nullable":true,"anyOf":[{"description":"ISO timestamp. Empty/null clears the schedule.","type":"string"},{"type":"null"}]},"activeTo":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibilityRules":{"nullable":true,"anyOf":[{"type":"object","properties":{"customerGroups":{"type":"array","items":{"type":"string"}},"branches":{"type":"array","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"activeFrom":{"nullable":true,"anyOf":[{"description":"ISO timestamp. Empty/null clears the schedule.","type":"string"},{"type":"null"}]},"activeTo":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"visibilityRules":{"nullable":true,"anyOf":[{"type":"object","properties":{"customerGroups":{"type":"array","items":{"type":"string"}},"branches":{"type":"array","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]}}}}}}}},"/bff/product-category/category-update-feed-mapping":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-categoryCategory-update-feed-mapping","tags":["Product Category"],"summary":"Update feed taxonomy mapping","description":"Updates Heureka / Google / Glami category mapping fields used by export feeds.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"heurekaCategoryId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"googleTaxonomyId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"glamiCategoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"heurekaCategoryId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"googleTaxonomyId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"glamiCategoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"heurekaCategoryId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"googleTaxonomyId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"glamiCategoryId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/product-category/taxonomy-google":{"get":{"operationId":"getBffProduct-categoryTaxonomy-google","tags":["Product Category"],"summary":"Bundled Google Product Taxonomy","description":"Returns a compact extract of the Google Product Taxonomy for the autocomplete picker.","responses":{"200":{}}}},"/bff/product-category/category-custom-fields":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"code","required":true}],"operationId":"getBffProduct-categoryCategory-custom-fields","tags":["Product Category"],"summary":"List category-scoped custom field definitions","responses":{"200":{}}}},"/bff/product-category/category-custom-field-upsert":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"operationId":"postBffProduct-categoryCategory-custom-field-upsert","tags":["Product Category"],"summary":"Create/update a category-scoped custom field","description":"Adds (or edits) a custom field definition that will be shown only for products whose main_category equals this category.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["categoryCode","key","type","label","required","active"],"properties":{"categoryCode":{"type":"string"},"id":{"type":"string"},"key":{"description":"snake_case identifier, 2-32 chars.","type":"string"},"type":{"examples":["text","number","boolean","date","select","url","email"],"type":"string"},"label":{"type":"string"},"helperText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"placeholder":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"boolean"},"active":{"type":"boolean"},"position":{"type":"number"},"validationPattern":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["categoryCode","key","type","label","required","active"],"properties":{"categoryCode":{"type":"string"},"id":{"type":"string"},"key":{"description":"snake_case identifier, 2-32 chars.","type":"string"},"type":{"examples":["text","number","boolean","date","select","url","email"],"type":"string"},"label":{"type":"string"},"helperText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"placeholder":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"boolean"},"active":{"type":"boolean"},"position":{"type":"number"},"validationPattern":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["categoryCode","key","type","label","required","active"],"properties":{"categoryCode":{"type":"string"},"id":{"type":"string"},"key":{"description":"snake_case identifier, 2-32 chars.","type":"string"},"type":{"examples":["text","number","boolean","date","select","url","email"],"type":"string"},"label":{"type":"string"},"helperText":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"placeholder":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"boolean"},"active":{"type":"boolean"},"position":{"type":"number"},"validationPattern":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/product-category/category-custom-field-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-categoryCategory-custom-field-delete","tags":["Product Category"],"summary":"Delete a category-scoped custom field","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}}},"/bff/product-category/category-ai-suggest":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"metaTitle":{"type":"string"},"metaDescription":{"type":"string"},"imageAlt":{"type":"string"}},"required":["description","metaTitle","metaDescription","imageAlt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"description":{"type":"string"},"metaTitle":{"type":"string"},"metaDescription":{"type":"string"},"imageAlt":{"type":"string"}},"required":["description","metaTitle","metaDescription","imageAlt"]}},"text/plain":{"schema":{"type":"object","properties":{"description":{"type":"string"},"metaTitle":{"type":"string"},"metaDescription":{"type":"string"},"imageAlt":{"type":"string"}},"required":["description","metaTitle","metaDescription","imageAlt"]}}}}},"operationId":"postBffProduct-categoryCategory-ai-suggest","tags":["Product Category"],"summary":"AI: generate category description + SEO","description":"Uses Claude (via askAIJson) and the categorys products to produce description, metaTitle, metaDescription, imageAlt.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"locale":{"type":"string"},"styleHint":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"locale":{"type":"string"},"styleHint":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"},"locale":{"type":"string"},"styleHint":{"type":"string"}}}}}}}},"/bff/product-category/category-ai-restructure-suggest":{"post":{"parameters":[],"operationId":"postBffProduct-categoryCategory-ai-restructure-suggest","tags":["Product Category"],"summary":"AI: propose a new category hierarchy","description":"Reads existing categories + sample products and proposes a cleaner tree. Returns the plan only — apply via /category-ai-restructure-apply.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"locale":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"locale":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/product-category/category-ai-restructure-apply":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"number"},"moved":{"type":"number"},"deprecated":{"type":"number"}},"required":["created","moved","deprecated"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"created":{"type":"number"},"moved":{"type":"number"},"deprecated":{"type":"number"}},"required":["created","moved","deprecated"]}},"text/plain":{"schema":{"type":"object","properties":{"created":{"type":"number"},"moved":{"type":"number"},"deprecated":{"type":"number"}},"required":["created","moved","deprecated"]}}}}},"operationId":"postBffProduct-categoryCategory-ai-restructure-apply","tags":["Product Category"],"summary":"AI: apply a proposed restructure","description":"Moves / creates categories according to the (possibly-edited) plan. Categories listed in toDeprecate are soft-deleted with cascade.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["tree","toDeprecate"],"properties":{"tree":{"description":"Tree shape returned by /category-ai-restructure-suggest (possibly user-edited)."},"toDeprecate":{"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["tree","toDeprecate"],"properties":{"tree":{"description":"Tree shape returned by /category-ai-restructure-suggest (possibly user-edited)."},"toDeprecate":{"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["tree","toDeprecate"],"properties":{"tree":{"description":"Tree shape returned by /category-ai-restructure-suggest (possibly user-edited)."},"toDeprecate":{"type":"array","items":{"type":"string"}}}}}}}}},"/bff/product-parameter/group-list":{"get":{"responses":{"200":{"description":"List of parameter groups.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"All parameter groups ordered by position then name.","type":"array","items":{"description":"Parameter group item.","type":"object","required":["id","code","name","position","active"],"properties":{"id":{"description":"Internal group ID.","type":"number"},"code":{"description":"Unique group code (URL-friendly slug).","type":"string"},"name":{"description":"Display name of the group.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the group is active.","type":"boolean"}}}},"itemCount":{"description":"Total number of groups.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"All parameter groups ordered by position then name.","type":"array","items":{"description":"Parameter group item.","type":"object","required":["id","code","name","position","active"],"properties":{"id":{"description":"Internal group ID.","type":"number"},"code":{"description":"Unique group code (URL-friendly slug).","type":"string"},"name":{"description":"Display name of the group.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the group is active.","type":"boolean"}}}},"itemCount":{"description":"Total number of groups.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"All parameter groups ordered by position then name.","type":"array","items":{"description":"Parameter group item.","type":"object","required":["id","code","name","position","active"],"properties":{"id":{"description":"Internal group ID.","type":"number"},"code":{"description":"Unique group code (URL-friendly slug).","type":"string"},"name":{"description":"Display name of the group.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the group is active.","type":"boolean"}}}},"itemCount":{"description":"Total number of groups.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProduct-parameterGroup-list","tags":["Product Parameter"],"summary":"List parameter groups","description":"Returns all parameter groups for the authenticated organisation. Groups are used to visually organize parameters into sections (e.g. \"Dimensions\", \"Technical specs\")."}},"/bff/product-parameter/group-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created group.","type":"number"},"code":{"description":"Final code of the created group (after slugification).","type":"string"}},"required":["id","code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created group.","type":"number"},"code":{"description":"Final code of the created group (after slugification).","type":"string"}},"required":["id","code"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created group.","type":"number"},"code":{"description":"Final code of the created group (after slugification).","type":"string"}},"required":["id","code"]}}}}},"operationId":"postBffProduct-parameterGroup-add","tags":["Product Parameter"],"summary":"Create parameter group","description":"Creates a new parameter group for organizing parameters into logical sections. The code is auto-generated from the name if not provided.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Display name for the group (e.g. \"Technical specs\").","examples":["Technical specs"],"type":"string"},"code":{"description":"URL-friendly code. If not provided, generated from name via slugification.","examples":["technical-specs"],"type":"string"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Display name for the group (e.g. \"Technical specs\").","examples":["Technical specs"],"type":"string"},"code":{"description":"URL-friendly code. If not provided, generated from name via slugification.","examples":["technical-specs"],"type":"string"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Display name for the group (e.g. \"Technical specs\").","examples":["Technical specs"],"type":"string"},"code":{"description":"URL-friendly code. If not provided, generated from name via slugification.","examples":["technical-specs"],"type":"string"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}}}}}},"/bff/product-parameter/group-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the group was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the group was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the group was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterGroup-update","tags":["Product Parameter"],"summary":"Update parameter group","description":"Updates properties of an existing parameter group. Only provided fields are changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to update.","examples":["technical-specs"],"type":"string"},"name":{"description":"New display name.","examples":["Dimensions"],"type":"string"},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to update.","examples":["technical-specs"],"type":"string"},"name":{"description":"New display name.","examples":["Dimensions"],"type":"string"},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to update.","examples":["technical-specs"],"type":"string"},"name":{"description":"New display name.","examples":["Dimensions"],"type":"string"},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}}}}}},"/bff/product-parameter/group-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the group was deleted.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the group was deleted.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the group was deleted.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterGroup-delete","tags":["Product Parameter"],"summary":"Delete parameter group","description":"Deletes a parameter group. Parameters in this group will have their group_id set to NULL (ungrouped). Fails if the group does not exist.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to delete.","examples":["technical-specs"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to delete.","examples":["technical-specs"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to delete.","examples":["technical-specs"],"type":"string"}}}}}}}},"/bff/product-parameter/list":{"get":{"parameters":[{"description":"Filter parameters by group code. If not provided, returns all parameters.","examples":["technical-specs"],"schema":{"type":"string"},"in":"query","name":"groupCode","required":false}],"responses":{"200":{"description":"List of parameter definitions.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Parameters ordered by position then name.","type":"array","items":{"description":"Parameter definition item.","type":"object","required":["id","code","name","type","filterable","comparable","variantForming","multiValue","position","active","valueCount"],"properties":{"id":{"description":"Internal parameter ID.","type":"number"},"code":{"description":"Unique parameter code.","type":"string"},"name":{"description":"Display name of the parameter.","type":"string"},"group":{"description":"Group this parameter belongs to. Undefined if ungrouped.","type":"object","required":["code","name"],"properties":{"code":{"description":"Group code.","type":"string"},"name":{"description":"Group display name.","type":"string"}}},"type":{"description":"Data type: string, number, boolean, enum, or color.","type":"string"},"unit":{"description":"Unit label (e.g. \"mm\", \"kg\"). Only for number type.","type":"string"},"filterable":{"description":"Whether this parameter should appear in frontend product filters.","type":"boolean"},"comparable":{"description":"Whether this parameter should appear in the product comparison table.","type":"boolean"},"variantForming":{"description":"Whether this parameter forms product variants (e.g. \"Size\" creates variants, \"Material\" does not). Only enum/color.","type":"boolean"},"multiValue":{"description":"Whether a product can have multiple values for this parameter (e.g. multiple colors). Only enum/color.","type":"boolean"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the parameter is active.","type":"boolean"},"valueCount":{"description":"Number of predefined values (relevant for enum/color types).","type":"number"}}}},"itemCount":{"description":"Total number of parameters.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Parameters ordered by position then name.","type":"array","items":{"description":"Parameter definition item.","type":"object","required":["id","code","name","type","filterable","comparable","variantForming","multiValue","position","active","valueCount"],"properties":{"id":{"description":"Internal parameter ID.","type":"number"},"code":{"description":"Unique parameter code.","type":"string"},"name":{"description":"Display name of the parameter.","type":"string"},"group":{"description":"Group this parameter belongs to. Undefined if ungrouped.","type":"object","required":["code","name"],"properties":{"code":{"description":"Group code.","type":"string"},"name":{"description":"Group display name.","type":"string"}}},"type":{"description":"Data type: string, number, boolean, enum, or color.","type":"string"},"unit":{"description":"Unit label (e.g. \"mm\", \"kg\"). Only for number type.","type":"string"},"filterable":{"description":"Whether this parameter should appear in frontend product filters.","type":"boolean"},"comparable":{"description":"Whether this parameter should appear in the product comparison table.","type":"boolean"},"variantForming":{"description":"Whether this parameter forms product variants (e.g. \"Size\" creates variants, \"Material\" does not). Only enum/color.","type":"boolean"},"multiValue":{"description":"Whether a product can have multiple values for this parameter (e.g. multiple colors). Only enum/color.","type":"boolean"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the parameter is active.","type":"boolean"},"valueCount":{"description":"Number of predefined values (relevant for enum/color types).","type":"number"}}}},"itemCount":{"description":"Total number of parameters.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Parameters ordered by position then name.","type":"array","items":{"description":"Parameter definition item.","type":"object","required":["id","code","name","type","filterable","comparable","variantForming","multiValue","position","active","valueCount"],"properties":{"id":{"description":"Internal parameter ID.","type":"number"},"code":{"description":"Unique parameter code.","type":"string"},"name":{"description":"Display name of the parameter.","type":"string"},"group":{"description":"Group this parameter belongs to. Undefined if ungrouped.","type":"object","required":["code","name"],"properties":{"code":{"description":"Group code.","type":"string"},"name":{"description":"Group display name.","type":"string"}}},"type":{"description":"Data type: string, number, boolean, enum, or color.","type":"string"},"unit":{"description":"Unit label (e.g. \"mm\", \"kg\"). Only for number type.","type":"string"},"filterable":{"description":"Whether this parameter should appear in frontend product filters.","type":"boolean"},"comparable":{"description":"Whether this parameter should appear in the product comparison table.","type":"boolean"},"variantForming":{"description":"Whether this parameter forms product variants (e.g. \"Size\" creates variants, \"Material\" does not). Only enum/color.","type":"boolean"},"multiValue":{"description":"Whether a product can have multiple values for this parameter (e.g. multiple colors). Only enum/color.","type":"boolean"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the parameter is active.","type":"boolean"},"valueCount":{"description":"Number of predefined values (relevant for enum/color types).","type":"number"}}}},"itemCount":{"description":"Total number of parameters.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProduct-parameterList","tags":["Product Parameter"],"summary":"List parameters","description":"Returns all parameter definitions for the organisation. Each parameter includes its type, flags, associated group, and count of predefined values (for enum/color types). Optionally filtered by group code."}},"/bff/product-parameter/add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created parameter.","type":"number"},"code":{"description":"Final code after slugification.","type":"string"}},"required":["id","code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created parameter.","type":"number"},"code":{"description":"Final code after slugification.","type":"string"}},"required":["id","code"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created parameter.","type":"number"},"code":{"description":"Final code after slugification.","type":"string"}},"required":["id","code"]}}}}},"operationId":"postBffProduct-parameterAdd","tags":["Product Parameter"],"summary":"Create parameter","description":"Creates a new parameter definition. For enum/color types, add predefined values afterwards via /value-add. DB-level constraints enforce: variant_forming only for enum/color; multi_value only for enum/color.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Display name (e.g. \"Weight\", \"Color\", \"Material\").","examples":["Weight"],"type":"string"},"code":{"description":"URL-friendly code. Auto-generated from name if not provided.","examples":["weight"],"type":"string"},"groupCode":{"description":"Code of the group to assign the parameter to. Omit for ungrouped.","examples":["technical-specs"],"type":"string"},"type":{"description":"Parameter data type. \"string\" = free text, \"number\" = numeric with optional unit, \"boolean\" = true/false, \"enum\" = predefined list of values, \"color\" = predefined colors with hex codes.","anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"enum","type":"string"},{"const":"color","type":"string"}]},"unit":{"description":"Unit label for number type (e.g. \"mm\", \"kg\", \"W\").","examples":["kg"],"type":"string"},"filterable":{"description":"Show in frontend filters. Defaults to false.","type":"boolean"},"comparable":{"description":"Show in product comparison. Defaults to false.","type":"boolean"},"variantForming":{"description":"Whether this parameter creates product variants. Only allowed for enum/color type. Defaults to false.","type":"boolean"},"multiValue":{"description":"Allow multiple values per product. Only allowed for enum/color type. Defaults to false.","type":"boolean"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Display name (e.g. \"Weight\", \"Color\", \"Material\").","examples":["Weight"],"type":"string"},"code":{"description":"URL-friendly code. Auto-generated from name if not provided.","examples":["weight"],"type":"string"},"groupCode":{"description":"Code of the group to assign the parameter to. Omit for ungrouped.","examples":["technical-specs"],"type":"string"},"type":{"description":"Parameter data type. \"string\" = free text, \"number\" = numeric with optional unit, \"boolean\" = true/false, \"enum\" = predefined list of values, \"color\" = predefined colors with hex codes.","anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"enum","type":"string"},{"const":"color","type":"string"}]},"unit":{"description":"Unit label for number type (e.g. \"mm\", \"kg\", \"W\").","examples":["kg"],"type":"string"},"filterable":{"description":"Show in frontend filters. Defaults to false.","type":"boolean"},"comparable":{"description":"Show in product comparison. Defaults to false.","type":"boolean"},"variantForming":{"description":"Whether this parameter creates product variants. Only allowed for enum/color type. Defaults to false.","type":"boolean"},"multiValue":{"description":"Allow multiple values per product. Only allowed for enum/color type. Defaults to false.","type":"boolean"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"minLength":1,"description":"Display name (e.g. \"Weight\", \"Color\", \"Material\").","examples":["Weight"],"type":"string"},"code":{"description":"URL-friendly code. Auto-generated from name if not provided.","examples":["weight"],"type":"string"},"groupCode":{"description":"Code of the group to assign the parameter to. Omit for ungrouped.","examples":["technical-specs"],"type":"string"},"type":{"description":"Parameter data type. \"string\" = free text, \"number\" = numeric with optional unit, \"boolean\" = true/false, \"enum\" = predefined list of values, \"color\" = predefined colors with hex codes.","anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"enum","type":"string"},{"const":"color","type":"string"}]},"unit":{"description":"Unit label for number type (e.g. \"mm\", \"kg\", \"W\").","examples":["kg"],"type":"string"},"filterable":{"description":"Show in frontend filters. Defaults to false.","type":"boolean"},"comparable":{"description":"Show in product comparison. Defaults to false.","type":"boolean"},"variantForming":{"description":"Whether this parameter creates product variants. Only allowed for enum/color type. Defaults to false.","type":"boolean"},"multiValue":{"description":"Allow multiple values per product. Only allowed for enum/color type. Defaults to false.","type":"boolean"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}}}}}},"/bff/product-parameter/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the parameter was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the parameter was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the parameter was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterUpdate","tags":["Product Parameter"],"summary":"Update parameter","description":"Updates properties of an existing parameter definition. Only provided fields are changed. Changing the type does not automatically migrate existing product assignments.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the parameter to update.","examples":["weight"],"type":"string"},"name":{"description":"New display name.","examples":["Net Weight"],"type":"string"},"groupCode":{"nullable":true,"anyOf":[{"description":"New group code, or null to ungroup the parameter.","examples":["technical-specs"],"type":"string"},{"type":"null"}]},"type":{"description":"Parameter data type. \"string\" = free text, \"number\" = numeric with optional unit, \"boolean\" = true/false, \"enum\" = predefined list of values, \"color\" = predefined colors with hex codes.","anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"enum","type":"string"},{"const":"color","type":"string"}]},"unit":{"nullable":true,"anyOf":[{"description":"New unit label, or null to clear.","examples":["g"],"type":"string"},{"type":"null"}]},"filterable":{"description":"New filterable flag.","type":"boolean"},"comparable":{"description":"New comparable flag.","type":"boolean"},"variantForming":{"description":"New variant-forming flag.","type":"boolean"},"multiValue":{"description":"New multi-value flag.","type":"boolean"},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the parameter to update.","examples":["weight"],"type":"string"},"name":{"description":"New display name.","examples":["Net Weight"],"type":"string"},"groupCode":{"nullable":true,"anyOf":[{"description":"New group code, or null to ungroup the parameter.","examples":["technical-specs"],"type":"string"},{"type":"null"}]},"type":{"description":"Parameter data type. \"string\" = free text, \"number\" = numeric with optional unit, \"boolean\" = true/false, \"enum\" = predefined list of values, \"color\" = predefined colors with hex codes.","anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"enum","type":"string"},{"const":"color","type":"string"}]},"unit":{"nullable":true,"anyOf":[{"description":"New unit label, or null to clear.","examples":["g"],"type":"string"},{"type":"null"}]},"filterable":{"description":"New filterable flag.","type":"boolean"},"comparable":{"description":"New comparable flag.","type":"boolean"},"variantForming":{"description":"New variant-forming flag.","type":"boolean"},"multiValue":{"description":"New multi-value flag.","type":"boolean"},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the parameter to update.","examples":["weight"],"type":"string"},"name":{"description":"New display name.","examples":["Net Weight"],"type":"string"},"groupCode":{"nullable":true,"anyOf":[{"description":"New group code, or null to ungroup the parameter.","examples":["technical-specs"],"type":"string"},{"type":"null"}]},"type":{"description":"Parameter data type. \"string\" = free text, \"number\" = numeric with optional unit, \"boolean\" = true/false, \"enum\" = predefined list of values, \"color\" = predefined colors with hex codes.","anyOf":[{"const":"string","type":"string"},{"const":"number","type":"string"},{"const":"boolean","type":"string"},{"const":"enum","type":"string"},{"const":"color","type":"string"}]},"unit":{"nullable":true,"anyOf":[{"description":"New unit label, or null to clear.","examples":["g"],"type":"string"},{"type":"null"}]},"filterable":{"description":"New filterable flag.","type":"boolean"},"comparable":{"description":"New comparable flag.","type":"boolean"},"variantForming":{"description":"New variant-forming flag.","type":"boolean"},"multiValue":{"description":"New multi-value flag.","type":"boolean"},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}}}}}},"/bff/product-parameter/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the parameter was deleted.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the parameter was deleted.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the parameter was deleted.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterDelete","tags":["Product Parameter"],"summary":"Delete parameter","description":"Deletes a parameter definition. Cascades to all predefined values, product assignments, category mappings, and locale translations associated with this parameter.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the parameter to delete.","examples":["weight"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the parameter to delete.","examples":["weight"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the parameter to delete.","examples":["weight"],"type":"string"}}}}}}}},"/bff/product-parameter/value-list":{"get":{"parameters":[{"description":"Code of the enum/color parameter to list values for.","examples":["color","size"],"schema":{"type":"string"},"in":"query","name":"parameterCode","required":true}],"responses":{"200":{"description":"List of predefined parameter values.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Values ordered by position then label.","type":"array","items":{"description":"Predefined parameter value.","type":"object","required":["id","code","label","position","active"],"properties":{"id":{"description":"Internal value ID.","type":"number"},"code":{"description":"Unique value code within this parameter.","type":"string"},"label":{"description":"Display label (e.g. \"Red\", \"XL\", \"Cotton\").","type":"string"},"colorHex":{"description":"Hex color code (e.g. \"#FF5733\"). Only for color-type parameters.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the value is active.","type":"boolean"}}}},"itemCount":{"description":"Total number of values.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Values ordered by position then label.","type":"array","items":{"description":"Predefined parameter value.","type":"object","required":["id","code","label","position","active"],"properties":{"id":{"description":"Internal value ID.","type":"number"},"code":{"description":"Unique value code within this parameter.","type":"string"},"label":{"description":"Display label (e.g. \"Red\", \"XL\", \"Cotton\").","type":"string"},"colorHex":{"description":"Hex color code (e.g. \"#FF5733\"). Only for color-type parameters.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the value is active.","type":"boolean"}}}},"itemCount":{"description":"Total number of values.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Values ordered by position then label.","type":"array","items":{"description":"Predefined parameter value.","type":"object","required":["id","code","label","position","active"],"properties":{"id":{"description":"Internal value ID.","type":"number"},"code":{"description":"Unique value code within this parameter.","type":"string"},"label":{"description":"Display label (e.g. \"Red\", \"XL\", \"Cotton\").","type":"string"},"colorHex":{"description":"Hex color code (e.g. \"#FF5733\"). Only for color-type parameters.","type":"string"},"position":{"description":"Sort order position.","type":"number"},"active":{"description":"Whether the value is active.","type":"boolean"}}}},"itemCount":{"description":"Total number of values.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProduct-parameterValue-list","tags":["Product Parameter"],"summary":"List parameter values","description":"Returns all predefined values for an enum or color parameter. Values are ordered by position then label. Each value has a code (for API use) and a label (for display)."}},"/bff/product-parameter/value-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created value.","type":"number"},"code":{"description":"Final code after slugification.","type":"string"}},"required":["id","code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created value.","type":"number"},"code":{"description":"Final code after slugification.","type":"string"}},"required":["id","code"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"ID of the created value.","type":"number"},"code":{"description":"Final code after slugification.","type":"string"}},"required":["id","code"]}}}}},"operationId":"postBffProduct-parameterValue-add","tags":["Product Parameter"],"summary":"Add parameter value","description":"Adds a new predefined value to an enum or color parameter. Fails if the parameter type is not enum or color.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["parameterCode","label"],"properties":{"parameterCode":{"description":"Code of the enum/color parameter to add the value to.","examples":["color"],"type":"string"},"label":{"minLength":1,"description":"Display label (e.g. \"Red\", \"Large\").","examples":["Red"],"type":"string"},"code":{"description":"URL-friendly value code. Auto-generated from label if not provided.","examples":["red"],"type":"string"},"colorHex":{"description":"Hex color code for color-type parameters (e.g. \"#FF5733\"). Validated format.","examples":["#FF5733"],"type":"string"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["parameterCode","label"],"properties":{"parameterCode":{"description":"Code of the enum/color parameter to add the value to.","examples":["color"],"type":"string"},"label":{"minLength":1,"description":"Display label (e.g. \"Red\", \"Large\").","examples":["Red"],"type":"string"},"code":{"description":"URL-friendly value code. Auto-generated from label if not provided.","examples":["red"],"type":"string"},"colorHex":{"description":"Hex color code for color-type parameters (e.g. \"#FF5733\"). Validated format.","examples":["#FF5733"],"type":"string"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["parameterCode","label"],"properties":{"parameterCode":{"description":"Code of the enum/color parameter to add the value to.","examples":["color"],"type":"string"},"label":{"minLength":1,"description":"Display label (e.g. \"Red\", \"Large\").","examples":["Red"],"type":"string"},"code":{"description":"URL-friendly value code. Auto-generated from label if not provided.","examples":["red"],"type":"string"},"colorHex":{"description":"Hex color code for color-type parameters (e.g. \"#FF5733\"). Validated format.","examples":["#FF5733"],"type":"string"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}}}}}},"/bff/product-parameter/value-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterValue-update","tags":["Product Parameter"],"summary":"Update parameter value","description":"Updates properties of a predefined parameter value. Only provided fields are changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["parameterCode","valueCode"],"properties":{"parameterCode":{"description":"Code of the parameter the value belongs to.","examples":["color"],"type":"string"},"valueCode":{"description":"Code of the value to update.","examples":["red"],"type":"string"},"label":{"description":"New display label.","examples":["Dark Red"],"type":"string"},"colorHex":{"nullable":true,"anyOf":[{"description":"New hex color code, or null to clear.","examples":["#8B0000"],"type":"string"},{"type":"null"}]},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["parameterCode","valueCode"],"properties":{"parameterCode":{"description":"Code of the parameter the value belongs to.","examples":["color"],"type":"string"},"valueCode":{"description":"Code of the value to update.","examples":["red"],"type":"string"},"label":{"description":"New display label.","examples":["Dark Red"],"type":"string"},"colorHex":{"nullable":true,"anyOf":[{"description":"New hex color code, or null to clear.","examples":["#8B0000"],"type":"string"},{"type":"null"}]},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["parameterCode","valueCode"],"properties":{"parameterCode":{"description":"Code of the parameter the value belongs to.","examples":["color"],"type":"string"},"valueCode":{"description":"Code of the value to update.","examples":["red"],"type":"string"},"label":{"description":"New display label.","examples":["Dark Red"],"type":"string"},"colorHex":{"nullable":true,"anyOf":[{"description":"New hex color code, or null to clear.","examples":["#8B0000"],"type":"string"},{"type":"null"}]},"position":{"description":"New sort order position.","examples":[1],"type":"number"},"active":{"description":"New active status.","examples":[true],"type":"boolean"}}}}}}}},"/bff/product-parameter/value-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was deleted.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was deleted.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was deleted.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterValue-delete","tags":["Product Parameter"],"summary":"Delete parameter value","description":"Deletes a predefined parameter value. Cascades to all product assignments that reference this value and all locale translations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["parameterCode","valueCode"],"properties":{"parameterCode":{"description":"Code of the parameter the value belongs to.","examples":["color"],"type":"string"},"valueCode":{"description":"Code of the value to delete.","examples":["red"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["parameterCode","valueCode"],"properties":{"parameterCode":{"description":"Code of the parameter the value belongs to.","examples":["color"],"type":"string"},"valueCode":{"description":"Code of the value to delete.","examples":["red"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["parameterCode","valueCode"],"properties":{"parameterCode":{"description":"Code of the parameter the value belongs to.","examples":["color"],"type":"string"},"valueCode":{"description":"Code of the value to delete.","examples":["red"],"type":"string"}}}}}}}},"/bff/product-parameter/product-values":{"get":{"parameters":[{"description":"Product code to list parameter values for.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"description":"Product parameter values.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"All parameter assignments for the product.","type":"array","items":{"description":"Single parameter assignment on a product.","type":"object","required":["assignmentId","parameterCode","parameterName","parameterType"],"properties":{"assignmentId":{"description":"Unique assignment ID (used to remove the assignment).","type":"number"},"parameterCode":{"description":"Parameter code.","type":"string"},"parameterName":{"description":"Parameter display name.","type":"string"},"parameterType":{"description":"Parameter data type.","type":"string"},"parameterUnit":{"description":"Parameter unit (e.g. \"mm\").","type":"string"},"groupCode":{"description":"Group code, if the parameter is grouped.","type":"string"},"groupName":{"description":"Group display name.","type":"string"},"valueCode":{"description":"Predefined value code (for enum/color types).","type":"string"},"valueLabel":{"description":"Predefined value display label (for enum/color types).","type":"string"},"colorHex":{"description":"Hex color code (for color-type values).","type":"string"},"valueString":{"description":"Free-text value (for string type).","type":"string"},"valueNumber":{"description":"Numeric value (for number type).","type":"number"},"valueBoolean":{"description":"Boolean value (for boolean type).","type":"boolean"},"variantCode":{"description":"Variant code if this assignment is variant-specific. Undefined for product-level.","type":"string"}}}},"itemCount":{"description":"Total number of assignments.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"All parameter assignments for the product.","type":"array","items":{"description":"Single parameter assignment on a product.","type":"object","required":["assignmentId","parameterCode","parameterName","parameterType"],"properties":{"assignmentId":{"description":"Unique assignment ID (used to remove the assignment).","type":"number"},"parameterCode":{"description":"Parameter code.","type":"string"},"parameterName":{"description":"Parameter display name.","type":"string"},"parameterType":{"description":"Parameter data type.","type":"string"},"parameterUnit":{"description":"Parameter unit (e.g. \"mm\").","type":"string"},"groupCode":{"description":"Group code, if the parameter is grouped.","type":"string"},"groupName":{"description":"Group display name.","type":"string"},"valueCode":{"description":"Predefined value code (for enum/color types).","type":"string"},"valueLabel":{"description":"Predefined value display label (for enum/color types).","type":"string"},"colorHex":{"description":"Hex color code (for color-type values).","type":"string"},"valueString":{"description":"Free-text value (for string type).","type":"string"},"valueNumber":{"description":"Numeric value (for number type).","type":"number"},"valueBoolean":{"description":"Boolean value (for boolean type).","type":"boolean"},"variantCode":{"description":"Variant code if this assignment is variant-specific. Undefined for product-level.","type":"string"}}}},"itemCount":{"description":"Total number of assignments.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"All parameter assignments for the product.","type":"array","items":{"description":"Single parameter assignment on a product.","type":"object","required":["assignmentId","parameterCode","parameterName","parameterType"],"properties":{"assignmentId":{"description":"Unique assignment ID (used to remove the assignment).","type":"number"},"parameterCode":{"description":"Parameter code.","type":"string"},"parameterName":{"description":"Parameter display name.","type":"string"},"parameterType":{"description":"Parameter data type.","type":"string"},"parameterUnit":{"description":"Parameter unit (e.g. \"mm\").","type":"string"},"groupCode":{"description":"Group code, if the parameter is grouped.","type":"string"},"groupName":{"description":"Group display name.","type":"string"},"valueCode":{"description":"Predefined value code (for enum/color types).","type":"string"},"valueLabel":{"description":"Predefined value display label (for enum/color types).","type":"string"},"colorHex":{"description":"Hex color code (for color-type values).","type":"string"},"valueString":{"description":"Free-text value (for string type).","type":"string"},"valueNumber":{"description":"Numeric value (for number type).","type":"number"},"valueBoolean":{"description":"Boolean value (for boolean type).","type":"boolean"},"variantCode":{"description":"Variant code if this assignment is variant-specific. Undefined for product-level.","type":"string"}}}},"itemCount":{"description":"Total number of assignments.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProduct-parameterProduct-values","tags":["Product Parameter"],"summary":"List product parameter values","description":"Returns all parameter values assigned to a product, including variant-level assignments. Each assignment contains the parameter definition, the concrete value (enum, string, number, or boolean), and optionally the variant code if the assignment is variant-specific."}},"/bff/product-parameter/product-assign":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was assigned.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was assigned.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was assigned.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterProduct-assign","tags":["Product Parameter"],"summary":"Assign parameter value to product","description":"Assigns a parameter value to a product. Exactly one value field must be provided based on the parameter type: valueCode for enum/color, valueString for string, valueNumber for number, valueBoolean for boolean. For multi-value enum/color parameters, call this endpoint multiple times with different valueCodes. For scalar types (string, number, boolean), only one assignment per product+parameter(+variant) is allowed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","parameterCode"],"properties":{"productCode":{"description":"Product code to assign the parameter value to.","examples":["my-product"],"type":"string"},"parameterCode":{"description":"Parameter code to assign.","examples":["color"],"type":"string"},"valueCode":{"description":"Predefined value code (required for enum/color parameters).","examples":["red"],"type":"string"},"valueString":{"description":"Free-text value (for string-type parameters).","examples":["Cotton blend"],"type":"string"},"valueNumber":{"description":"Numeric value (for number-type parameters).","examples":[500],"type":"number"},"valueBoolean":{"description":"Boolean value (for boolean-type parameters).","examples":[true],"type":"boolean"},"variantCode":{"description":"Variant code for variant-level assignment. Omit for product-level assignment.","examples":["variant-xl"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","parameterCode"],"properties":{"productCode":{"description":"Product code to assign the parameter value to.","examples":["my-product"],"type":"string"},"parameterCode":{"description":"Parameter code to assign.","examples":["color"],"type":"string"},"valueCode":{"description":"Predefined value code (required for enum/color parameters).","examples":["red"],"type":"string"},"valueString":{"description":"Free-text value (for string-type parameters).","examples":["Cotton blend"],"type":"string"},"valueNumber":{"description":"Numeric value (for number-type parameters).","examples":[500],"type":"number"},"valueBoolean":{"description":"Boolean value (for boolean-type parameters).","examples":[true],"type":"boolean"},"variantCode":{"description":"Variant code for variant-level assignment. Omit for product-level assignment.","examples":["variant-xl"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","parameterCode"],"properties":{"productCode":{"description":"Product code to assign the parameter value to.","examples":["my-product"],"type":"string"},"parameterCode":{"description":"Parameter code to assign.","examples":["color"],"type":"string"},"valueCode":{"description":"Predefined value code (required for enum/color parameters).","examples":["red"],"type":"string"},"valueString":{"description":"Free-text value (for string-type parameters).","examples":["Cotton blend"],"type":"string"},"valueNumber":{"description":"Numeric value (for number-type parameters).","examples":[500],"type":"number"},"valueBoolean":{"description":"Boolean value (for boolean-type parameters).","examples":[true],"type":"boolean"},"variantCode":{"description":"Variant code for variant-level assignment. Omit for product-level assignment.","examples":["variant-xl"],"type":"string"}}}}}}}},"/bff/product-parameter/product-remove":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the assignment was removed.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the assignment was removed.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the assignment was removed.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterProduct-remove","tags":["Product Parameter"],"summary":"Remove parameter assignment from product","description":"Removes a specific parameter value assignment from a product by its assignment ID. The assignment ID is returned in the /product-values endpoint.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["assignmentId"],"properties":{"assignmentId":{"description":"Assignment ID to remove (obtained from /product-values response).","examples":[42],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["assignmentId"],"properties":{"assignmentId":{"description":"Assignment ID to remove (obtained from /product-values response).","examples":[42],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["assignmentId"],"properties":{"assignmentId":{"description":"Assignment ID to remove (obtained from /product-values response).","examples":[42],"type":"number"}}}}}}}},"/bff/product-parameter/category-parameters":{"get":{"parameters":[{"description":"Product category code to list mapped parameters for.","examples":["electronics","clothing"],"schema":{"type":"string"},"in":"query","name":"categoryCode","required":true}],"responses":{"200":{"description":"Parameters assigned to the category.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Parameters mapped to this category, ordered by position then name.","type":"array","items":{"description":"Category-parameter mapping item.","type":"object","required":["parameterCode","parameterName","parameterType","required","position"],"properties":{"parameterCode":{"description":"Parameter code.","type":"string"},"parameterName":{"description":"Parameter display name.","type":"string"},"parameterType":{"description":"Parameter data type.","type":"string"},"required":{"description":"Whether the parameter is required for products in this category.","type":"boolean"},"position":{"description":"Sort order position within this category.","type":"number"}}}},"itemCount":{"description":"Total number of mapped parameters.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Parameters mapped to this category, ordered by position then name.","type":"array","items":{"description":"Category-parameter mapping item.","type":"object","required":["parameterCode","parameterName","parameterType","required","position"],"properties":{"parameterCode":{"description":"Parameter code.","type":"string"},"parameterName":{"description":"Parameter display name.","type":"string"},"parameterType":{"description":"Parameter data type.","type":"string"},"required":{"description":"Whether the parameter is required for products in this category.","type":"boolean"},"position":{"description":"Sort order position within this category.","type":"number"}}}},"itemCount":{"description":"Total number of mapped parameters.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Parameters mapped to this category, ordered by position then name.","type":"array","items":{"description":"Category-parameter mapping item.","type":"object","required":["parameterCode","parameterName","parameterType","required","position"],"properties":{"parameterCode":{"description":"Parameter code.","type":"string"},"parameterName":{"description":"Parameter display name.","type":"string"},"parameterType":{"description":"Parameter data type.","type":"string"},"required":{"description":"Whether the parameter is required for products in this category.","type":"boolean"},"position":{"description":"Sort order position within this category.","type":"number"}}}},"itemCount":{"description":"Total number of mapped parameters.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProduct-parameterCategory-parameters","tags":["Product Parameter"],"summary":"List category parameters","description":"Returns all parameters mapped to a product category. Category-parameter mapping defines which parameters are relevant (and optionally required) for products in this category. Used by the admin UI to show the appropriate parameter form."}},"/bff/product-parameter/category-assign":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the mapping was created.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the mapping was created.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the mapping was created.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterCategory-assign","tags":["Product Parameter"],"summary":"Assign parameter to category","description":"Maps a parameter to a product category. If the mapping already exists, the request is silently ignored (idempotent). This mapping tells the admin UI which parameters to show when editing products in this category.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["categoryCode","parameterCode"],"properties":{"categoryCode":{"description":"Product category code to map the parameter to.","examples":["electronics"],"type":"string"},"parameterCode":{"description":"Parameter code to assign to the category.","examples":["weight"],"type":"string"},"required":{"description":"Whether the parameter is required for products in this category. Defaults to false.","examples":[false],"type":"boolean"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["categoryCode","parameterCode"],"properties":{"categoryCode":{"description":"Product category code to map the parameter to.","examples":["electronics"],"type":"string"},"parameterCode":{"description":"Parameter code to assign to the category.","examples":["weight"],"type":"string"},"required":{"description":"Whether the parameter is required for products in this category. Defaults to false.","examples":[false],"type":"boolean"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["categoryCode","parameterCode"],"properties":{"categoryCode":{"description":"Product category code to map the parameter to.","examples":["electronics"],"type":"string"},"parameterCode":{"description":"Parameter code to assign to the category.","examples":["weight"],"type":"string"},"required":{"description":"Whether the parameter is required for products in this category. Defaults to false.","examples":[false],"type":"boolean"},"position":{"description":"Sort order position. Defaults to 0.","examples":[0],"type":"number"}}}}}}}},"/bff/product-parameter/category-remove":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the mapping was removed.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the mapping was removed.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the mapping was removed.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProduct-parameterCategory-remove","tags":["Product Parameter"],"summary":"Remove parameter from category","description":"Removes the mapping between a parameter and a product category. Does not delete existing product assignments — only removes the category-level mapping.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["categoryCode","parameterCode"],"properties":{"categoryCode":{"description":"Product category code to remove the mapping from.","examples":["electronics"],"type":"string"},"parameterCode":{"description":"Parameter code to remove from the category.","examples":["weight"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["categoryCode","parameterCode"],"properties":{"categoryCode":{"description":"Product category code to remove the mapping from.","examples":["electronics"],"type":"string"},"parameterCode":{"description":"Parameter code to remove from the category.","examples":["weight"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["categoryCode","parameterCode"],"properties":{"categoryCode":{"description":"Product category code to remove the mapping from.","examples":["electronics"],"type":"string"},"parameterCode":{"description":"Parameter code to remove from the category.","examples":["weight"],"type":"string"}}}}}}}},"/bff/product/search-product-variant-list":{"get":{"parameters":[{"description":"Product code to list variants for.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Product variants.","type":"array","items":{"type":"object","required":["code","name","price"],"properties":{"code":{"description":"Variant code.","type":"string"},"name":{"description":"Variant display name (falls back to code).","type":"string"},"price":{"description":"Variant price with VAT.","type":"number"},"sku":{"description":"Variant SKU (internal part number).","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Product variants.","type":"array","items":{"type":"object","required":["code","name","price"],"properties":{"code":{"description":"Variant code.","type":"string"},"name":{"description":"Variant display name (falls back to code).","type":"string"},"price":{"description":"Variant price with VAT.","type":"number"},"sku":{"description":"Variant SKU (internal part number).","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Product variants.","type":"array","items":{"type":"object","required":["code","name","price"],"properties":{"code":{"description":"Variant code.","type":"string"},"name":{"description":"Variant display name (falls back to code).","type":"string"},"price":{"description":"Variant price with VAT.","type":"number"},"sku":{"description":"Variant SKU (internal part number).","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffProductSearch-product-variant-list","tags":["Product"],"summary":"Search product variants (lightweight)","description":"Returns a lightweight list of all product variants (including deleted). Used for search/autocomplete in variant selectors. Ordered by position."}},"/bff/product/product-variant-list":{"get":{"parameters":[{"description":"Product code to list variants for.","examples":["my-product"],"schema":{"type":"string"},"in":"query","name":"productCode","required":true},{"description":"When true, hidden (soft-deleted) variants are included in the response so the operator can review and restore them. Defaults to false; hidden variants are never exposed to the public API or read model.","schema":{"type":"boolean"},"in":"query","name":"includeDeleted","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Product variants.","type":"array","items":{"type":"object","required":["id","code","price","priceAddition","cost","soldOut","warehouseAllQuantity","deleted"],"properties":{"id":{"description":"Variant relation hash (unique identifier).","type":"string"},"name":{"description":"Variant display name.","type":"string"},"code":{"description":"Variant code.","type":"string"},"ean":{"description":"Variant EAN barcode.","type":"string"},"price":{"description":"Price object with priceWithVat, priceWithoutVat, vat, currency."},"priceAddition":{"description":"Additional price on top of the base product price.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency. 0 when not set (falls back to product.cost at order time).","type":"number"},"soldOut":{"description":"Whether the variant is sold out.","type":"boolean"},"warehouseAllQuantity":{"description":"Total warehouse stock for this variant.","type":"number"},"deleted":{"description":"Whether the variant is hidden (soft-deleted). Hidden variants are excluded from the read model and public API.","type":"boolean"},"mainImage":{"type":"object","required":["token","filename","downloadUrl","contentType","lqipBase64"],"properties":{"token":{"description":"Blob token (image identifier).","type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL (full-resolution source blob).","type":"string"},"contentType":{"description":"MIME content type.","type":"string"},"lqipBase64":{"description":"32×32 WebP q40 base64 data URI placeholder (issue #80). Always present; empty string when the source is unreadable.","type":"string"},"thumbUrl":{"description":"Scout-generated 128×128 WebP thumbnail URL (issue #80). Absent until scout finishes generating variants for the row.","type":"string"}}}}}},"itemCount":{"description":"Total number of variants matching the current filter (respects `includeDeleted`).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Product variants.","type":"array","items":{"type":"object","required":["id","code","price","priceAddition","cost","soldOut","warehouseAllQuantity","deleted"],"properties":{"id":{"description":"Variant relation hash (unique identifier).","type":"string"},"name":{"description":"Variant display name.","type":"string"},"code":{"description":"Variant code.","type":"string"},"ean":{"description":"Variant EAN barcode.","type":"string"},"price":{"description":"Price object with priceWithVat, priceWithoutVat, vat, currency."},"priceAddition":{"description":"Additional price on top of the base product price.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency. 0 when not set (falls back to product.cost at order time).","type":"number"},"soldOut":{"description":"Whether the variant is sold out.","type":"boolean"},"warehouseAllQuantity":{"description":"Total warehouse stock for this variant.","type":"number"},"deleted":{"description":"Whether the variant is hidden (soft-deleted). Hidden variants are excluded from the read model and public API.","type":"boolean"},"mainImage":{"type":"object","required":["token","filename","downloadUrl","contentType","lqipBase64"],"properties":{"token":{"description":"Blob token (image identifier).","type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL (full-resolution source blob).","type":"string"},"contentType":{"description":"MIME content type.","type":"string"},"lqipBase64":{"description":"32×32 WebP q40 base64 data URI placeholder (issue #80). Always present; empty string when the source is unreadable.","type":"string"},"thumbUrl":{"description":"Scout-generated 128×128 WebP thumbnail URL (issue #80). Absent until scout finishes generating variants for the row.","type":"string"}}}}}},"itemCount":{"description":"Total number of variants matching the current filter (respects `includeDeleted`).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Product variants.","type":"array","items":{"type":"object","required":["id","code","price","priceAddition","cost","soldOut","warehouseAllQuantity","deleted"],"properties":{"id":{"description":"Variant relation hash (unique identifier).","type":"string"},"name":{"description":"Variant display name.","type":"string"},"code":{"description":"Variant code.","type":"string"},"ean":{"description":"Variant EAN barcode.","type":"string"},"price":{"description":"Price object with priceWithVat, priceWithoutVat, vat, currency."},"priceAddition":{"description":"Additional price on top of the base product price.","type":"number"},"cost":{"description":"Internal cost in the organisation default currency. 0 when not set (falls back to product.cost at order time).","type":"number"},"soldOut":{"description":"Whether the variant is sold out.","type":"boolean"},"warehouseAllQuantity":{"description":"Total warehouse stock for this variant.","type":"number"},"deleted":{"description":"Whether the variant is hidden (soft-deleted). Hidden variants are excluded from the read model and public API.","type":"boolean"},"mainImage":{"type":"object","required":["token","filename","downloadUrl","contentType","lqipBase64"],"properties":{"token":{"description":"Blob token (image identifier).","type":"string"},"filename":{"description":"Original filename.","type":"string"},"downloadUrl":{"description":"Public download URL (full-resolution source blob).","type":"string"},"contentType":{"description":"MIME content type.","type":"string"},"lqipBase64":{"description":"32×32 WebP q40 base64 data URI placeholder (issue #80). Always present; empty string when the source is unreadable.","type":"string"},"thumbUrl":{"description":"Scout-generated 128×128 WebP thumbnail URL (issue #80). Absent until scout finishes generating variants for the row.","type":"string"}}}}}},"itemCount":{"description":"Total number of variants matching the current filter (respects `includeDeleted`).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffProductProduct-variant-list","tags":["Product"],"summary":"List product variants (paginated)","description":"Returns a paginated list of product variants with full detail. By default only live variants are returned; pass `includeDeleted=true` to include hidden ones (each row carries a `deleted` flag). Ordered by warehouse quantity (highest first), then by position. Supports pagination via \"page\" and \"limit\" query parameters."}},"/bff/product/update-variant":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductUpdate-variant","tags":["Product"],"summary":"Update variant property","description":"Updates a single property of a product variant. Used for inline editing in data grids. Regenerates the parent product read model after update.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","code","haystack","property"],"properties":{"id":{"description":"Variant relation hash (unique identifier).","examples":["a1b2c3d4"],"type":"string"},"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"haystack":{"description":"New value for the property.","examples":["XL"],"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"property":{"description":"Property to update: name, code, ean, price, priceAddition, cost, soldOut, or warehouse.","examples":["name"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","code","haystack","property"],"properties":{"id":{"description":"Variant relation hash (unique identifier).","examples":["a1b2c3d4"],"type":"string"},"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"haystack":{"description":"New value for the property.","examples":["XL"],"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"property":{"description":"Property to update: name, code, ean, price, priceAddition, cost, soldOut, or warehouse.","examples":["name"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","code","haystack","property"],"properties":{"id":{"description":"Variant relation hash (unique identifier).","examples":["a1b2c3d4"],"type":"string"},"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"haystack":{"description":"New value for the property.","examples":["XL"],"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"property":{"description":"Property to update: name, code, ean, price, priceAddition, cost, soldOut, or warehouse.","examples":["name"],"type":"string"}}}}}}}},"/bff/product/delete-product-variant":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was hidden.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was hidden.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was hidden.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductDelete-product-variant","tags":["Product"],"summary":"Hide product variant","description":"Soft-deletes (hides) a product variant. The variant is removed from the read model and the public API, but preserved in the database and referenced by any existing orders/cart items. Use `/restore-product-variant` to bring it back.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","variantCode"],"properties":{"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to hide.","examples":["variant-xl"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","variantCode"],"properties":{"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to hide.","examples":["variant-xl"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code","variantCode"],"properties":{"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to hide.","examples":["variant-xl"],"type":"string"}}}}}}}},"/bff/product/restore-product-variant":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was restored.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was restored.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was restored.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductRestore-product-variant","tags":["Product"],"summary":"Restore hidden product variant","description":"Reverses a previous hide (soft-delete) — clears the `deleted` flag and rebuilds the product read model so the variant reappears in the public API.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","variantCode"],"properties":{"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to restore.","examples":["variant-xl"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","variantCode"],"properties":{"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to restore.","examples":["variant-xl"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code","variantCode"],"properties":{"code":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to restore.","examples":["variant-xl"],"type":"string"}}}}}}}},"/bff/product/product-variant-create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was created.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was created.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variant was created.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductProduct-variant-create","tags":["Product"],"summary":"Create product variant","description":"Creates a new variant for a product. The variant code is generated from the provided code (or from product code + name) and deduplicated. Each variant gets a unique relation hash for identification.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["mainProductCode","name","code"],"properties":{"mainProductCode":{"description":"Product code to add the variant to.","examples":["my-product"],"type":"string"},"name":{"minLength":1,"description":"Variant display name.","examples":["Size XL"],"type":"string"},"code":{"minLength":1,"description":"Variant code (will be slugified and deduplicated).","examples":["xl"],"type":"string"},"ean":{"description":"Variant EAN barcode.","examples":["8594000000456"],"type":"string"},"price":{"description":"Variant price with VAT.","examples":[399.9],"type":"number"},"priceAdd":{"description":"Additional price on top of the base product price.","examples":[50],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["mainProductCode","name","code"],"properties":{"mainProductCode":{"description":"Product code to add the variant to.","examples":["my-product"],"type":"string"},"name":{"minLength":1,"description":"Variant display name.","examples":["Size XL"],"type":"string"},"code":{"minLength":1,"description":"Variant code (will be slugified and deduplicated).","examples":["xl"],"type":"string"},"ean":{"description":"Variant EAN barcode.","examples":["8594000000456"],"type":"string"},"price":{"description":"Variant price with VAT.","examples":[399.9],"type":"number"},"priceAdd":{"description":"Additional price on top of the base product price.","examples":[50],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["mainProductCode","name","code"],"properties":{"mainProductCode":{"description":"Product code to add the variant to.","examples":["my-product"],"type":"string"},"name":{"minLength":1,"description":"Variant display name.","examples":["Size XL"],"type":"string"},"code":{"minLength":1,"description":"Variant code (will be slugified and deduplicated).","examples":["xl"],"type":"string"},"ean":{"description":"Variant EAN barcode.","examples":["8594000000456"],"type":"string"},"price":{"description":"Variant price with VAT.","examples":[399.9],"type":"number"},"priceAdd":{"description":"Additional price on top of the base product price.","examples":[50],"type":"number"}}}}}}}},"/bff/product/variant-set-main-image":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the main image was updated.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffProductVariant-set-main-image","tags":["Product"],"summary":"Set or remove variant main image","description":"Sets the main image for a product variant. The image must already be uploaded in the product gallery. To remove the current image, omit imageToken or pass null.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","variantCode"],"properties":{"productCode":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to set the image for.","examples":["variant-xl"],"type":"string"},"imageToken":{"description":"Blob token of the image to set as main. Must be an image from the product gallery. Omit or pass null to remove the current main image.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","variantCode"],"properties":{"productCode":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to set the image for.","examples":["variant-xl"],"type":"string"},"imageToken":{"description":"Blob token of the image to set as main. Must be an image from the product gallery. Omit or pass null to remove the current main image.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["productCode","variantCode"],"properties":{"productCode":{"description":"Product code the variant belongs to.","examples":["my-product"],"type":"string"},"variantCode":{"description":"Variant code to set the image for.","examples":["variant-xl"],"type":"string"},"imageToken":{"description":"Blob token of the image to set as main. Must be an image from the product gallery. Omit or pass null to remove the current main image.","type":"string"}}}}}}}},"/bff/rss-feed/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","url","active","nextSyncDate","insertedDate","postCount","newsroomShortlistCountToday"],"properties":{"id":{"description":"Feed external ID.","type":"string"},"url":{"description":"RSS feed URL.","type":"string"},"title":{"description":"Feed title parsed from the last successful fetch.","type":"string"},"description":{"description":"Feed description parsed from the last successful fetch.","type":"string"},"active":{"description":"Whether this feed is active for the organisation.","type":"boolean"},"lastFetchDate":{"description":"Timestamp of the last fetch attempt.","anyOf":[{"description":"Timestamp of the last fetch attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastFetchHttpCode":{"description":"HTTP status code from the last fetch.","type":"number"},"nextSyncDate":{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","anyOf":[{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"When the feed was linked to the organisation.","anyOf":[{"description":"When the feed was linked to the organisation.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Total number of articles discovered from this feed.","type":"number"},"latestPostDate":{"description":"Published date of the most recent article.","anyOf":[{"description":"Published date of the most recent article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"oldestPostDate":{"description":"Published date of the oldest article.","anyOf":[{"description":"Published date of the oldest article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"newsroomShortlistCountToday":{"description":"Number of articles from this feed in today's Newsroom shortlist (excluding dismissed). 0 if Newsroom is unused or no items today.","type":"number"}}}},"itemCount":{"description":"Total number of feeds.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","url","active","nextSyncDate","insertedDate","postCount","newsroomShortlistCountToday"],"properties":{"id":{"description":"Feed external ID.","type":"string"},"url":{"description":"RSS feed URL.","type":"string"},"title":{"description":"Feed title parsed from the last successful fetch.","type":"string"},"description":{"description":"Feed description parsed from the last successful fetch.","type":"string"},"active":{"description":"Whether this feed is active for the organisation.","type":"boolean"},"lastFetchDate":{"description":"Timestamp of the last fetch attempt.","anyOf":[{"description":"Timestamp of the last fetch attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastFetchHttpCode":{"description":"HTTP status code from the last fetch.","type":"number"},"nextSyncDate":{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","anyOf":[{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"When the feed was linked to the organisation.","anyOf":[{"description":"When the feed was linked to the organisation.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Total number of articles discovered from this feed.","type":"number"},"latestPostDate":{"description":"Published date of the most recent article.","anyOf":[{"description":"Published date of the most recent article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"oldestPostDate":{"description":"Published date of the oldest article.","anyOf":[{"description":"Published date of the oldest article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"newsroomShortlistCountToday":{"description":"Number of articles from this feed in today's Newsroom shortlist (excluding dismissed). 0 if Newsroom is unused or no items today.","type":"number"}}}},"itemCount":{"description":"Total number of feeds.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","url","active","nextSyncDate","insertedDate","postCount","newsroomShortlistCountToday"],"properties":{"id":{"description":"Feed external ID.","type":"string"},"url":{"description":"RSS feed URL.","type":"string"},"title":{"description":"Feed title parsed from the last successful fetch.","type":"string"},"description":{"description":"Feed description parsed from the last successful fetch.","type":"string"},"active":{"description":"Whether this feed is active for the organisation.","type":"boolean"},"lastFetchDate":{"description":"Timestamp of the last fetch attempt.","anyOf":[{"description":"Timestamp of the last fetch attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastFetchHttpCode":{"description":"HTTP status code from the last fetch.","type":"number"},"nextSyncDate":{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","anyOf":[{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"When the feed was linked to the organisation.","anyOf":[{"description":"When the feed was linked to the organisation.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Total number of articles discovered from this feed.","type":"number"},"latestPostDate":{"description":"Published date of the most recent article.","anyOf":[{"description":"Published date of the most recent article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"oldestPostDate":{"description":"Published date of the oldest article.","anyOf":[{"description":"Published date of the oldest article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"newsroomShortlistCountToday":{"description":"Number of articles from this feed in today's Newsroom shortlist (excluding dismissed). 0 if Newsroom is unused or no items today.","type":"number"}}}},"itemCount":{"description":"Total number of feeds.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffRss-feedList","tags":["RSS Feed"],"summary":"List RSS feeds","description":"Returns all RSS feeds linked to the authenticated organisation."}},"/bff/rss-feed/detail":{"get":{"parameters":[{"description":"Feed external ID.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Feed external ID.","type":"string"},"url":{"description":"RSS feed URL.","type":"string"},"title":{"description":"Feed title.","type":"string"},"description":{"description":"Feed description.","type":"string"},"active":{"description":"Whether this feed is active for the organisation.","type":"boolean"},"lastFetchDate":{"description":"Timestamp of the last fetch attempt.","anyOf":[{"description":"Timestamp of the last fetch attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastFetchHttpCode":{"description":"HTTP status code from the last fetch.","type":"number"},"lastFetchHash":{"description":"MD5 hash of the last fetched content.","type":"string"},"nextSyncDate":{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","anyOf":[{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"When the feed was created.","anyOf":[{"description":"When the feed was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When the feed was last updated.","anyOf":[{"description":"When the feed was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Total number of articles discovered.","type":"number"},"latestPostDate":{"description":"Published date of the most recent article.","anyOf":[{"description":"Published date of the most recent article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"oldestPostDate":{"description":"Published date of the oldest article.","anyOf":[{"description":"Published date of the oldest article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","url","active","nextSyncDate","insertedDate","updatedDate","postCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Feed external ID.","type":"string"},"url":{"description":"RSS feed URL.","type":"string"},"title":{"description":"Feed title.","type":"string"},"description":{"description":"Feed description.","type":"string"},"active":{"description":"Whether this feed is active for the organisation.","type":"boolean"},"lastFetchDate":{"description":"Timestamp of the last fetch attempt.","anyOf":[{"description":"Timestamp of the last fetch attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastFetchHttpCode":{"description":"HTTP status code from the last fetch.","type":"number"},"lastFetchHash":{"description":"MD5 hash of the last fetched content.","type":"string"},"nextSyncDate":{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","anyOf":[{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"When the feed was created.","anyOf":[{"description":"When the feed was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When the feed was last updated.","anyOf":[{"description":"When the feed was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Total number of articles discovered.","type":"number"},"latestPostDate":{"description":"Published date of the most recent article.","anyOf":[{"description":"Published date of the most recent article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"oldestPostDate":{"description":"Published date of the oldest article.","anyOf":[{"description":"Published date of the oldest article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","url","active","nextSyncDate","insertedDate","updatedDate","postCount"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Feed external ID.","type":"string"},"url":{"description":"RSS feed URL.","type":"string"},"title":{"description":"Feed title.","type":"string"},"description":{"description":"Feed description.","type":"string"},"active":{"description":"Whether this feed is active for the organisation.","type":"boolean"},"lastFetchDate":{"description":"Timestamp of the last fetch attempt.","anyOf":[{"description":"Timestamp of the last fetch attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastFetchHttpCode":{"description":"HTTP status code from the last fetch.","type":"number"},"lastFetchHash":{"description":"MD5 hash of the last fetched content.","type":"string"},"nextSyncDate":{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","anyOf":[{"description":"When the adaptive scheduler will next pick this feed up. See computeRssFeedNextSyncDate.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"When the feed was created.","anyOf":[{"description":"When the feed was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"When the feed was last updated.","anyOf":[{"description":"When the feed was last updated.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"postCount":{"description":"Total number of articles discovered.","type":"number"},"latestPostDate":{"description":"Published date of the most recent article.","anyOf":[{"description":"Published date of the most recent article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"oldestPostDate":{"description":"Published date of the oldest article.","anyOf":[{"description":"Published date of the oldest article.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","url","active","nextSyncDate","insertedDate","updatedDate","postCount"]}}}}},"operationId":"getBffRss-feedDetail","tags":["RSS Feed"],"summary":"Get RSS feed detail","description":"Returns full detail of a single RSS feed including post statistics."}},"/bff/rss-feed/post-list":{"get":{"parameters":[{"description":"Feed external ID to list posts for.","examples":["a1b2c3d4"],"schema":{"type":"string"},"in":"query","name":"feedId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","guid","discoveredDate"],"properties":{"id":{"description":"Post external ID.","type":"string"},"guid":{"description":"Unique identifier from the RSS feed (guid or link).","type":"string"},"url":{"description":"Article URL.","type":"string"},"title":{"description":"Article title.","type":"string"},"description":{"description":"Article summary/excerpt.","type":"string"},"author":{"description":"Article author.","type":"string"},"publishedDate":{"description":"Published date from the feed.","anyOf":[{"description":"Published date from the feed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"discoveredDate":{"description":"When the article was first discovered by the system.","anyOf":[{"description":"When the article was first discovered by the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of posts for this feed.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","guid","discoveredDate"],"properties":{"id":{"description":"Post external ID.","type":"string"},"guid":{"description":"Unique identifier from the RSS feed (guid or link).","type":"string"},"url":{"description":"Article URL.","type":"string"},"title":{"description":"Article title.","type":"string"},"description":{"description":"Article summary/excerpt.","type":"string"},"author":{"description":"Article author.","type":"string"},"publishedDate":{"description":"Published date from the feed.","anyOf":[{"description":"Published date from the feed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"discoveredDate":{"description":"When the article was first discovered by the system.","anyOf":[{"description":"When the article was first discovered by the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of posts for this feed.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","guid","discoveredDate"],"properties":{"id":{"description":"Post external ID.","type":"string"},"guid":{"description":"Unique identifier from the RSS feed (guid or link).","type":"string"},"url":{"description":"Article URL.","type":"string"},"title":{"description":"Article title.","type":"string"},"description":{"description":"Article summary/excerpt.","type":"string"},"author":{"description":"Article author.","type":"string"},"publishedDate":{"description":"Published date from the feed.","anyOf":[{"description":"Published date from the feed.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"discoveredDate":{"description":"When the article was first discovered by the system.","anyOf":[{"description":"When the article was first discovered by the system.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of posts for this feed.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffRss-feedPost-list","tags":["RSS Feed"],"summary":"List RSS feed posts","description":"Returns a paginated list of articles discovered from a specific RSS feed. Ordered by published date (newest first). Supports ?page= and ?limit= query params."}},"/bff/rss-feed/add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"feedId":{"description":"External ID of the feed (existing or newly created).","type":"string"},"created":{"description":"True if a new feed record was created, false if it already existed.","type":"boolean"}},"required":["success","feedId","created"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"feedId":{"description":"External ID of the feed (existing or newly created).","type":"string"},"created":{"description":"True if a new feed record was created, false if it already existed.","type":"boolean"}},"required":["success","feedId","created"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"feedId":{"description":"External ID of the feed (existing or newly created).","type":"string"},"created":{"description":"True if a new feed record was created, false if it already existed.","type":"boolean"}},"required":["success","feedId","created"]}}}}},"operationId":"postBffRss-feedAdd","tags":["RSS Feed"],"summary":"Add RSS feed","description":"Adds an RSS feed URL. If the URL already exists in the shared feed table, only a relation to the organisation is created. Otherwise a new feed record is inserted first.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"description":"RSS feed URL to add.","examples":["https://example.com/rss.xml"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["url"],"properties":{"url":{"description":"RSS feed URL to add.","examples":["https://example.com/rss.xml"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["url"],"properties":{"url":{"description":"RSS feed URL to add.","examples":["https://example.com/rss.xml"],"type":"string"}}}}}}}},"/bff/rss-feed/set-active":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"feedId":{"description":"Feed external ID.","type":"string"},"active":{"description":"New active state.","type":"boolean"}},"required":["success","feedId","active"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"feedId":{"description":"Feed external ID.","type":"string"},"active":{"description":"New active state.","type":"boolean"}},"required":["success","feedId","active"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"feedId":{"description":"Feed external ID.","type":"string"},"active":{"description":"New active state.","type":"boolean"}},"required":["success","feedId","active"]}}}}},"operationId":"postBffRss-feedSet-active","tags":["RSS Feed"],"summary":"Set RSS feed active flag","description":"Toggles the active flag on the link between the organisation and the feed. Inactive feeds are excluded from sync, AI enrichment, the Newsroom shortlist, and any AI-driven overview or article-writing logic. The flag is per-organisation and does not affect the global feed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["feedId","active"],"properties":{"feedId":{"description":"Feed external ID.","examples":["a1b2c3d4"],"type":"string"},"active":{"description":"Whether the feed should be active for this organisation.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["feedId","active"],"properties":{"feedId":{"description":"Feed external ID.","examples":["a1b2c3d4"],"type":"string"},"active":{"description":"Whether the feed should be active for this organisation.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["feedId","active"],"properties":{"feedId":{"description":"Feed external ID.","examples":["a1b2c3d4"],"type":"string"},"active":{"description":"Whether the feed should be active for this organisation.","type":"boolean"}}}}}}}},"/bff/rss-feed/sync":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","required":["feedId","updated"],"properties":{"feedId":{"description":"Feed external ID.","type":"string"},"updated":{"description":"Whether the feed content changed since the last fetch.","type":"boolean"},"error":{"description":"Error message if the sync failed for this feed.","type":"string"}}}}},"required":["success","results"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","required":["feedId","updated"],"properties":{"feedId":{"description":"Feed external ID.","type":"string"},"updated":{"description":"Whether the feed content changed since the last fetch.","type":"boolean"},"error":{"description":"Error message if the sync failed for this feed.","type":"string"}}}}},"required":["success","results"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"results":{"type":"array","items":{"type":"object","required":["feedId","updated"],"properties":{"feedId":{"description":"Feed external ID.","type":"string"},"updated":{"description":"Whether the feed content changed since the last fetch.","type":"boolean"},"error":{"description":"Error message if the sync failed for this feed.","type":"string"}}}}},"required":["success","results"]}}}}},"operationId":"postBffRss-feedSync","tags":["RSS Feed"],"summary":"Sync RSS feeds","description":"Fetches the latest content from RSS feed URLs. If feedId is provided, only that feed is synced. Otherwise every active feed for the organisation is synced immediately, ignoring the per-feed next_sync_date schedule used by the cron picker. Content is cached locally and compared by hash to avoid unnecessary updates.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feedId":{"description":"Feed external ID to sync. If omitted, all active feeds for the organisation are synced.","examples":["a1b2c3d4"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"feedId":{"description":"Feed external ID to sync. If omitted, all active feeds for the organisation are synced.","examples":["a1b2c3d4"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"feedId":{"description":"Feed external ID to sync. If omitted, all active feeds for the organisation are synced.","examples":["a1b2c3d4"],"type":"string"}}}}}}}},"/bff/rss-feed/{feedId}/newsroom-shortlist":{"get":{"parameters":[{"description":"Feed external ID.","schema":{"type":"string"},"in":"path","name":"feedId","required":true},{"description":"Maximum number of items (default 10).","schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","shortlistDate","rank","title","hotnessScore","czRelevanceScore","cctvFitScore","totalScore","status","insertedDate"],"properties":{"id":{"type":"string"},"shortlistDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"rank":{"type":"number"},"title":{"type":"string"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"},"hotnessScore":{"type":"number"},"czRelevanceScore":{"type":"number"},"cctvFitScore":{"type":"number"},"totalScore":{"type":"number"},"reason":{"type":"string"},"status":{"type":"string"},"draftId":{"type":"string"},"draftStatus":{"type":"string"},"topicType":{"type":"string"},"severity":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","shortlistDate","rank","title","hotnessScore","czRelevanceScore","cctvFitScore","totalScore","status","insertedDate"],"properties":{"id":{"type":"string"},"shortlistDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"rank":{"type":"number"},"title":{"type":"string"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"},"hotnessScore":{"type":"number"},"czRelevanceScore":{"type":"number"},"cctvFitScore":{"type":"number"},"totalScore":{"type":"number"},"reason":{"type":"string"},"status":{"type":"string"},"draftId":{"type":"string"},"draftStatus":{"type":"string"},"topicType":{"type":"string"},"severity":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","shortlistDate","rank","title","hotnessScore","czRelevanceScore","cctvFitScore","totalScore","status","insertedDate"],"properties":{"id":{"type":"string"},"shortlistDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"rank":{"type":"number"},"title":{"type":"string"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"feedId":{"description":"External ID of the source RSS feed.","type":"string"},"hotnessScore":{"type":"number"},"czRelevanceScore":{"type":"number"},"cctvFitScore":{"type":"number"},"totalScore":{"type":"number"},"reason":{"type":"string"},"status":{"type":"string"},"draftId":{"type":"string"},"draftStatus":{"type":"string"},"topicType":{"type":"string"},"severity":{"type":"string"},"insertedDate":{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffRss-feedByFeedIdNewsroom-shortlist","tags":["RSS Feed","Newsroom"],"summary":"List Newsroom shortlist items for a feed","description":"Returns Newsroom shortlist items whose source RSS post belongs to the given feed, across all dates. Same item shape as GET /bff/newsroom/shortlist. Ordered by shortlist date DESC, then rank ASC."}},"/bff/routing/list":{"get":{"parameters":[{"description":"Filter by route type code (e.g. \"article\", \"product-detail\").","examples":["article"],"schema":{"type":"string"},"in":"query","name":"typeCode","required":false},{"description":"Filter by related entity ID. Accepts internal numeric ID or external ID (e.g. \"P93gIby6q5t2gi2a\"). When using external ID, typeCode must also be provided for correct resolution.","examples":["42"],"schema":{"type":"string"},"in":"query","name":"relatedEntityId","required":false},{"description":"Filter by slug (partial match, case-insensitive).","examples":["my-article"],"schema":{"type":"string"},"in":"query","name":"slug","required":false},{"description":"Filter by canonical status (\"true\" or \"false\").","examples":["true"],"schema":{"type":"string"},"in":"query","name":"canonical","required":false},{"description":"Filter by locale code (e.g. \"cs\", \"en\").","examples":["cs"],"schema":{"type":"string"},"in":"query","name":"locale","required":false},{"description":"Page number (1-based). Default: 1.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Items per page (max 200). Default: 50.","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"description":"Paginated list of routes.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of route entries matching the filter criteria.","type":"array","items":{"description":"Single route entry.","type":"object","required":["id","typeCode","slug","canonical","relatedEntityId","locale","insertedDate"],"properties":{"id":{"description":"Unique route identifier.","type":"string"},"typeCode":{"description":"Entity type code (e.g. \"article\", \"product-detail\").","type":"string"},"slug":{"description":"URL slug for this route.","type":"string"},"canonical":{"description":"Whether this is the canonical route for the entity.","type":"boolean"},"relatedEntityId":{"description":"ID of the related entity (post, product, etc.).","type":"number"},"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"},"insertedDate":{"description":"Date when the route was created.","anyOf":[{"description":"Date when the route was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of matching routes (before pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of route entries matching the filter criteria.","type":"array","items":{"description":"Single route entry.","type":"object","required":["id","typeCode","slug","canonical","relatedEntityId","locale","insertedDate"],"properties":{"id":{"description":"Unique route identifier.","type":"string"},"typeCode":{"description":"Entity type code (e.g. \"article\", \"product-detail\").","type":"string"},"slug":{"description":"URL slug for this route.","type":"string"},"canonical":{"description":"Whether this is the canonical route for the entity.","type":"boolean"},"relatedEntityId":{"description":"ID of the related entity (post, product, etc.).","type":"number"},"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"},"insertedDate":{"description":"Date when the route was created.","anyOf":[{"description":"Date when the route was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of matching routes (before pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of route entries matching the filter criteria.","type":"array","items":{"description":"Single route entry.","type":"object","required":["id","typeCode","slug","canonical","relatedEntityId","locale","insertedDate"],"properties":{"id":{"description":"Unique route identifier.","type":"string"},"typeCode":{"description":"Entity type code (e.g. \"article\", \"product-detail\").","type":"string"},"slug":{"description":"URL slug for this route.","type":"string"},"canonical":{"description":"Whether this is the canonical route for the entity.","type":"boolean"},"relatedEntityId":{"description":"ID of the related entity (post, product, etc.).","type":"number"},"locale":{"description":"Locale code (e.g. \"cs\", \"en\").","type":"string"},"insertedDate":{"description":"Date when the route was created.","anyOf":[{"description":"Date when the route was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of matching routes (before pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffRoutingList","tags":["Routing"],"summary":"List routes","description":"Returns a paginated routing table for the authenticated organisation. Supports filtering by entity type, entity ID, slug, canonical status, and locale. Routes are ordered by insertion date (newest first)."}},"/bff/routing/type-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code"],"properties":{"id":{"description":"Route type ID.","type":"number"},"code":{"description":"Route type code.","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code"],"properties":{"id":{"description":"Route type ID.","type":"number"},"code":{"description":"Route type code.","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code"],"properties":{"id":{"description":"Route type ID.","type":"number"},"code":{"description":"Route type code.","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffRoutingType-list","tags":["Routing"],"summary":"List route types","description":"Returns all available route types (e.g. \"article\", \"product-detail\", \"post-category\", \"tag\"). Use these codes when creating or filtering routes."}},"/bff/routing/add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"description":"ID of the created route.","type":"string"},"slug":{"description":"Final slug (may differ from input if sanitized or deduplicated).","type":"string"}},"required":["success","id","slug"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"description":"ID of the created route.","type":"string"},"slug":{"description":"Final slug (may differ from input if sanitized or deduplicated).","type":"string"}},"required":["success","id","slug"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"description":"ID of the created route.","type":"string"},"slug":{"description":"Final slug (may differ from input if sanitized or deduplicated).","type":"string"}},"required":["success","id","slug"]}}}}},"operationId":"postBffRoutingAdd","tags":["Routing"],"summary":"Create route","description":"Creates a new route (URL slug) pointing to an entity. The slug is automatically sanitized and made unique by appending a numeric suffix if needed. New routes are marked as canonical by default.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["type","locale","slug","relatedEntityId"],"properties":{"type":{"description":"Route entity type code.","anyOf":[{"const":"product-detail","type":"string"},{"const":"article","type":"string"},{"const":"post-category","type":"string"},{"const":"tag","type":"string"},{"const":"glossary-term","type":"string"},{"const":"glossary-category","type":"string"},{"const":"author","type":"string"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"slug":{"description":"Desired URL slug. Will be automatically sanitized and deduplicated (e.g. \"My Article!\" becomes \"my-article\", or \"my-article-2\" if already taken).","examples":["my-article"],"type":"string"},"relatedEntityId":{"description":"ID of the entity this route points to. Accepts internal numeric ID or external ID (e.g. \"SohsLD38Hw8vs4MC\"); external IDs are resolved against the entity table for the given type.","examples":["42"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["type","locale","slug","relatedEntityId"],"properties":{"type":{"description":"Route entity type code.","anyOf":[{"const":"product-detail","type":"string"},{"const":"article","type":"string"},{"const":"post-category","type":"string"},{"const":"tag","type":"string"},{"const":"glossary-term","type":"string"},{"const":"glossary-category","type":"string"},{"const":"author","type":"string"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"slug":{"description":"Desired URL slug. Will be automatically sanitized and deduplicated (e.g. \"My Article!\" becomes \"my-article\", or \"my-article-2\" if already taken).","examples":["my-article"],"type":"string"},"relatedEntityId":{"description":"ID of the entity this route points to. Accepts internal numeric ID or external ID (e.g. \"SohsLD38Hw8vs4MC\"); external IDs are resolved against the entity table for the given type.","examples":["42"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["type","locale","slug","relatedEntityId"],"properties":{"type":{"description":"Route entity type code.","anyOf":[{"const":"product-detail","type":"string"},{"const":"article","type":"string"},{"const":"post-category","type":"string"},{"const":"tag","type":"string"},{"const":"glossary-term","type":"string"},{"const":"glossary-category","type":"string"},{"const":"author","type":"string"}]},"locale":{"examples":["cs","en","en-GB","pt-BR","zh-Hans"],"minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$","description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","type":"string"},"slug":{"description":"Desired URL slug. Will be automatically sanitized and deduplicated (e.g. \"My Article!\" becomes \"my-article\", or \"my-article-2\" if already taken).","examples":["my-article"],"type":"string"},"relatedEntityId":{"description":"ID of the entity this route points to. Accepts internal numeric ID or external ID (e.g. \"SohsLD38Hw8vs4MC\"); external IDs are resolved against the entity table for the given type.","examples":["42"],"type":"string"}}}}}}}},"/bff/routing/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffRoutingUpdate","tags":["Routing"],"summary":"Update route","description":"Updates route properties (slug, canonical status). Only provided fields are updated, others remain unchanged. For canonical switching (unmark old + mark new), prefer the /set-canonical endpoint.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to update.","examples":["123"],"type":"string"},"slug":{"description":"New slug value. Must be unique within the organisation.","examples":["new-slug"],"type":"string"},"canonical":{"description":"Set canonical status. Use /set-canonical endpoint for safe canonical switching.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to update.","examples":["123"],"type":"string"},"slug":{"description":"New slug value. Must be unique within the organisation.","examples":["new-slug"],"type":"string"},"canonical":{"description":"Set canonical status. Use /set-canonical endpoint for safe canonical switching.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to update.","examples":["123"],"type":"string"},"slug":{"description":"New slug value. Must be unique within the organisation.","examples":["new-slug"],"type":"string"},"canonical":{"description":"Set canonical status. Use /set-canonical endpoint for safe canonical switching.","type":"boolean"}}}}}}}},"/bff/routing/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffRoutingDelete","tags":["Routing"],"summary":"Delete route","description":"Permanently deletes a route. The entity remains, only the URL mapping is removed. If the deleted route was canonical, make sure to set another route as canonical.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to delete.","examples":["123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to delete.","examples":["123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to delete.","examples":["123"],"type":"string"}}}}}}}},"/bff/routing/set-canonical":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffRoutingSet-canonical","tags":["Routing"],"summary":"Set canonical route","description":"Marks a route as the canonical URL for its entity and locale. All other routes for the same entity, type, and locale are automatically unmarked. Canonical routes are used for link generation and SEO (rel=canonical).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to mark as canonical.","examples":["123"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to mark as canonical.","examples":["123"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Route ID to mark as canonical.","examples":["123"],"type":"string"}}}}}}}},"/bff/search/":{"get":{"parameters":[{"description":"Search query string.","examples":["invoice"],"schema":{"type":"string"},"in":"query","name":"query","required":false},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false},{"description":"Limit search to a specific result type (e.g. order, product, contact).","examples":["order"],"schema":{"type":"string"},"in":"query","name":"category","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"description":"Normalized search query.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["type","label","score"],"properties":{"type":{"description":"Result entity type (order, product, contact, post, etc.).","examples":["order"],"type":"string"},"label":{"description":"Display label of the result.","type":"string"},"description":{"description":"Additional context or subtitle.","type":"string"},"url":{"description":"Link to the result detail page.","type":"string"},"score":{"description":"Relevance score (higher = better match).","type":"number"}}}}},"required":["query","items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"query":{"description":"Normalized search query.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["type","label","score"],"properties":{"type":{"description":"Result entity type (order, product, contact, post, etc.).","examples":["order"],"type":"string"},"label":{"description":"Display label of the result.","type":"string"},"description":{"description":"Additional context or subtitle.","type":"string"},"url":{"description":"Link to the result detail page.","type":"string"},"score":{"description":"Relevance score (higher = better match).","type":"number"}}}}},"required":["query","items"]}},"text/plain":{"schema":{"type":"object","properties":{"query":{"description":"Normalized search query.","type":"string"},"items":{"type":"array","items":{"type":"object","required":["type","label","score"],"properties":{"type":{"description":"Result entity type (order, product, contact, post, etc.).","examples":["order"],"type":"string"},"label":{"description":"Display label of the result.","type":"string"},"description":{"description":"Additional context or subtitle.","type":"string"},"url":{"description":"Link to the result detail page.","type":"string"},"score":{"description":"Relevance score (higher = better match).","type":"number"}}}}},"required":["query","items"]}}}}},"operationId":"getBffSearch","tags":["Search"],"summary":"Global search — full result set (synchronous)","description":"Runs every module-level search in parallel, applies scoring + snippet + highlighting, and returns the sorted top 100 in one JSON payload. Use this for the full search-results page, batch consumers, and the MCP server — anything that needs the final ranked list before it can render.\n\nFor the admin autocomplete UX, prefer GET /search/stream: it emits per-module buckets as they resolve so the first result is visible in ~50–300 ms instead of waiting for the slowest module (~800–1000 ms cold on large organisations).\n\nThe query is recorded to `search__search_query` + `cas__organisation_search_log` **before** the search runs, so user intent is captured even when the search itself times out."}},"/bff/search/user":{"get":{"parameters":[{"description":"Contact email address.\n\nThe system validates the input as a standard email address and automatically applies **normalization and canonicalization**.\n\nAll API responses return the **normalized form**, and each email address is **unique per organisation** within the system.\n\n**Phone-only contacts:** Since 2026-06-10 a contact may exist without an e-mail when it was registered only by phone (e.g. imports of phone-only records). Responses that expose such contacts use `API_EMAIL_NULLABLE` instead, where this field can be `null`. Endpoints that accept e-mail as input still require a valid value here — phone-only creation goes through admin-only import / BFF flows.","examples":["jan@barasek.com"],"schema":{"type":"string"},"in":"query","name":"email","required":true}],"operationId":"getBffSearchUser","tags":["Search"],"summary":"Find user by email","description":"Looks up a user profile by exact email match. Used for user autocomplete and validation.","responses":{"200":{}}}},"/bff/search/stream":{"get":{"parameters":[{"description":"Search query string.","examples":["invoice"],"schema":{"type":"string"},"in":"query","name":"query","required":false},{"description":"Communication locale code — controls the language of textual data (product names, descriptions, articles, storefront UI, transactional e-mails).\n\n**Preferred format:** [BCP 47](https://www.rfc-editor.org/rfc/rfc5646) language tag — `language[-Script][-REGION]`. Use the full tag whenever the script or region matters:\n- `en-GB` vs. `en-US` (British vs. American spelling)\n- `pt-PT` vs. `pt-BR` (European vs. Brazilian Portuguese)\n- `zh-Hans` vs. `zh-Hant` (Simplified vs. Traditional Chinese)\n- `sr-Latn` vs. `sr-Cyrl` (Latin vs. Cyrillic Serbian)\n\n**Backwards-compatible fallback:** the bare two-letter ISO 639-1 code (`cs`, `en`, `pl`, ...) is accepted indefinitely — legacy clients that only send the language subtag continue to work unchanged.\n\n**Resolution algorithm (server-side):** the input is resolved against the supported locale list via the [RFC 4647 Lookup] progressive-fallback strategy — trailing subtags are stripped one by one until a supported locale is found. Example: `en-GB-oxendict` → `en-GB` → `en` (matched). If no subtag combination is supported, the request is rejected.\n\n**Currently supported locales:** `cs`, `en`, `fr`, `it`, `pl`, `de`, `sk`, `sv`, `es`, `zh`, `ja`, `uk`, `da`, `hu`, `ro`, `nl`, `pt`, `fi`, `nb`, `hr`. Region-specific variants (e.g. `en-GB`, `pt-BR`) are accepted and resolved to their base language when the exact variant is not registered separately.","examples":["cs","en","en-GB","pt-BR","zh-Hans"],"schema":{"type":"string","minLength":2,"maxLength":35,"pattern":"^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$"},"in":"query","name":"locale","required":false},{"description":"Limit search to a specific result type (e.g. order, product, contact).","examples":["order"],"schema":{"type":"string"},"in":"query","name":"category","required":false},{"description":"Optional per-module row cap for modules other than `category` (default 300). The header autocomplete sends a small value to keep each keystroke cheap; counts then mean \"at least N\".","examples":[30],"schema":{"minimum":1,"maximum":300,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":300,"description":"Optional per-module row cap for modules other than `category` (default 300). The header autocomplete sends a small value to keep each keystroke cheap; counts then mean \"at least N\".","examples":[30],"type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffSearchStream","tags":["Search"],"summary":"Global search — streaming (SSE, admin autocomplete)","description":"Purpose-built for the admin header autocomplete: emits per-module buckets as each SQL query resolves so the fastest module (calendar/order, ~30–300 ms) reaches the browser immediately instead of waiting for the slowest one (email/post, ~800–1000 ms cold on large organisations).\n\nUse GET /search when you need the final sorted list in a single JSON payload (search-results page, MCP server, batch consumers). Use this endpoint only when the client can render partial results progressively and sort them itself.\n\nWire format: text/event-stream. Events:\n  • `results` — `{ module, items: [{...}] }` — one per module bucket (may fire empty). Items already carry the final `score`, snippet, and `<strong>`-wrapped highlight.\n  • `error` — `{ module?, message }` — per-bucket failures; other buckets keep flowing.\n  • `done` — `{ total }` — sent once every bucket has settled, then the stream closes.\n\nThe query is recorded to `search__search_query` + `cas__organisation_search_log` **before** the stream opens, so user intent is captured even when the client aborts the fetch mid-stream (typical on every autocomplete keystroke).","responses":{"200":{}}}},"/bff/settings/env-variables":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Configuration variables ordered by key.","type":"array","items":{"type":"object","required":["key","valuePreview","valueLength","expired","known"],"properties":{"key":{"description":"Configuration key identifier.","type":"string"},"valuePreview":{"description":"Masked value preview (e.g. \"****abcd\").","type":"string"},"valueLength":{"description":"Length of the actual (unmasked) value.","type":"number"},"expirationDate":{"description":"ISO date when the value expires, if set.","type":"string"},"expired":{"description":"Whether the value has expired.","type":"boolean"},"known":{"description":"Whether the key appears in the well-known CONFIGURATION_KEYS catalogue.","type":"boolean"},"description":{"description":"Human-readable description from CONFIGURATION_KEYS (when known).","type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Configuration variables ordered by key.","type":"array","items":{"type":"object","required":["key","valuePreview","valueLength","expired","known"],"properties":{"key":{"description":"Configuration key identifier.","type":"string"},"valuePreview":{"description":"Masked value preview (e.g. \"****abcd\").","type":"string"},"valueLength":{"description":"Length of the actual (unmasked) value.","type":"number"},"expirationDate":{"description":"ISO date when the value expires, if set.","type":"string"},"expired":{"description":"Whether the value has expired.","type":"boolean"},"known":{"description":"Whether the key appears in the well-known CONFIGURATION_KEYS catalogue.","type":"boolean"},"description":{"description":"Human-readable description from CONFIGURATION_KEYS (when known).","type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Configuration variables ordered by key.","type":"array","items":{"type":"object","required":["key","valuePreview","valueLength","expired","known"],"properties":{"key":{"description":"Configuration key identifier.","type":"string"},"valuePreview":{"description":"Masked value preview (e.g. \"****abcd\").","type":"string"},"valueLength":{"description":"Length of the actual (unmasked) value.","type":"number"},"expirationDate":{"description":"ISO date when the value expires, if set.","type":"string"},"expired":{"description":"Whether the value has expired.","type":"boolean"},"known":{"description":"Whether the key appears in the well-known CONFIGURATION_KEYS catalogue.","type":"boolean"},"description":{"description":"Human-readable description from CONFIGURATION_KEYS (when known).","type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffSettingsEnv-variables","tags":["Settings"],"description":"Returns all configuration variables for the organisation. Values are masked for security — only the last 4 characters are visible (high-secret keys are fully masked). This is the advanced key-value store for secrets and integration keys. For common settings, use GET /organisation/profile instead.","summary":"List environment variables"}},"/bff/settings/env-known-keys":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Well-known configuration keys sorted by key.","type":"array","items":{"type":"object","required":["key","description","group"],"properties":{"key":{"description":"Canonical configuration key identifier.","type":"string"},"description":{"description":"Human-readable description of what the key controls.","type":"string"},"group":{"description":"First underscore-delimited segment used to group keys in the admin picker.","examples":["comgate","emailer","gopay","ai"],"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Well-known configuration keys sorted by key.","type":"array","items":{"type":"object","required":["key","description","group"],"properties":{"key":{"description":"Canonical configuration key identifier.","type":"string"},"description":{"description":"Human-readable description of what the key controls.","type":"string"},"group":{"description":"First underscore-delimited segment used to group keys in the admin picker.","examples":["comgate","emailer","gopay","ai"],"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Well-known configuration keys sorted by key.","type":"array","items":{"type":"object","required":["key","description","group"],"properties":{"key":{"description":"Canonical configuration key identifier.","type":"string"},"description":{"description":"Human-readable description of what the key controls.","type":"string"},"group":{"description":"First underscore-delimited segment used to group keys in the admin picker.","examples":["comgate","emailer","gopay","ai"],"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffSettingsEnv-known-keys","tags":["Settings"],"description":"Returns the well-known CONFIGURATION_KEYS catalogue — every key the platform recognises along with its description and group prefix. Used by the admin \"Add key\" picker so operators can discover available keys instead of mistyping them.","summary":"List known configuration keys"}},"/bff/settings/env-variable-history":{"get":{"parameters":[{"description":"Configuration key to pull history for.","examples":["comgate_merchant_id"],"schema":{"type":"string"},"in":"query","name":"key","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"History entries newest first.","type":"array","items":{"type":"object","required":["id","insertedDate","memberId","valuePreview","valueLength"],"properties":{"id":{"description":"History row identifier.","type":"number"},"insertedDate":{"description":"ISO timestamp when the change was recorded.","type":"string"},"memberId":{"description":"Member who made the change (0 for system).","type":"number"},"memberName":{"description":"Resolved member display name, if the member still exists.","type":"string"},"memberEmail":{"description":"Resolved member email, if available.","type":"string"},"valuePreview":{"description":"Masked value preview at the time of change.","type":"string"},"valueLength":{"description":"Length of the actual (unmasked) value.","type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"History entries newest first.","type":"array","items":{"type":"object","required":["id","insertedDate","memberId","valuePreview","valueLength"],"properties":{"id":{"description":"History row identifier.","type":"number"},"insertedDate":{"description":"ISO timestamp when the change was recorded.","type":"string"},"memberId":{"description":"Member who made the change (0 for system).","type":"number"},"memberName":{"description":"Resolved member display name, if the member still exists.","type":"string"},"memberEmail":{"description":"Resolved member email, if available.","type":"string"},"valuePreview":{"description":"Masked value preview at the time of change.","type":"string"},"valueLength":{"description":"Length of the actual (unmasked) value.","type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"History entries newest first.","type":"array","items":{"type":"object","required":["id","insertedDate","memberId","valuePreview","valueLength"],"properties":{"id":{"description":"History row identifier.","type":"number"},"insertedDate":{"description":"ISO timestamp when the change was recorded.","type":"string"},"memberId":{"description":"Member who made the change (0 for system).","type":"number"},"memberName":{"description":"Resolved member display name, if the member still exists.","type":"string"},"memberEmail":{"description":"Resolved member email, if available.","type":"string"},"valuePreview":{"description":"Masked value preview at the time of change.","type":"string"},"valueLength":{"description":"Length of the actual (unmasked) value.","type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffSettingsEnv-variable-history","tags":["Settings"],"description":"Returns the per-value change history for a configuration key, newest first. Each entry includes the member who made the change (when resolvable) and a masked value preview using the same high-secret rules as the list endpoint. Capped at 100 entries. Every call is audited to `core__activity` as `settings.env_view_variable_history` (level 1 for high-secret keys).","summary":"Get environment variable history"}},"/bff/settings/env-variable-value":{"get":{"parameters":[{"description":"Configuration key to retrieve the value for.","examples":["comgate_secret"],"schema":{"type":"string"},"in":"query","name":"key","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"description":"Full value of the configuration variable. Empty string if not found.","type":"string"}},"required":["value"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"value":{"description":"Full value of the configuration variable. Empty string if not found.","type":"string"}},"required":["value"]}},"text/plain":{"schema":{"type":"object","properties":{"value":{"description":"Full value of the configuration variable. Empty string if not found.","type":"string"}},"required":["value"]}}}}},"operationId":"getBffSettingsEnv-variable-value","tags":["Settings"],"description":"Returns the full (unmasked) value of a configuration variable. Every call is audited to `core__activity` as `settings.env_view_variable_value` (level 1 for high-secret keys, level 0 otherwise). The audit entry records who, when, which key, from which IP — never the value itself.","summary":"Get environment variable value"}},"/bff/settings/env-change-variable-value":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was changed successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was changed successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the value was changed successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffSettingsEnv-change-variable-value","tags":["Settings"],"description":"Updates a configuration variable value. Includes an optimistic concurrency check — oldValue must match the current value or the request is rejected. A history entry is created for audit purposes.","summary":"Change environment variable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key","oldValue","newValue"],"properties":{"key":{"description":"Configuration key to update.","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"},"oldValue":{"description":"Expected current value (optimistic concurrency check). Must match the actual value.","type":"string"},"newValue":{"description":"New value to set.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["key","oldValue","newValue"],"properties":{"key":{"description":"Configuration key to update.","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"},"oldValue":{"description":"Expected current value (optimistic concurrency check). Must match the actual value.","type":"string"},"newValue":{"description":"New value to set.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["key","oldValue","newValue"],"properties":{"key":{"description":"Configuration key to update.","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"},"oldValue":{"description":"Expected current value (optimistic concurrency check). Must match the actual value.","type":"string"},"newValue":{"description":"New value to set.","type":"string"}}}}}}}},"/bff/settings/env-add-variable":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variable was created successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variable was created successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the variable was created successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffSettingsEnv-add-variable","tags":["Settings"],"description":"Creates a new configuration variable for the organisation. Fails with 400 if the key already exists — use /settings/env-change-variable-value to update an existing one. A history entry is created for audit.","summary":"Add environment variable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key","value"],"properties":{"key":{"description":"Configuration key to create. Upper-case letters, digits and underscores, max 64 chars.","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"},"value":{"description":"Initial value of the configuration variable.","type":"string"},"expirationDate":{"description":"ISO date after which the value stops being valid.","examples":["2027-01-01"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["key","value"],"properties":{"key":{"description":"Configuration key to create. Upper-case letters, digits and underscores, max 64 chars.","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"},"value":{"description":"Initial value of the configuration variable.","type":"string"},"expirationDate":{"description":"ISO date after which the value stops being valid.","examples":["2027-01-01"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["key","value"],"properties":{"key":{"description":"Configuration key to create. Upper-case letters, digits and underscores, max 64 chars.","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"},"value":{"description":"Initial value of the configuration variable.","type":"string"},"expirationDate":{"description":"ISO date after which the value stops being valid.","examples":["2027-01-01"],"type":"string"}}}}}}}},"/bff/settings/env-remove-variable":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether a matching variable was deleted.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether a matching variable was deleted.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether a matching variable was deleted.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffSettingsEnv-remove-variable","tags":["Settings"],"description":"Deletes a configuration variable for the organisation. The variable row is removed; the historical audit entries in `cas__organisation_configuration_history` are retained for compliance.","summary":"Remove environment variable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"description":"Configuration key to remove.","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["key"],"properties":{"key":{"description":"Configuration key to remove.","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["key"],"properties":{"key":{"description":"Configuration key to remove.","examples":["GOOGLE_ANALYTICS_ID"],"type":"string"}}}}}}}},"/bff/settings/ip-ban-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["geoId","ip","hostname","city","country","countryRegion","latitude","longitude","isp","organisation","tor","hosting","proxy","reason","insertedDate"],"properties":{"geoId":{"description":"Geo IP record ID.","type":"number"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS hostname.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"Country code.","examples":["CZ"],"type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Country region.","type":"string"},{"type":"null"}]},"latitude":{"nullable":true,"anyOf":[{"description":"Latitude.","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"Longitude.","type":"number"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"Internet service provider.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"IP organisation.","type":"string"},{"type":"null"}]},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting provider.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy.","type":"boolean"},"reason":{"nullable":true,"anyOf":[{"description":"Reason for the ban.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO date when the ban was created.","anyOf":[{"description":"ISO date when the ban was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of banned IPs.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["geoId","ip","hostname","city","country","countryRegion","latitude","longitude","isp","organisation","tor","hosting","proxy","reason","insertedDate"],"properties":{"geoId":{"description":"Geo IP record ID.","type":"number"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS hostname.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"Country code.","examples":["CZ"],"type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Country region.","type":"string"},{"type":"null"}]},"latitude":{"nullable":true,"anyOf":[{"description":"Latitude.","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"Longitude.","type":"number"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"Internet service provider.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"IP organisation.","type":"string"},{"type":"null"}]},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting provider.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy.","type":"boolean"},"reason":{"nullable":true,"anyOf":[{"description":"Reason for the ban.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO date when the ban was created.","anyOf":[{"description":"ISO date when the ban was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of banned IPs.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["geoId","ip","hostname","city","country","countryRegion","latitude","longitude","isp","organisation","tor","hosting","proxy","reason","insertedDate"],"properties":{"geoId":{"description":"Geo IP record ID.","type":"number"},"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"hostname":{"nullable":true,"anyOf":[{"description":"Reverse DNS hostname.","type":"string"},{"type":"null"}]},"city":{"nullable":true,"anyOf":[{"description":"City name.","type":"string"},{"type":"null"}]},"country":{"nullable":true,"anyOf":[{"description":"Country code.","examples":["CZ"],"type":"string"},{"type":"null"}]},"countryRegion":{"nullable":true,"anyOf":[{"description":"Country region.","type":"string"},{"type":"null"}]},"latitude":{"nullable":true,"anyOf":[{"description":"Latitude.","type":"number"},{"type":"null"}]},"longitude":{"nullable":true,"anyOf":[{"description":"Longitude.","type":"number"},{"type":"null"}]},"isp":{"nullable":true,"anyOf":[{"description":"Internet service provider.","type":"string"},{"type":"null"}]},"organisation":{"nullable":true,"anyOf":[{"description":"IP organisation.","type":"string"},{"type":"null"}]},"tor":{"description":"Whether the IP is a known Tor exit node.","type":"boolean"},"hosting":{"description":"Whether the IP belongs to a hosting provider.","type":"boolean"},"proxy":{"description":"Whether the IP is a known proxy.","type":"boolean"},"reason":{"nullable":true,"anyOf":[{"description":"Reason for the ban.","type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO date when the ban was created.","anyOf":[{"description":"ISO date when the ban was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of banned IPs.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffSettingsIp-ban-list","tags":["Settings"],"description":"Returns all IP addresses banned for this organisation.","summary":"List banned IP addresses"}},"/bff/settings/ip-ban-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the IP was banned successfully.","type":"boolean"},"geoId":{"description":"Geo IP record ID of the banned IP.","type":"number"}},"required":["success","geoId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the IP was banned successfully.","type":"boolean"},"geoId":{"description":"Geo IP record ID of the banned IP.","type":"number"}},"required":["success","geoId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the IP was banned successfully.","type":"boolean"},"geoId":{"description":"Geo IP record ID of the banned IP.","type":"number"}},"required":["success","geoId"]}}}}},"operationId":"postBffSettingsIp-ban-add","tags":["Settings"],"description":"Add an IP address to the organisation ban list. The IP is resolved to a geo record automatically.","summary":"Ban an IP address","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ip"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"reason":{"description":"Reason for the ban.","examples":["Fraudulent orders"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["ip"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"reason":{"description":"Reason for the ban.","examples":["Fraudulent orders"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["ip"],"properties":{"ip":{"examples":["1.1.1.1","2001:4860:4860::8888"],"description":"User IP address used for GEO/IP intelligence.\n\n**Accepted formats:**\n- **IPv4** dot-decimal, e.g. `1.1.1.1` (4 octets, 0–255, no leading zeros).\n- **IPv6** as defined by [RFC 4291](https://www.rfc-editor.org/rfc/rfc4291) — full `2001:0db8:0000:0000:0000:0000:0000:0001`, zero-compressed `2001:db8::1`, IPv4-mapped `::ffff:1.2.3.4`, or scoped literals. Both upper- and lower-case hex are accepted.\n\n**Server-side canonicalization** (`ipNormalize` in `core/src/lib/network/ipNormalize.ts`):\n- Valid IPv4 is passed through verbatim.\n- Valid IPv6 is **lowercased** ([RFC 5952 §4.3](https://www.rfc-editor.org/rfc/rfc5952)).\n- **IPv4-mapped IPv6** `::ffff:X.X.X.X` is unwrapped to plain IPv4 (RFC 4291 §2.5.5.2) so `1.2.3.4` and `::ffff:1.2.3.4` share one `brj__geo_ip` row.\n- Loopback aliases (`::1`, `0.0.0.0`, `localhost`, empty string) collapse to `127.0.0.1`.\n- Junk values that fail both IPv4 and IPv6 validation are silently rejected and replaced with `127.0.0.1` (loopback).\n\n**On the wire:** every response returns the canonicalized form — clients can safely rely on lowercase IPv6 and the plain-IPv4 unwrap when de-duping or joining. Server-originated writers (activity log, session log, ban list) resolve the visitor IP via `resolveClientIp` / `resolveClientIpOrNull` — always native IPv6 on Vercel Edge (there is no auto-mapping to `::ffff:X.X.X.X`).\n\n**Enrichment:** the system resolves reverse DNS, geolocation, ASN, mobile/proxy/hosting/Tor flags via our VikiTron GEO/IP resolver for both address families. [Learn more](https://vikitron.com/ip-lookup)","type":"string"},"reason":{"description":"Reason for the ban.","examples":["Fraudulent orders"],"type":"string"}}}}}}}},"/bff/settings/ip-ban-remove":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the ban was removed successfully.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the ban was removed successfully.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the ban was removed successfully.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffSettingsIp-ban-remove","tags":["Settings"],"description":"Remove an IP address from the organisation ban list.","summary":"Remove IP ban","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["geoId"],"properties":{"geoId":{"description":"Geo IP record ID to unban.","examples":[42],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["geoId"],"properties":{"geoId":{"description":"Geo IP record ID to unban.","examples":[42],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["geoId"],"properties":{"geoId":{"description":"Geo IP record ID to unban.","examples":[42],"type":"number"}}}}}}}},"/bff/shipping/method":{"get":{"operationId":"getBffShippingMethod","tags":["Shipping"],"summary":"List shipping methods","description":"Lists all shipping methods configured for the organisation. Sorted by audience, sort_order, id. The admin UI groups them by audience tab (retail / wholesale). Self-heals by creating the default `eshop` sales channel on first call if missing.","responses":{"200":{}}},"post":{"parameters":[],"operationId":"postBffShippingMethod","tags":["Shipping"],"summary":"Create shipping method","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","name","audience"],"properties":{"code":{"minLength":1,"maxLength":100,"type":"string"},"name":{"minLength":1,"maxLength":150,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"isVisible":{"type":"boolean"},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"freeShippingEligible":{"type":"boolean"},"legacyPrice":{"minimum":0,"type":"number"},"carrierId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"carrierServiceId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"defaultCarrierConfigurationExternalId":{"description":"Public id of the carrier API account (`shop__carrier_configuration.external_id`) preselected when a shipment is created for an order with this shipping method. Must belong to the method carrier. NULL clears it; omitted keeps the current value (cleared automatically when the carrier changes).","anyOf":[{"minLength":1,"maxLength":16,"type":"string"},{"type":"null"}]},"logoBlobId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"translations":{"type":"array","items":{"type":"object","required":["localeId","name","description"],"properties":{"localeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"paymentMethodIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"contactGroupIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"shippingClassIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","name","audience"],"properties":{"code":{"minLength":1,"maxLength":100,"type":"string"},"name":{"minLength":1,"maxLength":150,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"isVisible":{"type":"boolean"},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"freeShippingEligible":{"type":"boolean"},"legacyPrice":{"minimum":0,"type":"number"},"carrierId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"carrierServiceId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"defaultCarrierConfigurationExternalId":{"description":"Public id of the carrier API account (`shop__carrier_configuration.external_id`) preselected when a shipment is created for an order with this shipping method. Must belong to the method carrier. NULL clears it; omitted keeps the current value (cleared automatically when the carrier changes).","anyOf":[{"minLength":1,"maxLength":16,"type":"string"},{"type":"null"}]},"logoBlobId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"translations":{"type":"array","items":{"type":"object","required":["localeId","name","description"],"properties":{"localeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"paymentMethodIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"contactGroupIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"shippingClassIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}},"text/plain":{"schema":{"type":"object","required":["code","name","audience"],"properties":{"code":{"minLength":1,"maxLength":100,"type":"string"},"name":{"minLength":1,"maxLength":150,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"isVisible":{"type":"boolean"},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"freeShippingEligible":{"type":"boolean"},"legacyPrice":{"minimum":0,"type":"number"},"carrierId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"carrierServiceId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"defaultCarrierConfigurationExternalId":{"description":"Public id of the carrier API account (`shop__carrier_configuration.external_id`) preselected when a shipment is created for an order with this shipping method. Must belong to the method carrier. NULL clears it; omitted keeps the current value (cleared automatically when the carrier changes).","anyOf":[{"minLength":1,"maxLength":16,"type":"string"},{"type":"null"}]},"logoBlobId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"translations":{"type":"array","items":{"type":"object","required":["localeId","name","description"],"properties":{"localeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"paymentMethodIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"contactGroupIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"shippingClassIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}}},"responses":{"200":{}}}},"/bff/shipping/method/{externalId}":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^[a-f0-9]{16}$"},"in":"path","name":"externalId","required":true}],"operationId":"getBffShippingMethodByExternalId","tags":["Shipping"],"summary":"Shipping method detail","responses":{"200":{}}},"delete":{"parameters":[{"schema":{"type":"string","pattern":"^[a-f0-9]{16}$"},"in":"path","name":"externalId","required":true}],"operationId":"deleteBffShippingMethodByExternalId","tags":["Shipping"],"summary":"Soft-delete shipping method","responses":{"200":{}}}},"/bff/shipping/method/{externalId}/update":{"post":{"parameters":[{"schema":{"type":"string","pattern":"^[a-f0-9]{16}$"},"in":"path","name":"externalId","required":true}],"operationId":"postBffShippingMethodByExternalIdUpdate","tags":["Shipping"],"summary":"Update shipping method","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","name","audience"],"properties":{"code":{"minLength":1,"maxLength":100,"type":"string"},"name":{"minLength":1,"maxLength":150,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"isVisible":{"type":"boolean"},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"freeShippingEligible":{"type":"boolean"},"legacyPrice":{"minimum":0,"type":"number"},"carrierId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"carrierServiceId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"defaultCarrierConfigurationExternalId":{"description":"Public id of the carrier API account (`shop__carrier_configuration.external_id`) preselected when a shipment is created for an order with this shipping method. Must belong to the method carrier. NULL clears it; omitted keeps the current value (cleared automatically when the carrier changes).","anyOf":[{"minLength":1,"maxLength":16,"type":"string"},{"type":"null"}]},"logoBlobId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"translations":{"type":"array","items":{"type":"object","required":["localeId","name","description"],"properties":{"localeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"paymentMethodIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"contactGroupIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"shippingClassIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","name","audience"],"properties":{"code":{"minLength":1,"maxLength":100,"type":"string"},"name":{"minLength":1,"maxLength":150,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"isVisible":{"type":"boolean"},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"freeShippingEligible":{"type":"boolean"},"legacyPrice":{"minimum":0,"type":"number"},"carrierId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"carrierServiceId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"defaultCarrierConfigurationExternalId":{"description":"Public id of the carrier API account (`shop__carrier_configuration.external_id`) preselected when a shipment is created for an order with this shipping method. Must belong to the method carrier. NULL clears it; omitted keeps the current value (cleared automatically when the carrier changes).","anyOf":[{"minLength":1,"maxLength":16,"type":"string"},{"type":"null"}]},"logoBlobId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"translations":{"type":"array","items":{"type":"object","required":["localeId","name","description"],"properties":{"localeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"paymentMethodIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"contactGroupIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"shippingClassIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}},"text/plain":{"schema":{"type":"object","required":["code","name","audience"],"properties":{"code":{"minLength":1,"maxLength":100,"type":"string"},"name":{"minLength":1,"maxLength":150,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"isVisible":{"type":"boolean"},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"freeShippingEligible":{"type":"boolean"},"legacyPrice":{"minimum":0,"type":"number"},"carrierId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"carrierServiceId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"defaultCarrierConfigurationExternalId":{"description":"Public id of the carrier API account (`shop__carrier_configuration.external_id`) preselected when a shipment is created for an order with this shipping method. Must belong to the method carrier. NULL clears it; omitted keeps the current value (cleared automatically when the carrier changes).","anyOf":[{"minLength":1,"maxLength":16,"type":"string"},{"type":"null"}]},"logoBlobId":{"anyOf":[{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},{"type":"null"}]},"translations":{"type":"array","items":{"type":"object","required":["localeId","name","description"],"properties":{"localeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"paymentMethodIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"contactGroupIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}},"shippingClassIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}}},"responses":{"200":{}}}},"/bff/shipping/method/reorder":{"post":{"parameters":[],"operationId":"postBffShippingMethodReorder","tags":["Shipping"],"summary":"Bulk reorder shipping methods","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","sortOrder"],"properties":{"externalId":{"pattern":"^[a-f0-9]{16}$","type":"string"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","sortOrder"],"properties":{"externalId":{"pattern":"^[a-f0-9]{16}$","type":"string"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","sortOrder"],"properties":{"externalId":{"pattern":"^[a-f0-9]{16}$","type":"string"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}}}}}},"responses":{"200":{}}}},"/bff/shipping/method/{externalId}/rule":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^[a-f0-9]{16}$"},"in":"path","name":"externalId","required":true},{"schema":{"type":"string","pattern":"^[A-Z]{2}$"},"in":"query","name":"countryCode","required":false}],"operationId":"getBffShippingMethodByExternalIdRule","tags":["Shipping"],"summary":"List price rules for a shipping method","responses":{"200":{}}},"post":{"parameters":[{"schema":{"type":"string","pattern":"^[a-f0-9]{16}$"},"in":"path","name":"externalId","required":true}],"operationId":"postBffShippingMethodByExternalIdRule","tags":["Shipping"],"summary":"Create price rule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["countryCode","valueFrom","weightFromGrams","vatClassificationId","price","sortOrder"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"valueFrom":{"minimum":0,"type":"number"},"valueTo":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"weightFromGrams":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"weightToGrams":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"vatClassificationId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"price":{"minimum":0,"type":"number"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["countryCode","valueFrom","weightFromGrams","vatClassificationId","price","sortOrder"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"valueFrom":{"minimum":0,"type":"number"},"valueTo":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"weightFromGrams":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"weightToGrams":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"vatClassificationId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"price":{"minimum":0,"type":"number"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["countryCode","valueFrom","weightFromGrams","vatClassificationId","price","sortOrder"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"valueFrom":{"minimum":0,"type":"number"},"valueTo":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"weightFromGrams":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"weightToGrams":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"vatClassificationId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"price":{"minimum":0,"type":"number"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}}},"responses":{"200":{}}}},"/bff/shipping/rule/{ruleId}/update":{"post":{"parameters":[{"schema":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"in":"path","name":"ruleId","required":true}],"operationId":"postBffShippingRuleByRuleIdUpdate","tags":["Shipping"],"summary":"Update price rule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderDeliveryExternalId","countryCode","valueFrom","weightFromGrams","vatClassificationId","price","sortOrder"],"properties":{"orderDeliveryExternalId":{"pattern":"^[a-f0-9]{16}$","type":"string"},"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"valueFrom":{"minimum":0,"type":"number"},"valueTo":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"weightFromGrams":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"weightToGrams":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"vatClassificationId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"price":{"minimum":0,"type":"number"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderDeliveryExternalId","countryCode","valueFrom","weightFromGrams","vatClassificationId","price","sortOrder"],"properties":{"orderDeliveryExternalId":{"pattern":"^[a-f0-9]{16}$","type":"string"},"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"valueFrom":{"minimum":0,"type":"number"},"valueTo":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"weightFromGrams":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"weightToGrams":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"vatClassificationId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"price":{"minimum":0,"type":"number"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderDeliveryExternalId","countryCode","valueFrom","weightFromGrams","vatClassificationId","price","sortOrder"],"properties":{"orderDeliveryExternalId":{"pattern":"^[a-f0-9]{16}$","type":"string"},"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"valueFrom":{"minimum":0,"type":"number"},"valueTo":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"weightFromGrams":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},"weightToGrams":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"vatClassificationId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"price":{"minimum":0,"type":"number"},"sortOrder":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}}},"responses":{"200":{}}}},"/bff/shipping/rule/{ruleId}":{"delete":{"parameters":[{"schema":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"in":"path","name":"ruleId","required":true}],"operationId":"deleteBffShippingRuleByRuleId","tags":["Shipping"],"summary":"Delete price rule","responses":{"200":{}}}},"/bff/shipping/method/{externalId}/coverage":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^[a-f0-9]{16}$"},"in":"path","name":"externalId","required":true}],"operationId":"getBffShippingMethodByExternalIdCoverage","tags":["Shipping"],"summary":"Detect gaps + overlaps in price rules","responses":{"200":{}}}},"/bff/shipping/free-shipping-rule":{"get":{"operationId":"getBffShippingFree-shipping-rule","tags":["Shipping"],"summary":"List free-shipping rules","responses":{"200":{}}},"post":{"parameters":[],"operationId":"postBffShippingFree-shipping-rule","tags":["Shipping"],"summary":"Create free-shipping rule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["countryCode","audience","minOrderValue","restrictedDeliveryIds"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"minOrderValue":{"exclusiveMinimum":0,"type":"number"},"restrictedDeliveryIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}},"multipart/form-data":{"schema":{"type":"object","required":["countryCode","audience","minOrderValue","restrictedDeliveryIds"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"minOrderValue":{"exclusiveMinimum":0,"type":"number"},"restrictedDeliveryIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}},"text/plain":{"schema":{"type":"object","required":["countryCode","audience","minOrderValue","restrictedDeliveryIds"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"minOrderValue":{"exclusiveMinimum":0,"type":"number"},"restrictedDeliveryIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}}},"responses":{"200":{}}}},"/bff/shipping/free-shipping-rule/{ruleId}/update":{"post":{"parameters":[{"schema":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"in":"path","name":"ruleId","required":true}],"operationId":"postBffShippingFree-shipping-ruleByRuleIdUpdate","tags":["Shipping"],"summary":"Update free-shipping rule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["countryCode","audience","minOrderValue","restrictedDeliveryIds"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"minOrderValue":{"exclusiveMinimum":0,"type":"number"},"restrictedDeliveryIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}},"multipart/form-data":{"schema":{"type":"object","required":["countryCode","audience","minOrderValue","restrictedDeliveryIds"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"minOrderValue":{"exclusiveMinimum":0,"type":"number"},"restrictedDeliveryIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}},"text/plain":{"schema":{"type":"object","required":["countryCode","audience","minOrderValue","restrictedDeliveryIds"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"audience":{"anyOf":[{"const":"all","type":"string"},{"const":"retail","type":"string"},{"const":"wholesale","type":"string"},{"const":"group","type":"string"}]},"minOrderValue":{"exclusiveMinimum":0,"type":"number"},"restrictedDeliveryIds":{"type":"array","items":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}}},"responses":{"200":{}}}},"/bff/shipping/free-shipping-rule/{ruleId}":{"delete":{"parameters":[{"schema":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"in":"path","name":"ruleId","required":true}],"operationId":"deleteBffShippingFree-shipping-ruleByRuleId","tags":["Shipping"],"summary":"Delete free-shipping rule","responses":{"200":{}}}},"/bff/shipping/carrier":{"get":{"operationId":"getBffShippingCarrier","tags":["Shipping"],"summary":"List carriers (system + per-org)","responses":{"200":{}}}},"/bff/shipping/carrier/{carrierId}/service":{"get":{"parameters":[{"schema":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"in":"path","name":"carrierId","required":true}],"operationId":"getBffShippingCarrierByCarrierIdService","tags":["Shipping"],"summary":"List services of a carrier","responses":{"200":{}}}},"/bff/shipping/class":{"get":{"operationId":"getBffShippingClass","tags":["Shipping"],"summary":"List shipping classes (system + per-org)","responses":{"200":{}}}},"/bff/shipping/preview":{"post":{"parameters":[],"operationId":"postBffShippingPreview","tags":["Shipping"],"summary":"Preview shipping options for a hypothetical cart","description":"Runs the full shipping calculator against a simulated cart. Useful in the admin configurator to sanity-check the price rules before publishing. Body accepts the raw cart lines (product / variant / qty / unit gross price) and resolves weights + shipping classes from the catalog server-side.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["countryCode","items"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"customerId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"salesChannelCode":{"maxLength":32,"type":"string"},"items":{"minItems":1,"type":"array","items":{"type":"object","required":["productId","variantId","quantity","unitPriceGross"],"properties":{"productId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"variantId":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"unitPriceGross":{"minimum":0,"type":"number"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["countryCode","items"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"customerId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"salesChannelCode":{"maxLength":32,"type":"string"},"items":{"minItems":1,"type":"array","items":{"type":"object","required":["productId","variantId","quantity","unitPriceGross"],"properties":{"productId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"variantId":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"unitPriceGross":{"minimum":0,"type":"number"}}}}}}},"text/plain":{"schema":{"type":"object","required":["countryCode","items"],"properties":{"countryCode":{"pattern":"^[A-Z]{2}$","type":"string"},"customerId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"salesChannelCode":{"maxLength":32,"type":"string"},"items":{"minItems":1,"type":"array","items":{"type":"object","required":["productId","variantId","quantity","unitPriceGross"],"properties":{"productId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"variantId":{"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"unitPriceGross":{"minimum":0,"type":"number"}}}}}}}}},"responses":{"200":{}}}},"/bff/shipping/system-seed":{"post":{"operationId":"postBffShippingSystem-seed","tags":["Shipping"],"summary":"Seed system carriers, services and shipping classes","description":"Idempotent seed of the system-wide catalog. Should be invoked once from admin after deploying the shipping module; the endpoint is otherwise harmless to call again.","responses":{"200":{}}}},"/bff/carrier/catalog":{"get":{"operationId":"getBffCarrierCatalog","tags":["bff"],"responses":{"200":{}}}},"/bff/carrier/config-list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false}],"operationId":"getBffCarrierConfig-list","tags":["bff"],"responses":{"200":{}}}},"/bff/carrier/config-detail":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"externalId","required":true}],"operationId":"getBffCarrierConfig-detail","tags":["bff"],"responses":{"200":{}}}},"/bff/carrier/config-overview":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"externalId","required":true}],"operationId":"getBffCarrierConfig-overview","tags":["bff"],"responses":{"200":{}}}},"/bff/carrier/config-save":{"post":{"parameters":[],"operationId":"postBffCarrierConfig-save","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["carrierId","label","credentials","sender","isSandbox","isActive"],"properties":{"externalId":{"type":"string"},"carrierId":{"type":"number"},"label":{"maxLength":64,"type":"string"},"credentials":{"type":"object","patternProperties":{"^(.*)$":{}}},"sender":{"type":"object","required":["name","street","city","zip","country"],"properties":{"name":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"zip":{"type":"string"},"country":{"minLength":2,"maxLength":2,"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}}},"defaultServiceCode":{"type":"string"},"isSandbox":{"type":"boolean"},"isActive":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["carrierId","label","credentials","sender","isSandbox","isActive"],"properties":{"externalId":{"type":"string"},"carrierId":{"type":"number"},"label":{"maxLength":64,"type":"string"},"credentials":{"type":"object","patternProperties":{"^(.*)$":{}}},"sender":{"type":"object","required":["name","street","city","zip","country"],"properties":{"name":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"zip":{"type":"string"},"country":{"minLength":2,"maxLength":2,"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}}},"defaultServiceCode":{"type":"string"},"isSandbox":{"type":"boolean"},"isActive":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["carrierId","label","credentials","sender","isSandbox","isActive"],"properties":{"externalId":{"type":"string"},"carrierId":{"type":"number"},"label":{"maxLength":64,"type":"string"},"credentials":{"type":"object","patternProperties":{"^(.*)$":{}}},"sender":{"type":"object","required":["name","street","city","zip","country"],"properties":{"name":{"type":"string"},"street":{"type":"string"},"city":{"type":"string"},"zip":{"type":"string"},"country":{"minLength":2,"maxLength":2,"type":"string"},"phone":{"type":"string"},"email":{"type":"string"}}},"defaultServiceCode":{"type":"string"},"isSandbox":{"type":"boolean"},"isActive":{"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/carrier/config-delete":{"post":{"parameters":[],"operationId":"postBffCarrierConfig-delete","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/carrier/test-connection":{"post":{"parameters":[],"operationId":"postBffCarrierTest-connection","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/shipment/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"carrierId","required":false},{"schema":{"type":"string"},"in":"query","name":"carrierConfigurationExternalId","required":false},{"schema":{"type":"string"},"in":"query","name":"states","required":false},{"schema":{"type":"string"},"in":"query","name":"orderExternalId","required":false},{"schema":{"type":"string"},"in":"query","name":"trackingNumberQuery","required":false},{"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"schema":{"type":"string"},"in":"query","name":"dateTo","required":false},{"description":"`1` / `true` = only stuck or recently failed / returned parcels.","schema":{"type":"string"},"in":"query","name":"needsAttention","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffShipmentList","tags":["bff"],"responses":{"200":{}}}},"/bff/shipment/detail":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"externalId","required":true}],"operationId":"getBffShipmentDetail","tags":["bff"],"responses":{"200":{}}}},"/bff/shipment/defaults":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"orderExternalId","required":true}],"operationId":"getBffShipmentDefaults","tags":["Shipment"],"summary":"Shipment form defaults for an order","description":"Suggested carrier account, service, pickup point and weight for a new shipment, derived from the order's shipping method and items. Values are suggestions; the operator may change them.","responses":{"200":{}}}},"/bff/shipment/services":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"carrierConfigurationExternalId","required":true}],"operationId":"getBffShipmentServices","tags":["Shipment"],"summary":"Carrier services available for one carrier account","responses":{"200":{}}}},"/bff/shipment/api-log":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"shipmentExternalId","required":false},{"schema":{"type":"string"},"in":"query","name":"carrierConfigurationExternalId","required":false},{"schema":{"type":"string"},"in":"query","name":"onlyErrors","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffShipmentApi-log","tags":["Shipment"],"summary":"Carrier API traffic log","description":"Every HTTP exchange with the carrier API (redacted request + response, status, duration), newest first, for one shipment or one carrier account.","responses":{"200":{}}}},"/bff/shipment/by-order":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"orderExternalId","required":true}],"operationId":"getBffShipmentBy-order","tags":["bff"],"responses":{"200":{}}}},"/bff/shipment/by-complaint":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"complaintExternalId","required":true}],"operationId":"getBffShipmentBy-complaint","tags":["bff"],"responses":{"200":{}}}},"/bff/shipment/complaint-return":{"post":{"parameters":[],"operationId":"postBffShipmentComplaint-return","tags":["Shipment"],"summary":"Create a return parcel (customer → shop) for a complaint","description":"Uses the order delivery address as sender and the carrier account sender address as recipient. Packeta returns are label-less (drop-off code); other carriers return a label. With sendToCustomer the customer gets the complaint-return-label e-mail.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["complaintExternalId","carrierConfigurationExternalId","weightG"],"properties":{"complaintExternalId":{"type":"string"},"carrierConfigurationExternalId":{"type":"string"},"serviceCode":{"type":"string"},"weightG":{"minimum":1,"maximum":100000,"type":"number"},"sendToCustomer":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["complaintExternalId","carrierConfigurationExternalId","weightG"],"properties":{"complaintExternalId":{"type":"string"},"carrierConfigurationExternalId":{"type":"string"},"serviceCode":{"type":"string"},"weightG":{"minimum":1,"maximum":100000,"type":"number"},"sendToCustomer":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["complaintExternalId","carrierConfigurationExternalId","weightG"],"properties":{"complaintExternalId":{"type":"string"},"carrierConfigurationExternalId":{"type":"string"},"serviceCode":{"type":"string"},"weightG":{"minimum":1,"maximum":100000,"type":"number"},"sendToCustomer":{"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/shipment/create":{"post":{"parameters":[],"operationId":"postBffShipmentCreate","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderExternalId","carrierConfigurationExternalId","weightG"],"properties":{"orderExternalId":{"type":"string"},"carrierConfigurationExternalId":{"type":"string"},"clientRequestId":{"minLength":8,"maxLength":32,"type":"string"},"deliveryPointId":{"maxLength":64,"type":"string"},"weightG":{"minimum":1,"type":"number"},"lengthMm":{"type":"number"},"widthMm":{"type":"number"},"heightMm":{"type":"number"},"serviceCode":{"type":"string"},"serviceOptions":{"type":"object","patternProperties":{"^(.*)$":{}}},"codAmountCents":{"type":"number"},"codCurrency":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderExternalId","carrierConfigurationExternalId","weightG"],"properties":{"orderExternalId":{"type":"string"},"carrierConfigurationExternalId":{"type":"string"},"clientRequestId":{"minLength":8,"maxLength":32,"type":"string"},"deliveryPointId":{"maxLength":64,"type":"string"},"weightG":{"minimum":1,"type":"number"},"lengthMm":{"type":"number"},"widthMm":{"type":"number"},"heightMm":{"type":"number"},"serviceCode":{"type":"string"},"serviceOptions":{"type":"object","patternProperties":{"^(.*)$":{}}},"codAmountCents":{"type":"number"},"codCurrency":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderExternalId","carrierConfigurationExternalId","weightG"],"properties":{"orderExternalId":{"type":"string"},"carrierConfigurationExternalId":{"type":"string"},"clientRequestId":{"minLength":8,"maxLength":32,"type":"string"},"deliveryPointId":{"maxLength":64,"type":"string"},"weightG":{"minimum":1,"type":"number"},"lengthMm":{"type":"number"},"widthMm":{"type":"number"},"heightMm":{"type":"number"},"serviceCode":{"type":"string"},"serviceOptions":{"type":"object","patternProperties":{"^(.*)$":{}}},"codAmountCents":{"type":"number"},"codCurrency":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/shipment/quick-create":{"post":{"parameters":[],"operationId":"postBffShipmentQuick-create","tags":["Shipment"],"summary":"Create the shipment of an order in one click","description":"Uses the carrier account, service, pickup point and weight derived from the order shipping method (fallback weight 1 kg) and the cash-on-delivery amount. Returns `needs-input` with the reason when the order lacks what is needed, so the admin can open the manual form.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderExternalId"],"properties":{"orderExternalId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderExternalId"],"properties":{"orderExternalId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderExternalId"],"properties":{"orderExternalId":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/shipment/bulk-quick-create":{"post":{"parameters":[],"operationId":"postBffShipmentBulk-quick-create","tags":["Shipment"],"summary":"Create shipments for several orders in one click","description":"Same defaults as `/quick-create`, per order. Orders that already have an active shipment are counted as `existing`; orders that lack what is needed come back in `failed` with the reason.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderExternalIds"],"properties":{"orderExternalIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderExternalIds"],"properties":{"orderExternalIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["orderExternalIds"],"properties":{"orderExternalIds":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{}}}},"/bff/shipment/refresh-tracking":{"post":{"parameters":[],"operationId":"postBffShipmentRefresh-tracking","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/shipment/cancel":{"post":{"parameters":[],"operationId":"postBffShipmentCancel","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"},"reason":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"},"reason":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"},"reason":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/shipment/manual-state":{"post":{"parameters":[],"operationId":"postBffShipmentManual-state","tags":["Shipment"],"summary":"Set the shipment state manually","description":"Operator override (e.g. delivered in person, lost). Runs the shipment lifecycle (order status, COD, restock) and freezes the state against carrier tracking until /resume-tracking. Customer e-mail only with notifyCustomer.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","state"],"properties":{"externalId":{"type":"string"},"state":{"anyOf":[{"const":"created","type":"string"},{"const":"handed_over","type":"string"},{"const":"in_transit","type":"string"},{"const":"ready_for_pickup","type":"string"},{"const":"delivered","type":"string"},{"const":"returned","type":"string"},{"const":"failed","type":"string"}]},"reason":{"maxLength":500,"type":"string"},"notifyCustomer":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","state"],"properties":{"externalId":{"type":"string"},"state":{"anyOf":[{"const":"created","type":"string"},{"const":"handed_over","type":"string"},{"const":"in_transit","type":"string"},{"const":"ready_for_pickup","type":"string"},{"const":"delivered","type":"string"},{"const":"returned","type":"string"},{"const":"failed","type":"string"}]},"reason":{"maxLength":500,"type":"string"},"notifyCustomer":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["externalId","state"],"properties":{"externalId":{"type":"string"},"state":{"anyOf":[{"const":"created","type":"string"},{"const":"handed_over","type":"string"},{"const":"in_transit","type":"string"},{"const":"ready_for_pickup","type":"string"},{"const":"delivered","type":"string"},{"const":"returned","type":"string"},{"const":"failed","type":"string"}]},"reason":{"maxLength":500,"type":"string"},"notifyCustomer":{"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/shipment/resume-tracking":{"post":{"parameters":[],"operationId":"postBffShipmentResume-tracking","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/shipment/resend-tracking-email":{"post":{"parameters":[],"operationId":"postBffShipmentResend-tracking-email","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/shipment/bulk-labels":{"post":{"parameters":[],"operationId":"postBffShipmentBulk-labels","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalIds"],"properties":{"externalIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"layout":{"anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalIds"],"properties":{"externalIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"layout":{"anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["externalIds"],"properties":{"externalIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"layout":{"anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"type":"number"}}}}}},"responses":{"200":{}}}},"/bff/shipment/delivery-points":{"get":{"parameters":[{"description":"Carrier code, e.g. `gls`.","schema":{"type":"string"},"in":"query","name":"carrier","required":true},{"schema":{"type":"string"},"in":"query","name":"query","required":false},{"description":"Also resolve this point (the current value of the form).","schema":{"type":"string"},"in":"query","name":"pointId","required":false}],"operationId":"getBffShipmentDelivery-points","tags":["bff"],"responses":{"200":{}}}},"/bff/shipment/handover/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"carrierConfigurationExternalId","required":true},{"description":"DataGrid fulltext: protocol number, or tracking / order number of a parcel on it.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffShipmentHandoverList","tags":["bff"],"responses":{"200":{}}}},"/bff/shipment/handover/create":{"post":{"parameters":[],"operationId":"postBffShipmentHandoverCreate","tags":["Shipment"],"summary":"Create a handover protocol","description":"Lists every parcel of the carrier account that waits for pickup (state `created`, not on a protocol yet) on a new numbered protocol. Fails with a validation error when there is nothing to hand over.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["carrierConfigurationExternalId","markHandedOver"],"properties":{"carrierConfigurationExternalId":{"type":"string"},"shipmentExternalIds":{"maxItems":500,"type":"array","items":{"type":"string"}},"markHandedOver":{"description":"Mark the listed parcels as handed over (orders move to shipped, customers get the e-mail).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["carrierConfigurationExternalId","markHandedOver"],"properties":{"carrierConfigurationExternalId":{"type":"string"},"shipmentExternalIds":{"maxItems":500,"type":"array","items":{"type":"string"}},"markHandedOver":{"description":"Mark the listed parcels as handed over (orders move to shipped, customers get the e-mail).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["carrierConfigurationExternalId","markHandedOver"],"properties":{"carrierConfigurationExternalId":{"type":"string"},"shipmentExternalIds":{"maxItems":500,"type":"array","items":{"type":"string"}},"markHandedOver":{"description":"Mark the listed parcels as handed over (orders move to shipped, customers get the e-mail).","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/shipment/handover/pdf":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"externalId","required":true}],"operationId":"getBffShipmentHandoverPdf","tags":["bff"],"responses":{"200":{}}}},"/bff/shipment/label":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"externalId","required":true}],"operationId":"getBffShipmentLabel","tags":["bff"],"responses":{"200":{}}}},"/bff/shipment/label-file":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"externalId","required":true},{"schema":{"type":"string"},"in":"query","name":"download","required":false}],"operationId":"getBffShipmentLabel-file","tags":["bff"],"responses":{"200":{}}}},"/bff/bulk-job/list":{"get":{"operationId":"getBffBulk-jobList","tags":["Bulk job"],"summary":"The member's latest bulk jobs","description":"Last 20 bulk jobs of the signed-in member from the past 14 days, newest first.","responses":{"200":{}}}},"/bff/bulk-job/detail":{"get":{"parameters":[{"description":"Bulk job id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffBulk-jobDetail","tags":["Bulk job"],"summary":"Bulk job progress and result","description":"State, counts and the failed records (with the reason) of a bulk job the member started, plus the records done (e.g. for the label PDF of created shipments).","responses":{"200":{}}}},"/bff/bulk-job/cancel":{"post":{"parameters":[],"operationId":"postBffBulk-jobCancel","tags":["Bulk job"],"summary":"Cancel a bulk job","description":"Stops the job after the running chunk. Records already done stay done.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Bulk job id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Bulk job id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Bulk job id.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/bulk-routine/list":{"get":{"parameters":[{"description":"Grid the routines belong to.","schema":{"type":"string","const":"order"},"in":"query","name":"gridCode","required":true}],"operationId":"getBffBulk-routineList","tags":["Bulk job"],"summary":"Routines of a list","responses":{"200":{}}}},"/bff/bulk-routine/save":{"post":{"parameters":[],"operationId":"postBffBulk-routineSave","tags":["Bulk job"],"summary":"Create or update a routine","description":"Steps run in order; every record that did not fail in a step goes on to the next one.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["gridCode","name","filters","steps"],"properties":{"id":{"description":"Routine id; omit to create.","type":"string"},"gridCode":{"const":"order","type":"string"},"name":{"minLength":1,"maxLength":64,"type":"string"},"filters":{"description":"List query params the routine runs on (as a saved view stores them).","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"steps":{"minItems":1,"maxItems":4,"type":"array","items":{"description":"One step; `statusCode` (+ optional `notify`) for set-status.","type":"object","required":["kind"],"properties":{"kind":{"anyOf":[{"const":"shipment-create","type":"string"},{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"}]},"statusCode":{"type":"string"},"notify":{"type":"boolean"}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["gridCode","name","filters","steps"],"properties":{"id":{"description":"Routine id; omit to create.","type":"string"},"gridCode":{"const":"order","type":"string"},"name":{"minLength":1,"maxLength":64,"type":"string"},"filters":{"description":"List query params the routine runs on (as a saved view stores them).","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"steps":{"minItems":1,"maxItems":4,"type":"array","items":{"description":"One step; `statusCode` (+ optional `notify`) for set-status.","type":"object","required":["kind"],"properties":{"kind":{"anyOf":[{"const":"shipment-create","type":"string"},{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"}]},"statusCode":{"type":"string"},"notify":{"type":"boolean"}}}}}}},"text/plain":{"schema":{"type":"object","required":["gridCode","name","filters","steps"],"properties":{"id":{"description":"Routine id; omit to create.","type":"string"},"gridCode":{"const":"order","type":"string"},"name":{"minLength":1,"maxLength":64,"type":"string"},"filters":{"description":"List query params the routine runs on (as a saved view stores them).","type":"object","patternProperties":{"^(.*)$":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"steps":{"minItems":1,"maxItems":4,"type":"array","items":{"description":"One step; `statusCode` (+ optional `notify`) for set-status.","type":"object","required":["kind"],"properties":{"kind":{"anyOf":[{"const":"shipment-create","type":"string"},{"const":"set-status","type":"string"},{"const":"mark-paid","type":"string"}]},"statusCode":{"type":"string"},"notify":{"type":"boolean"}}}}}}}}},"responses":{"200":{}}}},"/bff/bulk-routine/delete":{"post":{"parameters":[],"operationId":"postBffBulk-routineDelete","tags":["Bulk job"],"summary":"Delete a routine","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/bulk-routine/preview":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffBulk-routinePreview","tags":["Bulk job"],"summary":"How many records a routine would run on now","responses":{"200":{}}}},"/bff/bulk-routine/run":{"post":{"parameters":[],"operationId":"postBffBulk-routineRun","tags":["Bulk job"],"summary":"Run a routine","description":"Snapshots the records of the routine filter and starts its first step as a background job; follow it at `/bff/bulk-job/detail` (`nextJobId` points to the next step once it starts).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/subscription/list":{"get":{"parameters":[{"description":"Contact external ID.","examples":["abc123def456ghij"],"schema":{"type":"string"},"in":"query","name":"customerId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"description":"Subscription external ID.","type":"string"},"productSlug":{"description":"Product slug.","type":"string"},"productCode":{"description":"Product code.","type":"string"},"orderNumber":{"description":"Order number that initiated this subscription.","type":"string"},"orderHash":{"description":"Order hash for admin linking.","type":"string"},"autoRenew":{"description":"Whether the subscription auto-renews on renewalDate.","type":"boolean"},"renewalDate":{"description":"Next renewal charge attempt.","anyOf":[{"description":"Next renewal charge attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"description":"Access is granted until this date.","anyOf":[{"description":"Access is granted until this date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"description":"Timestamp of the last successful renewal charge.","anyOf":[{"description":"Timestamp of the last successful renewal charge.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of active subscriptions.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"description":"Subscription external ID.","type":"string"},"productSlug":{"description":"Product slug.","type":"string"},"productCode":{"description":"Product code.","type":"string"},"orderNumber":{"description":"Order number that initiated this subscription.","type":"string"},"orderHash":{"description":"Order hash for admin linking.","type":"string"},"autoRenew":{"description":"Whether the subscription auto-renews on renewalDate.","type":"boolean"},"renewalDate":{"description":"Next renewal charge attempt.","anyOf":[{"description":"Next renewal charge attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"description":"Access is granted until this date.","anyOf":[{"description":"Access is granted until this date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"description":"Timestamp of the last successful renewal charge.","anyOf":[{"description":"Timestamp of the last successful renewal charge.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of active subscriptions.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","productSlug","productCode","orderNumber","orderHash","autoRenew","renewalDate"],"properties":{"externalId":{"description":"Subscription external ID.","type":"string"},"productSlug":{"description":"Product slug.","type":"string"},"productCode":{"description":"Product code.","type":"string"},"orderNumber":{"description":"Order number that initiated this subscription.","type":"string"},"orderHash":{"description":"Order hash for admin linking.","type":"string"},"autoRenew":{"description":"Whether the subscription auto-renews on renewalDate.","type":"boolean"},"renewalDate":{"description":"Next renewal charge attempt.","anyOf":[{"description":"Next renewal charge attempt.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"activeToDate":{"description":"Access is granted until this date.","anyOf":[{"description":"Access is granted until this date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"lastSuccessPaymentDate":{"description":"Timestamp of the last successful renewal charge.","anyOf":[{"description":"Timestamp of the last successful renewal charge.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"itemCount":{"description":"Total number of active subscriptions.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffSubscriptionList","tags":["Subscription"],"summary":"List active subscriptions for a contact","description":"Returns every subscription of the contact whose activeToDate is in the future. Same primitive that powers /api/v1/subscription/active-list, scoped to the authenticated organisation. `itemCount` mirrors `items.length` so the response plugs straight into DataGrid without a separate count query."}},"/bff/subscription/subscribable-product-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","interval","price","currencyCode"],"properties":{"productCode":{"type":"string"},"productName":{"type":"string"},"interval":{"type":"string"},"price":{"type":"number"},"currencyCode":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","interval","price","currencyCode"],"properties":{"productCode":{"type":"string"},"productName":{"type":"string"},"interval":{"type":"string"},"price":{"type":"number"},"currencyCode":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["productCode","productName","interval","price","currencyCode"],"properties":{"productCode":{"type":"string"},"productName":{"type":"string"},"interval":{"type":"string"},"price":{"type":"number"},"currencyCode":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffSubscriptionSubscribable-product-list","tags":["Subscription"],"summary":"List products that can be sold as a subscription","description":"Returns every active product in the current organisation that has a `shop__product_subscription_plan` row attached. Consumed by the admin \"Přidat předplatné\" modal to build the product picker."}},"/bff/subscription/set-state":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"alreadyInState":{"type":"boolean"}},"required":["success","state","alreadyInState"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"alreadyInState":{"type":"boolean"}},"required":["success","state","alreadyInState"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]},"alreadyInState":{"type":"boolean"}},"required":["success","state","alreadyInState"]}}}}},"operationId":"postBffSubscriptionSet-state","tags":["Subscription"],"summary":"Set subscription state (cancelled | active)","description":"Cancel or re-instate a subscription. Cancel disables auto-renew, stops the retry cron on the pending renewal order, and sends the \"subscription-cancelled\" e-mail to the customer. Re-instate flips auto-renew back on without sending anything. Access is never revoked immediately.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","subscriptionId","state"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","subscriptionId","state"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["customerId","subscriptionId","state"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"},"state":{"anyOf":[{"const":"cancelled","type":"string"},{"const":"active","type":"string"}]}}}}}}}},"/bff/subscription/cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffSubscriptionCancel","tags":["Subscription"],"summary":"Cancel subscription auto-renew (legacy alias for /set-state)","description":"Legacy alias — prefer POST /bff/subscription/set-state with `state: \"cancelled\"`. Behaviour is identical: disables auto-renew, stops the retry cron on any pending renewal order, sends the \"subscription-cancelled\" notification. Access stays valid until `activeToDate`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","subscriptionId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","subscriptionId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","subscriptionId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"}}}}}}}},"/bff/subscription/trigger-current-charge":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orderNumber":{"description":"Order number that was re-armed.","type":"string"}},"required":["success","orderNumber"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orderNumber":{"description":"Order number that was re-armed.","type":"string"}},"required":["success","orderNumber"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orderNumber":{"description":"Order number that was re-armed.","type":"string"}},"required":["success","orderNumber"]}}}}},"operationId":"postBffSubscriptionTrigger-current-charge","tags":["Subscription"],"summary":"Arm an immediate retry of the subscription current charge","description":"Sets `next_payment_attempt_date=NOW()` on the subscription current order so the next `processRecurringPaymentRetry` cron tick (every 2 minutes) tries Stripe again. Does NOT talk to the gateway directly. Fails if the order is already paid or not on the subscription-charge-card payment policy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","subscriptionId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","subscriptionId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","subscriptionId"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"subscriptionId":{"description":"Subscription external ID.","examples":["d9DfQL3ZF01t7Ykk"],"type":"string"}}}}}}}},"/bff/subscription/create-for-contact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orderNumber":{"type":"string"},"orderHash":{"type":"string"}},"required":["success","orderNumber","orderHash"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orderNumber":{"type":"string"},"orderHash":{"type":"string"}},"required":["success","orderNumber","orderHash"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orderNumber":{"type":"string"},"orderHash":{"type":"string"}},"required":["success","orderNumber","orderHash"]}}}}},"operationId":"postBffSubscriptionCreate-for-contact","tags":["Subscription"],"summary":"Manually start a subscription for a contact","description":"Creates a zero-price paid order for the given subscription product and marks it as paid, which triggers the standard subscription-start rule (`writeSubscriptionByOrder`). Same effect as if the customer had bought and paid — invoice + activity behave identically. Fails if the product does not have a `shop__product_subscription_plan` row or does not belong to the current organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerId","productCode"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"productCode":{"description":"Product code with an attached subscription plan.","examples":["kurz-mesicni"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["customerId","productCode"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"productCode":{"description":"Product code with an attached subscription plan.","examples":["kurz-mesicni"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["customerId","productCode"],"properties":{"customerId":{"description":"Contact external ID.","examples":["abc123def456ghij"],"type":"string"},"productCode":{"description":"Product code with an attached subscription plan.","examples":["kurz-mesicni"],"type":"string"}}}}}}}},"/bff/tariff/list":{"get":{"responses":{"200":{"items":{"type":"object","required":["id","code","position","monthlyPriceCzk","priceFrom","commission","limits","product"],"properties":{"id":{"description":"Tariff ID.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"position":{"description":"Display order on the pricing page.","type":"number"},"monthlyPriceCzk":{"description":"Monthly catalogue price in WHOLE CZK without VAT. 0 = free.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" — actual price is negotiated per organisation (Enterprise).","type":"boolean"},"commission":{"type":"object","required":["flatCzk","percent"],"properties":{"flatCzk":{"description":"Flat salesperson commission per sale, in CZK. Mutually exclusive with percent.","type":"number"},"percent":{"description":"Percentage commission of the actual paid price (0-100). Used by Enterprise.","type":"number"}}},"limits":{"type":"object","required":["storageMb","members","products","ordersMonthly","customers","emailsMonthly","aiTokensMonthly","apiRequestsMonthly","forms"],"properties":{"storageMb":{"description":"Total storage occupied across the organisation, in MB. 0 = unlimited.","type":"number"},"members":{"description":"Total members in the organisation. 0 = unlimited.","type":"number"},"products":{"description":"Total products in the organisation. 0 = unlimited.","type":"number"},"ordersMonthly":{"description":"New orders created in the organisation per month. 0 = unlimited.","type":"number"},"customers":{"description":"Total customers in the organisation. 0 = unlimited.","type":"number"},"emailsMonthly":{"description":"Transactional emails sent or received in the organisation per month. 0 = unlimited.","type":"number"},"aiTokensMonthly":{"description":"AI tokens consumed in the organisation per month. 0 = unlimited.","type":"number"},"apiRequestsMonthly":{"description":"Authenticated public API requests processed for the organisation per month. 0 = unlimited.","type":"number"},"forms":{"description":"Forms in the organisation. 0 = unlimited.","type":"number"}}},"product":{"anyOf":[{"type":"object","required":["name","code","price","active","subscriptionInterval"],"properties":{"name":{"description":"Product slug.","type":"string"},"code":{"description":"Product code.","type":"string"},"price":{"description":"Product price.","type":"number"},"active":{"description":"Whether the product is active.","type":"boolean"},"subscriptionInterval":{"description":"Subscription interval (e.g. 1m).","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["id","code","position","monthlyPriceCzk","priceFrom","commission","limits","product"],"properties":{"id":{"description":"Tariff ID.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"position":{"description":"Display order on the pricing page.","type":"number"},"monthlyPriceCzk":{"description":"Monthly catalogue price in WHOLE CZK without VAT. 0 = free.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" — actual price is negotiated per organisation (Enterprise).","type":"boolean"},"commission":{"type":"object","required":["flatCzk","percent"],"properties":{"flatCzk":{"description":"Flat salesperson commission per sale, in CZK. Mutually exclusive with percent.","type":"number"},"percent":{"description":"Percentage commission of the actual paid price (0-100). Used by Enterprise.","type":"number"}}},"limits":{"type":"object","required":["storageMb","members","products","ordersMonthly","customers","emailsMonthly","aiTokensMonthly","apiRequestsMonthly","forms"],"properties":{"storageMb":{"description":"Total storage occupied across the organisation, in MB. 0 = unlimited.","type":"number"},"members":{"description":"Total members in the organisation. 0 = unlimited.","type":"number"},"products":{"description":"Total products in the organisation. 0 = unlimited.","type":"number"},"ordersMonthly":{"description":"New orders created in the organisation per month. 0 = unlimited.","type":"number"},"customers":{"description":"Total customers in the organisation. 0 = unlimited.","type":"number"},"emailsMonthly":{"description":"Transactional emails sent or received in the organisation per month. 0 = unlimited.","type":"number"},"aiTokensMonthly":{"description":"AI tokens consumed in the organisation per month. 0 = unlimited.","type":"number"},"apiRequestsMonthly":{"description":"Authenticated public API requests processed for the organisation per month. 0 = unlimited.","type":"number"},"forms":{"description":"Forms in the organisation. 0 = unlimited.","type":"number"}}},"product":{"anyOf":[{"type":"object","required":["name","code","price","active","subscriptionInterval"],"properties":{"name":{"description":"Product slug.","type":"string"},"code":{"description":"Product code.","type":"string"},"price":{"description":"Product price.","type":"number"},"active":{"description":"Whether the product is active.","type":"boolean"},"subscriptionInterval":{"description":"Subscription interval (e.g. 1m).","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}},"multipart/form-data":{"schema":{"type":"array","items":{"type":"object","required":["id","code","position","monthlyPriceCzk","priceFrom","commission","limits","product"],"properties":{"id":{"description":"Tariff ID.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"position":{"description":"Display order on the pricing page.","type":"number"},"monthlyPriceCzk":{"description":"Monthly catalogue price in WHOLE CZK without VAT. 0 = free.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" — actual price is negotiated per organisation (Enterprise).","type":"boolean"},"commission":{"type":"object","required":["flatCzk","percent"],"properties":{"flatCzk":{"description":"Flat salesperson commission per sale, in CZK. Mutually exclusive with percent.","type":"number"},"percent":{"description":"Percentage commission of the actual paid price (0-100). Used by Enterprise.","type":"number"}}},"limits":{"type":"object","required":["storageMb","members","products","ordersMonthly","customers","emailsMonthly","aiTokensMonthly","apiRequestsMonthly","forms"],"properties":{"storageMb":{"description":"Total storage occupied across the organisation, in MB. 0 = unlimited.","type":"number"},"members":{"description":"Total members in the organisation. 0 = unlimited.","type":"number"},"products":{"description":"Total products in the organisation. 0 = unlimited.","type":"number"},"ordersMonthly":{"description":"New orders created in the organisation per month. 0 = unlimited.","type":"number"},"customers":{"description":"Total customers in the organisation. 0 = unlimited.","type":"number"},"emailsMonthly":{"description":"Transactional emails sent or received in the organisation per month. 0 = unlimited.","type":"number"},"aiTokensMonthly":{"description":"AI tokens consumed in the organisation per month. 0 = unlimited.","type":"number"},"apiRequestsMonthly":{"description":"Authenticated public API requests processed for the organisation per month. 0 = unlimited.","type":"number"},"forms":{"description":"Forms in the organisation. 0 = unlimited.","type":"number"}}},"product":{"anyOf":[{"type":"object","required":["name","code","price","active","subscriptionInterval"],"properties":{"name":{"description":"Product slug.","type":"string"},"code":{"description":"Product code.","type":"string"},"price":{"description":"Product price.","type":"number"},"active":{"description":"Whether the product is active.","type":"boolean"},"subscriptionInterval":{"description":"Subscription interval (e.g. 1m).","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}},"text/plain":{"schema":{"type":"array","items":{"type":"object","required":["id","code","position","monthlyPriceCzk","priceFrom","commission","limits","product"],"properties":{"id":{"description":"Tariff ID.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"position":{"description":"Display order on the pricing page.","type":"number"},"monthlyPriceCzk":{"description":"Monthly catalogue price in WHOLE CZK without VAT. 0 = free.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" — actual price is negotiated per organisation (Enterprise).","type":"boolean"},"commission":{"type":"object","required":["flatCzk","percent"],"properties":{"flatCzk":{"description":"Flat salesperson commission per sale, in CZK. Mutually exclusive with percent.","type":"number"},"percent":{"description":"Percentage commission of the actual paid price (0-100). Used by Enterprise.","type":"number"}}},"limits":{"type":"object","required":["storageMb","members","products","ordersMonthly","customers","emailsMonthly","aiTokensMonthly","apiRequestsMonthly","forms"],"properties":{"storageMb":{"description":"Total storage occupied across the organisation, in MB. 0 = unlimited.","type":"number"},"members":{"description":"Total members in the organisation. 0 = unlimited.","type":"number"},"products":{"description":"Total products in the organisation. 0 = unlimited.","type":"number"},"ordersMonthly":{"description":"New orders created in the organisation per month. 0 = unlimited.","type":"number"},"customers":{"description":"Total customers in the organisation. 0 = unlimited.","type":"number"},"emailsMonthly":{"description":"Transactional emails sent or received in the organisation per month. 0 = unlimited.","type":"number"},"aiTokensMonthly":{"description":"AI tokens consumed in the organisation per month. 0 = unlimited.","type":"number"},"apiRequestsMonthly":{"description":"Authenticated public API requests processed for the organisation per month. 0 = unlimited.","type":"number"},"forms":{"description":"Forms in the organisation. 0 = unlimited.","type":"number"}}},"product":{"anyOf":[{"type":"object","required":["name","code","price","active","subscriptionInterval"],"properties":{"name":{"description":"Product slug.","type":"string"},"code":{"description":"Product code.","type":"string"},"price":{"description":"Product price.","type":"number"},"active":{"description":"Whether the product is active.","type":"boolean"},"subscriptionInterval":{"description":"Subscription interval (e.g. 1m).","anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}}}}}},"operationId":"getBffTariffList","tags":["Tariff"],"summary":"List available tariffs","description":"Returns all tariffs with their limits and linked product pricing. Used for displaying the public pricing page."}},"/bff/tariff/current":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"organisationId":{"description":"Organisation the report belongs to.","type":"number"},"tariff":{"type":"object","required":["id","code","name","position","monthlyPriceCzk","priceFrom","requiresCustomPrice","minCustomPriceCzk","commission","billingInterval"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"description":"Display name (falls back to `code`).","type":"string"},"position":{"description":"Display order on the pricing page.","type":"number"},"monthlyPriceCzk":{"description":"Catalogue monthly price in WHOLE CZK without VAT.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" (Enterprise) — the real price is negotiated per org.","type":"boolean"},"requiresCustomPrice":{"description":"True for plans where every organisation MUST have `customPriceCzk` set (Enterprise). When true and `billing.customPriceCzk` is null, validation.customPriceMissing will be true.","type":"boolean"},"minCustomPriceCzk":{"description":"Minimum allowed value for `customPriceCzk` when `requiresCustomPrice` is true. 0 for fixed plans.","type":"number"},"commission":{"description":"Salesperson commission rule from the catalogue.","type":"object","required":["mode","flatCzk","percent"],"properties":{"mode":{"description":"Which catalogue commission rule applies.","anyOf":[{"const":"flat","type":"string"},{"const":"percent","type":"string"},{"const":"none","type":"string"}]},"flatCzk":{"description":"Flat commission per sale in CZK (mode=flat).","type":"number"},"percent":{"description":"Percentage commission of the actual paid price (mode=percent), 0–100.","type":"number"}}},"billingInterval":{"description":"Linked product subscription interval (e.g. `1m`).","anyOf":[{"type":"string"},{"type":"null"}]}}},"billing":{"description":"Per-organisation billing block — everything that may differ from the catalogue. Modify via POST /tariff/set-billing.","type":"object","required":["effectivePriceCzk","catalogueMonthlyPriceCzk","customPriceCzk","discountPercent","activeFrom","activeTo","paidUntil","daysUntilExpiry","isExpired","expiringSoon","note","salesperson"],"properties":{"effectivePriceCzk":{"description":"Final monthly price the org actually pays, in WHOLE CZK. Equal to customPriceCzk when set, otherwise catalogueMonthlyPriceCzk minus discountPercent.","type":"number"},"catalogueMonthlyPriceCzk":{"description":"Same as tariff.monthlyPriceCzk — included for convenience.","type":"number"},"customPriceCzk":{"description":"Negotiated monthly price in CZK. NULL = use catalogue minus discount. REQUIRED for Enterprise — use POST /tariff/set-billing to set it.","anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"description":"Discount on top of catalogue price (0–100). Ignored when customPriceCzk is set.","type":"number"},"activeFrom":{"description":"When the current assignment started.","anyOf":[{"type":"string"},{"type":"null"}]},"activeTo":{"description":"Same as paidUntil — duplicated for back-compat.","anyOf":[{"type":"string"},{"type":"null"}]},"paidUntil":{"description":"Subscription paid-until date. After this timestamp the assignment is treated as expired and must be renewed (or auto-renewed at customPriceCzk / catalogue price).","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"description":"Whole days until paidUntil. Negative = already expired. NULL when paidUntil is unset.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Convenience flag = paidUntil < now.","type":"boolean"},"expiringSoon":{"description":"True when not expired and daysUntilExpiry ≤ 14. Drives the warning badge.","type":"boolean"},"note":{"description":"Free-form admin note attached to the assignment (e.g. \"VIP customer\", contract reference).","anyOf":[{"type":"string"},{"type":"null"}]},"salesperson":{"description":"Salesperson snapshot. NULL = self-service / no salesperson recorded.","anyOf":[{"type":"object","required":["userId","username","lockedCommissionCzk"],"properties":{"userId":{"description":"cas__user(id) of the BizKitHub staff member who closed the deal.","type":"number"},"username":{"description":"Salesperson username.","anyOf":[{"type":"string"},{"type":"null"}]},"lockedCommissionCzk":{"description":"Snapshot of the commission owed for this assignment, in CZK.","anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]}}},"vendor":{"description":"The white-label partner organisation that manages this org. Returned only when parent_id is set AND the parent holds an active cas__white_label_licence row. NULL otherwise (sold directly by us, or licence revoked).","anyOf":[{"type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor.","type":"string"},"contactPerson":{"description":"Vendor's nominated contact person (vendor.support_person_id).","anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"description":"Email address customers should write to. Resolved as: vendor's default_send_from_email → contact person login username → null.","anyOf":[{"type":"string"},{"type":"null"}]},"myTariff":{"type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"monthlyPriceCzk":{"description":"Final monthly price in CZK that the customer pays.","type":"number"},"priceFrom":{"type":"boolean"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"type":"number"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"}}}}},{"type":"null"}]},"validation":{"description":"State flags for admin UI badges. None of these throw — they describe configuration status.","type":"object","required":["requiresCustomPrice","minCustomPriceCzk","customPriceMissing","customPriceBelowMinimum","paidUntilMissing","expired","expiringSoon"],"properties":{"requiresCustomPrice":{"description":"Mirror of tariff.requiresCustomPrice.","type":"boolean"},"minCustomPriceCzk":{"description":"Mirror of tariff.minCustomPriceCzk.","type":"number"},"customPriceMissing":{"description":"TRUE when the tariff requires a custom price and none is set. Admin UI should block billing operations and show a \"Set price first\" CTA.","type":"boolean"},"customPriceBelowMinimum":{"description":"TRUE when customPriceCzk is below minCustomPriceCzk (data drift / manual edit).","type":"boolean"},"paidUntilMissing":{"description":"TRUE when no paidUntil is set. Encourage admin to fill it for predictable renewals.","type":"boolean"},"expired":{"description":"Same as billing.isExpired.","type":"boolean"},"expiringSoon":{"description":"Same as billing.expiringSoon.","type":"boolean"}}},"period":{"description":"Current calendar-month window. All `monthly_event` counters reset on `start`.","type":"object","required":["start","end","daysElapsed","daysTotal","elapsedFraction"],"properties":{"start":{"description":"Period start (first day of current calendar month, UTC).","type":"string"},"end":{"description":"Period end (first day of next calendar month, UTC, exclusive).","type":"string"},"daysElapsed":{"description":"Days elapsed since `start`, including today (1..daysTotal).","type":"number"},"daysTotal":{"description":"Total days in the current period.","type":"number"},"elapsedFraction":{"description":"`daysElapsed / daysTotal`, rounded to 3 decimals — used for end-of-month projections.","type":"number"}}},"resources":{"description":"Per-metric breakdown ordered roughly by importance (products → orders → storage → AI → API → emails → members → …).","type":"array","items":{"type":"object","required":["key","kind","unit","used","limit","unlimited","percent","projectedAtPeriodEnd","status","source"],"properties":{"key":{"description":"Stable machine key. One of: products, orders_monthly, storage_mb, ai_tokens_monthly, api_requests_monthly, emails_monthly, members, customers, forms.","type":"string"},"kind":{"description":"`running_total` = current snapshot count (e.g. members in the org). `monthly_event` = events that accumulate in the current calendar month and reset on the 1st.","anyOf":[{"const":"running_total","type":"string"},{"const":"monthly_event","type":"string"}]},"unit":{"description":"Display unit (orders, MB, tokens, requests, emails, members, …).","type":"string"},"used":{"description":"Current usage in `unit`.","type":"number"},"limit":{"description":"Tariff cap. `0 = unlimited`.","type":"number"},"unlimited":{"description":"Convenience flag = `limit === 0`.","type":"boolean"},"percent":{"description":"`used / limit * 100`, rounded to 1 decimal. `0` when unlimited.","type":"number"},"projectedAtPeriodEnd":{"description":"For `monthly_event` resources only: linear extrapolation of `used` to the end of the period at the current burn rate. `null` for `running_total`.","anyOf":[{"type":"number"},{"type":"null"}]},"status":{"description":"Severity bucket: unlimited | ok (<80%) | warn (≥80%) | critical (≥95%) | over (≥100%). Drives badge colour in admin UI.","anyOf":[{"const":"unlimited","type":"string"},{"const":"ok","type":"string"},{"const":"warn","type":"string"},{"const":"critical","type":"string"},{"const":"over","type":"string"}]},"source":{"description":"Origin of the value (table.column or live COUNT) — for debugging.","type":"string"}}}},"history":{"description":"Historical monthly usage from cas__organisation_usage_monthly.","type":"object","required":["monthly","totals"],"properties":{"monthly":{"description":"Last 12 months of monthly counters, newest first. Months with no recorded usage are returned with zeros (gaps filled).","type":"array","items":{"type":"object","required":["periodStart","ordersCount","emailsCount","aiTokensCount","apiRequestsCount"],"properties":{"periodStart":{"description":"First day of the month, ISO date (YYYY-MM-01).","type":"string"},"ordersCount":{"description":"New orders created in the month.","type":"number"},"emailsCount":{"description":"Transactional emails sent + received in the month.","type":"number"},"aiTokensCount":{"description":"AI tokens consumed in the month.","type":"number"},"apiRequestsCount":{"description":"Authenticated public API requests in the month.","type":"number"}}}},"totals":{"description":"Sums across the returned history window. Useful for \"last 12 months\" headlines.","type":"object","required":["orders","emails","aiTokens","apiRequests"],"properties":{"orders":{"type":"number"},"emails":{"type":"number"},"aiTokens":{"type":"number"},"apiRequests":{"type":"number"}}}}}},"required":["organisationId","tariff","billing","vendor","validation","period","resources","history"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"organisationId":{"description":"Organisation the report belongs to.","type":"number"},"tariff":{"type":"object","required":["id","code","name","position","monthlyPriceCzk","priceFrom","requiresCustomPrice","minCustomPriceCzk","commission","billingInterval"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"description":"Display name (falls back to `code`).","type":"string"},"position":{"description":"Display order on the pricing page.","type":"number"},"monthlyPriceCzk":{"description":"Catalogue monthly price in WHOLE CZK without VAT.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" (Enterprise) — the real price is negotiated per org.","type":"boolean"},"requiresCustomPrice":{"description":"True for plans where every organisation MUST have `customPriceCzk` set (Enterprise). When true and `billing.customPriceCzk` is null, validation.customPriceMissing will be true.","type":"boolean"},"minCustomPriceCzk":{"description":"Minimum allowed value for `customPriceCzk` when `requiresCustomPrice` is true. 0 for fixed plans.","type":"number"},"commission":{"description":"Salesperson commission rule from the catalogue.","type":"object","required":["mode","flatCzk","percent"],"properties":{"mode":{"description":"Which catalogue commission rule applies.","anyOf":[{"const":"flat","type":"string"},{"const":"percent","type":"string"},{"const":"none","type":"string"}]},"flatCzk":{"description":"Flat commission per sale in CZK (mode=flat).","type":"number"},"percent":{"description":"Percentage commission of the actual paid price (mode=percent), 0–100.","type":"number"}}},"billingInterval":{"description":"Linked product subscription interval (e.g. `1m`).","anyOf":[{"type":"string"},{"type":"null"}]}}},"billing":{"description":"Per-organisation billing block — everything that may differ from the catalogue. Modify via POST /tariff/set-billing.","type":"object","required":["effectivePriceCzk","catalogueMonthlyPriceCzk","customPriceCzk","discountPercent","activeFrom","activeTo","paidUntil","daysUntilExpiry","isExpired","expiringSoon","note","salesperson"],"properties":{"effectivePriceCzk":{"description":"Final monthly price the org actually pays, in WHOLE CZK. Equal to customPriceCzk when set, otherwise catalogueMonthlyPriceCzk minus discountPercent.","type":"number"},"catalogueMonthlyPriceCzk":{"description":"Same as tariff.monthlyPriceCzk — included for convenience.","type":"number"},"customPriceCzk":{"description":"Negotiated monthly price in CZK. NULL = use catalogue minus discount. REQUIRED for Enterprise — use POST /tariff/set-billing to set it.","anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"description":"Discount on top of catalogue price (0–100). Ignored when customPriceCzk is set.","type":"number"},"activeFrom":{"description":"When the current assignment started.","anyOf":[{"type":"string"},{"type":"null"}]},"activeTo":{"description":"Same as paidUntil — duplicated for back-compat.","anyOf":[{"type":"string"},{"type":"null"}]},"paidUntil":{"description":"Subscription paid-until date. After this timestamp the assignment is treated as expired and must be renewed (or auto-renewed at customPriceCzk / catalogue price).","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"description":"Whole days until paidUntil. Negative = already expired. NULL when paidUntil is unset.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Convenience flag = paidUntil < now.","type":"boolean"},"expiringSoon":{"description":"True when not expired and daysUntilExpiry ≤ 14. Drives the warning badge.","type":"boolean"},"note":{"description":"Free-form admin note attached to the assignment (e.g. \"VIP customer\", contract reference).","anyOf":[{"type":"string"},{"type":"null"}]},"salesperson":{"description":"Salesperson snapshot. NULL = self-service / no salesperson recorded.","anyOf":[{"type":"object","required":["userId","username","lockedCommissionCzk"],"properties":{"userId":{"description":"cas__user(id) of the BizKitHub staff member who closed the deal.","type":"number"},"username":{"description":"Salesperson username.","anyOf":[{"type":"string"},{"type":"null"}]},"lockedCommissionCzk":{"description":"Snapshot of the commission owed for this assignment, in CZK.","anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]}}},"vendor":{"description":"The white-label partner organisation that manages this org. Returned only when parent_id is set AND the parent holds an active cas__white_label_licence row. NULL otherwise (sold directly by us, or licence revoked).","anyOf":[{"type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor.","type":"string"},"contactPerson":{"description":"Vendor's nominated contact person (vendor.support_person_id).","anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"description":"Email address customers should write to. Resolved as: vendor's default_send_from_email → contact person login username → null.","anyOf":[{"type":"string"},{"type":"null"}]},"myTariff":{"type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"monthlyPriceCzk":{"description":"Final monthly price in CZK that the customer pays.","type":"number"},"priceFrom":{"type":"boolean"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"type":"number"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"}}}}},{"type":"null"}]},"validation":{"description":"State flags for admin UI badges. None of these throw — they describe configuration status.","type":"object","required":["requiresCustomPrice","minCustomPriceCzk","customPriceMissing","customPriceBelowMinimum","paidUntilMissing","expired","expiringSoon"],"properties":{"requiresCustomPrice":{"description":"Mirror of tariff.requiresCustomPrice.","type":"boolean"},"minCustomPriceCzk":{"description":"Mirror of tariff.minCustomPriceCzk.","type":"number"},"customPriceMissing":{"description":"TRUE when the tariff requires a custom price and none is set. Admin UI should block billing operations and show a \"Set price first\" CTA.","type":"boolean"},"customPriceBelowMinimum":{"description":"TRUE when customPriceCzk is below minCustomPriceCzk (data drift / manual edit).","type":"boolean"},"paidUntilMissing":{"description":"TRUE when no paidUntil is set. Encourage admin to fill it for predictable renewals.","type":"boolean"},"expired":{"description":"Same as billing.isExpired.","type":"boolean"},"expiringSoon":{"description":"Same as billing.expiringSoon.","type":"boolean"}}},"period":{"description":"Current calendar-month window. All `monthly_event` counters reset on `start`.","type":"object","required":["start","end","daysElapsed","daysTotal","elapsedFraction"],"properties":{"start":{"description":"Period start (first day of current calendar month, UTC).","type":"string"},"end":{"description":"Period end (first day of next calendar month, UTC, exclusive).","type":"string"},"daysElapsed":{"description":"Days elapsed since `start`, including today (1..daysTotal).","type":"number"},"daysTotal":{"description":"Total days in the current period.","type":"number"},"elapsedFraction":{"description":"`daysElapsed / daysTotal`, rounded to 3 decimals — used for end-of-month projections.","type":"number"}}},"resources":{"description":"Per-metric breakdown ordered roughly by importance (products → orders → storage → AI → API → emails → members → …).","type":"array","items":{"type":"object","required":["key","kind","unit","used","limit","unlimited","percent","projectedAtPeriodEnd","status","source"],"properties":{"key":{"description":"Stable machine key. One of: products, orders_monthly, storage_mb, ai_tokens_monthly, api_requests_monthly, emails_monthly, members, customers, forms.","type":"string"},"kind":{"description":"`running_total` = current snapshot count (e.g. members in the org). `monthly_event` = events that accumulate in the current calendar month and reset on the 1st.","anyOf":[{"const":"running_total","type":"string"},{"const":"monthly_event","type":"string"}]},"unit":{"description":"Display unit (orders, MB, tokens, requests, emails, members, …).","type":"string"},"used":{"description":"Current usage in `unit`.","type":"number"},"limit":{"description":"Tariff cap. `0 = unlimited`.","type":"number"},"unlimited":{"description":"Convenience flag = `limit === 0`.","type":"boolean"},"percent":{"description":"`used / limit * 100`, rounded to 1 decimal. `0` when unlimited.","type":"number"},"projectedAtPeriodEnd":{"description":"For `monthly_event` resources only: linear extrapolation of `used` to the end of the period at the current burn rate. `null` for `running_total`.","anyOf":[{"type":"number"},{"type":"null"}]},"status":{"description":"Severity bucket: unlimited | ok (<80%) | warn (≥80%) | critical (≥95%) | over (≥100%). Drives badge colour in admin UI.","anyOf":[{"const":"unlimited","type":"string"},{"const":"ok","type":"string"},{"const":"warn","type":"string"},{"const":"critical","type":"string"},{"const":"over","type":"string"}]},"source":{"description":"Origin of the value (table.column or live COUNT) — for debugging.","type":"string"}}}},"history":{"description":"Historical monthly usage from cas__organisation_usage_monthly.","type":"object","required":["monthly","totals"],"properties":{"monthly":{"description":"Last 12 months of monthly counters, newest first. Months with no recorded usage are returned with zeros (gaps filled).","type":"array","items":{"type":"object","required":["periodStart","ordersCount","emailsCount","aiTokensCount","apiRequestsCount"],"properties":{"periodStart":{"description":"First day of the month, ISO date (YYYY-MM-01).","type":"string"},"ordersCount":{"description":"New orders created in the month.","type":"number"},"emailsCount":{"description":"Transactional emails sent + received in the month.","type":"number"},"aiTokensCount":{"description":"AI tokens consumed in the month.","type":"number"},"apiRequestsCount":{"description":"Authenticated public API requests in the month.","type":"number"}}}},"totals":{"description":"Sums across the returned history window. Useful for \"last 12 months\" headlines.","type":"object","required":["orders","emails","aiTokens","apiRequests"],"properties":{"orders":{"type":"number"},"emails":{"type":"number"},"aiTokens":{"type":"number"},"apiRequests":{"type":"number"}}}}}},"required":["organisationId","tariff","billing","vendor","validation","period","resources","history"]}},"text/plain":{"schema":{"type":"object","properties":{"organisationId":{"description":"Organisation the report belongs to.","type":"number"},"tariff":{"type":"object","required":["id","code","name","position","monthlyPriceCzk","priceFrom","requiresCustomPrice","minCustomPriceCzk","commission","billingInterval"],"properties":{"id":{"description":"Tariff ID in cas__tariff.","type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"description":"Display name (falls back to `code`).","type":"string"},"position":{"description":"Display order on the pricing page.","type":"number"},"monthlyPriceCzk":{"description":"Catalogue monthly price in WHOLE CZK without VAT.","type":"number"},"priceFrom":{"description":"True when monthlyPriceCzk is \"od\" (Enterprise) — the real price is negotiated per org.","type":"boolean"},"requiresCustomPrice":{"description":"True for plans where every organisation MUST have `customPriceCzk` set (Enterprise). When true and `billing.customPriceCzk` is null, validation.customPriceMissing will be true.","type":"boolean"},"minCustomPriceCzk":{"description":"Minimum allowed value for `customPriceCzk` when `requiresCustomPrice` is true. 0 for fixed plans.","type":"number"},"commission":{"description":"Salesperson commission rule from the catalogue.","type":"object","required":["mode","flatCzk","percent"],"properties":{"mode":{"description":"Which catalogue commission rule applies.","anyOf":[{"const":"flat","type":"string"},{"const":"percent","type":"string"},{"const":"none","type":"string"}]},"flatCzk":{"description":"Flat commission per sale in CZK (mode=flat).","type":"number"},"percent":{"description":"Percentage commission of the actual paid price (mode=percent), 0–100.","type":"number"}}},"billingInterval":{"description":"Linked product subscription interval (e.g. `1m`).","anyOf":[{"type":"string"},{"type":"null"}]}}},"billing":{"description":"Per-organisation billing block — everything that may differ from the catalogue. Modify via POST /tariff/set-billing.","type":"object","required":["effectivePriceCzk","catalogueMonthlyPriceCzk","customPriceCzk","discountPercent","activeFrom","activeTo","paidUntil","daysUntilExpiry","isExpired","expiringSoon","note","salesperson"],"properties":{"effectivePriceCzk":{"description":"Final monthly price the org actually pays, in WHOLE CZK. Equal to customPriceCzk when set, otherwise catalogueMonthlyPriceCzk minus discountPercent.","type":"number"},"catalogueMonthlyPriceCzk":{"description":"Same as tariff.monthlyPriceCzk — included for convenience.","type":"number"},"customPriceCzk":{"description":"Negotiated monthly price in CZK. NULL = use catalogue minus discount. REQUIRED for Enterprise — use POST /tariff/set-billing to set it.","anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"description":"Discount on top of catalogue price (0–100). Ignored when customPriceCzk is set.","type":"number"},"activeFrom":{"description":"When the current assignment started.","anyOf":[{"type":"string"},{"type":"null"}]},"activeTo":{"description":"Same as paidUntil — duplicated for back-compat.","anyOf":[{"type":"string"},{"type":"null"}]},"paidUntil":{"description":"Subscription paid-until date. After this timestamp the assignment is treated as expired and must be renewed (or auto-renewed at customPriceCzk / catalogue price).","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"description":"Whole days until paidUntil. Negative = already expired. NULL when paidUntil is unset.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Convenience flag = paidUntil < now.","type":"boolean"},"expiringSoon":{"description":"True when not expired and daysUntilExpiry ≤ 14. Drives the warning badge.","type":"boolean"},"note":{"description":"Free-form admin note attached to the assignment (e.g. \"VIP customer\", contract reference).","anyOf":[{"type":"string"},{"type":"null"}]},"salesperson":{"description":"Salesperson snapshot. NULL = self-service / no salesperson recorded.","anyOf":[{"type":"object","required":["userId","username","lockedCommissionCzk"],"properties":{"userId":{"description":"cas__user(id) of the BizKitHub staff member who closed the deal.","type":"number"},"username":{"description":"Salesperson username.","anyOf":[{"type":"string"},{"type":"null"}]},"lockedCommissionCzk":{"description":"Snapshot of the commission owed for this assignment, in CZK.","anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]}}},"vendor":{"description":"The white-label partner organisation that manages this org. Returned only when parent_id is set AND the parent holds an active cas__white_label_licence row. NULL otherwise (sold directly by us, or licence revoked).","anyOf":[{"type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor.","type":"string"},"contactPerson":{"description":"Vendor's nominated contact person (vendor.support_person_id).","anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"description":"Email address customers should write to. Resolved as: vendor's default_send_from_email → contact person login username → null.","anyOf":[{"type":"string"},{"type":"null"}]},"myTariff":{"type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"monthlyPriceCzk":{"description":"Final monthly price in CZK that the customer pays.","type":"number"},"priceFrom":{"type":"boolean"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"type":"number"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"}}}}},{"type":"null"}]},"validation":{"description":"State flags for admin UI badges. None of these throw — they describe configuration status.","type":"object","required":["requiresCustomPrice","minCustomPriceCzk","customPriceMissing","customPriceBelowMinimum","paidUntilMissing","expired","expiringSoon"],"properties":{"requiresCustomPrice":{"description":"Mirror of tariff.requiresCustomPrice.","type":"boolean"},"minCustomPriceCzk":{"description":"Mirror of tariff.minCustomPriceCzk.","type":"number"},"customPriceMissing":{"description":"TRUE when the tariff requires a custom price and none is set. Admin UI should block billing operations and show a \"Set price first\" CTA.","type":"boolean"},"customPriceBelowMinimum":{"description":"TRUE when customPriceCzk is below minCustomPriceCzk (data drift / manual edit).","type":"boolean"},"paidUntilMissing":{"description":"TRUE when no paidUntil is set. Encourage admin to fill it for predictable renewals.","type":"boolean"},"expired":{"description":"Same as billing.isExpired.","type":"boolean"},"expiringSoon":{"description":"Same as billing.expiringSoon.","type":"boolean"}}},"period":{"description":"Current calendar-month window. All `monthly_event` counters reset on `start`.","type":"object","required":["start","end","daysElapsed","daysTotal","elapsedFraction"],"properties":{"start":{"description":"Period start (first day of current calendar month, UTC).","type":"string"},"end":{"description":"Period end (first day of next calendar month, UTC, exclusive).","type":"string"},"daysElapsed":{"description":"Days elapsed since `start`, including today (1..daysTotal).","type":"number"},"daysTotal":{"description":"Total days in the current period.","type":"number"},"elapsedFraction":{"description":"`daysElapsed / daysTotal`, rounded to 3 decimals — used for end-of-month projections.","type":"number"}}},"resources":{"description":"Per-metric breakdown ordered roughly by importance (products → orders → storage → AI → API → emails → members → …).","type":"array","items":{"type":"object","required":["key","kind","unit","used","limit","unlimited","percent","projectedAtPeriodEnd","status","source"],"properties":{"key":{"description":"Stable machine key. One of: products, orders_monthly, storage_mb, ai_tokens_monthly, api_requests_monthly, emails_monthly, members, customers, forms.","type":"string"},"kind":{"description":"`running_total` = current snapshot count (e.g. members in the org). `monthly_event` = events that accumulate in the current calendar month and reset on the 1st.","anyOf":[{"const":"running_total","type":"string"},{"const":"monthly_event","type":"string"}]},"unit":{"description":"Display unit (orders, MB, tokens, requests, emails, members, …).","type":"string"},"used":{"description":"Current usage in `unit`.","type":"number"},"limit":{"description":"Tariff cap. `0 = unlimited`.","type":"number"},"unlimited":{"description":"Convenience flag = `limit === 0`.","type":"boolean"},"percent":{"description":"`used / limit * 100`, rounded to 1 decimal. `0` when unlimited.","type":"number"},"projectedAtPeriodEnd":{"description":"For `monthly_event` resources only: linear extrapolation of `used` to the end of the period at the current burn rate. `null` for `running_total`.","anyOf":[{"type":"number"},{"type":"null"}]},"status":{"description":"Severity bucket: unlimited | ok (<80%) | warn (≥80%) | critical (≥95%) | over (≥100%). Drives badge colour in admin UI.","anyOf":[{"const":"unlimited","type":"string"},{"const":"ok","type":"string"},{"const":"warn","type":"string"},{"const":"critical","type":"string"},{"const":"over","type":"string"}]},"source":{"description":"Origin of the value (table.column or live COUNT) — for debugging.","type":"string"}}}},"history":{"description":"Historical monthly usage from cas__organisation_usage_monthly.","type":"object","required":["monthly","totals"],"properties":{"monthly":{"description":"Last 12 months of monthly counters, newest first. Months with no recorded usage are returned with zeros (gaps filled).","type":"array","items":{"type":"object","required":["periodStart","ordersCount","emailsCount","aiTokensCount","apiRequestsCount"],"properties":{"periodStart":{"description":"First day of the month, ISO date (YYYY-MM-01).","type":"string"},"ordersCount":{"description":"New orders created in the month.","type":"number"},"emailsCount":{"description":"Transactional emails sent + received in the month.","type":"number"},"aiTokensCount":{"description":"AI tokens consumed in the month.","type":"number"},"apiRequestsCount":{"description":"Authenticated public API requests in the month.","type":"number"}}}},"totals":{"description":"Sums across the returned history window. Useful for \"last 12 months\" headlines.","type":"object","required":["orders","emails","aiTokens","apiRequests"],"properties":{"orders":{"type":"number"},"emails":{"type":"number"},"aiTokens":{"type":"number"},"apiRequests":{"type":"number"}}}}}},"required":["organisationId","tariff","billing","vendor","validation","period","resources","history"]}}}}},"operationId":"getBffTariffCurrent","tags":["Tariff"],"summary":"Get current tariff, usage, and history","description":"Comprehensive tariff & usage report for the calling organisation. Returns tariff metadata (catalogue + per-org override + computed effective price), salesperson assignment, the current calendar-month period window, per-resource usage with limit/percent/projection/status, and the last 12 months of monthly usage counters (with gaps filled). Designed as the single source for the admin \"Tariff & usage\" screen."}},"/bff/tariff/assign":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"needsCustomPrice":{"description":"TRUE when the new tariff requires a custom price (Enterprise) and none is currently set. The admin should follow up with /tariff/set-billing.","type":"boolean"}},"required":["success","needsCustomPrice"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"needsCustomPrice":{"description":"TRUE when the new tariff requires a custom price (Enterprise) and none is currently set. The admin should follow up with /tariff/set-billing.","type":"boolean"}},"required":["success","needsCustomPrice"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"needsCustomPrice":{"description":"TRUE when the new tariff requires a custom price (Enterprise) and none is currently set. The admin should follow up with /tariff/set-billing.","type":"boolean"}},"required":["success","needsCustomPrice"]}}}}},"operationId":"postBffTariffAssign","tags":["Tariff","Admin"],"summary":"Assign tariff to organisation","description":"Assigns a tariff to an organisation. Updates both the organisation_tariff record and the tariff_id on the organisation table. Switches reset paid-until — follow up with /tariff/set-billing to set the negotiated price + paidUntil. Allowed for internal admin OR the vendor of the target organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","tariffId"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"tariffId":{"description":"ID of the tariff to assign.","examples":[3],"type":"number"},"note":{"description":"Admin note (e.g. VIP client, volume discount).","examples":["VIP client"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","tariffId"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"tariffId":{"description":"ID of the tariff to assign.","examples":[3],"type":"number"},"note":{"description":"Admin note (e.g. VIP client, volume discount).","examples":["VIP client"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","tariffId"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"tariffId":{"description":"ID of the tariff to assign.","examples":[3],"type":"number"},"note":{"description":"Admin note (e.g. VIP client, volume discount).","examples":["VIP client"],"type":"string"}}}}}}}},"/bff/tariff/set-billing":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"description":"Organisation ID.","type":"number"},"tariffId":{"description":"Assigned tariff ID.","type":"number"},"tariffCode":{"description":"Assigned tariff code.","type":"string"},"customPriceCzk":{"description":"Current custom price in CZK, or null.","anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"description":"Paid-until date as ISO string, or null.","anyOf":[{"type":"string"},{"type":"null"}]},"requiresCustomPrice":{"description":"Whether the tariff requires a custom price.","type":"boolean"},"minCustomPriceCzk":{"description":"Minimum allowed custom price in CZK.","type":"number"}},"required":["success","organisationId","tariffId","tariffCode","customPriceCzk","paidUntil","requiresCustomPrice","minCustomPriceCzk"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"description":"Organisation ID.","type":"number"},"tariffId":{"description":"Assigned tariff ID.","type":"number"},"tariffCode":{"description":"Assigned tariff code.","type":"string"},"customPriceCzk":{"description":"Current custom price in CZK, or null.","anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"description":"Paid-until date as ISO string, or null.","anyOf":[{"type":"string"},{"type":"null"}]},"requiresCustomPrice":{"description":"Whether the tariff requires a custom price.","type":"boolean"},"minCustomPriceCzk":{"description":"Minimum allowed custom price in CZK.","type":"number"}},"required":["success","organisationId","tariffId","tariffCode","customPriceCzk","paidUntil","requiresCustomPrice","minCustomPriceCzk"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"organisationId":{"description":"Organisation ID.","type":"number"},"tariffId":{"description":"Assigned tariff ID.","type":"number"},"tariffCode":{"description":"Assigned tariff code.","type":"string"},"customPriceCzk":{"description":"Current custom price in CZK, or null.","anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"description":"Paid-until date as ISO string, or null.","anyOf":[{"type":"string"},{"type":"null"}]},"requiresCustomPrice":{"description":"Whether the tariff requires a custom price.","type":"boolean"},"minCustomPriceCzk":{"description":"Minimum allowed custom price in CZK.","type":"number"}},"required":["success","organisationId","tariffId","tariffCode","customPriceCzk","paidUntil","requiresCustomPrice","minCustomPriceCzk"]}}}}},"operationId":"postBffTariffSet-billing","tags":["Tariff","Admin"],"summary":"Set per-organisation billing (custom price + paid-until)","description":"Updates the negotiated monthly price (CZK), the paid-until date, and the admin note on an organisation tariff assignment. Validates Enterprise rules (minimum 10 000 CZK). Allowed for internal admin OR the vendor of the target organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"customPriceCzk":{"description":"Negotiated monthly price in WHOLE CZK. Omit to leave unchanged. Pass `null` to clear the override and fall back to catalogue minus discount. REQUIRED (and ≥ minCustomPriceCzk) for tariffs flagged `requiresCustomPrice` (Enterprise).","anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"description":"Subscription expiry as ISO date. Omit to leave unchanged. Pass `null` to clear. After this date the tariff is treated as expired and must be renewed.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note attached to the assignment.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"customPriceCzk":{"description":"Negotiated monthly price in WHOLE CZK. Omit to leave unchanged. Pass `null` to clear the override and fall back to catalogue minus discount. REQUIRED (and ≥ minCustomPriceCzk) for tariffs flagged `requiresCustomPrice` (Enterprise).","anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"description":"Subscription expiry as ISO date. Omit to leave unchanged. Pass `null` to clear. After this date the tariff is treated as expired and must be renewed.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note attached to the assignment.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"customPriceCzk":{"description":"Negotiated monthly price in WHOLE CZK. Omit to leave unchanged. Pass `null` to clear the override and fall back to catalogue minus discount. REQUIRED (and ≥ minCustomPriceCzk) for tariffs flagged `requiresCustomPrice` (Enterprise).","anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"description":"Subscription expiry as ISO date. Omit to leave unchanged. Pass `null` to clear. After this date the tariff is treated as expired and must be renewed.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Admin note attached to the assignment.","type":"string"}}}}}}}},"/bff/tariff/change":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"description":"False when nothing differed from the current state.","type":"boolean"},"tariffSwitched":{"description":"True when the plan itself changed.","type":"boolean"},"tariffCode":{"type":"string"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","changed","tariffSwitched","tariffCode","customPriceCzk","paidUntil"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"description":"False when nothing differed from the current state.","type":"boolean"},"tariffSwitched":{"description":"True when the plan itself changed.","type":"boolean"},"tariffCode":{"type":"string"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","changed","tariffSwitched","tariffCode","customPriceCzk","paidUntil"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"description":"False when nothing differed from the current state.","type":"boolean"},"tariffSwitched":{"description":"True when the plan itself changed.","type":"boolean"},"tariffCode":{"type":"string"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"paidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","changed","tariffSwitched","tariffCode","customPriceCzk","paidUntil"]}}}}},"operationId":"postBffTariffChange","tags":["Tariff"],"summary":"Change tariff + billing of a managed organisation (atomic)","description":"One-call tariff change for white-label partners (vendor of the target organisation) and internal admins: plan, negotiated price and paid-until are validated together and written in one `changeTariff` transaction (audited: ORG_TARIFF_CHG system log + activity). Enterprise without a price ≥ minimum is rejected up front. Discount and salesperson stay internal-admin only (/bff/admin/organisation-tariff-change).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug","tariffId"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["wabo-trade-s-r-o"],"type":"string"},"tariffId":{"description":"Tariff to assign. May equal the current one to edit price / paid-until only.","examples":[3],"type":"number"},"customPriceCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Negotiated monthly price in whole CZK. Required (≥ minCustomPriceCzk) for plans with `requiresCustomPrice` (Enterprise). Omit to keep; null clears it (catalogue price).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Negotiated monthly price in whole CZK. Required (≥ minCustomPriceCzk) for plans with `requiresCustomPrice` (Enterprise). Omit to keep; null clears it (catalogue price).","type":"integer"}]},{"type":"null"}]},"paidUntil":{"nullable":true,"anyOf":[{"description":"Paid-until / renewal date (ISO). Null clears it. Omit to keep.","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Note attached to the assignment.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug","tariffId"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["wabo-trade-s-r-o"],"type":"string"},"tariffId":{"description":"Tariff to assign. May equal the current one to edit price / paid-until only.","examples":[3],"type":"number"},"customPriceCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Negotiated monthly price in whole CZK. Required (≥ minCustomPriceCzk) for plans with `requiresCustomPrice` (Enterprise). Omit to keep; null clears it (catalogue price).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Negotiated monthly price in whole CZK. Required (≥ minCustomPriceCzk) for plans with `requiresCustomPrice` (Enterprise). Omit to keep; null clears it (catalogue price).","type":"integer"}]},{"type":"null"}]},"paidUntil":{"nullable":true,"anyOf":[{"description":"Paid-until / renewal date (ISO). Null clears it. Omit to keep.","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Note attached to the assignment.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug","tariffId"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["wabo-trade-s-r-o"],"type":"string"},"tariffId":{"description":"Tariff to assign. May equal the current one to edit price / paid-until only.","examples":[3],"type":"number"},"customPriceCzk":{"nullable":true,"anyOf":[{"minimum":0,"description":"Negotiated monthly price in whole CZK. Required (≥ minCustomPriceCzk) for plans with `requiresCustomPrice` (Enterprise). Omit to keep; null clears it (catalogue price).","anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"description":"Negotiated monthly price in whole CZK. Required (≥ minCustomPriceCzk) for plans with `requiresCustomPrice` (Enterprise). Omit to keep; null clears it (catalogue price).","type":"integer"}]},{"type":"null"}]},"paidUntil":{"nullable":true,"anyOf":[{"description":"Paid-until / renewal date (ISO). Null clears it. Omit to keep.","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"note":{"nullable":true,"anyOf":[{"maxLength":2000,"description":"Note attached to the assignment.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/tariff/set-discount":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffTariffSet-discount","tags":["Tariff","Admin"],"summary":"Set tariff discount (legacy — prefer /tariff/set-billing)","description":"Sets a discount or custom price override on an organisation tariff assignment. Kept for backwards compatibility. New integrations should use /tariff/set-billing.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"discountPercent":{"description":"Discount percentage (0-100).","examples":[10],"type":"number"},"customPriceOverride":{"description":"Custom price override in CZK (null to remove). Prefer /tariff/set-billing.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Admin note.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"discountPercent":{"description":"Discount percentage (0-100).","examples":[10],"type":"number"},"customPriceOverride":{"description":"Custom price override in CZK (null to remove). Prefer /tariff/set-billing.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Admin note.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the target organisation.","examples":["my-shop"],"type":"string"},"discountPercent":{"description":"Discount percentage (0-100).","examples":[10],"type":"number"},"customPriceOverride":{"description":"Custom price override in CZK (null to remove). Prefer /tariff/set-billing.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"Admin note.","type":"string"}}}}}}}},"/bff/tariff/seed-plans":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"plans":{"type":"array","items":{"type":"object","required":["id","code","inserted"],"properties":{"id":{"description":"Tariff ID assigned by the database.","type":"number"},"code":{"description":"Tariff code.","type":"string"},"inserted":{"description":"True if the row was newly inserted, false if updated.","type":"boolean"}}}}},"required":["plans"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"plans":{"type":"array","items":{"type":"object","required":["id","code","inserted"],"properties":{"id":{"description":"Tariff ID assigned by the database.","type":"number"},"code":{"description":"Tariff code.","type":"string"},"inserted":{"description":"True if the row was newly inserted, false if updated.","type":"boolean"}}}}},"required":["plans"]}},"text/plain":{"schema":{"type":"object","properties":{"plans":{"type":"array","items":{"type":"object","required":["id","code","inserted"],"properties":{"id":{"description":"Tariff ID assigned by the database.","type":"number"},"code":{"description":"Tariff code.","type":"string"},"inserted":{"description":"True if the row was newly inserted, false if updated.","type":"boolean"}}}}},"required":["plans"]}}}}},"operationId":"postBffTariffSeed-plans","tags":["Tariff","Admin"],"summary":"Seed standard tariff plans","description":"Idempotently inserts/updates the four standard plans (free, startup, business, enterprise) from features/tariff/tariffCatalogue.ts. Safe to re-run after editing the catalogue. Requires internal admin."}},"/bff/terminal/session":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"user":{"description":"Authenticated user info","type":"object","required":["id","name","role"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"Display name of the user","type":"string"},"role":{"description":"User role in the organisation","examples":["member","root"],"type":"string"}}},"tenant":{"description":"Current organisation context","type":"object","required":["id","name"],"properties":{"id":{"description":"Organisation ID","type":"string"},"name":{"description":"Organisation name","type":"string"}}},"cwd":{"description":"Initial working directory","examples":["/drive"],"type":"string"},"welcome":{"description":"Structured status payload rendered by the terminal welcome block","type":"object","required":["product","version","channel","build","sessionStartedAt","sessionId","memberEmail","memberRole","orgName","orgSlug","region","clientIp","docsUrl"],"properties":{"product":{"description":"Product name shown as header title","examples":["bizkithub terminal"],"type":"string"},"version":{"description":"Semantic version string","examples":["1.0.0"],"type":"string"},"channel":{"description":"Surface identifier for the terminal session","examples":["web"],"type":"string"},"build":{"description":"7-character commit short-hash (or \"dev\" outside deploys)","examples":["4f2a91c"],"type":"string"},"sessionStartedAt":{"description":"ISO 8601 UTC timestamp of session start","type":"string"},"sessionId":{"description":"Short session identifier for support tickets","examples":["sess_8ktz4"],"type":"string"},"memberEmail":{"description":"Email of the authenticated member","examples":["user@example.com"],"type":"string"},"memberRole":{"description":"Effective role (root if member has the root permission, else member)","anyOf":[{"const":"root","type":"string"},{"const":"member","type":"string"}]},"orgName":{"description":"Organisation display name","examples":["GymRoom"],"type":"string"},"orgSlug":{"description":"Organisation slug","examples":["gymroom"],"type":"string"},"region":{"description":"Vercel deployment region or \"local\"","examples":["fra1","local"],"type":"string"},"clientIp":{"description":"Resolved client IP address","examples":["94.112.57.122"],"type":"string"},"docsUrl":{"description":"Absolute URL to the terminal documentation","examples":["https://docs.bizkithub.com/terminal"],"type":"string"}}}},"required":["user","tenant","cwd","welcome"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"user":{"description":"Authenticated user info","type":"object","required":["id","name","role"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"Display name of the user","type":"string"},"role":{"description":"User role in the organisation","examples":["member","root"],"type":"string"}}},"tenant":{"description":"Current organisation context","type":"object","required":["id","name"],"properties":{"id":{"description":"Organisation ID","type":"string"},"name":{"description":"Organisation name","type":"string"}}},"cwd":{"description":"Initial working directory","examples":["/drive"],"type":"string"},"welcome":{"description":"Structured status payload rendered by the terminal welcome block","type":"object","required":["product","version","channel","build","sessionStartedAt","sessionId","memberEmail","memberRole","orgName","orgSlug","region","clientIp","docsUrl"],"properties":{"product":{"description":"Product name shown as header title","examples":["bizkithub terminal"],"type":"string"},"version":{"description":"Semantic version string","examples":["1.0.0"],"type":"string"},"channel":{"description":"Surface identifier for the terminal session","examples":["web"],"type":"string"},"build":{"description":"7-character commit short-hash (or \"dev\" outside deploys)","examples":["4f2a91c"],"type":"string"},"sessionStartedAt":{"description":"ISO 8601 UTC timestamp of session start","type":"string"},"sessionId":{"description":"Short session identifier for support tickets","examples":["sess_8ktz4"],"type":"string"},"memberEmail":{"description":"Email of the authenticated member","examples":["user@example.com"],"type":"string"},"memberRole":{"description":"Effective role (root if member has the root permission, else member)","anyOf":[{"const":"root","type":"string"},{"const":"member","type":"string"}]},"orgName":{"description":"Organisation display name","examples":["GymRoom"],"type":"string"},"orgSlug":{"description":"Organisation slug","examples":["gymroom"],"type":"string"},"region":{"description":"Vercel deployment region or \"local\"","examples":["fra1","local"],"type":"string"},"clientIp":{"description":"Resolved client IP address","examples":["94.112.57.122"],"type":"string"},"docsUrl":{"description":"Absolute URL to the terminal documentation","examples":["https://docs.bizkithub.com/terminal"],"type":"string"}}}},"required":["user","tenant","cwd","welcome"]}},"text/plain":{"schema":{"type":"object","properties":{"user":{"description":"Authenticated user info","type":"object","required":["id","name","role"],"properties":{"id":{"description":"User ID","type":"string"},"name":{"description":"Display name of the user","type":"string"},"role":{"description":"User role in the organisation","examples":["member","root"],"type":"string"}}},"tenant":{"description":"Current organisation context","type":"object","required":["id","name"],"properties":{"id":{"description":"Organisation ID","type":"string"},"name":{"description":"Organisation name","type":"string"}}},"cwd":{"description":"Initial working directory","examples":["/drive"],"type":"string"},"welcome":{"description":"Structured status payload rendered by the terminal welcome block","type":"object","required":["product","version","channel","build","sessionStartedAt","sessionId","memberEmail","memberRole","orgName","orgSlug","region","clientIp","docsUrl"],"properties":{"product":{"description":"Product name shown as header title","examples":["bizkithub terminal"],"type":"string"},"version":{"description":"Semantic version string","examples":["1.0.0"],"type":"string"},"channel":{"description":"Surface identifier for the terminal session","examples":["web"],"type":"string"},"build":{"description":"7-character commit short-hash (or \"dev\" outside deploys)","examples":["4f2a91c"],"type":"string"},"sessionStartedAt":{"description":"ISO 8601 UTC timestamp of session start","type":"string"},"sessionId":{"description":"Short session identifier for support tickets","examples":["sess_8ktz4"],"type":"string"},"memberEmail":{"description":"Email of the authenticated member","examples":["user@example.com"],"type":"string"},"memberRole":{"description":"Effective role (root if member has the root permission, else member)","anyOf":[{"const":"root","type":"string"},{"const":"member","type":"string"}]},"orgName":{"description":"Organisation display name","examples":["GymRoom"],"type":"string"},"orgSlug":{"description":"Organisation slug","examples":["gymroom"],"type":"string"},"region":{"description":"Vercel deployment region or \"local\"","examples":["fra1","local"],"type":"string"},"clientIp":{"description":"Resolved client IP address","examples":["94.112.57.122"],"type":"string"},"docsUrl":{"description":"Absolute URL to the terminal documentation","examples":["https://docs.bizkithub.com/terminal"],"type":"string"}}}},"required":["user","tenant","cwd","welcome"]}}}}},"operationId":"postBffTerminalSession","tags":["Terminal"],"summary":"Initialize terminal session"}},"/bff/terminal/execute":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}},"text/plain":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}}}}},"operationId":"postBffTerminalExecute","tags":["Terminal"],"summary":"Execute terminal command","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"input":{"description":"Command string to execute","examples":["ls -la"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["input"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"input":{"description":"Command string to execute","examples":["ls -la"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["input"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"input":{"description":"Command string to execute","examples":["ls -la"],"type":"string"}}}}}}}},"/bff/terminal/execute-stream":{"post":{"parameters":[],"operationId":"postBffTerminalExecute-stream","tags":["Terminal"],"summary":"Execute terminal command with SSE streaming","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"input":{"description":"Command string to execute","examples":["ls -la"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["input"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"input":{"description":"Command string to execute","examples":["ls -la"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["input"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"input":{"description":"Command string to execute","examples":["ls -la"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/terminal/interact":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}},"text/plain":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}}}}},"operationId":"postBffTerminalInteract","tags":["Terminal"],"summary":"Respond to interactive prompt","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["commandId","interactionId","value"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"commandId":{"description":"ID of the command awaiting input","type":"string"},"interactionId":{"description":"ID of the specific prompt to answer","type":"string"},"value":{"description":"User-provided response value","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["commandId","interactionId","value"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"commandId":{"description":"ID of the command awaiting input","type":"string"},"interactionId":{"description":"ID of the specific prompt to answer","type":"string"},"value":{"description":"User-provided response value","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"}]}}}},"text/plain":{"schema":{"type":"object","required":["commandId","interactionId","value"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"commandId":{"description":"ID of the command awaiting input","type":"string"},"interactionId":{"description":"ID of the specific prompt to answer","type":"string"},"value":{"description":"User-provided response value","anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"}]}}}}}}}},"/bff/terminal/cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}},"text/plain":{"schema":{"type":"object","properties":{"commandId":{"description":"Unique identifier of the executed command","type":"string"},"outputs":{"description":"List of output blocks produced by the command","type":"array","items":{"anyOf":[{"type":"object","required":["type","content","style"],"properties":{"type":{"description":"Output type discriminator","const":"text","type":"string"},"content":{"description":"Text content of the output line","type":"string"},"style":{"description":"Visual style applied to the text","anyOf":[{"const":"info","type":"string"},{"const":"success","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"},{"const":"muted","type":"string"}]}}},{"type":"object","required":["type","columns","rows","total"],"properties":{"type":{"description":"Output type discriminator","const":"table","type":"string"},"columns":{"description":"Column header names","type":"array","items":{"type":"string"}},"rows":{"description":"Table row data as string arrays","type":"array","items":{"type":"array","items":{"type":"string"}}},"total":{"description":"Total number of rows before truncation","type":"number"},"truncated":{"description":"Number of rows omitted due to truncation","type":"number"}}},{"type":"object","required":["type","interactionId","promptType","message"],"properties":{"type":{"description":"Output type discriminator","const":"prompt","type":"string"},"interactionId":{"description":"Unique ID for this interactive prompt","type":"string"},"promptType":{"description":"Type of user input expected","anyOf":[{"const":"confirm","type":"string"},{"const":"input","type":"string"},{"const":"select","type":"string"},{"const":"password","type":"string"}]},"message":{"description":"Prompt message displayed to the user","type":"string"},"default":{"description":"Default value for confirm prompts","type":"boolean"},"options":{"description":"Available choices for select prompts","type":"array","items":{"type":"string"}}}},{"type":"object","required":["type","current","total","label"],"properties":{"type":{"description":"Output type discriminator","const":"progress","type":"string"},"current":{"description":"Current progress value","type":"number"},"total":{"description":"Total progress value","type":"number"},"label":{"description":"Progress bar label","type":"string"}}},{"type":"object","required":["type","url","name","size"],"properties":{"type":{"description":"Output type discriminator","const":"file","type":"string"},"url":{"description":"Download URL for the file","type":"string"},"name":{"description":"File name","examples":["report.csv"],"type":"string"},"size":{"description":"File size in bytes","type":"number"}}},{"type":"object","required":["type","data"],"properties":{"type":{"description":"Output type discriminator","const":"json","type":"string"},"data":{"description":"Arbitrary JSON payload"}}},{"type":"object","required":["type","url","label"],"properties":{"type":{"description":"Output type discriminator","const":"redirect","type":"string"},"url":{"description":"Target URL to navigate to","type":"string"},"label":{"description":"Display label for the link","type":"string"}}}]}},"status":{"description":"Current execution status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"cwd":{"description":"Working directory after command execution","examples":["/drive"],"type":"string"},"duration":{"description":"Execution time in milliseconds","type":"number"}},"required":["commandId","outputs","status","cwd","duration"]}}}}},"operationId":"postBffTerminalCancel","tags":["Terminal"],"summary":"Cancel running command","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["commandId"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"commandId":{"description":"ID of the command to cancel","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["commandId"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"commandId":{"description":"ID of the command to cancel","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["commandId"],"properties":{"cwd":{"description":"Current working directory","examples":["/drive"],"type":"string"},"commandId":{"description":"ID of the command to cancel","type":"string"}}}}}}}},"/bff/terminal/suggest":{"get":{"parameters":[{"description":"Current input text in the terminal","examples":["ls -"],"schema":{"type":"string"},"in":"query","name":"input","required":true},{"description":"Cursor position index within the input","examples":["4"],"schema":{"type":"string"},"in":"query","name":"cursor","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"description":"Matching autocomplete suggestions","type":"array","items":{"type":"object","required":["value","label","type"],"properties":{"value":{"description":"Value to insert on completion","type":"string"},"label":{"description":"Display label for the suggestion","type":"string"},"type":{"description":"Category of the suggestion","anyOf":[{"const":"command","type":"string"},{"const":"subcommand","type":"string"},{"const":"param","type":"string"},{"const":"flag","type":"string"},{"const":"value","type":"string"},{"const":"path","type":"string"}]},"description":{"description":"Short help text for the suggestion","type":"string"},"completions":{"description":"Additional completion variants","type":"array","items":{"type":"string"}}}}},"context":{"description":"Parsed context of the input","type":"object","required":["currentToken"],"properties":{"command":{"description":"Detected command name","type":"string"},"subcommand":{"description":"Detected subcommand name","type":"string"},"currentToken":{"description":"Token currently being typed","type":"string"}}}},"required":["suggestions","context"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"suggestions":{"description":"Matching autocomplete suggestions","type":"array","items":{"type":"object","required":["value","label","type"],"properties":{"value":{"description":"Value to insert on completion","type":"string"},"label":{"description":"Display label for the suggestion","type":"string"},"type":{"description":"Category of the suggestion","anyOf":[{"const":"command","type":"string"},{"const":"subcommand","type":"string"},{"const":"param","type":"string"},{"const":"flag","type":"string"},{"const":"value","type":"string"},{"const":"path","type":"string"}]},"description":{"description":"Short help text for the suggestion","type":"string"},"completions":{"description":"Additional completion variants","type":"array","items":{"type":"string"}}}}},"context":{"description":"Parsed context of the input","type":"object","required":["currentToken"],"properties":{"command":{"description":"Detected command name","type":"string"},"subcommand":{"description":"Detected subcommand name","type":"string"},"currentToken":{"description":"Token currently being typed","type":"string"}}}},"required":["suggestions","context"]}},"text/plain":{"schema":{"type":"object","properties":{"suggestions":{"description":"Matching autocomplete suggestions","type":"array","items":{"type":"object","required":["value","label","type"],"properties":{"value":{"description":"Value to insert on completion","type":"string"},"label":{"description":"Display label for the suggestion","type":"string"},"type":{"description":"Category of the suggestion","anyOf":[{"const":"command","type":"string"},{"const":"subcommand","type":"string"},{"const":"param","type":"string"},{"const":"flag","type":"string"},{"const":"value","type":"string"},{"const":"path","type":"string"}]},"description":{"description":"Short help text for the suggestion","type":"string"},"completions":{"description":"Additional completion variants","type":"array","items":{"type":"string"}}}}},"context":{"description":"Parsed context of the input","type":"object","required":["currentToken"],"properties":{"command":{"description":"Detected command name","type":"string"},"subcommand":{"description":"Detected subcommand name","type":"string"},"currentToken":{"description":"Token currently being typed","type":"string"}}}},"required":["suggestions","context"]}}}}},"operationId":"getBffTerminalSuggest","tags":["Terminal"],"summary":"Get autocomplete suggestions"}},"/bff/terminal/commands":{"get":{"operationId":"getBffTerminalCommands","tags":["Terminal"],"summary":"Get available commands","responses":{"200":{}}}},"/bff/terminal/history":{"get":{"parameters":[{"description":"Maximum number of items to return","examples":["20"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Number of items to skip","examples":["0"],"schema":{"type":"string"},"in":"query","name":"offset","required":false},{"description":"Filter history by command text","schema":{"type":"string"},"in":"query","name":"search","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"History entries","type":"array","items":{"type":"object","required":["id","input","timestamp","status","duration"],"properties":{"id":{"description":"History entry ID","type":"string"},"input":{"description":"Executed command string","type":"string"},"timestamp":{"description":"ISO 8601 timestamp of execution","type":"string"},"status":{"description":"Final status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"duration":{"description":"Execution time in milliseconds","type":"number"}}}},"total":{"description":"Total number of matching entries","type":"number"},"limit":{"description":"Applied page size limit","type":"number"},"offset":{"description":"Applied offset","type":"number"}},"required":["items","total","limit","offset"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"History entries","type":"array","items":{"type":"object","required":["id","input","timestamp","status","duration"],"properties":{"id":{"description":"History entry ID","type":"string"},"input":{"description":"Executed command string","type":"string"},"timestamp":{"description":"ISO 8601 timestamp of execution","type":"string"},"status":{"description":"Final status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"duration":{"description":"Execution time in milliseconds","type":"number"}}}},"total":{"description":"Total number of matching entries","type":"number"},"limit":{"description":"Applied page size limit","type":"number"},"offset":{"description":"Applied offset","type":"number"}},"required":["items","total","limit","offset"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"History entries","type":"array","items":{"type":"object","required":["id","input","timestamp","status","duration"],"properties":{"id":{"description":"History entry ID","type":"string"},"input":{"description":"Executed command string","type":"string"},"timestamp":{"description":"ISO 8601 timestamp of execution","type":"string"},"status":{"description":"Final status of the command","anyOf":[{"const":"done","type":"string"},{"const":"awaiting_input","type":"string"},{"const":"running","type":"string"},{"const":"cancelled","type":"string"}]},"duration":{"description":"Execution time in milliseconds","type":"number"}}}},"total":{"description":"Total number of matching entries","type":"number"},"limit":{"description":"Applied page size limit","type":"number"},"offset":{"description":"Applied offset","type":"number"}},"required":["items","total","limit","offset"]}}}}},"operationId":"getBffTerminalHistory","tags":["Terminal"],"summary":"Get command history"},"delete":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"description":"Number of entries deleted","type":"number"}},"required":["deleted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"deleted":{"description":"Number of entries deleted","type":"number"}},"required":["deleted"]}},"text/plain":{"schema":{"type":"object","properties":{"deleted":{"description":"Number of entries deleted","type":"number"}},"required":["deleted"]}}}}},"operationId":"deleteBffTerminalHistory","tags":["Terminal"],"summary":"Clear command history","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"description":"IDs of specific entries to delete; omit to clear all","type":"array","items":{"description":"History entry ID","type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"ids":{"description":"IDs of specific entries to delete; omit to clear all","type":"array","items":{"description":"History entry ID","type":"string"}}}}},"text/plain":{"schema":{"type":"object","properties":{"ids":{"description":"IDs of specific entries to delete; omit to clear all","type":"array","items":{"description":"History entry ID","type":"string"}}}}}}}}},"/bff/terminal/aliases":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"aliases":{"description":"List of user-defined aliases","type":"array","items":{"type":"object","required":["name","command","createdAt"],"properties":{"name":{"description":"Alias name","examples":["ll"],"type":"string"},"command":{"description":"Command the alias expands to","examples":["ls -la"],"type":"string"},"createdAt":{"description":"ISO 8601 creation timestamp","type":"string"}}}}},"required":["aliases"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"aliases":{"description":"List of user-defined aliases","type":"array","items":{"type":"object","required":["name","command","createdAt"],"properties":{"name":{"description":"Alias name","examples":["ll"],"type":"string"},"command":{"description":"Command the alias expands to","examples":["ls -la"],"type":"string"},"createdAt":{"description":"ISO 8601 creation timestamp","type":"string"}}}}},"required":["aliases"]}},"text/plain":{"schema":{"type":"object","properties":{"aliases":{"description":"List of user-defined aliases","type":"array","items":{"type":"object","required":["name","command","createdAt"],"properties":{"name":{"description":"Alias name","examples":["ll"],"type":"string"},"command":{"description":"Command the alias expands to","examples":["ls -la"],"type":"string"},"createdAt":{"description":"ISO 8601 creation timestamp","type":"string"}}}}},"required":["aliases"]}}}}},"operationId":"getBffTerminalAliases","tags":["Terminal"],"summary":"Get user aliases"},"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"alias":{"description":"The created or updated alias","type":"object","required":["name","command","createdAt"],"properties":{"name":{"description":"Alias name","type":"string"},"command":{"description":"Command the alias expands to","type":"string"},"createdAt":{"description":"ISO 8601 creation timestamp","type":"string"}}},"created":{"description":"True if a new alias was created, false if an existing one was updated","type":"boolean"}},"required":["alias","created"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"alias":{"description":"The created or updated alias","type":"object","required":["name","command","createdAt"],"properties":{"name":{"description":"Alias name","type":"string"},"command":{"description":"Command the alias expands to","type":"string"},"createdAt":{"description":"ISO 8601 creation timestamp","type":"string"}}},"created":{"description":"True if a new alias was created, false if an existing one was updated","type":"boolean"}},"required":["alias","created"]}},"text/plain":{"schema":{"type":"object","properties":{"alias":{"description":"The created or updated alias","type":"object","required":["name","command","createdAt"],"properties":{"name":{"description":"Alias name","type":"string"},"command":{"description":"Command the alias expands to","type":"string"},"createdAt":{"description":"ISO 8601 creation timestamp","type":"string"}}},"created":{"description":"True if a new alias was created, false if an existing one was updated","type":"boolean"}},"required":["alias","created"]}}}}},"operationId":"postBffTerminalAliases","tags":["Terminal"],"summary":"Create or update alias","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","command"],"properties":{"name":{"description":"Alias name","examples":["ll"],"type":"string"},"command":{"description":"Command the alias should expand to","examples":["ls -la"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["name","command"],"properties":{"name":{"description":"Alias name","examples":["ll"],"type":"string"},"command":{"description":"Command the alias should expand to","examples":["ls -la"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["name","command"],"properties":{"name":{"description":"Alias name","examples":["ll"],"type":"string"},"command":{"description":"Command the alias should expand to","examples":["ls -la"],"type":"string"}}}}}}},"delete":{"parameters":[{"description":"Name of the alias to delete","examples":["ll"],"schema":{"type":"string"},"in":"query","name":"name","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"description":"True if the alias existed and was removed","type":"boolean"}},"required":["deleted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"deleted":{"description":"True if the alias existed and was removed","type":"boolean"}},"required":["deleted"]}},"text/plain":{"schema":{"type":"object","properties":{"deleted":{"description":"True if the alias existed and was removed","type":"boolean"}},"required":["deleted"]}}}}},"operationId":"deleteBffTerminalAliases","tags":["Terminal"],"summary":"Delete alias"}},"/bff/time-tracker/running":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"running":{"anyOf":[{"type":"null"},{"type":"object","required":["id","note","startedAt"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"}}}]}},"required":["running"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"running":{"anyOf":[{"type":"null"},{"type":"object","required":["id","note","startedAt"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"}}}]}},"required":["running"]}},"text/plain":{"schema":{"type":"object","properties":{"running":{"anyOf":[{"type":"null"},{"type":"object","required":["id","note","startedAt"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"}}}]}},"required":["running"]}}}}},"operationId":"getBffTime-trackerRunning","tags":["TimeTracker"],"summary":"Currently running stopwatch entry","description":"Returns the running entry for the authenticated member, or null."}},"/bff/time-tracker/list":{"get":{"parameters":[{"description":"'mine' (default) or 'org' for the agency-wide view.","schema":{"type":"string"},"in":"query","name":"scope","required":false},{"schema":{"type":"string"},"in":"query","name":"memberId","required":false},{"description":"Inclusive lower bound for work_date (YYYY-MM-DD).","schema":{"type":"string"},"in":"query","name":"from","required":false},{"description":"Inclusive upper bound for work_date (YYYY-MM-DD).","schema":{"type":"string"},"in":"query","name":"to","required":false},{"schema":{"type":"string"},"in":"query","name":"projectId","required":false},{"description":"'true' / 'false' — filter by billable flag.","schema":{"type":"string"},"in":"query","name":"billable","required":false},{"description":"'true' / 'false' — filter by write_off flag.","schema":{"type":"string"},"in":"query","name":"writeOff","required":false},{"description":"'invoiced' | 'wip' | 'all'.","schema":{"type":"string"},"in":"query","name":"invoiceStatus","required":false},{"description":"DataGrid fulltext over note, client note, project name/key and member name.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffTime-trackerList","tags":["TimeTracker"],"summary":"List time entries","description":"Paginated list with filters. Personal scope by default; org scope for the team report. `totalDurationMs` sums every entry matching the filters, across all pages.","responses":{"200":{}}}},"/bff/time-tracker/start":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"running":{"type":"object","required":["id","note","startedAt"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"}}}},"required":["running"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"running":{"type":"object","required":["id","note","startedAt"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"}}}},"required":["running"]}},"text/plain":{"schema":{"type":"object","properties":{"running":{"type":"object","required":["id","note","startedAt"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"}}}},"required":["running"]}}}}},"operationId":"postBffTime-trackerStart","tags":["TimeTracker"],"summary":"Start a stopwatch measurement","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"description":"Optional free-form note. Trimmed; empty strings are stored as null.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"note":{"description":"Optional free-form note. Trimmed; empty strings are stored as null.","type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"note":{"description":"Optional free-form note. Trimmed; empty strings are stored as null.","type":"string"}}}}}}}},"/bff/time-tracker/stop":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"stopped":{"anyOf":[{"type":"null"},{"type":"object","required":["id","note","startedAt","stoppedAt","durationMs"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"stoppedAt":{"type":"string"},"durationMs":{"type":"number"}}}]}},"required":["stopped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"stopped":{"anyOf":[{"type":"null"},{"type":"object","required":["id","note","startedAt","stoppedAt","durationMs"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"stoppedAt":{"type":"string"},"durationMs":{"type":"number"}}}]}},"required":["stopped"]}},"text/plain":{"schema":{"type":"object","properties":{"stopped":{"anyOf":[{"type":"null"},{"type":"object","required":["id","note","startedAt","stoppedAt","durationMs"],"properties":{"id":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"type":"string"},"stoppedAt":{"type":"string"},"durationMs":{"type":"number"}}}]}},"required":["stopped"]}}}}},"operationId":"postBffTime-trackerStop","tags":["TimeTracker"],"summary":"Stop a stopwatch measurement","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"note":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"},"note":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"},"note":{"type":"string"}}}}}}}},"/bff/time-tracker/write":{"post":{"parameters":[],"operationId":"postBffTime-trackerWrite","tags":["TimeTracker"],"summary":"Create a manual time entry","description":"Logs work by day and minutes, with optional project link and billing fields. Snapshots the rate at create time.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workDate","minutes"],"properties":{"workDate":{"description":"ISO date (YYYY-MM-DD) the work is booked into.","type":"string"},"minutes":{"description":"Total minutes for this entry (1–1440).","type":"number"},"memberId":{"description":"Defaults to the authenticated member.","type":"number"},"projectId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"billable":{"type":"boolean"},"writeOff":{"type":"boolean"},"writeOffReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["workDate","minutes"],"properties":{"workDate":{"description":"ISO date (YYYY-MM-DD) the work is booked into.","type":"string"},"minutes":{"description":"Total minutes for this entry (1–1440).","type":"number"},"memberId":{"description":"Defaults to the authenticated member.","type":"number"},"projectId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"billable":{"type":"boolean"},"writeOff":{"type":"boolean"},"writeOffReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["workDate","minutes"],"properties":{"workDate":{"description":"ISO date (YYYY-MM-DD) the work is booked into.","type":"string"},"minutes":{"description":"Total minutes for this entry (1–1440).","type":"number"},"memberId":{"description":"Defaults to the authenticated member.","type":"number"},"projectId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"billable":{"type":"boolean"},"writeOff":{"type":"boolean"},"writeOffReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/time-tracker/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"operationId":"patchBffTime-trackerById","tags":["TimeTracker"],"summary":"Update a time entry","description":"Edit any field. Refuses when the entry is already invoiced or in a locked period.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"anyOf":[{"type":"number"},{"type":"null"}]},"workDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"minutes":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"billable":{"type":"boolean"},"writeOff":{"type":"boolean"},"writeOffReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"projectId":{"anyOf":[{"type":"number"},{"type":"null"}]},"workDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"minutes":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"billable":{"type":"boolean"},"writeOff":{"type":"boolean"},"writeOffReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"projectId":{"anyOf":[{"type":"number"},{"type":"null"}]},"workDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"minutes":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"billable":{"type":"boolean"},"writeOff":{"type":"boolean"},"writeOffReason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}},"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}},"text/plain":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}},"operationId":"deleteBffTime-trackerById","tags":["TimeTracker"],"summary":"Delete a time entry (only when not invoiced)."}},"/bff/project/list":{"get":{"parameters":[{"description":"Fulltext over name / slug / project_key.","schema":{"type":"string"},"in":"query","name":"q","required":false},{"description":"DataGrid fulltext (same as `q`).","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"`active` (no end date or end date in the future), `archived` (end date passed), `all` (default).","schema":{"anyOf":[{"const":"active","type":"string"},{"const":"archived","type":"string"},{"const":"all","type":"string"}]},"in":"query","name":"state","required":false}],"operationId":"getBffProjectList","tags":["Project"],"summary":"List projects with WIP roll-up","responses":{"200":{}}}},"/bff/project/{id}":{"get":{"parameters":[{"description":"Project `externalId` (16 chars). A legacy numeric id is still accepted.","schema":{"type":"string"},"in":"path","name":"id","required":true}],"operationId":"getBffProjectById","tags":["Project"],"summary":"Project detail","responses":{"200":{}}},"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}},"text/plain":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}},"operationId":"deleteBffProjectById","tags":["Project"],"summary":"Delete a project (refused when issues or time entries reference it)."}},"/bff/project/write":{"post":{"parameters":[],"operationId":"postBffProjectWrite","tags":["Project"],"summary":"Create or update a project","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"When set, updates this row; otherwise creates a new project.","type":"number"},"name":{"description":"Optional display name. Empty = the project key is shown alone (and stored as the name).","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"projectKey":{"type":"string"},"managerId":{"type":"number"},"projectOwnerId":{"type":"number"},"priority":{"type":"number"},"budget":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"anyOf":[{"description":"Chip accent `#rrggbb`. Empty string clears it.","examples":["#3b82f6"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"When set, updates this row; otherwise creates a new project.","type":"number"},"name":{"description":"Optional display name. Empty = the project key is shown alone (and stored as the name).","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"projectKey":{"type":"string"},"managerId":{"type":"number"},"projectOwnerId":{"type":"number"},"priority":{"type":"number"},"budget":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"anyOf":[{"description":"Chip accent `#rrggbb`. Empty string clears it.","examples":["#3b82f6"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"When set, updates this row; otherwise creates a new project.","type":"number"},"name":{"description":"Optional display name. Empty = the project key is shown alone (and stored as the name).","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"slug":{"type":"string"},"projectKey":{"type":"string"},"managerId":{"type":"number"},"projectOwnerId":{"type":"number"},"priority":{"type":"number"},"budget":{"anyOf":[{"type":"string"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"color":{"anyOf":[{"description":"Chip accent `#rrggbb`. Empty string clears it.","examples":["#3b82f6"],"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/project/{id}/set-auto-close-waiting":{"post":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"autoCloseWaitingAfterDays":{"type":"number"}},"required":["success","autoCloseWaitingAfterDays"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"autoCloseWaitingAfterDays":{"type":"number"}},"required":["success","autoCloseWaitingAfterDays"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"autoCloseWaitingAfterDays":{"type":"number"}},"required":["success","autoCloseWaitingAfterDays"]}}}}},"operationId":"postBffProjectByIdSet-auto-close-waiting","tags":["Project"],"summary":"Set the \"auto-close waiting\" threshold for a project","description":"Updates only `cas__organisation_project.auto_close_waiting_after_days`. The `/cron/sync-low-priority-jobs` tier sweep (`syncAutoCloseWaitingIssues`) closes every issue on projects where this value is > 0 whose current status is in the `waiting` category and whose `updated_date` is older than the threshold. `0` (default) disables the sweep.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["autoCloseWaitingAfterDays"],"properties":{"autoCloseWaitingAfterDays":{"minimum":0,"maximum":365,"description":"Number of days a `waiting`-category issue must stay untouched before the low-priority cron closes it. `0` disables the sweep for this project.","examples":[0,7,14],"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["autoCloseWaitingAfterDays"],"properties":{"autoCloseWaitingAfterDays":{"minimum":0,"maximum":365,"description":"Number of days a `waiting`-category issue must stay untouched before the low-priority cron closes it. `0` disables the sweep for this project.","examples":[0,7,14],"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["autoCloseWaitingAfterDays"],"properties":{"autoCloseWaitingAfterDays":{"minimum":0,"maximum":365,"description":"Number of days a `waiting`-category issue must stay untouched before the low-priority cron closes it. `0` disables the sweep for this project.","examples":[0,7,14],"type":"number"}}}}}}}},"/bff/project-rate/list":{"get":{"parameters":[{"description":"Scope to one project.","schema":{"type":"string"},"in":"query","name":"projectId","required":false}],"operationId":"getBffProject-rateList","tags":["ProjectRate"],"summary":"List project-rate windows","responses":{"200":{}}}},"/bff/project-rate/write":{"post":{"parameters":[],"operationId":"postBffProject-rateWrite","tags":["ProjectRate"],"summary":"Create or update a project-rate window","description":"Validity windows must not overlap per (organisation, project). Overlap returns a 400 with guidance.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","validFrom"],"properties":{"id":{"type":"number"},"projectId":{"type":"number"},"costRatePerHour":{"anyOf":[{"type":"number"},{"type":"null"}]},"billingRatePerHour":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"},"billingMode":{"type":"string"},"fixedPriceAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"billingIncrementMinutes":{"type":"number"},"roundingPolicy":{"type":"string"},"validFrom":{"description":"Inclusive lower bound (YYYY-MM-DD).","type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["projectId","validFrom"],"properties":{"id":{"type":"number"},"projectId":{"type":"number"},"costRatePerHour":{"anyOf":[{"type":"number"},{"type":"null"}]},"billingRatePerHour":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"},"billingMode":{"type":"string"},"fixedPriceAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"billingIncrementMinutes":{"type":"number"},"roundingPolicy":{"type":"string"},"validFrom":{"description":"Inclusive lower bound (YYYY-MM-DD).","type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["projectId","validFrom"],"properties":{"id":{"type":"number"},"projectId":{"type":"number"},"costRatePerHour":{"anyOf":[{"type":"number"},{"type":"null"}]},"billingRatePerHour":{"anyOf":[{"type":"number"},{"type":"null"}]},"currency":{"type":"string"},"billingMode":{"type":"string"},"fixedPriceAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"billingIncrementMinutes":{"type":"number"},"roundingPolicy":{"type":"string"},"validFrom":{"description":"Inclusive lower bound (YYYY-MM-DD).","type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/project-rate/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}},"text/plain":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}},"operationId":"deleteBffProject-rateById","tags":["ProjectRate"],"summary":"Delete a project-rate window."}},"/bff/project-rate/generate-invoice-from-time":{"post":{"parameters":[],"operationId":"postBffProject-rateGenerate-invoice-from-time","tags":["ProjectRate","Invoice"],"summary":"Generate invoice from billable time","description":"Locks billable, unbilled time entries within the range, rounds per project rate policy, creates an invoice + items, and attaches each line back to the entries it consumed. Reversing the invoice (delete) returns the entries to WIP automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","from","to"],"properties":{"projectId":{"type":"number"},"customerContactId":{"description":"The shop__contact row to bill (numeric id).","type":"number"},"customerExternalId":{"description":"The shop__contact row to bill, by external id (CuRefNo). Used when `customerContactId` is absent.","type":"string"},"from":{"description":"Inclusive lower bound (YYYY-MM-DD).","type":"string"},"to":{"description":"Inclusive upper bound (YYYY-MM-DD).","type":"string"},"groupBy":{"description":"'flat' (one item) or 'day' (item per work_date).","type":"string"},"vatRate":{"description":"Override VAT percent; defaults from org VAT-payer flag.","type":"number"},"publicNotice":{"description":"Free-form text shown to the customer.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["projectId","from","to"],"properties":{"projectId":{"type":"number"},"customerContactId":{"description":"The shop__contact row to bill (numeric id).","type":"number"},"customerExternalId":{"description":"The shop__contact row to bill, by external id (CuRefNo). Used when `customerContactId` is absent.","type":"string"},"from":{"description":"Inclusive lower bound (YYYY-MM-DD).","type":"string"},"to":{"description":"Inclusive upper bound (YYYY-MM-DD).","type":"string"},"groupBy":{"description":"'flat' (one item) or 'day' (item per work_date).","type":"string"},"vatRate":{"description":"Override VAT percent; defaults from org VAT-payer flag.","type":"number"},"publicNotice":{"description":"Free-form text shown to the customer.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["projectId","from","to"],"properties":{"projectId":{"type":"number"},"customerContactId":{"description":"The shop__contact row to bill (numeric id).","type":"number"},"customerExternalId":{"description":"The shop__contact row to bill, by external id (CuRefNo). Used when `customerContactId` is absent.","type":"string"},"from":{"description":"Inclusive lower bound (YYYY-MM-DD).","type":"string"},"to":{"description":"Inclusive upper bound (YYYY-MM-DD).","type":"string"},"groupBy":{"description":"'flat' (one item) or 'day' (item per work_date).","type":"string"},"vatRate":{"description":"Override VAT percent; defaults from org VAT-payer flag.","type":"number"},"publicNotice":{"description":"Free-form text shown to the customer.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/translate/text":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"translated":{"description":"The translated text","type":"string"}},"required":["translated"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"translated":{"description":"The translated text","type":"string"}},"required":["translated"]}},"text/plain":{"schema":{"type":"object","properties":{"translated":{"description":"The translated text","type":"string"}},"required":["translated"]}}}}},"operationId":"postBffTranslateText","tags":["Translate"],"summary":"Translate text to a target language","description":"Translates the given text to the target locale using AI. Source locale is auto-detected if not provided. Token usage is tracked per organisation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text","targetLocale"],"properties":{"text":{"maxLength":20000,"description":"The text to translate.","examples":["Dobrý den"],"type":"string"},"targetLocale":{"description":"Target locale code (e.g. \"en\", \"de\", \"cs\").","examples":["en"],"type":"string"},"sourceLocale":{"description":"Source locale code. If omitted, the language is auto-detected.","examples":["cs"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["text","targetLocale"],"properties":{"text":{"maxLength":20000,"description":"The text to translate.","examples":["Dobrý den"],"type":"string"},"targetLocale":{"description":"Target locale code (e.g. \"en\", \"de\", \"cs\").","examples":["en"],"type":"string"},"sourceLocale":{"description":"Source locale code. If omitted, the language is auto-detected.","examples":["cs"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["text","targetLocale"],"properties":{"text":{"maxLength":20000,"description":"The text to translate.","examples":["Dobrý den"],"type":"string"},"targetLocale":{"description":"Target locale code (e.g. \"en\", \"de\", \"cs\").","examples":["en"],"type":"string"},"sourceLocale":{"description":"Source locale code. If omitted, the language is auto-detected.","examples":["cs"],"type":"string"}}}}}}}},"/bff/transaction/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Filter transactions linked to a specific order.","examples":["abc123"],"schema":{"type":"string"},"in":"query","name":"orderHash","required":false},{"description":"Filter by bank account external ID.","examples":["2000123456"],"schema":{"type":"string"},"in":"query","name":"filterAccount","required":false}],"responses":{"200":{"description":"Paginated list of bank transactions.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Bank transaction record.","type":"object","required":["id","date","price"],"properties":{"id":{"description":"Bank transaction ID (unique within the bank).","type":"string"},"date":{"description":"Transaction date.","anyOf":[{"description":"Transaction date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"price":{"description":"Transaction amount. Positive = incoming, negative = outgoing.","type":"object","required":["priceWithoutVat","priceWithVat","vat","currency","currencyLocale"],"properties":{"priceWithoutVat":{"description":"Amount without VAT.","type":"number"},"priceWithVat":{"description":"Amount with VAT (the actual transferred amount).","type":"number"},"vat":{"description":"VAT amount.","type":"number"},"currency":{"description":"Currency code (e.g., \"CZK\").","type":"string"},"currencyLocale":{"description":"Locale string for currency formatting.","type":"string"}}},"toAccount":{"description":"Counterparty account number.","type":"string"},"toAccountName":{"description":"Counterparty account holder name.","type":"string"},"toBankCode":{"description":"Counterparty bank code.","type":"number"},"toBankName":{"description":"Counterparty bank name.","type":"string"},"constantSymbol":{"description":"Constant symbol (KS).","type":"number"},"variableSymbol":{"description":"Variable symbol (VS) - used for order matching.","type":"number"},"specificSymbol":{"description":"Specific symbol (SS).","type":"number"},"userNotice":{"description":"Notice for the recipient.","type":"string"},"toMessage":{"description":"Message for the recipient.","type":"string"},"type":{"description":"Raw transaction type from the bank.","type":"string"},"sender":{"description":"Sender identification.","type":"string"},"message":{"description":"Transaction message.","type":"string"},"comment":{"description":"Internal comment.","type":"string"},"bic":{"description":"Counterparty BIC/SWIFT code.","type":"string"},"idTransaction":{"description":"Internal transaction reference number.","type":"number"},"orderHash":{"description":"Matched order hash (for linking to order detail).","type":"string"},"orderNumber":{"description":"Matched order number.","type":"string"},"orderGroup":{"description":"Order group name.","type":"string"},"typeCode":{"description":"Transaction category code.","type":"string"},"typeLabel":{"description":"Transaction category label.","type":"string"},"typeColor":{"description":"Transaction category hex color.","type":"string"}}}},"itemCount":{"description":"Total number of transactions matching the filter (before pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Bank transaction record.","type":"object","required":["id","date","price"],"properties":{"id":{"description":"Bank transaction ID (unique within the bank).","type":"string"},"date":{"description":"Transaction date.","anyOf":[{"description":"Transaction date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"price":{"description":"Transaction amount. Positive = incoming, negative = outgoing.","type":"object","required":["priceWithoutVat","priceWithVat","vat","currency","currencyLocale"],"properties":{"priceWithoutVat":{"description":"Amount without VAT.","type":"number"},"priceWithVat":{"description":"Amount with VAT (the actual transferred amount).","type":"number"},"vat":{"description":"VAT amount.","type":"number"},"currency":{"description":"Currency code (e.g., \"CZK\").","type":"string"},"currencyLocale":{"description":"Locale string for currency formatting.","type":"string"}}},"toAccount":{"description":"Counterparty account number.","type":"string"},"toAccountName":{"description":"Counterparty account holder name.","type":"string"},"toBankCode":{"description":"Counterparty bank code.","type":"number"},"toBankName":{"description":"Counterparty bank name.","type":"string"},"constantSymbol":{"description":"Constant symbol (KS).","type":"number"},"variableSymbol":{"description":"Variable symbol (VS) - used for order matching.","type":"number"},"specificSymbol":{"description":"Specific symbol (SS).","type":"number"},"userNotice":{"description":"Notice for the recipient.","type":"string"},"toMessage":{"description":"Message for the recipient.","type":"string"},"type":{"description":"Raw transaction type from the bank.","type":"string"},"sender":{"description":"Sender identification.","type":"string"},"message":{"description":"Transaction message.","type":"string"},"comment":{"description":"Internal comment.","type":"string"},"bic":{"description":"Counterparty BIC/SWIFT code.","type":"string"},"idTransaction":{"description":"Internal transaction reference number.","type":"number"},"orderHash":{"description":"Matched order hash (for linking to order detail).","type":"string"},"orderNumber":{"description":"Matched order number.","type":"string"},"orderGroup":{"description":"Order group name.","type":"string"},"typeCode":{"description":"Transaction category code.","type":"string"},"typeLabel":{"description":"Transaction category label.","type":"string"},"typeColor":{"description":"Transaction category hex color.","type":"string"}}}},"itemCount":{"description":"Total number of transactions matching the filter (before pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Bank transaction record.","type":"object","required":["id","date","price"],"properties":{"id":{"description":"Bank transaction ID (unique within the bank).","type":"string"},"date":{"description":"Transaction date.","anyOf":[{"description":"Transaction date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"price":{"description":"Transaction amount. Positive = incoming, negative = outgoing.","type":"object","required":["priceWithoutVat","priceWithVat","vat","currency","currencyLocale"],"properties":{"priceWithoutVat":{"description":"Amount without VAT.","type":"number"},"priceWithVat":{"description":"Amount with VAT (the actual transferred amount).","type":"number"},"vat":{"description":"VAT amount.","type":"number"},"currency":{"description":"Currency code (e.g., \"CZK\").","type":"string"},"currencyLocale":{"description":"Locale string for currency formatting.","type":"string"}}},"toAccount":{"description":"Counterparty account number.","type":"string"},"toAccountName":{"description":"Counterparty account holder name.","type":"string"},"toBankCode":{"description":"Counterparty bank code.","type":"number"},"toBankName":{"description":"Counterparty bank name.","type":"string"},"constantSymbol":{"description":"Constant symbol (KS).","type":"number"},"variableSymbol":{"description":"Variable symbol (VS) - used for order matching.","type":"number"},"specificSymbol":{"description":"Specific symbol (SS).","type":"number"},"userNotice":{"description":"Notice for the recipient.","type":"string"},"toMessage":{"description":"Message for the recipient.","type":"string"},"type":{"description":"Raw transaction type from the bank.","type":"string"},"sender":{"description":"Sender identification.","type":"string"},"message":{"description":"Transaction message.","type":"string"},"comment":{"description":"Internal comment.","type":"string"},"bic":{"description":"Counterparty BIC/SWIFT code.","type":"string"},"idTransaction":{"description":"Internal transaction reference number.","type":"number"},"orderHash":{"description":"Matched order hash (for linking to order detail).","type":"string"},"orderNumber":{"description":"Matched order number.","type":"string"},"orderGroup":{"description":"Order group name.","type":"string"},"typeCode":{"description":"Transaction category code.","type":"string"},"typeLabel":{"description":"Transaction category label.","type":"string"},"typeColor":{"description":"Transaction category hex color.","type":"string"}}}},"itemCount":{"description":"Total number of transactions matching the filter (before pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffTransactionList","tags":["Transaction"],"summary":"List bank transactions","description":"Returns a paginated list of bank transactions. Supports filtering by order and bank account. Includes matched order info and transaction category when available."}},"/bff/transaction/category-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Transaction category with aggregated financial data.","type":"object","required":["category_code","category_label","currency","color","total_income","total_expense","transaction_count","net_total"],"properties":{"category_code":{"description":"Category code identifier.","type":"string"},"category_label":{"description":"Category display label.","type":"string"},"currency":{"description":"Currency code (e.g., \"CZK\").","type":"string"},"color":{"description":"Category hex color (e.g., \"#FF5733\").","type":"string"},"total_income":{"description":"Sum of all incoming transactions in this category.","type":"number"},"total_expense":{"description":"Sum of all outgoing transactions in this category.","type":"number"},"transaction_count":{"description":"Number of transactions in this category.","type":"number"},"net_total":{"description":"Net total (income + expense). Negative if expense > income.","type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Transaction category with aggregated financial data.","type":"object","required":["category_code","category_label","currency","color","total_income","total_expense","transaction_count","net_total"],"properties":{"category_code":{"description":"Category code identifier.","type":"string"},"category_label":{"description":"Category display label.","type":"string"},"currency":{"description":"Currency code (e.g., \"CZK\").","type":"string"},"color":{"description":"Category hex color (e.g., \"#FF5733\").","type":"string"},"total_income":{"description":"Sum of all incoming transactions in this category.","type":"number"},"total_expense":{"description":"Sum of all outgoing transactions in this category.","type":"number"},"transaction_count":{"description":"Number of transactions in this category.","type":"number"},"net_total":{"description":"Net total (income + expense). Negative if expense > income.","type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"description":"Transaction category with aggregated financial data.","type":"object","required":["category_code","category_label","currency","color","total_income","total_expense","transaction_count","net_total"],"properties":{"category_code":{"description":"Category code identifier.","type":"string"},"category_label":{"description":"Category display label.","type":"string"},"currency":{"description":"Currency code (e.g., \"CZK\").","type":"string"},"color":{"description":"Category hex color (e.g., \"#FF5733\").","type":"string"},"total_income":{"description":"Sum of all incoming transactions in this category.","type":"number"},"total_expense":{"description":"Sum of all outgoing transactions in this category.","type":"number"},"transaction_count":{"description":"Number of transactions in this category.","type":"number"},"net_total":{"description":"Net total (income + expense). Negative if expense > income.","type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffTransactionCategory-list","tags":["Transaction"],"summary":"Transaction categories with totals","description":"Returns all transaction categories with aggregated income, expense, and net totals. Useful for a breakdown chart or category filter in the transaction list."}},"/bff/transaction/sync-all":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed without errors.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed without errors.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the sync completed without errors.","type":"boolean"}},"required":["success"]}}}}},"operationId":"getBffTransactionSync-all","tags":["Transaction"],"summary":"Sync all bank transactions","description":"Triggers a synchronization of transactions from all connected bank accounts (Fio API). Fetches new transactions since the last sync and automatically matches them to orders by variable symbol. Ignores the adaptive per-account schedule used by the cron, so every connected account is fetched immediately."}},"/bff/transaction/add-api-token":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the token was accepted.","type":"boolean"},"externalId":{"description":"External ID of the newly created bank account.","type":"string"},"status":{"description":"Connector state right after the call.","const":"pending","type":"string"}},"required":["success","externalId","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the token was accepted.","type":"boolean"},"externalId":{"description":"External ID of the newly created bank account.","type":"string"},"status":{"description":"Connector state right after the call.","const":"pending","type":"string"}},"required":["success","externalId","status"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the token was accepted.","type":"boolean"},"externalId":{"description":"External ID of the newly created bank account.","type":"string"},"status":{"description":"Connector state right after the call.","const":"pending","type":"string"}},"required":["success","externalId","status"]}}}}},"operationId":"postBffTransactionAdd-api-token","tags":["Transaction"],"summary":"Connect a bank account","description":"Adds a new Fio bank account by API token. The token is validated for uniqueness and the account is created immediately with its connector in `pending` state; the first sync (IBAN discovery + transaction import) runs in the background with retries around the Fio 30 s rate limit. Poll `GET /bff/bank-account` and watch `connectorLastStatus` (`pending` → `success` / `error`). Throws if the token is malformed or already connected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiToken"],"properties":{"apiToken":{"description":"Fio bank API token (from internetbanking settings).","examples":["abcdef1234567890"],"type":"string"},"displayName":{"maxLength":128,"description":"Optional user-facing label for the account.","examples":["Spořicí účet"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["apiToken"],"properties":{"apiToken":{"description":"Fio bank API token (from internetbanking settings).","examples":["abcdef1234567890"],"type":"string"},"displayName":{"maxLength":128,"description":"Optional user-facing label for the account.","examples":["Spořicí účet"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["apiToken"],"properties":{"apiToken":{"description":"Fio bank API token (from internetbanking settings).","examples":["abcdef1234567890"],"type":"string"},"displayName":{"maxLength":128,"description":"Optional user-facing label for the account.","examples":["Spořicí účet"],"type":"string"}}}}}}}},"/bff/transaction/import-gpc":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"statementNumber":{"description":"Statement number from the 074 header.","type":"string"},"statementDate":{"description":"Statement date from the 074 header.","anyOf":[{"description":"Statement date from the 074 header.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"parsed":{"description":"Number of 075 transaction records found in the file.","type":"number"},"inserted":{"description":"Number of new transactions actually inserted.","type":"number"},"skippedDuplicates":{"description":"Number of transactions already present in the database.","type":"number"}},"required":["statementNumber","statementDate","parsed","inserted","skippedDuplicates"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"statementNumber":{"description":"Statement number from the 074 header.","type":"string"},"statementDate":{"description":"Statement date from the 074 header.","anyOf":[{"description":"Statement date from the 074 header.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"parsed":{"description":"Number of 075 transaction records found in the file.","type":"number"},"inserted":{"description":"Number of new transactions actually inserted.","type":"number"},"skippedDuplicates":{"description":"Number of transactions already present in the database.","type":"number"}},"required":["statementNumber","statementDate","parsed","inserted","skippedDuplicates"]}},"text/plain":{"schema":{"type":"object","properties":{"statementNumber":{"description":"Statement number from the 074 header.","type":"string"},"statementDate":{"description":"Statement date from the 074 header.","anyOf":[{"description":"Statement date from the 074 header.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"parsed":{"description":"Number of 075 transaction records found in the file.","type":"number"},"inserted":{"description":"Number of new transactions actually inserted.","type":"number"},"skippedDuplicates":{"description":"Number of transactions already present in the database.","type":"number"}},"required":["statementNumber","statementDate","parsed","inserted","skippedDuplicates"]}}}}},"operationId":"postBffTransactionImport-gpc","tags":["Transaction"],"summary":"Import a GPC/ABO bank statement","description":"Parses a Czech GPC/ABO fixed-width bank statement (074 header + 075 transaction lines) and inserts new transactions into the selected bank account. Idempotent: re-uploading the same statement only adds previously unseen transactions.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["bankAccountExternalId","content"],"properties":{"bankAccountExternalId":{"description":"External ID of the destination bank account.","examples":["2000123456"],"type":"string"},"content":{"description":"Raw GPC/ABO statement file content (one line per record).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["bankAccountExternalId","content"],"properties":{"bankAccountExternalId":{"description":"External ID of the destination bank account.","examples":["2000123456"],"type":"string"},"content":{"description":"Raw GPC/ABO statement file content (one line per record).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["bankAccountExternalId","content"],"properties":{"bankAccountExternalId":{"description":"External ID of the destination bank account.","examples":["2000123456"],"type":"string"},"content":{"description":"Raw GPC/ABO statement file content (one line per record).","type":"string"}}}}}}}},"/bff/usage/summary":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"storage":{"description":"File storage usage breakdown.","type":"object","required":["totalBytes","categories"],"properties":{"totalBytes":{"description":"Total storage used in bytes.","type":"number"},"categories":{"description":"Breakdown of storage by file category.","type":"array","items":{"type":"object","required":["tag","count","sizeBytes"],"properties":{"tag":{"description":"Storage category tag (e.g. \"image\", \"document\").","type":"string"},"count":{"description":"Number of files in this category.","type":"number"},"sizeBytes":{"description":"Total size of files in this category, in bytes.","type":"number"}}}}}},"aiTokens":{"description":"AI token consumption statistics.","type":"object","required":["totalTokens","totalCost","byModel"],"properties":{"totalTokens":{"description":"Total AI tokens consumed.","type":"number"},"totalCost":{"description":"Total estimated cost of AI token usage.","type":"number"},"byModel":{"description":"Token usage grouped by AI model.","type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["tokens","cost"],"properties":{"tokens":{"description":"Tokens consumed by this model.","type":"number"},"cost":{"description":"Estimated cost for this model.","type":"number"}}}}}}},"emails":{"description":"Email delivery statistics.","type":"object","required":["total","sent","failed","pending"],"properties":{"total":{"description":"Total emails processed.","type":"number"},"sent":{"description":"Successfully delivered emails.","type":"number"},"failed":{"description":"Emails that failed to send.","type":"number"},"pending":{"description":"Emails queued for delivery.","type":"number"}}},"counts":{"description":"Entity counts across the organisation.","type":"object","required":["products","orders","customers","members","invoices","forms","vouchers"],"properties":{"products":{"description":"Total products in the organisation.","type":"number"},"orders":{"description":"Total orders.","type":"number"},"customers":{"description":"Total customer contacts.","type":"number"},"members":{"description":"Active organisation members.","type":"number"},"invoices":{"description":"Total invoices.","type":"number"},"forms":{"description":"Total forms.","type":"number"},"vouchers":{"description":"Total vouchers.","type":"number"}}}},"required":["storage","aiTokens","emails","counts"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"storage":{"description":"File storage usage breakdown.","type":"object","required":["totalBytes","categories"],"properties":{"totalBytes":{"description":"Total storage used in bytes.","type":"number"},"categories":{"description":"Breakdown of storage by file category.","type":"array","items":{"type":"object","required":["tag","count","sizeBytes"],"properties":{"tag":{"description":"Storage category tag (e.g. \"image\", \"document\").","type":"string"},"count":{"description":"Number of files in this category.","type":"number"},"sizeBytes":{"description":"Total size of files in this category, in bytes.","type":"number"}}}}}},"aiTokens":{"description":"AI token consumption statistics.","type":"object","required":["totalTokens","totalCost","byModel"],"properties":{"totalTokens":{"description":"Total AI tokens consumed.","type":"number"},"totalCost":{"description":"Total estimated cost of AI token usage.","type":"number"},"byModel":{"description":"Token usage grouped by AI model.","type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["tokens","cost"],"properties":{"tokens":{"description":"Tokens consumed by this model.","type":"number"},"cost":{"description":"Estimated cost for this model.","type":"number"}}}}}}},"emails":{"description":"Email delivery statistics.","type":"object","required":["total","sent","failed","pending"],"properties":{"total":{"description":"Total emails processed.","type":"number"},"sent":{"description":"Successfully delivered emails.","type":"number"},"failed":{"description":"Emails that failed to send.","type":"number"},"pending":{"description":"Emails queued for delivery.","type":"number"}}},"counts":{"description":"Entity counts across the organisation.","type":"object","required":["products","orders","customers","members","invoices","forms","vouchers"],"properties":{"products":{"description":"Total products in the organisation.","type":"number"},"orders":{"description":"Total orders.","type":"number"},"customers":{"description":"Total customer contacts.","type":"number"},"members":{"description":"Active organisation members.","type":"number"},"invoices":{"description":"Total invoices.","type":"number"},"forms":{"description":"Total forms.","type":"number"},"vouchers":{"description":"Total vouchers.","type":"number"}}}},"required":["storage","aiTokens","emails","counts"]}},"text/plain":{"schema":{"type":"object","properties":{"storage":{"description":"File storage usage breakdown.","type":"object","required":["totalBytes","categories"],"properties":{"totalBytes":{"description":"Total storage used in bytes.","type":"number"},"categories":{"description":"Breakdown of storage by file category.","type":"array","items":{"type":"object","required":["tag","count","sizeBytes"],"properties":{"tag":{"description":"Storage category tag (e.g. \"image\", \"document\").","type":"string"},"count":{"description":"Number of files in this category.","type":"number"},"sizeBytes":{"description":"Total size of files in this category, in bytes.","type":"number"}}}}}},"aiTokens":{"description":"AI token consumption statistics.","type":"object","required":["totalTokens","totalCost","byModel"],"properties":{"totalTokens":{"description":"Total AI tokens consumed.","type":"number"},"totalCost":{"description":"Total estimated cost of AI token usage.","type":"number"},"byModel":{"description":"Token usage grouped by AI model.","type":"object","patternProperties":{"^(.*)$":{"type":"object","required":["tokens","cost"],"properties":{"tokens":{"description":"Tokens consumed by this model.","type":"number"},"cost":{"description":"Estimated cost for this model.","type":"number"}}}}}}},"emails":{"description":"Email delivery statistics.","type":"object","required":["total","sent","failed","pending"],"properties":{"total":{"description":"Total emails processed.","type":"number"},"sent":{"description":"Successfully delivered emails.","type":"number"},"failed":{"description":"Emails that failed to send.","type":"number"},"pending":{"description":"Emails queued for delivery.","type":"number"}}},"counts":{"description":"Entity counts across the organisation.","type":"object","required":["products","orders","customers","members","invoices","forms","vouchers"],"properties":{"products":{"description":"Total products in the organisation.","type":"number"},"orders":{"description":"Total orders.","type":"number"},"customers":{"description":"Total customer contacts.","type":"number"},"members":{"description":"Active organisation members.","type":"number"},"invoices":{"description":"Total invoices.","type":"number"},"forms":{"description":"Total forms.","type":"number"},"vouchers":{"description":"Total vouchers.","type":"number"}}}},"required":["storage","aiTokens","emails","counts"]}}}}},"operationId":"getBffUsageSummary","tags":["Usage"],"summary":"Get organisation usage summary","description":"Returns a comprehensive usage summary for the authenticated organisation including storage consumption, AI token usage by model, email delivery statistics, and entity counts."}},"/bff/vat-rate/list":{"get":{"parameters":[{"description":"ISO 3166-1 alpha-2 country code filter (e.g. \"CZ\").","examples":["CZ"],"schema":{"type":"string"},"in":"query","name":"countryCode","required":false},{"description":"ISO date (YYYY-MM-DD). When provided, only rates valid on that day are returned — use this when populating a \"VAT rate\" dropdown for a specific invoice issue date.","examples":["2026-05-04"],"schema":{"type":"string"},"in":"query","name":"validOn","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","countryCode","ratePercent","validFrom","validTo","isDefault","isReverseCharge","labelCs","labelEn","labelDe","displayOrder"],"properties":{"id":{"type":"number"},"code":{"description":"Logical code (e.g. \"CZ_BASIC\", \"CZ_REDUCED\", \"CZ_REVERSE\").","type":"string"},"countryCode":{"type":"string"},"ratePercent":{"description":"Numeric percent as decimal string (e.g. \"21.00\").","type":"string"},"validFrom":{"description":"ISO date (inclusive).","type":"string"},"validTo":{"description":"ISO date (exclusive). NULL = ongoing.","anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isReverseCharge":{"description":"When true, the rate is 0 % with the EU reverse-charge note.","type":"boolean"},"labelCs":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelDe":{"description":"German label (DE/AT/CH). Uses \"MWST\" for Swiss rates, \"MwSt.\" for AT/DE convention as authored in the seed.","anyOf":[{"type":"string"},{"type":"null"}]},"displayOrder":{"description":"UI sort key (lower first).","type":"number"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","countryCode","ratePercent","validFrom","validTo","isDefault","isReverseCharge","labelCs","labelEn","labelDe","displayOrder"],"properties":{"id":{"type":"number"},"code":{"description":"Logical code (e.g. \"CZ_BASIC\", \"CZ_REDUCED\", \"CZ_REVERSE\").","type":"string"},"countryCode":{"type":"string"},"ratePercent":{"description":"Numeric percent as decimal string (e.g. \"21.00\").","type":"string"},"validFrom":{"description":"ISO date (inclusive).","type":"string"},"validTo":{"description":"ISO date (exclusive). NULL = ongoing.","anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isReverseCharge":{"description":"When true, the rate is 0 % with the EU reverse-charge note.","type":"boolean"},"labelCs":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelDe":{"description":"German label (DE/AT/CH). Uses \"MWST\" for Swiss rates, \"MwSt.\" for AT/DE convention as authored in the seed.","anyOf":[{"type":"string"},{"type":"null"}]},"displayOrder":{"description":"UI sort key (lower first).","type":"number"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","countryCode","ratePercent","validFrom","validTo","isDefault","isReverseCharge","labelCs","labelEn","labelDe","displayOrder"],"properties":{"id":{"type":"number"},"code":{"description":"Logical code (e.g. \"CZ_BASIC\", \"CZ_REDUCED\", \"CZ_REVERSE\").","type":"string"},"countryCode":{"type":"string"},"ratePercent":{"description":"Numeric percent as decimal string (e.g. \"21.00\").","type":"string"},"validFrom":{"description":"ISO date (inclusive).","type":"string"},"validTo":{"description":"ISO date (exclusive). NULL = ongoing.","anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isReverseCharge":{"description":"When true, the rate is 0 % with the EU reverse-charge note.","type":"boolean"},"labelCs":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelDe":{"description":"German label (DE/AT/CH). Uses \"MWST\" for Swiss rates, \"MwSt.\" for AT/DE convention as authored in the seed.","anyOf":[{"type":"string"},{"type":"null"}]},"displayOrder":{"description":"UI sort key (lower first).","type":"number"}}}}},"required":["items"]}}}}},"operationId":"getBffVat-rateList","tags":["VAT rate"],"summary":"List VAT rates","description":"Returns the time-bounded VAT rate master table. Filterable by country and \"valid on this date\". Use without `validOn` for the admin management screen, with `validOn` for invoice issue dropdowns."}},"/bff/vat-rate/resolve":{"get":{"parameters":[{"description":"Logical VAT rate code, e.g. \"CZ_BASIC\".","examples":["CZ_BASIC"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"ISO 3166-1 alpha-2 country code.","examples":["CZ"],"schema":{"type":"string"},"in":"query","name":"countryCode","required":true},{"description":"ISO date the rate must be valid on (taxable supply date of the invoice).","examples":["2023-12-31"],"schema":{"type":"string"},"in":"query","name":"date","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"countryCode":{"type":"string"},"ratePercent":{"description":"Numeric percent (e.g., 21 for \"21 %\", 12 for the post-2024 reduced rate).","type":"number"},"validFrom":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"isReverseCharge":{"type":"boolean"},"labelCs":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelDe":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code","countryCode","ratePercent","validFrom","validTo","isReverseCharge","labelCs","labelEn","labelDe"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"countryCode":{"type":"string"},"ratePercent":{"description":"Numeric percent (e.g., 21 for \"21 %\", 12 for the post-2024 reduced rate).","type":"number"},"validFrom":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"isReverseCharge":{"type":"boolean"},"labelCs":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelDe":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code","countryCode","ratePercent","validFrom","validTo","isReverseCharge","labelCs","labelEn","labelDe"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"countryCode":{"type":"string"},"ratePercent":{"description":"Numeric percent (e.g., 21 for \"21 %\", 12 for the post-2024 reduced rate).","type":"number"},"validFrom":{"type":"string"},"validTo":{"anyOf":[{"type":"string"},{"type":"null"}]},"isReverseCharge":{"type":"boolean"},"labelCs":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"anyOf":[{"type":"string"},{"type":"null"}]},"labelDe":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","code","countryCode","ratePercent","validFrom","validTo","isReverseCharge","labelCs","labelEn","labelDe"]}}}}},"operationId":"getBffVat-rateResolve","tags":["VAT rate"],"summary":"Resolve the VAT rate in force on a given date","description":"Returns the single rate that was valid on `date` for the given country and logical code. Throws when no rate matches (admin must add a record to core__vat_rate). Use this when populating a VAT field on an invoice item — the date is the invoice's taxable supply date, not \"today\"."}},"/bff/vendor/of-current":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"vendor":{"description":"The white-label partner organisation that manages the calling org. Returned only when (a) parent_id is set AND (b) the parent holds an active cas__white_label_licence row. NULL otherwise — i.e. either we sell directly to the customer or the parent's licence is revoked.","anyOf":[{"type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug — used by /vendor/switch.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Vendor short description.","anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor (mirror of cas__white_label_licence.licence_key).","type":"string"},"contactPerson":{"description":"Vendor's nominated contact person. NULL when no support_person_id is set.","anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"description":"cas__organisation_member.id of the vendor's nominated contact.","type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"description":"Email customers should write to. Resolved as: vendor's default_send_from_email config → contact person login username → null.","anyOf":[{"type":"string"},{"type":"null"}]},"myTariff":{"type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"type":"string"},"monthlyPriceCzk":{"description":"Final monthly price the customer pays, in WHOLE CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"type":"number"},"expiresAt":{"description":"When the current paid period ends. NULL = no paid-until set.","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"}}}}},{"type":"null"}]}},"required":["vendor"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"vendor":{"description":"The white-label partner organisation that manages the calling org. Returned only when (a) parent_id is set AND (b) the parent holds an active cas__white_label_licence row. NULL otherwise — i.e. either we sell directly to the customer or the parent's licence is revoked.","anyOf":[{"type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug — used by /vendor/switch.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Vendor short description.","anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor (mirror of cas__white_label_licence.licence_key).","type":"string"},"contactPerson":{"description":"Vendor's nominated contact person. NULL when no support_person_id is set.","anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"description":"cas__organisation_member.id of the vendor's nominated contact.","type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"description":"Email customers should write to. Resolved as: vendor's default_send_from_email config → contact person login username → null.","anyOf":[{"type":"string"},{"type":"null"}]},"myTariff":{"type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"type":"string"},"monthlyPriceCzk":{"description":"Final monthly price the customer pays, in WHOLE CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"type":"number"},"expiresAt":{"description":"When the current paid period ends. NULL = no paid-until set.","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"}}}}},{"type":"null"}]}},"required":["vendor"]}},"text/plain":{"schema":{"type":"object","properties":{"vendor":{"description":"The white-label partner organisation that manages the calling org. Returned only when (a) parent_id is set AND (b) the parent holds an active cas__white_label_licence row. NULL otherwise — i.e. either we sell directly to the customer or the parent's licence is revoked.","anyOf":[{"type":"object","required":["organisation","whiteLabelLicenceId","contactPerson","contactEmail","myTariff"],"properties":{"organisation":{"type":"object","required":["id","slug","name","emoji","description"],"properties":{"id":{"description":"Vendor (parent) organisation id.","type":"number"},"slug":{"description":"Vendor slug — used by /vendor/switch.","type":"string"},"name":{"description":"Vendor display name (e.g. \"7 nápadů s.r.o.\").","type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"description":"Vendor short description.","anyOf":[{"type":"string"},{"type":"null"}]}}},"whiteLabelLicenceId":{"description":"16-character white-label licence id of the vendor (mirror of cas__white_label_licence.licence_key).","type":"string"},"contactPerson":{"description":"Vendor's nominated contact person. NULL when no support_person_id is set.","anyOf":[{"type":"object","required":["memberId","firstName","lastName"],"properties":{"memberId":{"description":"cas__organisation_member.id of the vendor's nominated contact.","type":"number"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"contactEmail":{"description":"Email customers should write to. Resolved as: vendor's default_send_from_email config → contact person login username → null.","anyOf":[{"type":"string"},{"type":"null"}]},"myTariff":{"type":"object","required":["id","code","name","monthlyPriceCzk","priceFrom","customPriceCzk","discountPercent","expiresAt","daysUntilExpiry","isExpired"],"properties":{"id":{"type":"number"},"code":{"description":"Tariff code (free, startup, business, enterprise).","type":"string"},"name":{"type":"string"},"monthlyPriceCzk":{"description":"Final monthly price the customer pays, in WHOLE CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"},"customPriceCzk":{"anyOf":[{"type":"number"},{"type":"null"}]},"discountPercent":{"type":"number"},"expiresAt":{"description":"When the current paid period ends. NULL = no paid-until set.","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"}}}}},{"type":"null"}]}},"required":["vendor"]}}}}},"operationId":"getBffVendorOf-current","tags":["Vendor"],"summary":"Get the vendor of the current organisation","description":"Returns the parent (vendor) organisation that resells / technically manages the calling organisation, including its technical manager. Use this in the customer admin to render the \"Můj technický správce\" widget."}},"/bff/vendor/managed-organisations":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"organisations":{"type":"array","items":{"type":"object","required":["vendor","organisation","tariff","billing","hasDirectMembership"],"properties":{"vendor":{"type":"object","required":["id","slug","name","emoji"],"properties":{"id":{"type":"number"},"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"organisation":{"type":"object","required":["id","slug","name","emoji","insertedDate","memberCount","storageUsedMb"],"properties":{"id":{"type":"number"},"slug":{"description":"Use this with POST /vendor/switch.","type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"memberCount":{"description":"Active members in the customer org.","type":"number"},"storageUsedMb":{"description":"Storage usage of the customer org, in MB.","type":"number"}}},"tariff":{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"monthlyPriceCzk":{"description":"Catalogue price in CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"}}},"billing":{"type":"object","required":["customPriceCzk","effectivePriceCzk","discountPercent","paidUntil","daysUntilExpiry","isExpired","expiringSoon"],"properties":{"customPriceCzk":{"description":"Negotiated price in CZK. NULL = use catalogue minus discount.","anyOf":[{"type":"number"},{"type":"null"}]},"effectivePriceCzk":{"description":"Final monthly price the customer actually pays, in CZK.","type":"number"},"discountPercent":{"type":"number"},"paidUntil":{"description":"Subscription expiry date.","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"description":"Negative when expired. NULL when paidUntil is unset.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"},"expiringSoon":{"description":"True when daysUntilExpiry ≤ 14 and not yet expired.","type":"boolean"}}},"hasDirectMembership":{"description":"True if the calling user already has a `cas__organisation_member` row in this customer org. When false, POST /vendor/switch will auto-create one before switching.","type":"boolean"}}}},"totals":{"type":"object","required":["count","monthlyRevenueCzk","expired","expiringSoon"],"properties":{"count":{"description":"Total managed organisations.","type":"number"},"monthlyRevenueCzk":{"description":"Sum of effective monthly prices, in CZK.","type":"number"},"expired":{"description":"How many are past their paidUntil.","type":"number"},"expiringSoon":{"description":"How many are within 14 days of expiry.","type":"number"}}}},"required":["organisations","totals"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"organisations":{"type":"array","items":{"type":"object","required":["vendor","organisation","tariff","billing","hasDirectMembership"],"properties":{"vendor":{"type":"object","required":["id","slug","name","emoji"],"properties":{"id":{"type":"number"},"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"organisation":{"type":"object","required":["id","slug","name","emoji","insertedDate","memberCount","storageUsedMb"],"properties":{"id":{"type":"number"},"slug":{"description":"Use this with POST /vendor/switch.","type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"memberCount":{"description":"Active members in the customer org.","type":"number"},"storageUsedMb":{"description":"Storage usage of the customer org, in MB.","type":"number"}}},"tariff":{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"monthlyPriceCzk":{"description":"Catalogue price in CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"}}},"billing":{"type":"object","required":["customPriceCzk","effectivePriceCzk","discountPercent","paidUntil","daysUntilExpiry","isExpired","expiringSoon"],"properties":{"customPriceCzk":{"description":"Negotiated price in CZK. NULL = use catalogue minus discount.","anyOf":[{"type":"number"},{"type":"null"}]},"effectivePriceCzk":{"description":"Final monthly price the customer actually pays, in CZK.","type":"number"},"discountPercent":{"type":"number"},"paidUntil":{"description":"Subscription expiry date.","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"description":"Negative when expired. NULL when paidUntil is unset.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"},"expiringSoon":{"description":"True when daysUntilExpiry ≤ 14 and not yet expired.","type":"boolean"}}},"hasDirectMembership":{"description":"True if the calling user already has a `cas__organisation_member` row in this customer org. When false, POST /vendor/switch will auto-create one before switching.","type":"boolean"}}}},"totals":{"type":"object","required":["count","monthlyRevenueCzk","expired","expiringSoon"],"properties":{"count":{"description":"Total managed organisations.","type":"number"},"monthlyRevenueCzk":{"description":"Sum of effective monthly prices, in CZK.","type":"number"},"expired":{"description":"How many are past their paidUntil.","type":"number"},"expiringSoon":{"description":"How many are within 14 days of expiry.","type":"number"}}}},"required":["organisations","totals"]}},"text/plain":{"schema":{"type":"object","properties":{"organisations":{"type":"array","items":{"type":"object","required":["vendor","organisation","tariff","billing","hasDirectMembership"],"properties":{"vendor":{"type":"object","required":["id","slug","name","emoji"],"properties":{"id":{"type":"number"},"slug":{"type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"organisation":{"type":"object","required":["id","slug","name","emoji","insertedDate","memberCount","storageUsedMb"],"properties":{"id":{"type":"number"},"slug":{"description":"Use this with POST /vendor/switch.","type":"string"},"name":{"type":"string"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"memberCount":{"description":"Active members in the customer org.","type":"number"},"storageUsedMb":{"description":"Storage usage of the customer org, in MB.","type":"number"}}},"tariff":{"type":"object","required":["id","code","monthlyPriceCzk","priceFrom"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"monthlyPriceCzk":{"description":"Catalogue price in CZK.","type":"number"},"priceFrom":{"description":"True for Enterprise (variable pricing).","type":"boolean"}}},"billing":{"type":"object","required":["customPriceCzk","effectivePriceCzk","discountPercent","paidUntil","daysUntilExpiry","isExpired","expiringSoon"],"properties":{"customPriceCzk":{"description":"Negotiated price in CZK. NULL = use catalogue minus discount.","anyOf":[{"type":"number"},{"type":"null"}]},"effectivePriceCzk":{"description":"Final monthly price the customer actually pays, in CZK.","type":"number"},"discountPercent":{"type":"number"},"paidUntil":{"description":"Subscription expiry date.","anyOf":[{"type":"string"},{"type":"null"}]},"daysUntilExpiry":{"description":"Negative when expired. NULL when paidUntil is unset.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"type":"boolean"},"expiringSoon":{"description":"True when daysUntilExpiry ≤ 14 and not yet expired.","type":"boolean"}}},"hasDirectMembership":{"description":"True if the calling user already has a `cas__organisation_member` row in this customer org. When false, POST /vendor/switch will auto-create one before switching.","type":"boolean"}}}},"totals":{"type":"object","required":["count","monthlyRevenueCzk","expired","expiringSoon"],"properties":{"count":{"description":"Total managed organisations.","type":"number"},"monthlyRevenueCzk":{"description":"Sum of effective monthly prices, in CZK.","type":"number"},"expired":{"description":"How many are past their paidUntil.","type":"number"},"expiringSoon":{"description":"How many are within 14 days of expiry.","type":"number"}}}},"required":["organisations","totals"]}}}}},"operationId":"getBffVendorManaged-organisations","tags":["Vendor"],"summary":"List organisations managed by the calling user","description":"Returns all organisations whose `parent_id` points to an organisation in which the calling user is an active member — i.e. the orgs the user can manage as a technical manager / vendor support. Includes the tariff, billing snapshot, paid-until status, member count, and a `hasDirectMembership` flag indicating whether the user is already a direct member of each row (so the UI can decide between a \"Switch\" button and a \"Join + switch\" button)."}},"/bff/vendor/switch":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"identityId":{"anyOf":[{"type":"string"},{"type":"undefined"}]},"targetOrganisationId":{"type":"number"},"targetMemberId":{"description":"New or existing member row in the target org.","type":"number"},"vendorOrganisationId":{"description":"Vendor org through which access was granted.","type":"number"}},"required":["success","targetOrganisationId","targetMemberId","vendorOrganisationId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"identityId":{"anyOf":[{"type":"string"},{"type":"undefined"}]},"targetOrganisationId":{"type":"number"},"targetMemberId":{"description":"New or existing member row in the target org.","type":"number"},"vendorOrganisationId":{"description":"Vendor org through which access was granted.","type":"number"}},"required":["success","targetOrganisationId","targetMemberId","vendorOrganisationId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"identityId":{"anyOf":[{"type":"string"},{"type":"undefined"}]},"targetOrganisationId":{"type":"number"},"targetMemberId":{"description":"New or existing member row in the target org.","type":"number"},"vendorOrganisationId":{"description":"Vendor org through which access was granted.","type":"number"}},"required":["success","targetOrganisationId","targetMemberId","vendorOrganisationId"]}}}}},"operationId":"postBffVendorSwitch","tags":["Vendor"],"summary":"Switch into a managed organisation","description":"Lets a technical manager (member of a vendor organisation) switch their session into a managed customer organisation. If the caller is not yet a member of the target org, a `cas__organisation_member` row is auto-created first (idempotent). Throws PUBLIC_VENDOR_RELATION_NOT_FOUND when the target org is not a child of any org the caller belongs to.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the managed organisation to switch into.","examples":["my-shop"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the managed organisation to switch into.","examples":["my-shop"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["organisationSlug"],"properties":{"organisationSlug":{"description":"Slug of the managed organisation to switch into.","examples":["my-shop"],"type":"string"}}}}}}}},"/bff/voucher/list":{"get":{"parameters":[{"description":"Page number (1-based) for pagination.","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Maximum items per page (1–500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Full-text search across voucher code and internal note.","examples":["SUMMER","WELCOME"],"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Filter by voucher type: fixed, percentage, free-credit, or free-product.","examples":["percentage"],"schema":{"type":"string"},"in":"query","name":"type","required":false},{"description":"Filter by computed status. Allowed values: active, inactive, expired, not-yet-valid, limit-reached.","examples":["active"],"schema":{"type":"string"},"in":"query","name":"status","required":false},{"description":"Behavioural segment, orthogonal to `status` (can be combined). Allowed values: expiring-soon (active and within 30 days of validTo), hot (used at least once in the last 7 days), gift-card (generated from a source order, i.e. product voucher template), never-used (created 30+ days ago, never redeemed), unlimited (no usage limit set).","examples":["expiring-soon"],"schema":{"type":"string"},"in":"query","name":"segment","required":false}],"responses":{"200":{"description":"Paginated list of vouchers with metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of voucher items matching the query criteria.","type":"array","items":{"description":"Single voucher item in the list.","type":"object","required":["id","type","value","usedCount","usedOrderCount","active","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","note","insertedDate","updatedDate","cost","revenue","uniqueCustomers","burnRate7d","burnRate30d","sourceOrderId","sourceOrderNumber","sourceOrderHash"],"properties":{"id":{"description":"Voucher code (unique identifier within organisation).","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value (amount for fixed, percentage for percentage type).","type":"string"},"usageLimit":{"description":"Maximum number of times voucher can be used. Null if unlimited.","type":"number"},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usedOrderCount":{"description":"Number of orders that have used this voucher.","type":"number"},"active":{"description":"Whether voucher is currently active (computed from all conditions).","type":"boolean"},"isOrderSingleton":{"description":"If true, voucher can only be applied once per order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated voucher-redeem page.","type":"boolean"},"note":{"description":"Internal note (truncated to 100 characters in list view).","type":"string"},"lastUsedDate":{"description":"Date when voucher was last used.","anyOf":[{"description":"Date when voucher was last used.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validFrom":{"description":"Start date of validity period.","anyOf":[{"description":"Start date of validity period.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"End date of validity period.","anyOf":[{"description":"End date of validity period.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when voucher was created.","anyOf":[{"description":"Date when voucher was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when voucher was last modified.","anyOf":[{"description":"Date when voucher was last modified.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = unknown (1:1 fallback), 0 = explicitly gifted.","anyOf":[{"type":"number"},{"type":"null"}]},"revenue":{"description":"Sum of `shop__order.price` for orders that used this voucher and reached paid status. Stringified to preserve decimal precision.","type":"string"},"uniqueCustomers":{"description":"Distinct customers that have redeemed this voucher.","type":"number"},"burnRate7d":{"description":"Number of redemptions in the last 7 days.","type":"number"},"burnRate30d":{"description":"Number of redemptions in the last 30 days.","type":"number"},"sourceOrderId":{"description":"Order that generated this voucher (product-voucher template fulfilment). Null for manually created vouchers.","anyOf":[{"type":"number"},{"type":"null"}]},"sourceOrderNumber":{"description":"Source order number, mirroring sourceOrderId.","anyOf":[{"type":"string"},{"type":"null"}]},"sourceOrderHash":{"description":"Source order hash (used as the admin order detail route segment).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total number of vouchers matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of voucher items matching the query criteria.","type":"array","items":{"description":"Single voucher item in the list.","type":"object","required":["id","type","value","usedCount","usedOrderCount","active","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","note","insertedDate","updatedDate","cost","revenue","uniqueCustomers","burnRate7d","burnRate30d","sourceOrderId","sourceOrderNumber","sourceOrderHash"],"properties":{"id":{"description":"Voucher code (unique identifier within organisation).","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value (amount for fixed, percentage for percentage type).","type":"string"},"usageLimit":{"description":"Maximum number of times voucher can be used. Null if unlimited.","type":"number"},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usedOrderCount":{"description":"Number of orders that have used this voucher.","type":"number"},"active":{"description":"Whether voucher is currently active (computed from all conditions).","type":"boolean"},"isOrderSingleton":{"description":"If true, voucher can only be applied once per order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated voucher-redeem page.","type":"boolean"},"note":{"description":"Internal note (truncated to 100 characters in list view).","type":"string"},"lastUsedDate":{"description":"Date when voucher was last used.","anyOf":[{"description":"Date when voucher was last used.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validFrom":{"description":"Start date of validity period.","anyOf":[{"description":"Start date of validity period.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"End date of validity period.","anyOf":[{"description":"End date of validity period.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when voucher was created.","anyOf":[{"description":"Date when voucher was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when voucher was last modified.","anyOf":[{"description":"Date when voucher was last modified.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = unknown (1:1 fallback), 0 = explicitly gifted.","anyOf":[{"type":"number"},{"type":"null"}]},"revenue":{"description":"Sum of `shop__order.price` for orders that used this voucher and reached paid status. Stringified to preserve decimal precision.","type":"string"},"uniqueCustomers":{"description":"Distinct customers that have redeemed this voucher.","type":"number"},"burnRate7d":{"description":"Number of redemptions in the last 7 days.","type":"number"},"burnRate30d":{"description":"Number of redemptions in the last 30 days.","type":"number"},"sourceOrderId":{"description":"Order that generated this voucher (product-voucher template fulfilment). Null for manually created vouchers.","anyOf":[{"type":"number"},{"type":"null"}]},"sourceOrderNumber":{"description":"Source order number, mirroring sourceOrderId.","anyOf":[{"type":"string"},{"type":"null"}]},"sourceOrderHash":{"description":"Source order hash (used as the admin order detail route segment).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total number of vouchers matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of voucher items matching the query criteria.","type":"array","items":{"description":"Single voucher item in the list.","type":"object","required":["id","type","value","usedCount","usedOrderCount","active","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","note","insertedDate","updatedDate","cost","revenue","uniqueCustomers","burnRate7d","burnRate30d","sourceOrderId","sourceOrderNumber","sourceOrderHash"],"properties":{"id":{"description":"Voucher code (unique identifier within organisation).","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value (amount for fixed, percentage for percentage type).","type":"string"},"usageLimit":{"description":"Maximum number of times voucher can be used. Null if unlimited.","type":"number"},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usedOrderCount":{"description":"Number of orders that have used this voucher.","type":"number"},"active":{"description":"Whether voucher is currently active (computed from all conditions).","type":"boolean"},"isOrderSingleton":{"description":"If true, voucher can only be applied once per order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated voucher-redeem page.","type":"boolean"},"note":{"description":"Internal note (truncated to 100 characters in list view).","type":"string"},"lastUsedDate":{"description":"Date when voucher was last used.","anyOf":[{"description":"Date when voucher was last used.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validFrom":{"description":"Start date of validity period.","anyOf":[{"description":"Start date of validity period.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"End date of validity period.","anyOf":[{"description":"End date of validity period.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Date when voucher was created.","anyOf":[{"description":"Date when voucher was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Date when voucher was last modified.","anyOf":[{"description":"Date when voucher was last modified.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = unknown (1:1 fallback), 0 = explicitly gifted.","anyOf":[{"type":"number"},{"type":"null"}]},"revenue":{"description":"Sum of `shop__order.price` for orders that used this voucher and reached paid status. Stringified to preserve decimal precision.","type":"string"},"uniqueCustomers":{"description":"Distinct customers that have redeemed this voucher.","type":"number"},"burnRate7d":{"description":"Number of redemptions in the last 7 days.","type":"number"},"burnRate30d":{"description":"Number of redemptions in the last 30 days.","type":"number"},"sourceOrderId":{"description":"Order that generated this voucher (product-voucher template fulfilment). Null for manually created vouchers.","anyOf":[{"type":"number"},{"type":"null"}]},"sourceOrderNumber":{"description":"Source order number, mirroring sourceOrderId.","anyOf":[{"type":"string"},{"type":"null"}]},"sourceOrderHash":{"description":"Source order hash (used as the admin order detail route segment).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"description":"Total number of vouchers matching the query (before pagination).","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffVoucherList","tags":["Voucher"],"summary":"List vouchers","description":"Returns a paginated list of vouchers for the authenticated organisation. Default order is status-aware: active vouchers expiring soon first, then active, then awaiting activation, limit-reached, expired, and finally manually deactivated. Within each group the rows are ordered by valid_to ascending and then last_used_date descending. Each voucher includes usage statistics, validity information, cost, revenue (sum of paid order totals where used), unique customer count, recent burn rate, and source-order linkage. Supports full-text search on code/note, type filter, computed-status filter, and orthogonal segment filter."}},"/bff/voucher/dashboard-summary":{"get":{"responses":{"200":{"description":"Voucher dashboard KPI summary.","content":{"application/json":{"schema":{"type":"object","properties":{"totalCount":{"description":"Total number of vouchers in the organisation.","type":"number"},"activeCount":{"description":"Vouchers currently usable (active flag + within validity + under limit).","type":"number"},"expiringSoonCount":{"description":"Active vouchers whose validTo falls within the next 30 days.","type":"number"},"giftCardCount":{"description":"Vouchers generated from a source order (product-voucher template).","type":"number"},"unusedCount":{"description":"Vouchers created at least 30 days ago that have never been redeemed.","type":"number"},"hotCount":{"description":"Vouchers redeemed at least once in the last 7 days.","type":"number"},"totalRevenue":{"description":"Sum of `shop__order.price` for paid orders that used any voucher in this org. Stringified for precision.","type":"string"},"totalCost":{"description":"Sum of `shop__voucher.cost` across all vouchers in this org (org default currency). Stringified for precision.","type":"string"},"totalRoi":{"description":"Revenue / cost ratio. Null when totalCost is 0.","anyOf":[{"type":"number"},{"type":"null"}]},"uniqueCustomers":{"description":"Distinct customers across paid orders that used any voucher in this org.","type":"number"}},"required":["totalCount","activeCount","expiringSoonCount","giftCardCount","unusedCount","hotCount","totalRevenue","totalCost","totalRoi","uniqueCustomers"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"totalCount":{"description":"Total number of vouchers in the organisation.","type":"number"},"activeCount":{"description":"Vouchers currently usable (active flag + within validity + under limit).","type":"number"},"expiringSoonCount":{"description":"Active vouchers whose validTo falls within the next 30 days.","type":"number"},"giftCardCount":{"description":"Vouchers generated from a source order (product-voucher template).","type":"number"},"unusedCount":{"description":"Vouchers created at least 30 days ago that have never been redeemed.","type":"number"},"hotCount":{"description":"Vouchers redeemed at least once in the last 7 days.","type":"number"},"totalRevenue":{"description":"Sum of `shop__order.price` for paid orders that used any voucher in this org. Stringified for precision.","type":"string"},"totalCost":{"description":"Sum of `shop__voucher.cost` across all vouchers in this org (org default currency). Stringified for precision.","type":"string"},"totalRoi":{"description":"Revenue / cost ratio. Null when totalCost is 0.","anyOf":[{"type":"number"},{"type":"null"}]},"uniqueCustomers":{"description":"Distinct customers across paid orders that used any voucher in this org.","type":"number"}},"required":["totalCount","activeCount","expiringSoonCount","giftCardCount","unusedCount","hotCount","totalRevenue","totalCost","totalRoi","uniqueCustomers"]}},"text/plain":{"schema":{"type":"object","properties":{"totalCount":{"description":"Total number of vouchers in the organisation.","type":"number"},"activeCount":{"description":"Vouchers currently usable (active flag + within validity + under limit).","type":"number"},"expiringSoonCount":{"description":"Active vouchers whose validTo falls within the next 30 days.","type":"number"},"giftCardCount":{"description":"Vouchers generated from a source order (product-voucher template).","type":"number"},"unusedCount":{"description":"Vouchers created at least 30 days ago that have never been redeemed.","type":"number"},"hotCount":{"description":"Vouchers redeemed at least once in the last 7 days.","type":"number"},"totalRevenue":{"description":"Sum of `shop__order.price` for paid orders that used any voucher in this org. Stringified for precision.","type":"string"},"totalCost":{"description":"Sum of `shop__voucher.cost` across all vouchers in this org (org default currency). Stringified for precision.","type":"string"},"totalRoi":{"description":"Revenue / cost ratio. Null when totalCost is 0.","anyOf":[{"type":"number"},{"type":"null"}]},"uniqueCustomers":{"description":"Distinct customers across paid orders that used any voucher in this org.","type":"number"}},"required":["totalCount","activeCount","expiringSoonCount","giftCardCount","unusedCount","hotCount","totalRevenue","totalCost","totalRoi","uniqueCustomers"]}}}}},"operationId":"getBffVoucherDashboard-summary","tags":["Voucher"],"summary":"Voucher dashboard summary (KPI tiles)","description":"Returns org-wide voucher KPIs powering the dashboard tile bar above the voucher list: total count, active count, expiring-soon count (next 30 days), gift-card count, never-used count, hot codes count (redeemed in the last 7 days), total revenue from paid orders that used a voucher, total committed cost, ROI ratio (revenue/cost), and unique paid customers."}},"/bff/voucher/detail":{"get":{"parameters":[{"description":"Voucher code to retrieve.","examples":["SUMMER2024"],"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"description":"Voucher detail object.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Voucher code.","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"usageLimit":{"description":"Maximum usage count.","type":"number"},"usedCount":{"description":"Current usage count.","type":"number"},"usedOrderCount":{"description":"Number of orders using this voucher.","type":"number"},"active":{"description":"Whether voucher is active.","type":"boolean"},"isOrderSingleton":{"description":"Single use per order flag.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"description":"Last usage date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"note":{"description":"Internal note.","type":"string"},"validFrom":{"description":"Validity start date.","anyOf":[{"description":"Validity start date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"Validity end date.","anyOf":[{"description":"Validity end date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","type","value","usedCount","usedOrderCount","active","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","note","insertedDate","updatedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Voucher code.","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"usageLimit":{"description":"Maximum usage count.","type":"number"},"usedCount":{"description":"Current usage count.","type":"number"},"usedOrderCount":{"description":"Number of orders using this voucher.","type":"number"},"active":{"description":"Whether voucher is active.","type":"boolean"},"isOrderSingleton":{"description":"Single use per order flag.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"description":"Last usage date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"note":{"description":"Internal note.","type":"string"},"validFrom":{"description":"Validity start date.","anyOf":[{"description":"Validity start date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"Validity end date.","anyOf":[{"description":"Validity end date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","type","value","usedCount","usedOrderCount","active","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","note","insertedDate","updatedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Voucher code.","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"usageLimit":{"description":"Maximum usage count.","type":"number"},"usedCount":{"description":"Current usage count.","type":"number"},"usedOrderCount":{"description":"Number of orders using this voucher.","type":"number"},"active":{"description":"Whether voucher is active.","type":"boolean"},"isOrderSingleton":{"description":"Single use per order flag.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"description":"Last usage date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"note":{"description":"Internal note.","type":"string"},"validFrom":{"description":"Validity start date.","anyOf":[{"description":"Validity start date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"validTo":{"description":"Validity end date.","anyOf":[{"description":"Validity end date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}},"required":["id","type","value","usedCount","usedOrderCount","active","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","note","insertedDate","updatedDate"]}}}}},"operationId":"getBffVoucherDetail","tags":["Voucher"],"summary":"Get voucher detail","description":"Returns basic detail of a specific voucher identified by its code."}},"/bff/voucher/full-detail":{"get":{"parameters":[{"description":"Voucher code to retrieve full details for.","examples":["SUMMER2024"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"description":"Comprehensive voucher detail with context.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"Voucher code.","type":"string"},"internalId":{"description":"Internal database ID.","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"usageLimit":{"description":"Maximum usage count or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"usedCount":{"description":"Current usage count.","type":"number"},"usedOrderCount":{"description":"Number of orders using this voucher.","type":"number"},"active":{"description":"Database active flag.","type":"boolean"},"effectivelyActive":{"description":"Computed status considering expiration, usage limit, and validity period.","type":"boolean"},"isOrderSingleton":{"description":"Single use per order flag.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"remainingUsage":{"description":"Remaining uses before limit is reached. Null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Whether the validity period has ended.","type":"boolean"},"isNotYetValid":{"description":"Whether the validity period has not started yet.","type":"boolean"},"daysUntilExpiration":{"description":"Days until voucher expires. Null if no expiration date or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = \"ratio unknown\" → resulting credits applied 1:1. 0 = \"explicitly gifted\" → resulting credits carry zero money value.","anyOf":[{"type":"number"},{"type":"null"}]},"sourceOrder":{"description":"Order that spawned this voucher (product-template fulfilment or workflow special action). Null for manually created vouchers.","anyOf":[{"type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol"],"properties":{"orderId":{"description":"Source order ID.","type":"number"},"orderHash":{"description":"Source order hash (admin order detail route segment).","type":"string"},"orderNumber":{"description":"Source order number.","type":"string"},"orderVariableSymbol":{"description":"Source order variable symbol.","type":"string"}}},{"type":"null"}]},"recentOrders":{"description":"Last 5 orders that used this voucher.","type":"array","items":{"description":"Order that used this voucher.","type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol","customerName","orderTotal","currencyCode","usedDate"],"properties":{"orderId":{"description":"Order ID.","type":"number"},"orderHash":{"description":"Order hash (used as the admin order detail route segment).","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"orderVariableSymbol":{"description":"Variable symbol for payment.","type":"string"},"customerName":{"description":"Customer name or \"Anonymous\".","type":"string"},"orderTotal":{"description":"Total order value with VAT.","type":"string"},"currencyCode":{"description":"Currency code (e.g., CZK, EUR).","type":"string"},"usedDate":{"description":"When voucher was applied to this order.","anyOf":[{"description":"When voucher was applied to this order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"linkedProducts":{"description":"Products that generate this voucher when purchased.","type":"array","items":{"description":"Product linked to this voucher template.","type":"object","required":["productId","productName","productCode","productActive"],"properties":{"productId":{"description":"Product ID.","type":"number"},"productName":{"description":"Product name.","type":"string"},"productCode":{"description":"Product SKU/code.","type":"string"},"productActive":{"description":"Whether product is active.","type":"boolean"}}}}},"required":["id","internalId","type","value","usageLimit","usedCount","usedOrderCount","active","effectivelyActive","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","lastUsedDate","note","validFrom","validTo","insertedDate","updatedDate","remainingUsage","isExpired","isNotYetValid","daysUntilExpiration","cost","sourceOrder","recentOrders","linkedProducts"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"Voucher code.","type":"string"},"internalId":{"description":"Internal database ID.","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"usageLimit":{"description":"Maximum usage count or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"usedCount":{"description":"Current usage count.","type":"number"},"usedOrderCount":{"description":"Number of orders using this voucher.","type":"number"},"active":{"description":"Database active flag.","type":"boolean"},"effectivelyActive":{"description":"Computed status considering expiration, usage limit, and validity period.","type":"boolean"},"isOrderSingleton":{"description":"Single use per order flag.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"remainingUsage":{"description":"Remaining uses before limit is reached. Null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Whether the validity period has ended.","type":"boolean"},"isNotYetValid":{"description":"Whether the validity period has not started yet.","type":"boolean"},"daysUntilExpiration":{"description":"Days until voucher expires. Null if no expiration date or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = \"ratio unknown\" → resulting credits applied 1:1. 0 = \"explicitly gifted\" → resulting credits carry zero money value.","anyOf":[{"type":"number"},{"type":"null"}]},"sourceOrder":{"description":"Order that spawned this voucher (product-template fulfilment or workflow special action). Null for manually created vouchers.","anyOf":[{"type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol"],"properties":{"orderId":{"description":"Source order ID.","type":"number"},"orderHash":{"description":"Source order hash (admin order detail route segment).","type":"string"},"orderNumber":{"description":"Source order number.","type":"string"},"orderVariableSymbol":{"description":"Source order variable symbol.","type":"string"}}},{"type":"null"}]},"recentOrders":{"description":"Last 5 orders that used this voucher.","type":"array","items":{"description":"Order that used this voucher.","type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol","customerName","orderTotal","currencyCode","usedDate"],"properties":{"orderId":{"description":"Order ID.","type":"number"},"orderHash":{"description":"Order hash (used as the admin order detail route segment).","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"orderVariableSymbol":{"description":"Variable symbol for payment.","type":"string"},"customerName":{"description":"Customer name or \"Anonymous\".","type":"string"},"orderTotal":{"description":"Total order value with VAT.","type":"string"},"currencyCode":{"description":"Currency code (e.g., CZK, EUR).","type":"string"},"usedDate":{"description":"When voucher was applied to this order.","anyOf":[{"description":"When voucher was applied to this order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"linkedProducts":{"description":"Products that generate this voucher when purchased.","type":"array","items":{"description":"Product linked to this voucher template.","type":"object","required":["productId","productName","productCode","productActive"],"properties":{"productId":{"description":"Product ID.","type":"number"},"productName":{"description":"Product name.","type":"string"},"productCode":{"description":"Product SKU/code.","type":"string"},"productActive":{"description":"Whether product is active.","type":"boolean"}}}}},"required":["id","internalId","type","value","usageLimit","usedCount","usedOrderCount","active","effectivelyActive","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","lastUsedDate","note","validFrom","validTo","insertedDate","updatedDate","remainingUsage","isExpired","isNotYetValid","daysUntilExpiration","cost","sourceOrder","recentOrders","linkedProducts"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"Voucher code.","type":"string"},"internalId":{"description":"Internal database ID.","type":"string"},"type":{"description":"Discount type. \"fixed\" = fixed amount discount, \"percentage\" = percentage discount, \"free-credit\" = adds credit to customer account, \"free-product\" = adds free product to order.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"usageLimit":{"description":"Maximum usage count or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"usedCount":{"description":"Current usage count.","type":"number"},"usedOrderCount":{"description":"Number of orders using this voucher.","type":"number"},"active":{"description":"Database active flag.","type":"boolean"},"effectivelyActive":{"description":"Computed status considering expiration, usage limit, and validity period.","type":"boolean"},"isOrderSingleton":{"description":"Single use per order flag.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, each customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"insertedDate":{"description":"Creation date.","anyOf":[{"description":"Creation date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"updatedDate":{"description":"Last modification date.","anyOf":[{"description":"Last modification date.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"remainingUsage":{"description":"Remaining uses before limit is reached. Null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Whether the validity period has ended.","type":"boolean"},"isNotYetValid":{"description":"Whether the validity period has not started yet.","type":"boolean"},"daysUntilExpiration":{"description":"Days until voucher expires. Null if no expiration date or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = \"ratio unknown\" → resulting credits applied 1:1. 0 = \"explicitly gifted\" → resulting credits carry zero money value.","anyOf":[{"type":"number"},{"type":"null"}]},"sourceOrder":{"description":"Order that spawned this voucher (product-template fulfilment or workflow special action). Null for manually created vouchers.","anyOf":[{"type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol"],"properties":{"orderId":{"description":"Source order ID.","type":"number"},"orderHash":{"description":"Source order hash (admin order detail route segment).","type":"string"},"orderNumber":{"description":"Source order number.","type":"string"},"orderVariableSymbol":{"description":"Source order variable symbol.","type":"string"}}},{"type":"null"}]},"recentOrders":{"description":"Last 5 orders that used this voucher.","type":"array","items":{"description":"Order that used this voucher.","type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol","customerName","orderTotal","currencyCode","usedDate"],"properties":{"orderId":{"description":"Order ID.","type":"number"},"orderHash":{"description":"Order hash (used as the admin order detail route segment).","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"orderVariableSymbol":{"description":"Variable symbol for payment.","type":"string"},"customerName":{"description":"Customer name or \"Anonymous\".","type":"string"},"orderTotal":{"description":"Total order value with VAT.","type":"string"},"currencyCode":{"description":"Currency code (e.g., CZK, EUR).","type":"string"},"usedDate":{"description":"When voucher was applied to this order.","anyOf":[{"description":"When voucher was applied to this order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"linkedProducts":{"description":"Products that generate this voucher when purchased.","type":"array","items":{"description":"Product linked to this voucher template.","type":"object","required":["productId","productName","productCode","productActive"],"properties":{"productId":{"description":"Product ID.","type":"number"},"productName":{"description":"Product name.","type":"string"},"productCode":{"description":"Product SKU/code.","type":"string"},"productActive":{"description":"Whether product is active.","type":"boolean"}}}}},"required":["id","internalId","type","value","usageLimit","usedCount","usedOrderCount","active","effectivelyActive","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","lastUsedDate","note","validFrom","validTo","insertedDate","updatedDate","remainingUsage","isExpired","isNotYetValid","daysUntilExpiration","cost","sourceOrder","recentOrders","linkedProducts"]}}}}},"operationId":"getBffVoucherFull-detail","tags":["Voucher"],"summary":"Get comprehensive voucher detail","description":"Returns comprehensive detail of a voucher including usage context, recent orders that used it, linked products (for voucher templates), and computed status fields like effective activity and days until expiration."}},"/bff/voucher/usage-history":{"get":{"parameters":[{"description":"Voucher code to get usage history for.","examples":["SUMMER2024"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Maximum number of items to return (default: 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"Number of items to skip for pagination (default: 0).","examples":["0"],"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"description":"Paginated voucher usage history.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"description":"Array of usage history records.","type":"array","items":{"description":"Single usage history record.","type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol","orderStatus","orderTotalPrice","currencyCode","customerName","customerEmail","usedDate","orderInsertedDate"],"properties":{"orderId":{"description":"Order ID.","type":"number"},"orderHash":{"description":"Order hash (used as the admin order detail route segment).","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"orderVariableSymbol":{"description":"Variable symbol for payment identification.","type":"string"},"orderStatus":{"description":"Current order status label.","type":"string"},"orderTotalPrice":{"description":"Total order value with VAT.","type":"string"},"currencyCode":{"description":"Currency code.","type":"string"},"customerName":{"description":"Customer name or \"Anonymous\".","type":"string"},"customerEmail":{"description":"Customer email address.","type":"string"},"usedDate":{"description":"When the voucher was applied to this order.","anyOf":[{"description":"When the voucher was applied to this order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderInsertedDate":{"description":"When the order was created.","anyOf":[{"description":"When the order was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"totalCount":{"description":"Total number of orders that used this voucher.","type":"number"}},"required":["items","totalCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"description":"Array of usage history records.","type":"array","items":{"description":"Single usage history record.","type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol","orderStatus","orderTotalPrice","currencyCode","customerName","customerEmail","usedDate","orderInsertedDate"],"properties":{"orderId":{"description":"Order ID.","type":"number"},"orderHash":{"description":"Order hash (used as the admin order detail route segment).","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"orderVariableSymbol":{"description":"Variable symbol for payment identification.","type":"string"},"orderStatus":{"description":"Current order status label.","type":"string"},"orderTotalPrice":{"description":"Total order value with VAT.","type":"string"},"currencyCode":{"description":"Currency code.","type":"string"},"customerName":{"description":"Customer name or \"Anonymous\".","type":"string"},"customerEmail":{"description":"Customer email address.","type":"string"},"usedDate":{"description":"When the voucher was applied to this order.","anyOf":[{"description":"When the voucher was applied to this order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderInsertedDate":{"description":"When the order was created.","anyOf":[{"description":"When the order was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"totalCount":{"description":"Total number of orders that used this voucher.","type":"number"}},"required":["items","totalCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"description":"Array of usage history records.","type":"array","items":{"description":"Single usage history record.","type":"object","required":["orderId","orderHash","orderNumber","orderVariableSymbol","orderStatus","orderTotalPrice","currencyCode","customerName","customerEmail","usedDate","orderInsertedDate"],"properties":{"orderId":{"description":"Order ID.","type":"number"},"orderHash":{"description":"Order hash (used as the admin order detail route segment).","type":"string"},"orderNumber":{"description":"Order number.","type":"string"},"orderVariableSymbol":{"description":"Variable symbol for payment identification.","type":"string"},"orderStatus":{"description":"Current order status label.","type":"string"},"orderTotalPrice":{"description":"Total order value with VAT.","type":"string"},"currencyCode":{"description":"Currency code.","type":"string"},"customerName":{"description":"Customer name or \"Anonymous\".","type":"string"},"customerEmail":{"description":"Customer email address.","type":"string"},"usedDate":{"description":"When the voucher was applied to this order.","anyOf":[{"description":"When the voucher was applied to this order.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},"orderInsertedDate":{"description":"When the order was created.","anyOf":[{"description":"When the order was created.","type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}}}},"totalCount":{"description":"Total number of orders that used this voucher.","type":"number"}},"required":["items","totalCount"]}}}}},"operationId":"getBffVoucherUsage-history","tags":["Voucher"],"summary":"Get voucher usage history","description":"Returns paginated history of all orders that used a specific voucher. Includes order details, customer information, and usage timestamps."}},"/bff/voucher/statistics":{"get":{"parameters":[{"description":"Voucher code to get statistics for.","examples":["SUMMER2024"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"description":"Voucher statistics or null.","anyOf":[{"description":"Voucher statistics object.","type":"object","required":["totalOrders","totalRevenue","averageOrderValue","uniqueCustomers","firstUsedDate","lastUsedDate","usageByStatus","remainingUsage","isExpired","isActive","daysUntilExpiration"],"properties":{"totalOrders":{"description":"Total number of orders that used this voucher.","type":"number"},"totalRevenue":{"description":"Sum of all order totals where voucher was used.","type":"string"},"averageOrderValue":{"description":"Average order value when voucher was used.","type":"string"},"uniqueCustomers":{"description":"Number of distinct customers who used the voucher.","type":"number"},"firstUsedDate":{"description":"First time the voucher was used.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastUsedDate":{"description":"Most recent usage of the voucher.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"usageByStatus":{"description":"Breakdown of voucher usage by order status type.","type":"object","required":["paid","pending","cancelled"],"properties":{"paid":{"description":"Orders with paid/completed status.","type":"number"},"pending":{"description":"Orders with pending/processing status.","type":"number"},"cancelled":{"description":"Orders with cancelled/storno status.","type":"number"}}},"remainingUsage":{"description":"Remaining uses before limit. Null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Whether voucher validity period has ended.","type":"boolean"},"isActive":{"description":"Computed effective active status.","type":"boolean"},"daysUntilExpiration":{"description":"Days until expiration. Null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]}}},{"description":"Null if voucher not found.","type":"null"}],"content":{"application/json":{"schema":{"description":"Voucher statistics or null.","anyOf":[{"description":"Voucher statistics object.","type":"object","required":["totalOrders","totalRevenue","averageOrderValue","uniqueCustomers","firstUsedDate","lastUsedDate","usageByStatus","remainingUsage","isExpired","isActive","daysUntilExpiration"],"properties":{"totalOrders":{"description":"Total number of orders that used this voucher.","type":"number"},"totalRevenue":{"description":"Sum of all order totals where voucher was used.","type":"string"},"averageOrderValue":{"description":"Average order value when voucher was used.","type":"string"},"uniqueCustomers":{"description":"Number of distinct customers who used the voucher.","type":"number"},"firstUsedDate":{"description":"First time the voucher was used.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastUsedDate":{"description":"Most recent usage of the voucher.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"usageByStatus":{"description":"Breakdown of voucher usage by order status type.","type":"object","required":["paid","pending","cancelled"],"properties":{"paid":{"description":"Orders with paid/completed status.","type":"number"},"pending":{"description":"Orders with pending/processing status.","type":"number"},"cancelled":{"description":"Orders with cancelled/storno status.","type":"number"}}},"remainingUsage":{"description":"Remaining uses before limit. Null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Whether voucher validity period has ended.","type":"boolean"},"isActive":{"description":"Computed effective active status.","type":"boolean"},"daysUntilExpiration":{"description":"Days until expiration. Null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]}}},{"description":"Null if voucher not found.","type":"null"}]}},"multipart/form-data":{"schema":{"description":"Voucher statistics or null.","anyOf":[{"description":"Voucher statistics object.","type":"object","required":["totalOrders","totalRevenue","averageOrderValue","uniqueCustomers","firstUsedDate","lastUsedDate","usageByStatus","remainingUsage","isExpired","isActive","daysUntilExpiration"],"properties":{"totalOrders":{"description":"Total number of orders that used this voucher.","type":"number"},"totalRevenue":{"description":"Sum of all order totals where voucher was used.","type":"string"},"averageOrderValue":{"description":"Average order value when voucher was used.","type":"string"},"uniqueCustomers":{"description":"Number of distinct customers who used the voucher.","type":"number"},"firstUsedDate":{"description":"First time the voucher was used.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastUsedDate":{"description":"Most recent usage of the voucher.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"usageByStatus":{"description":"Breakdown of voucher usage by order status type.","type":"object","required":["paid","pending","cancelled"],"properties":{"paid":{"description":"Orders with paid/completed status.","type":"number"},"pending":{"description":"Orders with pending/processing status.","type":"number"},"cancelled":{"description":"Orders with cancelled/storno status.","type":"number"}}},"remainingUsage":{"description":"Remaining uses before limit. Null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Whether voucher validity period has ended.","type":"boolean"},"isActive":{"description":"Computed effective active status.","type":"boolean"},"daysUntilExpiration":{"description":"Days until expiration. Null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]}}},{"description":"Null if voucher not found.","type":"null"}]}},"text/plain":{"schema":{"description":"Voucher statistics or null.","anyOf":[{"description":"Voucher statistics object.","type":"object","required":["totalOrders","totalRevenue","averageOrderValue","uniqueCustomers","firstUsedDate","lastUsedDate","usageByStatus","remainingUsage","isExpired","isActive","daysUntilExpiration"],"properties":{"totalOrders":{"description":"Total number of orders that used this voucher.","type":"number"},"totalRevenue":{"description":"Sum of all order totals where voucher was used.","type":"string"},"averageOrderValue":{"description":"Average order value when voucher was used.","type":"string"},"uniqueCustomers":{"description":"Number of distinct customers who used the voucher.","type":"number"},"firstUsedDate":{"description":"First time the voucher was used.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"lastUsedDate":{"description":"Most recent usage of the voucher.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"usageByStatus":{"description":"Breakdown of voucher usage by order status type.","type":"object","required":["paid","pending","cancelled"],"properties":{"paid":{"description":"Orders with paid/completed status.","type":"number"},"pending":{"description":"Orders with pending/processing status.","type":"number"},"cancelled":{"description":"Orders with cancelled/storno status.","type":"number"}}},"remainingUsage":{"description":"Remaining uses before limit. Null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"isExpired":{"description":"Whether voucher validity period has ended.","type":"boolean"},"isActive":{"description":"Computed effective active status.","type":"boolean"},"daysUntilExpiration":{"description":"Days until expiration. Null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]}}},{"description":"Null if voucher not found.","type":"null"}]}}}}},"operationId":"getBffVoucherStatistics","tags":["Voucher"],"summary":"Get voucher statistics","description":"Returns analytics and statistics for a specific voucher including total revenue generated, average order value, unique customer count, and usage breakdown by order status."}},"/bff/voucher/analyze":{"get":{"parameters":[{"description":"Voucher code to analyze.","examples":["SUMMER2024"],"schema":{"type":"string"},"in":"query","name":"code","required":true},{"description":"Optional redemption context. \"order\" = voucher is being added to a reservation/order; \"voucher_page\" = voucher is being redeemed on the dedicated voucher-redeem page. When present, the response includes `rejectionReason`/`rejectionMessage` reflecting what the order engine would answer today.","examples":["order","voucher_page"],"schema":{"type":"string"},"in":"query","name":"redeemContext","required":false},{"description":"Optional numeric contact id. Required to resolve \"single-use per customer\" rejection ahead of time. When omitted the final check still runs during order creation.","examples":["12345"],"schema":{"type":"string"},"in":"query","name":"contactId","required":false}],"responses":{"200":{"description":"Voucher analysis result.","anyOf":[{"description":"Voucher not found.","type":"object","required":["exists","rejectionReason","rejectionMessage"],"properties":{"exists":{"description":"Voucher with this code does not exist.","const":false,"type":"boolean"},"rejectionReason":{"description":"Always \"code_not_found\" for the exists=false branch.","const":"code_not_found","type":"string"},"rejectionMessage":{"description":"Human-readable reason, pre-formatted for the frontend.","type":"string"}}},{"description":"Voucher exists — snapshot with computed status.","type":"object","required":["exists","code","type","value","active","effectivelyActive","isValid","status","usedCount","usageLimit","remainingUsage","validFrom","validTo","daysUntilExpiration","lastUsedDate","note","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","rejectionReason","rejectionMessage","acceptedForContext"],"properties":{"exists":{"const":true,"type":"boolean"},"code":{"description":"Voucher code (canonical, uppercase).","type":"string"},"type":{"description":"Discount type.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"active":{"description":"Database active flag (does NOT consider expiration/limit).","type":"boolean"},"effectivelyActive":{"description":"True if voucher is currently usable (active + within validity + below limit).","type":"boolean"},"isValid":{"description":"Alias of effectivelyActive — convenient flag for UI consumers.","type":"boolean"},"status":{"description":"Computed status enum.","anyOf":[{"const":"active","type":"string"},{"const":"inactive","type":"string"},{"const":"expired","type":"string"},{"const":"not-yet-valid","type":"string"},{"const":"limit-reached","type":"string"}]},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usageLimit":{"description":"Maximum number of uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"remainingUsage":{"description":"Remaining uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"daysUntilExpiration":{"description":"Days remaining until expiration, or null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"isOrderSingleton":{"description":"If true, voucher cannot be combined with other vouchers inside a single order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated \"redeem voucher\" page (typically used for free-credit vouchers).","type":"boolean"},"rejectionReason":{"description":"Rejection reason the order engine would answer for this voucher in the supplied `redeemContext`. Null when the voucher would be accepted or when `redeemContext` was not supplied.","anyOf":[{"const":"code_not_found","type":"string"},{"const":"inactive","type":"string"},{"const":"not_yet_valid","type":"string"},{"const":"expired","type":"string"},{"const":"usage_limit_reached","type":"string"},{"const":"already_used_by_customer","type":"string"},{"const":"wrong_redemption_context","type":"string"},{"type":"null"}]},"rejectionMessage":{"description":"Human-readable rejection message. Null when accepted or no context passed.","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedForContext":{"description":"When the engine accepted the voucher this echoes the requested `redeemContext`; otherwise null.","anyOf":[{"const":"order","type":"string"},{"const":"voucher_page","type":"string"},{"type":"null"}]}}}],"content":{"application/json":{"schema":{"description":"Voucher analysis result.","anyOf":[{"description":"Voucher not found.","type":"object","required":["exists","rejectionReason","rejectionMessage"],"properties":{"exists":{"description":"Voucher with this code does not exist.","const":false,"type":"boolean"},"rejectionReason":{"description":"Always \"code_not_found\" for the exists=false branch.","const":"code_not_found","type":"string"},"rejectionMessage":{"description":"Human-readable reason, pre-formatted for the frontend.","type":"string"}}},{"description":"Voucher exists — snapshot with computed status.","type":"object","required":["exists","code","type","value","active","effectivelyActive","isValid","status","usedCount","usageLimit","remainingUsage","validFrom","validTo","daysUntilExpiration","lastUsedDate","note","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","rejectionReason","rejectionMessage","acceptedForContext"],"properties":{"exists":{"const":true,"type":"boolean"},"code":{"description":"Voucher code (canonical, uppercase).","type":"string"},"type":{"description":"Discount type.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"active":{"description":"Database active flag (does NOT consider expiration/limit).","type":"boolean"},"effectivelyActive":{"description":"True if voucher is currently usable (active + within validity + below limit).","type":"boolean"},"isValid":{"description":"Alias of effectivelyActive — convenient flag for UI consumers.","type":"boolean"},"status":{"description":"Computed status enum.","anyOf":[{"const":"active","type":"string"},{"const":"inactive","type":"string"},{"const":"expired","type":"string"},{"const":"not-yet-valid","type":"string"},{"const":"limit-reached","type":"string"}]},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usageLimit":{"description":"Maximum number of uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"remainingUsage":{"description":"Remaining uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"daysUntilExpiration":{"description":"Days remaining until expiration, or null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"isOrderSingleton":{"description":"If true, voucher cannot be combined with other vouchers inside a single order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated \"redeem voucher\" page (typically used for free-credit vouchers).","type":"boolean"},"rejectionReason":{"description":"Rejection reason the order engine would answer for this voucher in the supplied `redeemContext`. Null when the voucher would be accepted or when `redeemContext` was not supplied.","anyOf":[{"const":"code_not_found","type":"string"},{"const":"inactive","type":"string"},{"const":"not_yet_valid","type":"string"},{"const":"expired","type":"string"},{"const":"usage_limit_reached","type":"string"},{"const":"already_used_by_customer","type":"string"},{"const":"wrong_redemption_context","type":"string"},{"type":"null"}]},"rejectionMessage":{"description":"Human-readable rejection message. Null when accepted or no context passed.","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedForContext":{"description":"When the engine accepted the voucher this echoes the requested `redeemContext`; otherwise null.","anyOf":[{"const":"order","type":"string"},{"const":"voucher_page","type":"string"},{"type":"null"}]}}}]}},"multipart/form-data":{"schema":{"description":"Voucher analysis result.","anyOf":[{"description":"Voucher not found.","type":"object","required":["exists","rejectionReason","rejectionMessage"],"properties":{"exists":{"description":"Voucher with this code does not exist.","const":false,"type":"boolean"},"rejectionReason":{"description":"Always \"code_not_found\" for the exists=false branch.","const":"code_not_found","type":"string"},"rejectionMessage":{"description":"Human-readable reason, pre-formatted for the frontend.","type":"string"}}},{"description":"Voucher exists — snapshot with computed status.","type":"object","required":["exists","code","type","value","active","effectivelyActive","isValid","status","usedCount","usageLimit","remainingUsage","validFrom","validTo","daysUntilExpiration","lastUsedDate","note","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","rejectionReason","rejectionMessage","acceptedForContext"],"properties":{"exists":{"const":true,"type":"boolean"},"code":{"description":"Voucher code (canonical, uppercase).","type":"string"},"type":{"description":"Discount type.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"active":{"description":"Database active flag (does NOT consider expiration/limit).","type":"boolean"},"effectivelyActive":{"description":"True if voucher is currently usable (active + within validity + below limit).","type":"boolean"},"isValid":{"description":"Alias of effectivelyActive — convenient flag for UI consumers.","type":"boolean"},"status":{"description":"Computed status enum.","anyOf":[{"const":"active","type":"string"},{"const":"inactive","type":"string"},{"const":"expired","type":"string"},{"const":"not-yet-valid","type":"string"},{"const":"limit-reached","type":"string"}]},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usageLimit":{"description":"Maximum number of uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"remainingUsage":{"description":"Remaining uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"daysUntilExpiration":{"description":"Days remaining until expiration, or null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"isOrderSingleton":{"description":"If true, voucher cannot be combined with other vouchers inside a single order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated \"redeem voucher\" page (typically used for free-credit vouchers).","type":"boolean"},"rejectionReason":{"description":"Rejection reason the order engine would answer for this voucher in the supplied `redeemContext`. Null when the voucher would be accepted or when `redeemContext` was not supplied.","anyOf":[{"const":"code_not_found","type":"string"},{"const":"inactive","type":"string"},{"const":"not_yet_valid","type":"string"},{"const":"expired","type":"string"},{"const":"usage_limit_reached","type":"string"},{"const":"already_used_by_customer","type":"string"},{"const":"wrong_redemption_context","type":"string"},{"type":"null"}]},"rejectionMessage":{"description":"Human-readable rejection message. Null when accepted or no context passed.","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedForContext":{"description":"When the engine accepted the voucher this echoes the requested `redeemContext`; otherwise null.","anyOf":[{"const":"order","type":"string"},{"const":"voucher_page","type":"string"},{"type":"null"}]}}}]}},"text/plain":{"schema":{"description":"Voucher analysis result.","anyOf":[{"description":"Voucher not found.","type":"object","required":["exists","rejectionReason","rejectionMessage"],"properties":{"exists":{"description":"Voucher with this code does not exist.","const":false,"type":"boolean"},"rejectionReason":{"description":"Always \"code_not_found\" for the exists=false branch.","const":"code_not_found","type":"string"},"rejectionMessage":{"description":"Human-readable reason, pre-formatted for the frontend.","type":"string"}}},{"description":"Voucher exists — snapshot with computed status.","type":"object","required":["exists","code","type","value","active","effectivelyActive","isValid","status","usedCount","usageLimit","remainingUsage","validFrom","validTo","daysUntilExpiration","lastUsedDate","note","isOrderSingleton","singleUsePerCustomer","redeemableAtOrder","redeemableAtVoucherPage","rejectionReason","rejectionMessage","acceptedForContext"],"properties":{"exists":{"const":true,"type":"boolean"},"code":{"description":"Voucher code (canonical, uppercase).","type":"string"},"type":{"description":"Discount type.","anyOf":[{"const":"fixed","type":"string"},{"const":"percentage","type":"string"},{"const":"free-credit","type":"string"},{"const":"free-product","type":"string"}]},"value":{"description":"Discount value.","type":"string"},"active":{"description":"Database active flag (does NOT consider expiration/limit).","type":"boolean"},"effectivelyActive":{"description":"True if voucher is currently usable (active + within validity + below limit).","type":"boolean"},"isValid":{"description":"Alias of effectivelyActive — convenient flag for UI consumers.","type":"boolean"},"status":{"description":"Computed status enum.","anyOf":[{"const":"active","type":"string"},{"const":"inactive","type":"string"},{"const":"expired","type":"string"},{"const":"not-yet-valid","type":"string"},{"const":"limit-reached","type":"string"}]},"usedCount":{"description":"Number of times voucher has been used.","type":"number"},"usageLimit":{"description":"Maximum number of uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"remainingUsage":{"description":"Remaining uses, or null if unlimited.","anyOf":[{"type":"number"},{"type":"null"}]},"validFrom":{"description":"Validity start date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"validTo":{"description":"Validity end date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"daysUntilExpiration":{"description":"Days remaining until expiration, or null if no expiration or already expired.","anyOf":[{"type":"number"},{"type":"null"}]},"lastUsedDate":{"description":"Last usage date.","anyOf":[{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]},{"type":"null"}]},"note":{"description":"Internal note (full content).","type":"string"},"isOrderSingleton":{"description":"If true, voucher cannot be combined with other vouchers inside a single order.","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order.","type":"boolean"},"redeemableAtOrder":{"description":"If true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated \"redeem voucher\" page (typically used for free-credit vouchers).","type":"boolean"},"rejectionReason":{"description":"Rejection reason the order engine would answer for this voucher in the supplied `redeemContext`. Null when the voucher would be accepted or when `redeemContext` was not supplied.","anyOf":[{"const":"code_not_found","type":"string"},{"const":"inactive","type":"string"},{"const":"not_yet_valid","type":"string"},{"const":"expired","type":"string"},{"const":"usage_limit_reached","type":"string"},{"const":"already_used_by_customer","type":"string"},{"const":"wrong_redemption_context","type":"string"},{"type":"null"}]},"rejectionMessage":{"description":"Human-readable rejection message. Null when accepted or no context passed.","anyOf":[{"type":"string"},{"type":"null"}]},"acceptedForContext":{"description":"When the engine accepted the voucher this echoes the requested `redeemContext`; otherwise null.","anyOf":[{"const":"order","type":"string"},{"const":"voucher_page","type":"string"},{"type":"null"}]}}}]}}}}},"operationId":"getBffVoucherAnalyze","tags":["Voucher"],"summary":"Analyze voucher code","description":"Returns a lightweight snapshot of a voucher: whether it exists in the organisation and, if it does, its computed status (active / inactive / expired / not-yet-valid / limit-reached). Unlike /full-detail, this endpoint does NOT throw when the voucher is missing. BIZKIT-19: when `redeemContext` is supplied, the response additionally carries the engine rejection reason this voucher would hit for that context."}},"/bff/voucher/check-code-available":{"get":{"parameters":[{"description":"Voucher code to check availability for.","examples":["WELCOME10"],"schema":{"type":"string"},"in":"query","name":"code","required":true}],"responses":{"200":{"description":"Code availability result.","content":{"application/json":{"schema":{"type":"object","properties":{"available":{"description":"True if the code is available, false if already taken.","type":"boolean"}},"required":["available"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"available":{"description":"True if the code is available, false if already taken.","type":"boolean"}},"required":["available"]}},"text/plain":{"schema":{"type":"object","properties":{"available":{"description":"True if the code is available, false if already taken.","type":"boolean"}},"required":["available"]}}}}},"operationId":"getBffVoucherCheck-code-available","tags":["Voucher"],"summary":"Check voucher code availability","description":"Checks if a voucher code is available (not already taken) within the organisation. Use this before creating a new voucher to ensure uniqueness."}},"/bff/voucher/add":{"post":{"parameters":[],"responses":{"200":{"description":"Created voucher confirmation.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"description":"The created voucher code.","type":"string"}},"required":["code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"code":{"description":"The created voucher code.","type":"string"}},"required":["code"]}},"text/plain":{"schema":{"type":"object","properties":{"code":{"description":"The created voucher code.","type":"string"}},"required":["code"]}}}}},"operationId":"postBffVoucherAdd","tags":["Voucher"],"summary":"Create new voucher","description":"Creates a new voucher with the specified parameters. The voucher code must be unique within the organisation and will be converted to uppercase.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","type","value"],"properties":{"code":{"description":"Unique voucher code (will be converted to uppercase).","examples":["SUMMER2024"],"type":"string"},"type":{"description":"Discount type: fixed, percentage, free-credit, or free-product.","examples":["percentage"],"type":"string"},"value":{"description":"Discount value (e.g., \"100\" for fixed, \"10\" for 10% percentage).","examples":["10"],"type":"string"},"usageLimit":{"description":"Maximum number of uses. Omit for unlimited.","examples":[100],"type":"number"},"note":{"description":"Internal note for administrative purposes.","examples":["Summer campaign"],"type":"string"},"active":{"description":"Whether voucher is active immediately (default: false).","type":"boolean"},"isOrderSingleton":{"description":"Limit to one use per order (default: false).","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order. If false (default), the voucher is bounded only by usageLimit + validity.","type":"boolean"},"redeemableAtOrder":{"description":"If true (default), voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated voucher-redeem page (typically used for free-credit vouchers; default FALSE).","type":"boolean"},"validFrom":{"description":"ISO date string for validity start.","examples":["2024-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date string for validity end.","examples":["2024-12-31T23:59:59Z"],"type":"string"},"cost":{"description":"Money the voucher cost when issued (organisation default currency). Use null to leave unset → resulting credits applied 1:1 to money. Use 0 to mark as gifted → resulting credits carry zero money value. Any positive number is the real cash equivalent of the voucher.","examples":[0,500,1000],"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","type","value"],"properties":{"code":{"description":"Unique voucher code (will be converted to uppercase).","examples":["SUMMER2024"],"type":"string"},"type":{"description":"Discount type: fixed, percentage, free-credit, or free-product.","examples":["percentage"],"type":"string"},"value":{"description":"Discount value (e.g., \"100\" for fixed, \"10\" for 10% percentage).","examples":["10"],"type":"string"},"usageLimit":{"description":"Maximum number of uses. Omit for unlimited.","examples":[100],"type":"number"},"note":{"description":"Internal note for administrative purposes.","examples":["Summer campaign"],"type":"string"},"active":{"description":"Whether voucher is active immediately (default: false).","type":"boolean"},"isOrderSingleton":{"description":"Limit to one use per order (default: false).","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order. If false (default), the voucher is bounded only by usageLimit + validity.","type":"boolean"},"redeemableAtOrder":{"description":"If true (default), voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated voucher-redeem page (typically used for free-credit vouchers; default FALSE).","type":"boolean"},"validFrom":{"description":"ISO date string for validity start.","examples":["2024-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date string for validity end.","examples":["2024-12-31T23:59:59Z"],"type":"string"},"cost":{"description":"Money the voucher cost when issued (organisation default currency). Use null to leave unset → resulting credits applied 1:1 to money. Use 0 to mark as gifted → resulting credits carry zero money value. Any positive number is the real cash equivalent of the voucher.","examples":[0,500,1000],"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code","type","value"],"properties":{"code":{"description":"Unique voucher code (will be converted to uppercase).","examples":["SUMMER2024"],"type":"string"},"type":{"description":"Discount type: fixed, percentage, free-credit, or free-product.","examples":["percentage"],"type":"string"},"value":{"description":"Discount value (e.g., \"100\" for fixed, \"10\" for 10% percentage).","examples":["10"],"type":"string"},"usageLimit":{"description":"Maximum number of uses. Omit for unlimited.","examples":[100],"type":"number"},"note":{"description":"Internal note for administrative purposes.","examples":["Summer campaign"],"type":"string"},"active":{"description":"Whether voucher is active immediately (default: false).","type":"boolean"},"isOrderSingleton":{"description":"Limit to one use per order (default: false).","type":"boolean"},"singleUsePerCustomer":{"description":"If true, every customer may redeem this voucher on at most one order. If false (default), the voucher is bounded only by usageLimit + validity.","type":"boolean"},"redeemableAtOrder":{"description":"If true (default), voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"If true, voucher may be redeemed on the dedicated voucher-redeem page (typically used for free-credit vouchers; default FALSE).","type":"boolean"},"validFrom":{"description":"ISO date string for validity start.","examples":["2024-01-01T00:00:00Z"],"type":"string"},"validTo":{"description":"ISO date string for validity end.","examples":["2024-12-31T23:59:59Z"],"type":"string"},"cost":{"description":"Money the voucher cost when issued (organisation default currency). Use null to leave unset → resulting credits applied 1:1 to money. Use 0 to mark as gifted → resulting credits carry zero money value. Any positive number is the real cash equivalent of the voucher.","examples":[0,500,1000],"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/voucher/update":{"post":{"parameters":[],"responses":{"200":{"description":"Update result.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"},"code":{"description":"The updated voucher code.","type":"string"}},"required":["success","code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"},"code":{"description":"The updated voucher code.","type":"string"}},"required":["success","code"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether the update was successful.","type":"boolean"},"code":{"description":"The updated voucher code.","type":"string"}},"required":["success","code"]}}}}},"operationId":"postBffVoucherUpdate","tags":["Voucher"],"summary":"Update existing voucher","description":"Updates an existing voucher. Only provided fields will be updated; omitted fields remain unchanged. Use null to explicitly remove optional values.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Voucher code to update (identifier, cannot be changed).","examples":["SUMMER2024"],"type":"string"},"type":{"description":"New discount type.","examples":["percentage"],"type":"string"},"value":{"description":"New discount value.","examples":["15"],"type":"string"},"usageLimit":{"description":"New usage limit. Set to null to remove limit.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"New internal note.","type":"string"},"active":{"description":"New active status.","type":"boolean"},"isOrderSingleton":{"description":"New singleton flag.","type":"boolean"},"singleUsePerCustomer":{"description":"When true, each customer may redeem this voucher on at most one order. Only usageLimit + validity apply when false.","type":"boolean"},"redeemableAtOrder":{"description":"When true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"When true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"hasValidityPeriod":{"description":"UI-only flag from the admin form: when false, validFrom/validTo are cleared regardless of their values.","type":"boolean"},"validFrom":{"description":"New validity start. Set to null to remove.","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"New validity end. Set to null to remove.","anyOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"New voucher cost (organisation default currency). null = ratio unknown (1:1 fallback on next credit application); 0 = explicitly gifted; positive number = real money equivalent.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Voucher code to update (identifier, cannot be changed).","examples":["SUMMER2024"],"type":"string"},"type":{"description":"New discount type.","examples":["percentage"],"type":"string"},"value":{"description":"New discount value.","examples":["15"],"type":"string"},"usageLimit":{"description":"New usage limit. Set to null to remove limit.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"New internal note.","type":"string"},"active":{"description":"New active status.","type":"boolean"},"isOrderSingleton":{"description":"New singleton flag.","type":"boolean"},"singleUsePerCustomer":{"description":"When true, each customer may redeem this voucher on at most one order. Only usageLimit + validity apply when false.","type":"boolean"},"redeemableAtOrder":{"description":"When true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"When true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"hasValidityPeriod":{"description":"UI-only flag from the admin form: when false, validFrom/validTo are cleared regardless of their values.","type":"boolean"},"validFrom":{"description":"New validity start. Set to null to remove.","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"New validity end. Set to null to remove.","anyOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"New voucher cost (organisation default currency). null = ratio unknown (1:1 fallback on next credit application); 0 = explicitly gifted; positive number = real money equivalent.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Voucher code to update (identifier, cannot be changed).","examples":["SUMMER2024"],"type":"string"},"type":{"description":"New discount type.","examples":["percentage"],"type":"string"},"value":{"description":"New discount value.","examples":["15"],"type":"string"},"usageLimit":{"description":"New usage limit. Set to null to remove limit.","anyOf":[{"type":"number"},{"type":"null"}]},"note":{"description":"New internal note.","type":"string"},"active":{"description":"New active status.","type":"boolean"},"isOrderSingleton":{"description":"New singleton flag.","type":"boolean"},"singleUsePerCustomer":{"description":"When true, each customer may redeem this voucher on at most one order. Only usageLimit + validity apply when false.","type":"boolean"},"redeemableAtOrder":{"description":"When true, voucher may be redeemed on the reservation / order form.","type":"boolean"},"redeemableAtVoucherPage":{"description":"When true, voucher may be redeemed on the voucher-redeem page.","type":"boolean"},"hasValidityPeriod":{"description":"UI-only flag from the admin form: when false, validFrom/validTo are cleared regardless of their values.","type":"boolean"},"validFrom":{"description":"New validity start. Set to null to remove.","anyOf":[{"type":"string"},{"type":"null"}]},"validTo":{"description":"New validity end. Set to null to remove.","anyOf":[{"type":"string"},{"type":"null"}]},"cost":{"description":"New voucher cost (organisation default currency). null = ratio unknown (1:1 fallback on next credit application); 0 = explicitly gifted; positive number = real money equivalent.","anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/voucher/bulk-create":{"post":{"parameters":[],"responses":{"200":{"description":"Bulk-create result.","content":{"application/json":{"schema":{"type":"object","properties":{"codes":{"description":"Generated voucher codes, in insertion order.","type":"array","items":{"type":"string"}}},"required":["codes"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"codes":{"description":"Generated voucher codes, in insertion order.","type":"array","items":{"type":"string"}}},"required":["codes"]}},"text/plain":{"schema":{"type":"object","properties":{"codes":{"description":"Generated voucher codes, in insertion order.","type":"array","items":{"type":"string"}}},"required":["codes"]}}}}},"operationId":"postBffVoucherBulk-create","tags":["Voucher"],"summary":"Bulk-create vouchers","description":"Generates a batch of unique voucher codes in a single transaction. Two generation modes: \"random\" (length + charset + optional prefix/suffix) and \"pattern\" (template with # / 9 / A placeholders). All vouchers share the same type, value, validity, usage limit and note. Returns the list of generated codes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["count","generationMode","generationCharset","type","value"],"properties":{"count":{"minimum":1,"maximum":1000,"description":"Number of voucher codes to generate in this batch (1–1000).","examples":[10,100],"type":"number"},"generationMode":{"description":"\"random\" = length + charset + optional prefix/suffix; \"pattern\" = template with # / 9 / A.","examples":["random"],"anyOf":[{"const":"random","type":"string"},{"const":"pattern","type":"string"}]},"generationCharset":{"description":"Character set: alphanumeric, alpha, numeric, or unambiguous (no O/0/I/1/L).","examples":["alphanumeric"],"type":"string"},"generationLength":{"minimum":4,"maximum":32,"description":"Length of the random portion when generationMode = random (4–32).","examples":[8,12],"type":"number"},"generationPrefix":{"description":"Literal prefix prepended to every generated code (uppercased). Random mode only.","examples":["XMAS-"],"type":"string"},"generationSuffix":{"description":"Literal suffix appended to every generated code (uppercased). Random mode only.","type":"string"},"generationPattern":{"description":"Template with placeholders: # / * = any char from charset, 9 = digit, A = letter. Other characters are literals. Pattern mode only.","examples":["XMAS-####","GIFT-AA-9999"],"type":"string"},"type":{"description":"Discount type applied to every generated voucher.","examples":["fixed"],"type":"string"},"value":{"description":"Discount value applied to every generated voucher.","examples":["100"],"type":"string"},"usageLimit":{"description":"Maximum number of uses per voucher. Omit for unlimited.","examples":[1],"type":"number"},"note":{"description":"Internal note shared across the whole batch (useful for filtering later).","examples":["Vánoční kampaň 2026"],"type":"string"},"active":{"description":"Whether the vouchers are active immediately.","type":"boolean"},"isOrderSingleton":{"description":"Limit each voucher to one use per order.","type":"boolean"},"singleUsePerCustomer":{"description":"When true, every customer may redeem each voucher in the batch on at most one order. When false (default), the voucher is bounded only by usageLimit + validity.","type":"boolean"},"redeemableAtOrder":{"description":"Applied to every voucher in the batch (default TRUE).","type":"boolean"},"redeemableAtVoucherPage":{"description":"Applied to every voucher in the batch (default FALSE).","type":"boolean"},"validFrom":{"description":"ISO date string for validity start.","type":"string"},"validTo":{"description":"ISO date string for validity end.","type":"string"},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = unknown ratio, 0 = explicitly gifted, positive number = real cash equivalent. Applied to every voucher in the batch.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["count","generationMode","generationCharset","type","value"],"properties":{"count":{"minimum":1,"maximum":1000,"description":"Number of voucher codes to generate in this batch (1–1000).","examples":[10,100],"type":"number"},"generationMode":{"description":"\"random\" = length + charset + optional prefix/suffix; \"pattern\" = template with # / 9 / A.","examples":["random"],"anyOf":[{"const":"random","type":"string"},{"const":"pattern","type":"string"}]},"generationCharset":{"description":"Character set: alphanumeric, alpha, numeric, or unambiguous (no O/0/I/1/L).","examples":["alphanumeric"],"type":"string"},"generationLength":{"minimum":4,"maximum":32,"description":"Length of the random portion when generationMode = random (4–32).","examples":[8,12],"type":"number"},"generationPrefix":{"description":"Literal prefix prepended to every generated code (uppercased). Random mode only.","examples":["XMAS-"],"type":"string"},"generationSuffix":{"description":"Literal suffix appended to every generated code (uppercased). Random mode only.","type":"string"},"generationPattern":{"description":"Template with placeholders: # / * = any char from charset, 9 = digit, A = letter. Other characters are literals. Pattern mode only.","examples":["XMAS-####","GIFT-AA-9999"],"type":"string"},"type":{"description":"Discount type applied to every generated voucher.","examples":["fixed"],"type":"string"},"value":{"description":"Discount value applied to every generated voucher.","examples":["100"],"type":"string"},"usageLimit":{"description":"Maximum number of uses per voucher. Omit for unlimited.","examples":[1],"type":"number"},"note":{"description":"Internal note shared across the whole batch (useful for filtering later).","examples":["Vánoční kampaň 2026"],"type":"string"},"active":{"description":"Whether the vouchers are active immediately.","type":"boolean"},"isOrderSingleton":{"description":"Limit each voucher to one use per order.","type":"boolean"},"singleUsePerCustomer":{"description":"When true, every customer may redeem each voucher in the batch on at most one order. When false (default), the voucher is bounded only by usageLimit + validity.","type":"boolean"},"redeemableAtOrder":{"description":"Applied to every voucher in the batch (default TRUE).","type":"boolean"},"redeemableAtVoucherPage":{"description":"Applied to every voucher in the batch (default FALSE).","type":"boolean"},"validFrom":{"description":"ISO date string for validity start.","type":"string"},"validTo":{"description":"ISO date string for validity end.","type":"string"},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = unknown ratio, 0 = explicitly gifted, positive number = real cash equivalent. Applied to every voucher in the batch.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["count","generationMode","generationCharset","type","value"],"properties":{"count":{"minimum":1,"maximum":1000,"description":"Number of voucher codes to generate in this batch (1–1000).","examples":[10,100],"type":"number"},"generationMode":{"description":"\"random\" = length + charset + optional prefix/suffix; \"pattern\" = template with # / 9 / A.","examples":["random"],"anyOf":[{"const":"random","type":"string"},{"const":"pattern","type":"string"}]},"generationCharset":{"description":"Character set: alphanumeric, alpha, numeric, or unambiguous (no O/0/I/1/L).","examples":["alphanumeric"],"type":"string"},"generationLength":{"minimum":4,"maximum":32,"description":"Length of the random portion when generationMode = random (4–32).","examples":[8,12],"type":"number"},"generationPrefix":{"description":"Literal prefix prepended to every generated code (uppercased). Random mode only.","examples":["XMAS-"],"type":"string"},"generationSuffix":{"description":"Literal suffix appended to every generated code (uppercased). Random mode only.","type":"string"},"generationPattern":{"description":"Template with placeholders: # / * = any char from charset, 9 = digit, A = letter. Other characters are literals. Pattern mode only.","examples":["XMAS-####","GIFT-AA-9999"],"type":"string"},"type":{"description":"Discount type applied to every generated voucher.","examples":["fixed"],"type":"string"},"value":{"description":"Discount value applied to every generated voucher.","examples":["100"],"type":"string"},"usageLimit":{"description":"Maximum number of uses per voucher. Omit for unlimited.","examples":[1],"type":"number"},"note":{"description":"Internal note shared across the whole batch (useful for filtering later).","examples":["Vánoční kampaň 2026"],"type":"string"},"active":{"description":"Whether the vouchers are active immediately.","type":"boolean"},"isOrderSingleton":{"description":"Limit each voucher to one use per order.","type":"boolean"},"singleUsePerCustomer":{"description":"When true, every customer may redeem each voucher in the batch on at most one order. When false (default), the voucher is bounded only by usageLimit + validity.","type":"boolean"},"redeemableAtOrder":{"description":"Applied to every voucher in the batch (default TRUE).","type":"boolean"},"redeemableAtVoucherPage":{"description":"Applied to every voucher in the batch (default FALSE).","type":"boolean"},"validFrom":{"description":"ISO date string for validity start.","type":"string"},"validTo":{"description":"ISO date string for validity end.","type":"string"},"cost":{"description":"Money the voucher cost when issued (organisation default currency). null = unknown ratio, 0 = explicitly gifted, positive number = real cash equivalent. Applied to every voucher in the batch.","anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/voucher/restore-usage":{"post":{"parameters":[],"responses":{"200":{"description":"Restore result.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Always true when no exception was raised.","type":"boolean"},"code":{"description":"Canonical voucher code.","type":"string"},"orderId":{"description":"Order id the restore ran against.","type":"number"},"wasAttached":{"description":"True when a (voucher, order) row existed and was removed. False means the restore was idempotent (nothing to undo).","type":"boolean"},"usedCountBefore":{"description":"Voucher used_count before the restore.","type":"number"},"usedCountAfter":{"description":"Voucher used_count after the restore.","type":"number"},"creditReversal":{"description":"Outcome of the free-credit reversal step.","type":"object","required":["reversed"],"properties":{"reversed":{"description":"True when a negative credit record was inserted.","type":"boolean"},"creditAmount":{"description":"Original positive credit amount (now reversed).","type":"number"},"creditAmountMoney":{"description":"Original positive credit money value (now reversed).","type":"number"},"reasonSkipped":{"description":"Explanation why no reversal happened (only present when reversed=false). Values: attachment-not-found | voucher-type-does-not-generate-credit | no-credit-record-found.","type":"string"}}}},"required":["success","code","orderId","wasAttached","usedCountBefore","usedCountAfter","creditReversal"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Always true when no exception was raised.","type":"boolean"},"code":{"description":"Canonical voucher code.","type":"string"},"orderId":{"description":"Order id the restore ran against.","type":"number"},"wasAttached":{"description":"True when a (voucher, order) row existed and was removed. False means the restore was idempotent (nothing to undo).","type":"boolean"},"usedCountBefore":{"description":"Voucher used_count before the restore.","type":"number"},"usedCountAfter":{"description":"Voucher used_count after the restore.","type":"number"},"creditReversal":{"description":"Outcome of the free-credit reversal step.","type":"object","required":["reversed"],"properties":{"reversed":{"description":"True when a negative credit record was inserted.","type":"boolean"},"creditAmount":{"description":"Original positive credit amount (now reversed).","type":"number"},"creditAmountMoney":{"description":"Original positive credit money value (now reversed).","type":"number"},"reasonSkipped":{"description":"Explanation why no reversal happened (only present when reversed=false). Values: attachment-not-found | voucher-type-does-not-generate-credit | no-credit-record-found.","type":"string"}}}},"required":["success","code","orderId","wasAttached","usedCountBefore","usedCountAfter","creditReversal"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Always true when no exception was raised.","type":"boolean"},"code":{"description":"Canonical voucher code.","type":"string"},"orderId":{"description":"Order id the restore ran against.","type":"number"},"wasAttached":{"description":"True when a (voucher, order) row existed and was removed. False means the restore was idempotent (nothing to undo).","type":"boolean"},"usedCountBefore":{"description":"Voucher used_count before the restore.","type":"number"},"usedCountAfter":{"description":"Voucher used_count after the restore.","type":"number"},"creditReversal":{"description":"Outcome of the free-credit reversal step.","type":"object","required":["reversed"],"properties":{"reversed":{"description":"True when a negative credit record was inserted.","type":"boolean"},"creditAmount":{"description":"Original positive credit amount (now reversed).","type":"number"},"creditAmountMoney":{"description":"Original positive credit money value (now reversed).","type":"number"},"reasonSkipped":{"description":"Explanation why no reversal happened (only present when reversed=false). Values: attachment-not-found | voucher-type-does-not-generate-credit | no-credit-record-found.","type":"string"}}}},"required":["success","code","orderId","wasAttached","usedCountBefore","usedCountAfter","creditReversal"]}}}}},"operationId":"postBffVoucherRestore-usage","tags":["Voucher"],"summary":"Restore a voucher usage (undo attachment)","description":"BIZKIT-19 — reverses a single voucher usage: removes the (voucher, order) row from shop__order_voucher, decrements the voucher counter (floor 0), reverses any free-credit top-up this voucher produced on that order, and records the operator identity + reason in the activity log. Idempotent for already-restored attachments.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","orderId"],"properties":{"code":{"description":"Voucher code to restore. Must belong to the authenticated organisation.","examples":["PRVNI20"],"type":"string"},"orderId":{"description":"Internal id of the order whose voucher attachment should be removed.","type":"number"},"reason":{"description":"Free-form reason recorded verbatim in the audit activity entry. Strongly recommended so the ledger explains why the usage was undone. The admin UI MUST force a confirm dialog before calling this endpoint.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","orderId"],"properties":{"code":{"description":"Voucher code to restore. Must belong to the authenticated organisation.","examples":["PRVNI20"],"type":"string"},"orderId":{"description":"Internal id of the order whose voucher attachment should be removed.","type":"number"},"reason":{"description":"Free-form reason recorded verbatim in the audit activity entry. Strongly recommended so the ledger explains why the usage was undone. The admin UI MUST force a confirm dialog before calling this endpoint.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code","orderId"],"properties":{"code":{"description":"Voucher code to restore. Must belong to the authenticated organisation.","examples":["PRVNI20"],"type":"string"},"orderId":{"description":"Internal id of the order whose voucher attachment should be removed.","type":"number"},"reason":{"description":"Free-form reason recorded verbatim in the audit activity entry. Strongly recommended so the ledger explains why the usage was undone. The admin UI MUST force a confirm dialog before calling this endpoint.","type":"string"}}}}}}}},"/bff/voucher/deactivate":{"post":{"parameters":[],"responses":{"200":{"description":"Deactivation result.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"description":"Whether deactivation was successful.","type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"description":"Whether deactivation was successful.","type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"description":"Whether deactivation was successful.","type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffVoucherDeactivate","tags":["Voucher"],"summary":"Deactivate voucher","description":"Deactivates a voucher by setting its active flag to false. This is a soft delete - the voucher remains in the database but cannot be used. Use update endpoint with active: true to reactivate.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Voucher code to deactivate.","examples":["SUMMER2024"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Voucher code to deactivate.","examples":["SUMMER2024"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Voucher code to deactivate.","examples":["SUMMER2024"],"type":"string"}}}}}}}},"/bff/warehouse/list":{"get":{"parameters":[{"description":"\"true\" to hide inactive warehouses.","schema":{"type":"string"},"in":"query","name":"onlyActive","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","description","addressStreet","addressCity","addressZip","addressCountry","isDefault","isActive","allowNegativeStock","managerMemberId","stockItemCount","totalQuantity","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"description":"When true (default), outbound / transfer / adjustment may drive the cell to negative quantity.","type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockItemCount":{"type":"number"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","description","addressStreet","addressCity","addressZip","addressCountry","isDefault","isActive","allowNegativeStock","managerMemberId","stockItemCount","totalQuantity","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"description":"When true (default), outbound / transfer / adjustment may drive the cell to negative quantity.","type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockItemCount":{"type":"number"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","description","addressStreet","addressCity","addressZip","addressCountry","isDefault","isActive","allowNegativeStock","managerMemberId","stockItemCount","totalQuantity","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"description":"When true (default), outbound / transfer / adjustment may drive the cell to negative quantity.","type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockItemCount":{"type":"number"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffWarehouseList","tags":["Warehouse"],"summary":"List warehouses"}},"/bff/warehouse/detail":{"get":{"parameters":[{"description":"Numeric id.","schema":{"type":"string"},"in":"query","name":"id","required":false},{"description":"String code.","schema":{"type":"string"},"in":"query","name":"code","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"description":"When true (default), outbound / transfer / adjustment may drive the cell to negative quantity.","type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockItemCount":{"type":"number"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}},"required":["id","code","name","description","addressStreet","addressCity","addressZip","addressCountry","isDefault","isActive","allowNegativeStock","managerMemberId","stockItemCount","totalQuantity","insertedDate","updatedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"description":"When true (default), outbound / transfer / adjustment may drive the cell to negative quantity.","type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockItemCount":{"type":"number"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}},"required":["id","code","name","description","addressStreet","addressCity","addressZip","addressCountry","isDefault","isActive","allowNegativeStock","managerMemberId","stockItemCount","totalQuantity","insertedDate","updatedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"description":"When true (default), outbound / transfer / adjustment may drive the cell to negative quantity.","type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockItemCount":{"type":"number"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}},"required":["id","code","name","description","addressStreet","addressCity","addressZip","addressCountry","isDefault","isActive","allowNegativeStock","managerMemberId","stockItemCount","totalQuantity","insertedDate","updatedDate"]}}}}},"operationId":"getBffWarehouseDetail","tags":["Warehouse"],"summary":"Get warehouse detail by id or code"}},"/bff/warehouse/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"},"isDefault":{"type":"boolean"}},"required":["success","id","isDefault"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"},"isDefault":{"type":"boolean"}},"required":["success","id","isDefault"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"},"isDefault":{"type":"boolean"}},"required":["success","id","isDefault"]}}}}},"operationId":"postBffWarehouseCreate","tags":["Warehouse"],"summary":"Create warehouse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","name"],"properties":{"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"maxLength":2,"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","name"],"properties":{"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"maxLength":2,"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code","name"],"properties":{"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"maxLength":2,"type":"string"},{"type":"null"}]},"isDefault":{"type":"boolean"},"isActive":{"type":"boolean"},"allowNegativeStock":{"type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseUpdate","tags":["Warehouse"],"summary":"Update warehouse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"allowNegativeStock":{"type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"allowNegativeStock":{"type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressStreet":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCity":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressZip":{"anyOf":[{"type":"string"},{"type":"null"}]},"addressCountry":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"allowNegativeStock":{"type":"boolean"},"managerMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/set-default":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseSet-default","tags":["Warehouse"],"summary":"Promote a warehouse to organisation default","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"}}}}}}}},"/bff/warehouse/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseDelete","tags":["Warehouse"],"summary":"Delete an empty warehouse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"}}}}}}}},"/bff/warehouse/location/list":{"get":{"parameters":[{"description":"Numeric warehouse id.","schema":{"type":"string"},"in":"query","name":"warehouseId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","parentLocationId","code","name","note","isActive","totalQuantity","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"code":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","parentLocationId","code","name","note","isActive","totalQuantity","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"code":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","parentLocationId","code","name","note","isActive","totalQuantity","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"code":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"totalQuantity":{"type":"number"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}}},"required":["items"]}}}}},"operationId":"getBffWarehouseLocationList","tags":["Warehouse"],"summary":"List locations in a warehouse"}},"/bff/warehouse/product-defaults":{"get":{"parameters":[{"description":"Product code (variants inherit the product defaults).","schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"number"},"defaultWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseName","locationId","locationCode","locationName"],"properties":{"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"type":"number"},"locationCode":{"type":"string"},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["productId","defaultWarehouseId","purchaseLeadTimeDays","locations"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"productId":{"type":"number"},"defaultWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseName","locationId","locationCode","locationName"],"properties":{"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"type":"number"},"locationCode":{"type":"string"},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["productId","defaultWarehouseId","purchaseLeadTimeDays","locations"]}},"text/plain":{"schema":{"type":"object","properties":{"productId":{"type":"number"},"defaultWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"purchaseLeadTimeDays":{"anyOf":[{"type":"number"},{"type":"null"}]},"locations":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseName","locationId","locationCode","locationName"],"properties":{"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"type":"number"},"locationCode":{"type":"string"},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["productId","defaultWarehouseId","purchaseLeadTimeDays","locations"]}}}}},"operationId":"getBffWarehouseProduct-defaults","tags":["Warehouse"],"summary":"Product default warehouse, per-warehouse location and lead time"}},"/bff/warehouse/product-location/set":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseProduct-locationSet","tags":["Warehouse"],"summary":"Set the product default location in a warehouse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","warehouseId","locationId"],"properties":{"productCode":{"type":"string"},"warehouseId":{"type":"number"},"locationId":{"description":"NULL clears the default location in this warehouse.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","warehouseId","locationId"],"properties":{"productCode":{"type":"string"},"warehouseId":{"type":"number"},"locationId":{"description":"NULL clears the default location in this warehouse.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["productCode","warehouseId","locationId"],"properties":{"productCode":{"type":"string"},"warehouseId":{"type":"number"},"locationId":{"description":"NULL clears the default location in this warehouse.","anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/location/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"}},"required":["success","id"]}}}}},"operationId":"postBffWarehouseLocationCreate","tags":["Warehouse"],"summary":"Create a location","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["warehouseId","code"],"properties":{"warehouseId":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isActive":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["warehouseId","code"],"properties":{"warehouseId":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isActive":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["warehouseId","code"],"properties":{"warehouseId":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isActive":{"type":"boolean"}}}}}}}},"/bff/warehouse/location/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseLocationUpdate","tags":["Warehouse"],"summary":"Update a location","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isActive":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isActive":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"isActive":{"type":"boolean"}}}}}}}},"/bff/warehouse/location/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseLocationDelete","tags":["Warehouse"],"summary":"Delete an empty location","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["locationId"],"properties":{"locationId":{"type":"number"}}}}}}}},"/bff/warehouse/stock/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"warehouseId","required":false},{"schema":{"type":"string"},"in":"query","name":"locationId","required":false},{"schema":{"type":"string"},"in":"query","name":"productId","required":false},{"schema":{"type":"string"},"in":"query","name":"productVariantId","required":false},{"description":"Product code (preferred over productId).","schema":{"type":"string"},"in":"query","name":"productCode","required":false},{"description":"Variant code; requires productCode.","schema":{"type":"string"},"in":"query","name":"productVariantCode","required":false},{"description":"Exact lot (šarže).","schema":{"type":"string"},"in":"query","name":"lotCode","required":false},{"description":"Substring of product / variant code or name, virtual SKU or lot.","schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"onlyPositive","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","warehouseCode","locationId","locationCode","locationName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","lotCode","stockUnit","quantity","quantityReserved","available","lowStockThreshold","unitCost","stockValue","costCurrency","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"warehouseCode":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Lot / batch (šarže). NULL = untracked cell.","anyOf":[{"type":"string"},{"type":"null"}]},"stockUnit":{"description":"Product stock unit (\"m\", \"kg\"…). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"description":"Active reservations against this cell (Tier 1 #1).","type":"number"},"available":{"description":"quantity - quantityReserved.","type":"number"},"lowStockThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Per-unit cost: weighted average of open FIFO layers, else variant/product cost. NULL = unknown.","anyOf":[{"type":"number"},{"type":"null"}]},"stockValue":{"description":"quantity × unitCost (stock value).","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"description":"Currency of unitCost / stockValue (organisation default).","type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","warehouseCode","locationId","locationCode","locationName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","lotCode","stockUnit","quantity","quantityReserved","available","lowStockThreshold","unitCost","stockValue","costCurrency","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"warehouseCode":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Lot / batch (šarže). NULL = untracked cell.","anyOf":[{"type":"string"},{"type":"null"}]},"stockUnit":{"description":"Product stock unit (\"m\", \"kg\"…). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"description":"Active reservations against this cell (Tier 1 #1).","type":"number"},"available":{"description":"quantity - quantityReserved.","type":"number"},"lowStockThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Per-unit cost: weighted average of open FIFO layers, else variant/product cost. NULL = unknown.","anyOf":[{"type":"number"},{"type":"null"}]},"stockValue":{"description":"quantity × unitCost (stock value).","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"description":"Currency of unitCost / stockValue (organisation default).","type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","warehouseCode","locationId","locationCode","locationName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","lotCode","stockUnit","quantity","quantityReserved","available","lowStockThreshold","unitCost","stockValue","costCurrency","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"warehouseCode":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Lot / batch (šarže). NULL = untracked cell.","anyOf":[{"type":"string"},{"type":"null"}]},"stockUnit":{"description":"Product stock unit (\"m\", \"kg\"…). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"description":"Active reservations against this cell (Tier 1 #1).","type":"number"},"available":{"description":"quantity - quantityReserved.","type":"number"},"lowStockThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Per-unit cost: weighted average of open FIFO layers, else variant/product cost. NULL = unknown.","anyOf":[{"type":"number"},{"type":"null"}]},"stockValue":{"description":"quantity × unitCost (stock value).","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"description":"Currency of unitCost / stockValue (organisation default).","type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehouseStockList","tags":["Warehouse"],"summary":"List stock items"}},"/bff/warehouse/stock/inbound":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}},"required":["success","movementId","newQuantity"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}},"required":["success","movementId","newQuantity"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}},"required":["success","movementId","newQuantity"]}}}}},"operationId":"postBffWarehouseStockInbound","tags":["Warehouse"],"summary":"Inbound (naskladnění)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetWarehouseId","quantity"],"properties":{"targetWarehouseId":{"type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot / batch number (šarže). Required on inbound when the product tracks lots.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["targetWarehouseId","quantity"],"properties":{"targetWarehouseId":{"type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot / batch number (šarže). Required on inbound when the product tracks lots.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["targetWarehouseId","quantity"],"properties":{"targetWarehouseId":{"type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot / batch number (šarže). Required on inbound when the product tracks lots.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stock/outbound":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"},"movementIds":{"description":"One movement per lot when FIFO split the quantity.","type":"array","items":{"type":"number"}}},"required":["success","movementId","newQuantity","movementIds"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"},"movementIds":{"description":"One movement per lot when FIFO split the quantity.","type":"array","items":{"type":"number"}}},"required":["success","movementId","newQuantity","movementIds"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"},"movementIds":{"description":"One movement per lot when FIFO split the quantity.","type":"array","items":{"type":"number"}}},"required":["success","movementId","newQuantity","movementIds"]}}}}},"operationId":"postBffWarehouseStockOutbound","tags":["Warehouse"],"summary":"Outbound (vyskladnění)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sourceWarehouseId","quantity"],"properties":{"sourceWarehouseId":{"type":"number"},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot to take from. Omit for automatic FIFO across lots (lot-tracked products).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["sourceWarehouseId","quantity"],"properties":{"sourceWarehouseId":{"type":"number"},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot to take from. Omit for automatic FIFO across lots (lot-tracked products).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["sourceWarehouseId","quantity"],"properties":{"sourceWarehouseId":{"type":"number"},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot to take from. Omit for automatic FIFO across lots (lot-tracked products).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stock/transfer":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"sourceNewQuantity":{"type":"number"},"targetNewQuantity":{"type":"number"},"movementIds":{"type":"array","items":{"type":"number"}}},"required":["success","movementId","sourceNewQuantity","targetNewQuantity","movementIds"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"sourceNewQuantity":{"type":"number"},"targetNewQuantity":{"type":"number"},"movementIds":{"type":"array","items":{"type":"number"}}},"required":["success","movementId","sourceNewQuantity","targetNewQuantity","movementIds"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"sourceNewQuantity":{"type":"number"},"targetNewQuantity":{"type":"number"},"movementIds":{"type":"array","items":{"type":"number"}}},"required":["success","movementId","sourceNewQuantity","targetNewQuantity","movementIds"]}}}}},"operationId":"postBffWarehouseStockTransfer","tags":["Warehouse"],"summary":"Transfer between warehouses/locations","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sourceWarehouseId","targetWarehouseId","quantity"],"properties":{"sourceWarehouseId":{"type":"number"},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetWarehouseId":{"type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot to move (keeps its lot on the target). Omit for automatic FIFO.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["sourceWarehouseId","targetWarehouseId","quantity"],"properties":{"sourceWarehouseId":{"type":"number"},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetWarehouseId":{"type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot to move (keeps its lot on the target). Omit for automatic FIFO.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["sourceWarehouseId","targetWarehouseId","quantity"],"properties":{"sourceWarehouseId":{"type":"number"},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetWarehouseId":{"type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Positive quantity, up to 3 decimals (e.g. 2.5 m).","type":"number"},"lotCode":{"description":"Lot to move (keeps its lot on the target). Omit for automatic FIFO.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stock/adjust":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}},"required":["success","movementId","newQuantity"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}},"required":["success","movementId","newQuantity"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}},"required":["success","movementId","newQuantity"]}}}}},"operationId":"postBffWarehouseStockAdjust","tags":["Warehouse"],"summary":"Adjustment (inventory / write-off)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["warehouseId","delta"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"delta":{"description":"Non-zero signed delta, up to 3 decimals. Positive = correction up, negative = write-off.","type":"number"},"lotCode":{"description":"Lot of the corrected cell. Empty = lot-less cell.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["warehouseId","delta"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"delta":{"description":"Non-zero signed delta, up to 3 decimals. Positive = correction up, negative = write-off.","type":"number"},"lotCode":{"description":"Lot of the corrected cell. Empty = lot-less cell.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["warehouseId","delta"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"delta":{"description":"Non-zero signed delta, up to 3 decimals. Positive = correction up, negative = write-off.","type":"number"},"lotCode":{"description":"Lot of the corrected cell. Empty = lot-less cell.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/movement/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"warehouseId","required":false},{"description":"Numeric product id (alternative to productCode).","schema":{"type":"string"},"in":"query","name":"productId","required":false},{"description":"Product code (preferred over productId).","schema":{"type":"string"},"in":"query","name":"productCode","required":false},{"description":"Numeric variant id (alternative to productVariantCode).","schema":{"type":"string"},"in":"query","name":"productVariantId","required":false},{"description":"Variant code; requires productCode.","schema":{"type":"string"},"in":"query","name":"productVariantCode","required":false},{"description":"inbound | outbound | transfer | adjustment | reservation | reservation_release | reservation_commit | production_out | production_in","schema":{"type":"string"},"in":"query","name":"type","required":false},{"description":"Filter movements coupled to one order (Tier 1 reservation/commit linkage).","schema":{"type":"string"},"in":"query","name":"orderId","required":false},{"description":"Order hash (alternative to orderId); the order detail \"Stock\" tab uses it (BIZKIT-172).","schema":{"type":"string"},"in":"query","name":"orderHash","required":false},{"description":"Filter movements of one production order (BIZKIT-112).","schema":{"type":"string"},"in":"query","name":"productionOrderId","required":false},{"description":"Exact lot (šarže).","schema":{"type":"string"},"in":"query","name":"lotCode","required":false},{"description":"ISO date / datetime — lower bound (inclusive).","schema":{"type":"string"},"in":"query","name":"dateFrom","required":false},{"description":"ISO datetime — upper bound (exclusive); a bare YYYY-MM-DD includes that whole day.","schema":{"type":"string"},"in":"query","name":"dateTo","required":false},{"description":"DataGrid fulltext: substring of product / variant code, name or SKU, virtual SKU, lot (šarže) or note.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Alias of `filterFulltextQuery`.","schema":{"type":"string"},"in":"query","name":"search","required":false},{"description":"Page size, default 50, max 500.","schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"1-based page (DataGrid). Ignored when `offset` is set.","schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","type","sourceWarehouseId","sourceWarehouseName","sourceLocationId","sourceLocationCode","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","lotCode","stockUnit","quantity","note","performedByMemberId","performedByMemberName","performedDate","orderId","orderItemId","linkedMovementId","reservationId","stocktakeSessionId","expiresAt","productionOrderId","productionOrderNumber","purchaseOrderId","purchaseOrderNumber"],"properties":{"id":{"type":"number"},"type":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"},{"const":"reservation","type":"string"},{"const":"reservation_release","type":"string"},{"const":"reservation_commit","type":"string"},{"const":"production_out","type":"string"},{"const":"production_in","type":"string"}]},"sourceWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceWarehouseName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetWarehouseName":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"performedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedDate":{"type":"string"},"orderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"linkedMovementId":{"anyOf":[{"type":"number"},{"type":"null"}]},"reservationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stocktakeSessionId":{"anyOf":[{"type":"number"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"productionOrderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productionOrderNumber":{"description":"Production order number (BIZKIT-112), e.g. VP-2026-0001.","anyOf":[{"type":"string"},{"type":"null"}]},"purchaseOrderId":{"description":"Purchase order whose receipt booked this inbound (BIZKIT-174).","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseOrderNumber":{"description":"Purchase order number, e.g. OV-2026-0001.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","type","sourceWarehouseId","sourceWarehouseName","sourceLocationId","sourceLocationCode","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","lotCode","stockUnit","quantity","note","performedByMemberId","performedByMemberName","performedDate","orderId","orderItemId","linkedMovementId","reservationId","stocktakeSessionId","expiresAt","productionOrderId","productionOrderNumber","purchaseOrderId","purchaseOrderNumber"],"properties":{"id":{"type":"number"},"type":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"},{"const":"reservation","type":"string"},{"const":"reservation_release","type":"string"},{"const":"reservation_commit","type":"string"},{"const":"production_out","type":"string"},{"const":"production_in","type":"string"}]},"sourceWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceWarehouseName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetWarehouseName":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"performedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedDate":{"type":"string"},"orderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"linkedMovementId":{"anyOf":[{"type":"number"},{"type":"null"}]},"reservationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stocktakeSessionId":{"anyOf":[{"type":"number"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"productionOrderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productionOrderNumber":{"description":"Production order number (BIZKIT-112), e.g. VP-2026-0001.","anyOf":[{"type":"string"},{"type":"null"}]},"purchaseOrderId":{"description":"Purchase order whose receipt booked this inbound (BIZKIT-174).","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseOrderNumber":{"description":"Purchase order number, e.g. OV-2026-0001.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","type","sourceWarehouseId","sourceWarehouseName","sourceLocationId","sourceLocationCode","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","lotCode","stockUnit","quantity","note","performedByMemberId","performedByMemberName","performedDate","orderId","orderItemId","linkedMovementId","reservationId","stocktakeSessionId","expiresAt","productionOrderId","productionOrderNumber","purchaseOrderId","purchaseOrderNumber"],"properties":{"id":{"type":"number"},"type":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"},{"const":"reservation","type":"string"},{"const":"reservation_release","type":"string"},{"const":"reservation_commit","type":"string"},{"const":"production_out","type":"string"},{"const":"production_in","type":"string"}]},"sourceWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceWarehouseName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetWarehouseName":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"performedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedDate":{"type":"string"},"orderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"linkedMovementId":{"anyOf":[{"type":"number"},{"type":"null"}]},"reservationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stocktakeSessionId":{"anyOf":[{"type":"number"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"productionOrderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productionOrderNumber":{"description":"Production order number (BIZKIT-112), e.g. VP-2026-0001.","anyOf":[{"type":"string"},{"type":"null"}]},"purchaseOrderId":{"description":"Purchase order whose receipt booked this inbound (BIZKIT-174).","anyOf":[{"type":"number"},{"type":"null"}]},"purchaseOrderNumber":{"description":"Purchase order number, e.g. OV-2026-0001.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehouseMovementList","tags":["Warehouse"],"summary":"List movements (audit log)"}},"/bff/warehouse/product-stock":{"get":{"parameters":[{"description":"Numeric product id (alternative to productCode).","schema":{"type":"string"},"in":"query","name":"productId","required":false},{"description":"Human-readable product code, e.g. from /bff/product/product-detail.","schema":{"type":"string"},"in":"query","name":"productCode","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"productSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasVariants":{"type":"boolean"},"totalQuantity":{"type":"number"},"totalReserved":{"type":"number"},"totalAvailable":{"type":"number"},"totalOrdered":{"description":"Outstanding on sent / partially received purchase orders.","type":"number"},"totalOrderedDraft":{"description":"Outstanding on draft purchase orders (not yet sent).","type":"number"},"nextExpectedDate":{"description":"Earliest due date of an outstanding sent order line (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"perWarehouse":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseCode","warehouseName","quantity","quantityReserved","available","isDefault","quantityOrdered","quantityOrderedDraft"],"properties":{"warehouseId":{"type":"number"},"warehouseCode":{"type":"string"},"warehouseName":{"type":"string"},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"isDefault":{"type":"boolean"},"quantityOrdered":{"type":"number"},"quantityOrderedDraft":{"type":"number"}}}},"variants":{"type":"array","items":{"type":"object","required":["variantId","variantCode","variantName","totalQuantity","totalReserved","totalAvailable","totalOrdered","totalOrderedDraft","perWarehouse"],"properties":{"variantId":{"type":"number"},"variantCode":{"type":"string"},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalQuantity":{"type":"number"},"totalReserved":{"type":"number"},"totalAvailable":{"type":"number"},"totalOrdered":{"type":"number"},"totalOrderedDraft":{"type":"number"},"perWarehouse":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseCode","warehouseName","quantity","quantityReserved","available","isDefault","quantityOrdered","quantityOrderedDraft"],"properties":{"warehouseId":{"type":"number"},"warehouseCode":{"type":"string"},"warehouseName":{"type":"string"},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"isDefault":{"type":"boolean"},"quantityOrdered":{"type":"number"},"quantityOrderedDraft":{"type":"number"}}}}}}},"lowStockWarnings":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseName","variantId","variantName","quantity","threshold"],"properties":{"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"variantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"threshold":{"type":"number"}}}}},"required":["productId","productCode","productName","productSku","hasVariants","totalQuantity","totalReserved","totalAvailable","totalOrdered","totalOrderedDraft","nextExpectedDate","perWarehouse","variants","lowStockWarnings"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"productId":{"type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"productSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasVariants":{"type":"boolean"},"totalQuantity":{"type":"number"},"totalReserved":{"type":"number"},"totalAvailable":{"type":"number"},"totalOrdered":{"description":"Outstanding on sent / partially received purchase orders.","type":"number"},"totalOrderedDraft":{"description":"Outstanding on draft purchase orders (not yet sent).","type":"number"},"nextExpectedDate":{"description":"Earliest due date of an outstanding sent order line (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"perWarehouse":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseCode","warehouseName","quantity","quantityReserved","available","isDefault","quantityOrdered","quantityOrderedDraft"],"properties":{"warehouseId":{"type":"number"},"warehouseCode":{"type":"string"},"warehouseName":{"type":"string"},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"isDefault":{"type":"boolean"},"quantityOrdered":{"type":"number"},"quantityOrderedDraft":{"type":"number"}}}},"variants":{"type":"array","items":{"type":"object","required":["variantId","variantCode","variantName","totalQuantity","totalReserved","totalAvailable","totalOrdered","totalOrderedDraft","perWarehouse"],"properties":{"variantId":{"type":"number"},"variantCode":{"type":"string"},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalQuantity":{"type":"number"},"totalReserved":{"type":"number"},"totalAvailable":{"type":"number"},"totalOrdered":{"type":"number"},"totalOrderedDraft":{"type":"number"},"perWarehouse":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseCode","warehouseName","quantity","quantityReserved","available","isDefault","quantityOrdered","quantityOrderedDraft"],"properties":{"warehouseId":{"type":"number"},"warehouseCode":{"type":"string"},"warehouseName":{"type":"string"},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"isDefault":{"type":"boolean"},"quantityOrdered":{"type":"number"},"quantityOrderedDraft":{"type":"number"}}}}}}},"lowStockWarnings":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseName","variantId","variantName","quantity","threshold"],"properties":{"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"variantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"threshold":{"type":"number"}}}}},"required":["productId","productCode","productName","productSku","hasVariants","totalQuantity","totalReserved","totalAvailable","totalOrdered","totalOrderedDraft","nextExpectedDate","perWarehouse","variants","lowStockWarnings"]}},"text/plain":{"schema":{"type":"object","properties":{"productId":{"type":"number"},"productCode":{"type":"string"},"productName":{"type":"string"},"productSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"hasVariants":{"type":"boolean"},"totalQuantity":{"type":"number"},"totalReserved":{"type":"number"},"totalAvailable":{"type":"number"},"totalOrdered":{"description":"Outstanding on sent / partially received purchase orders.","type":"number"},"totalOrderedDraft":{"description":"Outstanding on draft purchase orders (not yet sent).","type":"number"},"nextExpectedDate":{"description":"Earliest due date of an outstanding sent order line (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]},"perWarehouse":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseCode","warehouseName","quantity","quantityReserved","available","isDefault","quantityOrdered","quantityOrderedDraft"],"properties":{"warehouseId":{"type":"number"},"warehouseCode":{"type":"string"},"warehouseName":{"type":"string"},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"isDefault":{"type":"boolean"},"quantityOrdered":{"type":"number"},"quantityOrderedDraft":{"type":"number"}}}},"variants":{"type":"array","items":{"type":"object","required":["variantId","variantCode","variantName","totalQuantity","totalReserved","totalAvailable","totalOrdered","totalOrderedDraft","perWarehouse"],"properties":{"variantId":{"type":"number"},"variantCode":{"type":"string"},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalQuantity":{"type":"number"},"totalReserved":{"type":"number"},"totalAvailable":{"type":"number"},"totalOrdered":{"type":"number"},"totalOrderedDraft":{"type":"number"},"perWarehouse":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseCode","warehouseName","quantity","quantityReserved","available","isDefault","quantityOrdered","quantityOrderedDraft"],"properties":{"warehouseId":{"type":"number"},"warehouseCode":{"type":"string"},"warehouseName":{"type":"string"},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"isDefault":{"type":"boolean"},"quantityOrdered":{"type":"number"},"quantityOrderedDraft":{"type":"number"}}}}}}},"lowStockWarnings":{"type":"array","items":{"type":"object","required":["warehouseId","warehouseName","variantId","variantName","quantity","threshold"],"properties":{"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"variantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"threshold":{"type":"number"}}}}},"required":["productId","productCode","productName","productSku","hasVariants","totalQuantity","totalReserved","totalAvailable","totalOrdered","totalOrderedDraft","nextExpectedDate","perWarehouse","variants","lowStockWarnings"]}}}}},"operationId":"getBffWarehouseProduct-stock","tags":["Warehouse"],"summary":"Aggregate stock breakdown for one product","description":"Returns total + per-warehouse + per-variant stock for a product. The Product detail \"Stock\" tab uses this as a single round-trip."}},"/bff/warehouse/alerts/low-stock":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","organisationName","stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","quantityReserved","available","threshold","fromPolicy","reorderPoint","maxCapacity","quantityOrdered","quantityOrderedDraft","nextExpectedDate","coveredByOrders","suggestedQuantity","lastPurchase","defaultVendor"],"properties":{"organisationId":{"type":"number"},"organisationName":{"type":"string"},"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"threshold":{"type":"number"},"fromPolicy":{"type":"boolean"},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"quantityOrdered":{"description":"Outstanding on sent / partially received purchase orders into this warehouse.","type":"number"},"quantityOrderedDraft":{"description":"Outstanding on draft purchase orders.","type":"number"},"nextExpectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredByOrders":{"description":"Available + ordered already reaches the threshold.","type":"boolean"},"suggestedQuantity":{"description":"Proposed quantity for a new purchase order.","type":"number"},"lastPurchase":{"anyOf":[{"type":"object","required":["vendorId","vendorName","unitPrice","vatRate","currency"],"properties":{"vendorId":{"description":"Supplier contact external id.","type":"string"},"vendorName":{"type":"string"},"unitPrice":{"type":"number"},"vatRate":{"type":"number"},"currency":{"type":"string"}}},{"type":"null"}]},"defaultVendor":{"description":"Product's default supplier (BIZKIT-168); preferred over lastPurchase when drafting orders.","anyOf":[{"type":"object","required":["vendorId","vendorName"],"properties":{"vendorId":{"description":"Supplier contact external id.","type":"string"},"vendorName":{"type":"string"}}},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","organisationName","stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","quantityReserved","available","threshold","fromPolicy","reorderPoint","maxCapacity","quantityOrdered","quantityOrderedDraft","nextExpectedDate","coveredByOrders","suggestedQuantity","lastPurchase","defaultVendor"],"properties":{"organisationId":{"type":"number"},"organisationName":{"type":"string"},"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"threshold":{"type":"number"},"fromPolicy":{"type":"boolean"},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"quantityOrdered":{"description":"Outstanding on sent / partially received purchase orders into this warehouse.","type":"number"},"quantityOrderedDraft":{"description":"Outstanding on draft purchase orders.","type":"number"},"nextExpectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredByOrders":{"description":"Available + ordered already reaches the threshold.","type":"boolean"},"suggestedQuantity":{"description":"Proposed quantity for a new purchase order.","type":"number"},"lastPurchase":{"anyOf":[{"type":"object","required":["vendorId","vendorName","unitPrice","vatRate","currency"],"properties":{"vendorId":{"description":"Supplier contact external id.","type":"string"},"vendorName":{"type":"string"},"unitPrice":{"type":"number"},"vatRate":{"type":"number"},"currency":{"type":"string"}}},{"type":"null"}]},"defaultVendor":{"description":"Product's default supplier (BIZKIT-168); preferred over lastPurchase when drafting orders.","anyOf":[{"type":"object","required":["vendorId","vendorName"],"properties":{"vendorId":{"description":"Supplier contact external id.","type":"string"},"vendorName":{"type":"string"}}},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["organisationId","organisationName","stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","quantityReserved","available","threshold","fromPolicy","reorderPoint","maxCapacity","quantityOrdered","quantityOrderedDraft","nextExpectedDate","coveredByOrders","suggestedQuantity","lastPurchase","defaultVendor"],"properties":{"organisationId":{"type":"number"},"organisationName":{"type":"string"},"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"threshold":{"type":"number"},"fromPolicy":{"type":"boolean"},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"quantityOrdered":{"description":"Outstanding on sent / partially received purchase orders into this warehouse.","type":"number"},"quantityOrderedDraft":{"description":"Outstanding on draft purchase orders.","type":"number"},"nextExpectedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"coveredByOrders":{"description":"Available + ordered already reaches the threshold.","type":"boolean"},"suggestedQuantity":{"description":"Proposed quantity for a new purchase order.","type":"number"},"lastPurchase":{"anyOf":[{"type":"object","required":["vendorId","vendorName","unitPrice","vatRate","currency"],"properties":{"vendorId":{"description":"Supplier contact external id.","type":"string"},"vendorName":{"type":"string"},"unitPrice":{"type":"number"},"vatRate":{"type":"number"},"currency":{"type":"string"}}},{"type":"null"}]},"defaultVendor":{"description":"Product's default supplier (BIZKIT-168); preferred over lastPurchase when drafting orders.","anyOf":[{"type":"object","required":["vendorId","vendorName"],"properties":{"vendorId":{"description":"Supplier contact external id.","type":"string"},"vendorName":{"type":"string"}}},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehouseAlertsLow-stock","tags":["Warehouse"],"summary":"List stock cells under the configured low-stock threshold","description":"Same data the cron daemon scans. Ordered by severity (how far below the threshold). The dashboard surfaces the count as a notification badge; the warehouse list page renders the full list as a dedicated tab."}},"/bff/warehouse/reports/dead-stock":{"get":{"parameters":[{"description":"Idle days that disqualify the item from being live stock. Default 90.","schema":{"type":"string"},"in":"query","name":"thresholdDays","required":false},{"schema":{"type":"string"},"in":"query","name":"warehouseId","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","lastMovementDate","daysSinceLastMovement"],"properties":{"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"lastMovementDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysSinceLastMovement":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","lastMovementDate","daysSinceLastMovement"],"properties":{"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"lastMovementDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysSinceLastMovement":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","lastMovementDate","daysSinceLastMovement"],"properties":{"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"lastMovementDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"daysSinceLastMovement":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehouseReportsDead-stock","tags":["Warehouse"],"summary":"List stock with no movement for N days (\"dead stock\")","description":"Surfaces capital tied up in inventory that has not moved recently. The default threshold of 90 days matches the e-commerce industry norm for fast-moving goods. Sortable by `daysSinceLastMovement` to show the worst offenders first."}},"/bff/warehouse/reservation/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"reservationId":{"type":"number"},"movementId":{"type":"number"},"newQuantity":{"type":"number"},"newReserved":{"type":"number"},"available":{"type":"number"},"deduped":{"type":"boolean"}},"required":["success","reservationId","movementId","newQuantity","newReserved","available","deduped"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"reservationId":{"type":"number"},"movementId":{"type":"number"},"newQuantity":{"type":"number"},"newReserved":{"type":"number"},"available":{"type":"number"},"deduped":{"type":"boolean"}},"required":["success","reservationId","movementId","newQuantity","newReserved","available","deduped"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"reservationId":{"type":"number"},"movementId":{"type":"number"},"newQuantity":{"type":"number"},"newReserved":{"type":"number"},"available":{"type":"number"},"deduped":{"type":"boolean"}},"required":["success","reservationId","movementId","newQuantity","newReserved","available","deduped"]}}}}},"operationId":"postBffWarehouseReservationCreate","tags":["Warehouse"],"summary":"Reserve stock (Tier 1 #1)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["warehouseId","quantity"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"minimum":1,"type":"number"},"mode":{"anyOf":[{"const":"soft","type":"string"},{"const":"hard","type":"string"}]},"orderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"externalKey":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"description":"ISO datetime; required for `soft` reservations to be auto-released.","type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["warehouseId","quantity"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"minimum":1,"type":"number"},"mode":{"anyOf":[{"const":"soft","type":"string"},{"const":"hard","type":"string"}]},"orderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"externalKey":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"description":"ISO datetime; required for `soft` reservations to be auto-released.","type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["warehouseId","quantity"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"quantity":{"minimum":1,"type":"number"},"mode":{"anyOf":[{"const":"soft","type":"string"},{"const":"hard","type":"string"}]},"orderId":{"anyOf":[{"type":"number"},{"type":"null"}]},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"externalKey":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"description":"ISO datetime; required for `soft` reservations to be auto-released.","type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/reservation/release":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"released":{"type":"array","items":{"type":"object","required":["reservationId","warehouseId","productId","productVariantId","virtualItemSku","quantity","newReserved","newQuantity","movementId"],"properties":{"reservationId":{"type":"number"},"warehouseId":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"newReserved":{"type":"number"},"newQuantity":{"type":"number"},"movementId":{"type":"number"}}}},"alreadyResolved":{"type":"boolean"}},"required":["success","released","alreadyResolved"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"released":{"type":"array","items":{"type":"object","required":["reservationId","warehouseId","productId","productVariantId","virtualItemSku","quantity","newReserved","newQuantity","movementId"],"properties":{"reservationId":{"type":"number"},"warehouseId":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"newReserved":{"type":"number"},"newQuantity":{"type":"number"},"movementId":{"type":"number"}}}},"alreadyResolved":{"type":"boolean"}},"required":["success","released","alreadyResolved"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"released":{"type":"array","items":{"type":"object","required":["reservationId","warehouseId","productId","productVariantId","virtualItemSku","quantity","newReserved","newQuantity","movementId"],"properties":{"reservationId":{"type":"number"},"warehouseId":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"newReserved":{"type":"number"},"newQuantity":{"type":"number"},"movementId":{"type":"number"}}}},"alreadyResolved":{"type":"boolean"}},"required":["success","released","alreadyResolved"]}}}}},"operationId":"postBffWarehouseReservationRelease","tags":["Warehouse"],"summary":"Release reservation(s) (Tier 1 #1)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reservationId":{"type":"number"},"orderId":{"type":"number"},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"externalKey":{"maxLength":120,"type":"string"},"reason":{"anyOf":[{"const":"storno","type":"string"},{"const":"expired","type":"string"},{"const":"manual","type":"string"},{"const":"cart_abandoned","type":"string"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"reservationId":{"type":"number"},"orderId":{"type":"number"},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"externalKey":{"maxLength":120,"type":"string"},"reason":{"anyOf":[{"const":"storno","type":"string"},{"const":"expired","type":"string"},{"const":"manual","type":"string"},{"const":"cart_abandoned","type":"string"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"reservationId":{"type":"number"},"orderId":{"type":"number"},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"externalKey":{"maxLength":120,"type":"string"},"reason":{"anyOf":[{"const":"storno","type":"string"},{"const":"expired","type":"string"},{"const":"manual","type":"string"},{"const":"cart_abandoned","type":"string"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/reservation/commit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"committed":{"type":"array","items":{"type":"object","required":["reservationId","warehouseId","productId","productVariantId","virtualItemSku","quantity","newQuantity","newReserved","movementId"],"properties":{"reservationId":{"type":"number"},"warehouseId":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"newQuantity":{"type":"number"},"newReserved":{"type":"number"},"movementId":{"type":"number"}}}},"alreadyResolved":{"type":"boolean"}},"required":["success","committed","alreadyResolved"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"committed":{"type":"array","items":{"type":"object","required":["reservationId","warehouseId","productId","productVariantId","virtualItemSku","quantity","newQuantity","newReserved","movementId"],"properties":{"reservationId":{"type":"number"},"warehouseId":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"newQuantity":{"type":"number"},"newReserved":{"type":"number"},"movementId":{"type":"number"}}}},"alreadyResolved":{"type":"boolean"}},"required":["success","committed","alreadyResolved"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"committed":{"type":"array","items":{"type":"object","required":["reservationId","warehouseId","productId","productVariantId","virtualItemSku","quantity","newQuantity","newReserved","movementId"],"properties":{"reservationId":{"type":"number"},"warehouseId":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"newQuantity":{"type":"number"},"newReserved":{"type":"number"},"movementId":{"type":"number"}}}},"alreadyResolved":{"type":"boolean"}},"required":["success","committed","alreadyResolved"]}}}}},"operationId":"postBffWarehouseReservationCommit","tags":["Warehouse"],"summary":"Commit reservation(s) to outbound (Tier 1 #1)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reservationId":{"type":"number"},"quantity":{"anyOf":[{"minimum":1,"type":"number"},{"type":"null"}]},"orderId":{"type":"number"},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","properties":{"reservationId":{"type":"number"},"quantity":{"anyOf":[{"minimum":1,"type":"number"},{"type":"null"}]},"orderId":{"type":"number"},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","properties":{"reservationId":{"type":"number"},"quantity":{"anyOf":[{"minimum":1,"type":"number"},{"type":"null"}]},"orderId":{"type":"number"},"orderItemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"anyOf":[{"maxLength":80,"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stocktake/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"warehouseId","required":false},{"description":"draft | in_progress | review | approved | cancelled","schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","locationId","locationCode","locationName","name","status","lockScope","filterNote","note","startedByMemberId","startedByMemberName","startedDate","submittedDate","approvedDate","cancelledDate","insertedDate","updatedDate","itemCount","countedItemCount","discrepancyCount","totalAbsDiscrepancy"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"status":{"type":"string"},"lockScope":{"type":"boolean"},"filterNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"startedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"submittedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"itemCount":{"type":"number"},"countedItemCount":{"type":"number"},"discrepancyCount":{"type":"number"},"totalAbsDiscrepancy":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","locationId","locationCode","locationName","name","status","lockScope","filterNote","note","startedByMemberId","startedByMemberName","startedDate","submittedDate","approvedDate","cancelledDate","insertedDate","updatedDate","itemCount","countedItemCount","discrepancyCount","totalAbsDiscrepancy"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"status":{"type":"string"},"lockScope":{"type":"boolean"},"filterNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"startedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"submittedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"itemCount":{"type":"number"},"countedItemCount":{"type":"number"},"discrepancyCount":{"type":"number"},"totalAbsDiscrepancy":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","locationId","locationCode","locationName","name","status","lockScope","filterNote","note","startedByMemberId","startedByMemberName","startedDate","submittedDate","approvedDate","cancelledDate","insertedDate","updatedDate","itemCount","countedItemCount","discrepancyCount","totalAbsDiscrepancy"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"locationName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"status":{"type":"string"},"lockScope":{"type":"boolean"},"filterNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"startedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"submittedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"itemCount":{"type":"number"},"countedItemCount":{"type":"number"},"discrepancyCount":{"type":"number"},"totalAbsDiscrepancy":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehouseStocktakeList","tags":["Warehouse"],"summary":"List stocktake sessions (Tier 1 #2)"}},"/bff/warehouse/stocktake/detail":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"sessionId","required":true},{"schema":{"type":"string"},"in":"query","name":"onlyDiscrepancies","required":false},{"schema":{"type":"string"},"in":"query","name":"onlyPending","required":false},{"description":"\"false\" returns `items: []`; page them via `/stocktake/items` instead.","schema":{"type":"string"},"in":"query","name":"includeItems","required":false}],"operationId":"getBffWarehouseStocktakeDetail","tags":["Warehouse"],"summary":"Stocktake session detail (Tier 1 #2)","responses":{"200":{}}}},"/bff/warehouse/stocktake/items":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"sessionId","required":true},{"description":"'pending' (not counted) | 'discrepancies' (counted ≠ expected).","schema":{"type":"string"},"in":"query","name":"filter","required":false},{"description":"DataGrid fulltext over product / variant name and code, SKU, location and lot.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffWarehouseStocktakeItems","tags":["Warehouse"],"summary":"Paginated count rows of one stocktake session","responses":{"200":{}}}},"/bff/warehouse/stocktake/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sessionId":{"type":"number"},"itemCount":{"type":"number"}},"required":["success","sessionId","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sessionId":{"type":"number"},"itemCount":{"type":"number"}},"required":["success","sessionId","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sessionId":{"type":"number"},"itemCount":{"type":"number"}},"required":["success","sessionId","itemCount"]}}}}},"operationId":"postBffWarehouseStocktakeCreate","tags":["Warehouse"],"summary":"Create stocktake session (Tier 1 #2)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["warehouseId","name"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"name":{"minLength":1,"type":"string"},"filterNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"lockScope":{"type":"boolean"},"snapshot":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["warehouseId","name"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"name":{"minLength":1,"type":"string"},"filterNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"lockScope":{"type":"boolean"},"snapshot":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["warehouseId","name"],"properties":{"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"name":{"minLength":1,"type":"string"},"filterNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"lockScope":{"type":"boolean"},"snapshot":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stocktake/start":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseStocktakeStart","tags":["Warehouse"],"summary":"Start stocktake session (Tier 1 #2)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"startedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stocktake/count":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"itemId":{"type":"number"},"expectedQuantity":{"type":"number"},"countedQuantity":{"type":"number"},"discrepancy":{"type":"number"}},"required":["success","itemId","expectedQuantity","countedQuantity","discrepancy"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"itemId":{"type":"number"},"expectedQuantity":{"type":"number"},"countedQuantity":{"type":"number"},"discrepancy":{"type":"number"}},"required":["success","itemId","expectedQuantity","countedQuantity","discrepancy"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"itemId":{"type":"number"},"expectedQuantity":{"type":"number"},"countedQuantity":{"type":"number"},"discrepancy":{"type":"number"}},"required":["success","itemId","expectedQuantity","countedQuantity","discrepancy"]}}}}},"operationId":"postBffWarehouseStocktakeCount","tags":["Warehouse"],"summary":"Record counted quantity (Tier 1 #2)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId","countedQuantity"],"properties":{"sessionId":{"type":"number"},"itemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"productCode":{"description":"Alternative to productId.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"lotCode":{"description":"Lot of the counted cell.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"countedQuantity":{"minimum":0,"description":"Counted quantity, up to 3 decimals.","type":"number"},"discrepancyReason":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}]},"countedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["sessionId","countedQuantity"],"properties":{"sessionId":{"type":"number"},"itemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"productCode":{"description":"Alternative to productId.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"lotCode":{"description":"Lot of the counted cell.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"countedQuantity":{"minimum":0,"description":"Counted quantity, up to 3 decimals.","type":"number"},"discrepancyReason":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}]},"countedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["sessionId","countedQuantity"],"properties":{"sessionId":{"type":"number"},"itemId":{"anyOf":[{"type":"number"},{"type":"null"}]},"warehouseId":{"type":"number"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"productCode":{"description":"Alternative to productId.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"lotCode":{"description":"Lot of the counted cell.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"countedQuantity":{"minimum":0,"description":"Counted quantity, up to 3 decimals.","type":"number"},"discrepancyReason":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}]},"countedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stocktake/submit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseStocktakeSubmit","tags":["Warehouse"],"summary":"Submit stocktake for review (Tier 1 #2)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"submittedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"submittedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"submittedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stocktake/approve":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sessionId":{"type":"number"},"approved":{"type":"array","items":{"type":"object","required":["itemId","warehouseId","expectedQuantity","countedQuantity","delta","movementId","newQuantity"],"properties":{"itemId":{"type":"number"},"warehouseId":{"type":"number"},"expectedQuantity":{"type":"number"},"countedQuantity":{"type":"number"},"delta":{"type":"number"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}}}},"skipped":{"type":"number"},"noDelta":{"type":"number"}},"required":["success","sessionId","approved","skipped","noDelta"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sessionId":{"type":"number"},"approved":{"type":"array","items":{"type":"object","required":["itemId","warehouseId","expectedQuantity","countedQuantity","delta","movementId","newQuantity"],"properties":{"itemId":{"type":"number"},"warehouseId":{"type":"number"},"expectedQuantity":{"type":"number"},"countedQuantity":{"type":"number"},"delta":{"type":"number"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}}}},"skipped":{"type":"number"},"noDelta":{"type":"number"}},"required":["success","sessionId","approved","skipped","noDelta"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"sessionId":{"type":"number"},"approved":{"type":"array","items":{"type":"object","required":["itemId","warehouseId","expectedQuantity","countedQuantity","delta","movementId","newQuantity"],"properties":{"itemId":{"type":"number"},"warehouseId":{"type":"number"},"expectedQuantity":{"type":"number"},"countedQuantity":{"type":"number"},"delta":{"type":"number"},"movementId":{"type":"number"},"newQuantity":{"type":"number"}}}},"skipped":{"type":"number"},"noDelta":{"type":"number"}},"required":["success","sessionId","approved","skipped","noDelta"]}}}}},"operationId":"postBffWarehouseStocktakeApprove","tags":["Warehouse"],"summary":"Approve stocktake — produces adjustment movements (Tier 1 #2)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"approvedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"approvedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"approvedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/stocktake/cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseStocktakeCancel","tags":["Warehouse"],"summary":"Cancel stocktake session (Tier 1 #2)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"cancelledByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"cancelledByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["sessionId"],"properties":{"sessionId":{"type":"number"},"cancelledByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/warehouse/scanner/resolve":{"post":{"parameters":[],"operationId":"postBffWarehouseScannerResolve","tags":["Warehouse"],"summary":"Resolve a scanned code to one or more entities (Tier 1 #3)","description":"Returns every match across warehouse / location / variant / product / virtual SKU and a `best` pick from the caller-supplied preference order.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"minLength":1,"description":"Raw scanner string (EAN / SKU / product / location / warehouse code).","type":"string"},"preference":{"type":"array","items":{"anyOf":[{"const":"warehouse","type":"string"},{"const":"location","type":"string"},{"const":"variant","type":"string"},{"const":"product","type":"string"},{"const":"virtual","type":"string"}]}}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"minLength":1,"description":"Raw scanner string (EAN / SKU / product / location / warehouse code).","type":"string"},"preference":{"type":"array","items":{"anyOf":[{"const":"warehouse","type":"string"},{"const":"location","type":"string"},{"const":"variant","type":"string"},{"const":"product","type":"string"},{"const":"virtual","type":"string"}]}}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"minLength":1,"description":"Raw scanner string (EAN / SKU / product / location / warehouse code).","type":"string"},"preference":{"type":"array","items":{"anyOf":[{"const":"warehouse","type":"string"},{"const":"location","type":"string"},{"const":"variant","type":"string"},{"const":"product","type":"string"},{"const":"virtual","type":"string"}]}}}}}}},"responses":{"200":{}}}},"/bff/warehouse/scanner/quick-op":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"kind":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"}]},"newSourceQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"newTargetQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedSourceWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedSourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedTargetWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedTargetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["success","movementId","kind","newSourceQuantity","newTargetQuantity","resolvedSourceWarehouseId","resolvedSourceLocationId","resolvedTargetWarehouseId","resolvedTargetLocationId","replayed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"kind":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"}]},"newSourceQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"newTargetQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedSourceWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedSourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedTargetWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedTargetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["success","movementId","kind","newSourceQuantity","newTargetQuantity","resolvedSourceWarehouseId","resolvedSourceLocationId","resolvedTargetWarehouseId","resolvedTargetLocationId","replayed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"movementId":{"type":"number"},"kind":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"}]},"newSourceQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"newTargetQuantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedSourceWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedSourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedTargetWarehouseId":{"anyOf":[{"type":"number"},{"type":"null"}]},"resolvedTargetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"replayed":{"type":"boolean"}},"required":["success","movementId","kind","newSourceQuantity","newTargetQuantity","resolvedSourceWarehouseId","resolvedSourceLocationId","resolvedTargetWarehouseId","resolvedTargetLocationId","replayed"]}}}}},"operationId":"postBffWarehouseScannerQuick-op","tags":["Warehouse"],"summary":"Mobile/scanner quick stock operation with idempotent offline-queue support (Tier 1 #3)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","quantity"],"properties":{"kind":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"}]},"clientOperationId":{"anyOf":[{"maxLength":80,"description":"Idempotency token; format suggestion `{deviceId}:{counter}`.","type":"string"},{"type":"null"}]},"itemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Up to 3 decimals. Signed for adjustments.","type":"number"},"lotCode":{"description":"Lot / batch number (šarže). Required on inbound when the product tracks lots.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["kind","quantity"],"properties":{"kind":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"}]},"clientOperationId":{"anyOf":[{"maxLength":80,"description":"Idempotency token; format suggestion `{deviceId}:{counter}`.","type":"string"},{"type":"null"}]},"itemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Up to 3 decimals. Signed for adjustments.","type":"number"},"lotCode":{"description":"Lot / batch number (šarže). Required on inbound when the product tracks lots.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["kind","quantity"],"properties":{"kind":{"anyOf":[{"const":"inbound","type":"string"},{"const":"outbound","type":"string"},{"const":"transfer","type":"string"},{"const":"adjustment","type":"string"}]},"clientOperationId":{"anyOf":[{"maxLength":80,"description":"Idempotency token; format suggestion `{deviceId}:{counter}`.","type":"string"},{"type":"null"}]},"itemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"sourceCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"description":"Up to 3 decimals. Signed for adjustments.","type":"number"},"lotCode":{"description":"Lot / batch number (šarže). Required on inbound when the product tracks lots.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/policy/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"warehouseId","required":false},{"schema":{"type":"string"},"in":"query","name":"productId","required":false},{"schema":{"type":"string"},"in":"query","name":"productVariantId","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","minThreshold","reorderPoint","maxCapacity","allowBackorder","notifyChannels","isActive","note","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"minThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"allowBackorder":{"type":"boolean"},"notifyChannels":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","minThreshold","reorderPoint","maxCapacity","allowBackorder","notifyChannels","isActive","note","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"minThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"allowBackorder":{"type":"boolean"},"notifyChannels":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","minThreshold","reorderPoint","maxCapacity","allowBackorder","notifyChannels","isActive","note","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"minThreshold":{"anyOf":[{"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"type":"number"},{"type":"null"}]},"allowBackorder":{"type":"boolean"},"notifyChannels":{"anyOf":[{"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehousePolicyList","tags":["Warehouse"],"summary":"List stock policies (Tier 1 #4)"}},"/bff/warehouse/policy/upsert":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"},"created":{"type":"boolean"}},"required":["success","id","created"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"},"created":{"type":"boolean"}},"required":["success","id","created"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"},"created":{"type":"boolean"}},"required":["success","id","created"]}}}}},"operationId":"postBffWarehousePolicyUpsert","tags":["Warehouse"],"summary":"Create or update a stock policy (Tier 1 #4)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"minThreshold":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"allowBackorder":{"type":"boolean"},"notifyChannels":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"minThreshold":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"allowBackorder":{"type":"boolean"},"notifyChannels":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["warehouseId"],"properties":{"warehouseId":{"type":"number"},"productCode":{"description":"Human-readable product code (mutually exclusive with virtualItemSku).","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code, requires productCode.","anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Free-form virtual SKU for non-catalogue items.","anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"minThreshold":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"maxCapacity":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"allowBackorder":{"type":"boolean"},"notifyChannels":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/warehouse/policy/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehousePolicyDelete","tags":["Warehouse"],"summary":"Delete a stock policy (Tier 1 #4)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["policyId"],"properties":{"policyId":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["policyId"],"properties":{"policyId":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["policyId"],"properties":{"policyId":{"type":"number"}}}}}}}},"/bff/warehouse/dashboard/health":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"deadStockDays","required":false},{"schema":{"type":"string"},"in":"query","name":"shrinkageWindowDays","required":false},{"schema":{"type":"string"},"in":"query","name":"topMoversLimit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"generatedAt":{"type":"string"},"totalActiveCells":{"type":"number"},"lowStockCount":{"type":"number"},"reorderPointBreachCount":{"type":"number"},"negativeAvailableCount":{"type":"number"},"deadStockValue":{"type":"number"},"deadStockCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"shrinkageRate":{"type":"number"},"totalReservedUnits":{"type":"number"},"activeSoftReservations":{"type":"number"},"topMovers":{"type":"array","items":{"type":"object","required":["productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","unitsMoved"],"properties":{"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"unitsMoved":{"type":"number"}}}}},"required":["generatedAt","totalActiveCells","lowStockCount","reorderPointBreachCount","negativeAvailableCount","deadStockValue","deadStockCurrency","shrinkageRate","totalReservedUnits","activeSoftReservations","topMovers"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"generatedAt":{"type":"string"},"totalActiveCells":{"type":"number"},"lowStockCount":{"type":"number"},"reorderPointBreachCount":{"type":"number"},"negativeAvailableCount":{"type":"number"},"deadStockValue":{"type":"number"},"deadStockCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"shrinkageRate":{"type":"number"},"totalReservedUnits":{"type":"number"},"activeSoftReservations":{"type":"number"},"topMovers":{"type":"array","items":{"type":"object","required":["productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","unitsMoved"],"properties":{"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"unitsMoved":{"type":"number"}}}}},"required":["generatedAt","totalActiveCells","lowStockCount","reorderPointBreachCount","negativeAvailableCount","deadStockValue","deadStockCurrency","shrinkageRate","totalReservedUnits","activeSoftReservations","topMovers"]}},"text/plain":{"schema":{"type":"object","properties":{"generatedAt":{"type":"string"},"totalActiveCells":{"type":"number"},"lowStockCount":{"type":"number"},"reorderPointBreachCount":{"type":"number"},"negativeAvailableCount":{"type":"number"},"deadStockValue":{"type":"number"},"deadStockCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"shrinkageRate":{"type":"number"},"totalReservedUnits":{"type":"number"},"activeSoftReservations":{"type":"number"},"topMovers":{"type":"array","items":{"type":"object","required":["productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","unitsMoved"],"properties":{"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"unitsMoved":{"type":"number"}}}}},"required":["generatedAt","totalActiveCells","lowStockCount","reorderPointBreachCount","negativeAvailableCount","deadStockValue","deadStockCurrency","shrinkageRate","totalReservedUnits","activeSoftReservations","topMovers"]}}}}},"operationId":"getBffWarehouseDashboardHealth","tags":["Warehouse"],"summary":"Stock health dashboard (Tier 1 #4)","description":"One round-trip for the admin dashboard widget. Returns alert counts, dead-stock value, shrinkage rate, top movers, and reservation totals."}},"/bff/warehouse/reports/days-of-stock":{"get":{"parameters":[{"description":"Moving-average window in days. Default 30.","schema":{"type":"string"},"in":"query","name":"windowDays","required":false},{"schema":{"type":"string"},"in":"query","name":"warehouseId","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","quantityReserved","available","avgDailyConsumption","daysOfStock","reorderPoint"],"properties":{"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"avgDailyConsumption":{"type":"number"},"daysOfStock":{"anyOf":[{"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","quantityReserved","available","avgDailyConsumption","daysOfStock","reorderPoint"],"properties":{"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"avgDailyConsumption":{"type":"number"},"daysOfStock":{"anyOf":[{"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["stockItemId","warehouseId","warehouseName","productId","productCode","productName","productVariantId","variantCode","variantName","virtualItemSku","itemLabel","quantity","quantityReserved","available","avgDailyConsumption","daysOfStock","reorderPoint"],"properties":{"stockItemId":{"type":"number"},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productName":{"anyOf":[{"type":"string"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"itemLabel":{"type":"string"},"itemSku":{"description":"Product SKU (variant SKU first).","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"},"quantityReserved":{"type":"number"},"available":{"type":"number"},"avgDailyConsumption":{"type":"number"},"daysOfStock":{"anyOf":[{"type":"number"},{"type":"null"}]},"reorderPoint":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehouseReportsDays-of-stock","tags":["Warehouse"],"summary":"Days-of-stock report (Tier 1 #4)","description":"Per-cell \"how many days does current available last given the moving-average consumption\"."}},"/bff/workflow/status":{"get":{"parameters":[{"description":"Optional order group code to filter statuses by group.","examples":["default"],"schema":{"type":"string"},"in":"query","name":"groupCode","required":false}],"operationId":"getBffWorkflowStatus","tags":["Workflow"],"summary":"Get workflow status list","description":"Returns all order workflow statuses for the organisation with their rules, colors, redirect logic and linked email templates. Optionally filtered by order group.","responses":{"200":{}}}},"/bff/workflow/add-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowAdd-status","tags":["Workflow"],"summary":"Add workflow status","description":"Creates a new order workflow status at the end of the specified phase group.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label","code","color","type"],"properties":{"label":{"description":"Display label for the status.","examples":["Odesláno"],"type":"string"},"code":{"description":"Unique status code (slug). If empty, generated from label.","examples":["odeslano"],"type":"string"},"color":{"description":"Hex color for the status badge.","examples":["#22c55e"],"type":"string"},"type":{"description":"Workflow phase: new, processing, storno or done.","examples":["processing"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["label","code","color","type"],"properties":{"label":{"description":"Display label for the status.","examples":["Odesláno"],"type":"string"},"code":{"description":"Unique status code (slug). If empty, generated from label.","examples":["odeslano"],"type":"string"},"color":{"description":"Hex color for the status badge.","examples":["#22c55e"],"type":"string"},"type":{"description":"Workflow phase: new, processing, storno or done.","examples":["processing"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["label","code","color","type"],"properties":{"label":{"description":"Display label for the status.","examples":["Odesláno"],"type":"string"},"code":{"description":"Unique status code (slug). If empty, generated from label.","examples":["odeslano"],"type":"string"},"color":{"description":"Hex color for the status badge.","examples":["#22c55e"],"type":"string"},"type":{"description":"Workflow phase: new, processing, storno or done.","examples":["processing"],"type":"string"}}}}}}}},"/bff/workflow/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowUpdate","tags":["Workflow"],"summary":"Update workflow status","description":"Updates an existing workflow status including its automation rules (auto-pay, invoice, redirect).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["label","code","color","markAsPaid","createInvoice","createReceipt"],"properties":{"label":{"description":"Display label for the status.","examples":["Odesláno"],"type":"string"},"code":{"description":"Status code to update (identifies the status).","examples":["odeslano"],"type":"string"},"internalName":{"description":"Internal name visible only to staff.","type":"string"},"publicLabel":{"description":"Public-facing label shown to customers.","type":"string"},"color":{"description":"Hex color for the status badge.","examples":["#22c55e"],"type":"string"},"markAsPaid":{"description":"Automatically mark order as paid when entering this status.","type":"boolean"},"createInvoice":{"description":"Automatically create invoice when entering this status.","type":"boolean"},"createReceipt":{"description":"Automatically create receipt when entering this status.","type":"boolean"},"redirectToCode":{"description":"Status code to auto-redirect to after timeout.","examples":["done"],"type":"string"},"redirectTimeout":{"description":"Relative time before redirect (e.g. \"2h\", \"1d\").","examples":["2h"],"type":"string"},"redirectWhenPaidToCode":{"description":"Status code to move to once the order is in this status AND paid, in either order (entering the status while paid, or getting paid while in it). Empty string clears it; omitted = unchanged.","examples":["zak-dokonceno"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["label","code","color","markAsPaid","createInvoice","createReceipt"],"properties":{"label":{"description":"Display label for the status.","examples":["Odesláno"],"type":"string"},"code":{"description":"Status code to update (identifies the status).","examples":["odeslano"],"type":"string"},"internalName":{"description":"Internal name visible only to staff.","type":"string"},"publicLabel":{"description":"Public-facing label shown to customers.","type":"string"},"color":{"description":"Hex color for the status badge.","examples":["#22c55e"],"type":"string"},"markAsPaid":{"description":"Automatically mark order as paid when entering this status.","type":"boolean"},"createInvoice":{"description":"Automatically create invoice when entering this status.","type":"boolean"},"createReceipt":{"description":"Automatically create receipt when entering this status.","type":"boolean"},"redirectToCode":{"description":"Status code to auto-redirect to after timeout.","examples":["done"],"type":"string"},"redirectTimeout":{"description":"Relative time before redirect (e.g. \"2h\", \"1d\").","examples":["2h"],"type":"string"},"redirectWhenPaidToCode":{"description":"Status code to move to once the order is in this status AND paid, in either order (entering the status while paid, or getting paid while in it). Empty string clears it; omitted = unchanged.","examples":["zak-dokonceno"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["label","code","color","markAsPaid","createInvoice","createReceipt"],"properties":{"label":{"description":"Display label for the status.","examples":["Odesláno"],"type":"string"},"code":{"description":"Status code to update (identifies the status).","examples":["odeslano"],"type":"string"},"internalName":{"description":"Internal name visible only to staff.","type":"string"},"publicLabel":{"description":"Public-facing label shown to customers.","type":"string"},"color":{"description":"Hex color for the status badge.","examples":["#22c55e"],"type":"string"},"markAsPaid":{"description":"Automatically mark order as paid when entering this status.","type":"boolean"},"createInvoice":{"description":"Automatically create invoice when entering this status.","type":"boolean"},"createReceipt":{"description":"Automatically create receipt when entering this status.","type":"boolean"},"redirectToCode":{"description":"Status code to auto-redirect to after timeout.","examples":["done"],"type":"string"},"redirectTimeout":{"description":"Relative time before redirect (e.g. \"2h\", \"1d\").","examples":["2h"],"type":"string"},"redirectWhenPaidToCode":{"description":"Status code to move to once the order is in this status AND paid, in either order (entering the status while paid, or getting paid while in it). Empty string clears it; omitted = unchanged.","examples":["zak-dokonceno"],"type":"string"}}}}}}}},"/bff/workflow/set-status-position":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowSet-status-position","tags":["Workflow"],"summary":"Change workflow status position","description":"Moves a workflow status up or down in the ordering within its phase group.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","direction"],"properties":{"code":{"description":"Status code to reorder.","examples":["odeslano"],"type":"string"},"direction":{"description":"Direction to move: \"up\" or \"down\".","examples":["up"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","direction"],"properties":{"code":{"description":"Status code to reorder.","examples":["odeslano"],"type":"string"},"direction":{"description":"Direction to move: \"up\" or \"down\".","examples":["up"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code","direction"],"properties":{"code":{"description":"Status code to reorder.","examples":["odeslano"],"type":"string"},"direction":{"description":"Direction to move: \"up\" or \"down\".","examples":["up"],"type":"string"}}}}}}}},"/bff/workflow/assign-group-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowAssign-group-status","tags":["Workflow"],"summary":"Assign status to order group","description":"Links a workflow status to an order group so that orders in this group only show the assigned statuses.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groupCode","statusCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to assign to the group.","examples":["odeslano"],"type":"string"},"position":{"description":"Position within the group. Auto-assigned if omitted.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["groupCode","statusCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to assign to the group.","examples":["odeslano"],"type":"string"},"position":{"description":"Position within the group. Auto-assigned if omitted.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["groupCode","statusCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to assign to the group.","examples":["odeslano"],"type":"string"},"position":{"description":"Position within the group. Auto-assigned if omitted.","type":"number"}}}}}}}},"/bff/workflow/remove-group-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowRemove-group-status","tags":["Workflow"],"summary":"Remove status from order group","description":"Unlinks a workflow status from an order group.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groupCode","statusCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to remove from the group.","examples":["odeslano"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["groupCode","statusCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to remove from the group.","examples":["odeslano"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["groupCode","statusCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to remove from the group.","examples":["odeslano"],"type":"string"}}}}}}}},"/bff/workflow/assign-group-template":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowAssign-group-template","tags":["Workflow"],"summary":"Assign email template to group status","description":"Links an email template to a specific status within an order group for status change notifications.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groupCode","statusCode","templateCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code the template is linked to.","examples":["odeslano"],"type":"string"},"templateCode":{"description":"Email template code to assign.","examples":["order-shipped-cs"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["groupCode","statusCode","templateCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code the template is linked to.","examples":["odeslano"],"type":"string"},"templateCode":{"description":"Email template code to assign.","examples":["order-shipped-cs"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["groupCode","statusCode","templateCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code the template is linked to.","examples":["odeslano"],"type":"string"},"templateCode":{"description":"Email template code to assign.","examples":["order-shipped-cs"],"type":"string"}}}}}}}},"/bff/workflow/remove-group-template":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowRemove-group-template","tags":["Workflow"],"summary":"Remove email template from group status","description":"Unlinks an email template from a specific status within an order group.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groupCode","statusCode","templateCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to unlink the template from.","examples":["odeslano"],"type":"string"},"templateCode":{"description":"Email template code to remove.","examples":["order-shipped-cs"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["groupCode","statusCode","templateCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to unlink the template from.","examples":["odeslano"],"type":"string"},"templateCode":{"description":"Email template code to remove.","examples":["order-shipped-cs"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["groupCode","statusCode","templateCode"],"properties":{"groupCode":{"description":"Order group code.","examples":["default"],"type":"string"},"statusCode":{"description":"Status code to unlink the template from.","examples":["odeslano"],"type":"string"},"templateCode":{"description":"Email template code to remove.","examples":["order-shipped-cs"],"type":"string"}}}}}}}},"/bff/workflow/group-templates":{"get":{"parameters":[{"description":"Order group code to list templates for.","examples":["default"],"schema":{"type":"string"},"in":"query","name":"groupCode","required":true}],"operationId":"getBffWorkflowGroup-templates","tags":["Workflow"],"summary":"List group email templates","description":"Returns all email templates linked to statuses within the specified order group.","responses":{"200":{}}}},"/bff/workflow/group-list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","description","default","active","position","dueDateRelativeTime","invoicePrefix","invoiceIssuerId","invoiceIssuer","forceInvoice","useSystemDefaultNotifications","preferBankTransferPayment","notifyOnlyGroupTemplates","hiddenByDefault","calendarCode","insertedDate","orderCount","statusCount","statuses","paymentGatewayPreference"],"properties":{"id":{"description":"Internal numeric group ID.","type":"number"},"code":{"description":"Stable group code (slug, unique per organisation).","examples":["default"],"type":"string"},"name":{"description":"Display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Free-form admin description.","type":"string"},{"type":"null"}]},"default":{"description":"Whether this group is the organisation default.","type":"boolean"},"active":{"description":"Whether new orders can be assigned to this group.","type":"boolean"},"position":{"description":"Sort order within the organisation.","type":"number"},"dueDateRelativeTime":{"description":"Default due-date offset for new orders, e.g. \"7d\".","examples":["7d"],"type":"string"},"invoicePrefix":{"nullable":true,"anyOf":[{"description":"Optional invoice number prefix (1–3 chars).","examples":["A"],"type":"string"},{"type":"null"}]},"invoiceIssuerId":{"nullable":true,"anyOf":[{"description":"Contact ID of the invoice issuer override, or null to use the org default.","type":"number"},{"type":"null"}]},"invoiceIssuer":{"nullable":true,"anyOf":[{"description":"Override contact who issues invoices for this group. `null` means the organisation's internal contact is used (default behaviour).","type":"object","required":["cuRefNo","name","companyName","personalName","email"],"properties":{"cuRefNo":{"description":"shop__contact.external_id (16-char) — admin-facing contact reference.","type":"string"},"name":{"description":"Display label. Company name with personal name in parens when both exist, otherwise whichever is set, otherwise email.","type":"string"},"companyName":{"nullable":true,"anyOf":[{"description":"Trading / legal name of the company, if set on the contact.","type":"string"},{"type":"null"}]},"personalName":{"nullable":true,"anyOf":[{"description":"Trimmed `first last` of the contact, or `null` when neither is set.","type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"description":"Invoice issuer e-mail. `null` for phone-only contacts; in that case the issuer block on the invoice falls back to `name` and `cuRefNo`.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"forceInvoice":{"description":"When true, paid orders in this group always get a full tax invoice regardless of country/threshold rules. The status-level create_receipt flag is suppressed for orders in this group — a single receipt cannot substitute for the required invoice on internal-party billing (e.g. franchise settlement).","type":"boolean"},"useSystemDefaultNotifications":{"description":"When true, sendOrderStatusNotification bypasses any per-group binding and per-org template variant configured for this organisation and sends the platform-baked default template keyed by the 4 status types (new / processing / storno / done). Used when the group hosts a flow (consulting, real-estate handoff, e-shop upsell inside a reservation-focused org) that does not fit the org's regular custom-template copy.","type":"boolean"},"preferBankTransferPayment":{"description":"When true, the system-default \"order received\" e-mail template renders bank transfer instructions (IBAN + variable symbol + payment QR) instead of the \"Zaplatit online\" button — provided the organisation has a bank account configured for the order currency and the order carries a variable symbol. Card payments through configured gateways continue to work; the flag only shapes the confirmation e-mail. Defaults to false.","type":"boolean"},"notifyOnlyGroupTemplates":{"description":"When true, only the templates assigned to this group per status are sent. A status without an assigned template sends no customer e-mail instead of falling back to the organisation-wide order-status template. Ignored when useSystemDefaultNotifications is on.","type":"boolean"},"hiddenByDefault":{"description":"When true, orders in this group are left out of the default order list, its count and the order statistics. They appear only when the list is filtered by this group explicitly.","type":"boolean"},"calendarCode":{"description":"BIZKIT-171: planning calendar for the group's orders (expected date, installations).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp when the group was created.","type":"string"},"orderCount":{"description":"Total number of orders ever assigned to this group.","type":"number"},"statusCount":{"description":"Number of workflow statuses linked via shop__order_group_status.","type":"number"},"statuses":{"description":"Statuses enabled for this group, ordered by their group position then global workflow position.","type":"array","items":{"type":"object","required":["id","code","label","color","workflowPosition","position"],"properties":{"id":{"description":"Status internal ID.","type":"number"},"code":{"description":"Status code.","examples":["paid"],"type":"string"},"label":{"description":"Status display label.","type":"string"},"color":{"description":"Hex color including leading #.","examples":["#3c78d8"],"type":"string"},"workflowPosition":{"description":"Global workflow position within the organisation.","type":"number"},"position":{"description":"Position of the status within this group.","type":"number"}}}},"paymentGatewayPreference":{"description":"How online payments resolve for orders in this group.","type":"object","required":["mode","gatewayCode","gatewayInstanceId"],"properties":{"mode":{"description":"\"fallback\" — group has no specific preference, resolver uses the org-wide active gateway. \"specific\" — group is bound to a single gateway instance (see gatewayCode). \"none\" — online payments are explicitly disabled for this group; no redirect, no fallback.","anyOf":[{"const":"fallback","type":"string"},{"const":"specific","type":"string"},{"const":"none","type":"string"}]},"gatewayCode":{"nullable":true,"anyOf":[{"description":"Gateway instance code when mode is \"specific\".","type":"string"},{"type":"null"}]},"gatewayInstanceId":{"nullable":true,"anyOf":[{"description":"Gateway instance internal ID when mode is \"specific\".","type":"number"},{"type":"null"}]}}}}}},"itemCount":{"description":"Total number of groups returned.","type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","description","default","active","position","dueDateRelativeTime","invoicePrefix","invoiceIssuerId","invoiceIssuer","forceInvoice","useSystemDefaultNotifications","preferBankTransferPayment","notifyOnlyGroupTemplates","hiddenByDefault","calendarCode","insertedDate","orderCount","statusCount","statuses","paymentGatewayPreference"],"properties":{"id":{"description":"Internal numeric group ID.","type":"number"},"code":{"description":"Stable group code (slug, unique per organisation).","examples":["default"],"type":"string"},"name":{"description":"Display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Free-form admin description.","type":"string"},{"type":"null"}]},"default":{"description":"Whether this group is the organisation default.","type":"boolean"},"active":{"description":"Whether new orders can be assigned to this group.","type":"boolean"},"position":{"description":"Sort order within the organisation.","type":"number"},"dueDateRelativeTime":{"description":"Default due-date offset for new orders, e.g. \"7d\".","examples":["7d"],"type":"string"},"invoicePrefix":{"nullable":true,"anyOf":[{"description":"Optional invoice number prefix (1–3 chars).","examples":["A"],"type":"string"},{"type":"null"}]},"invoiceIssuerId":{"nullable":true,"anyOf":[{"description":"Contact ID of the invoice issuer override, or null to use the org default.","type":"number"},{"type":"null"}]},"invoiceIssuer":{"nullable":true,"anyOf":[{"description":"Override contact who issues invoices for this group. `null` means the organisation's internal contact is used (default behaviour).","type":"object","required":["cuRefNo","name","companyName","personalName","email"],"properties":{"cuRefNo":{"description":"shop__contact.external_id (16-char) — admin-facing contact reference.","type":"string"},"name":{"description":"Display label. Company name with personal name in parens when both exist, otherwise whichever is set, otherwise email.","type":"string"},"companyName":{"nullable":true,"anyOf":[{"description":"Trading / legal name of the company, if set on the contact.","type":"string"},{"type":"null"}]},"personalName":{"nullable":true,"anyOf":[{"description":"Trimmed `first last` of the contact, or `null` when neither is set.","type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"description":"Invoice issuer e-mail. `null` for phone-only contacts; in that case the issuer block on the invoice falls back to `name` and `cuRefNo`.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"forceInvoice":{"description":"When true, paid orders in this group always get a full tax invoice regardless of country/threshold rules. The status-level create_receipt flag is suppressed for orders in this group — a single receipt cannot substitute for the required invoice on internal-party billing (e.g. franchise settlement).","type":"boolean"},"useSystemDefaultNotifications":{"description":"When true, sendOrderStatusNotification bypasses any per-group binding and per-org template variant configured for this organisation and sends the platform-baked default template keyed by the 4 status types (new / processing / storno / done). Used when the group hosts a flow (consulting, real-estate handoff, e-shop upsell inside a reservation-focused org) that does not fit the org's regular custom-template copy.","type":"boolean"},"preferBankTransferPayment":{"description":"When true, the system-default \"order received\" e-mail template renders bank transfer instructions (IBAN + variable symbol + payment QR) instead of the \"Zaplatit online\" button — provided the organisation has a bank account configured for the order currency and the order carries a variable symbol. Card payments through configured gateways continue to work; the flag only shapes the confirmation e-mail. Defaults to false.","type":"boolean"},"notifyOnlyGroupTemplates":{"description":"When true, only the templates assigned to this group per status are sent. A status without an assigned template sends no customer e-mail instead of falling back to the organisation-wide order-status template. Ignored when useSystemDefaultNotifications is on.","type":"boolean"},"hiddenByDefault":{"description":"When true, orders in this group are left out of the default order list, its count and the order statistics. They appear only when the list is filtered by this group explicitly.","type":"boolean"},"calendarCode":{"description":"BIZKIT-171: planning calendar for the group's orders (expected date, installations).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp when the group was created.","type":"string"},"orderCount":{"description":"Total number of orders ever assigned to this group.","type":"number"},"statusCount":{"description":"Number of workflow statuses linked via shop__order_group_status.","type":"number"},"statuses":{"description":"Statuses enabled for this group, ordered by their group position then global workflow position.","type":"array","items":{"type":"object","required":["id","code","label","color","workflowPosition","position"],"properties":{"id":{"description":"Status internal ID.","type":"number"},"code":{"description":"Status code.","examples":["paid"],"type":"string"},"label":{"description":"Status display label.","type":"string"},"color":{"description":"Hex color including leading #.","examples":["#3c78d8"],"type":"string"},"workflowPosition":{"description":"Global workflow position within the organisation.","type":"number"},"position":{"description":"Position of the status within this group.","type":"number"}}}},"paymentGatewayPreference":{"description":"How online payments resolve for orders in this group.","type":"object","required":["mode","gatewayCode","gatewayInstanceId"],"properties":{"mode":{"description":"\"fallback\" — group has no specific preference, resolver uses the org-wide active gateway. \"specific\" — group is bound to a single gateway instance (see gatewayCode). \"none\" — online payments are explicitly disabled for this group; no redirect, no fallback.","anyOf":[{"const":"fallback","type":"string"},{"const":"specific","type":"string"},{"const":"none","type":"string"}]},"gatewayCode":{"nullable":true,"anyOf":[{"description":"Gateway instance code when mode is \"specific\".","type":"string"},{"type":"null"}]},"gatewayInstanceId":{"nullable":true,"anyOf":[{"description":"Gateway instance internal ID when mode is \"specific\".","type":"number"},{"type":"null"}]}}}}}},"itemCount":{"description":"Total number of groups returned.","type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","description","default","active","position","dueDateRelativeTime","invoicePrefix","invoiceIssuerId","invoiceIssuer","forceInvoice","useSystemDefaultNotifications","preferBankTransferPayment","notifyOnlyGroupTemplates","hiddenByDefault","calendarCode","insertedDate","orderCount","statusCount","statuses","paymentGatewayPreference"],"properties":{"id":{"description":"Internal numeric group ID.","type":"number"},"code":{"description":"Stable group code (slug, unique per organisation).","examples":["default"],"type":"string"},"name":{"description":"Display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"Free-form admin description.","type":"string"},{"type":"null"}]},"default":{"description":"Whether this group is the organisation default.","type":"boolean"},"active":{"description":"Whether new orders can be assigned to this group.","type":"boolean"},"position":{"description":"Sort order within the organisation.","type":"number"},"dueDateRelativeTime":{"description":"Default due-date offset for new orders, e.g. \"7d\".","examples":["7d"],"type":"string"},"invoicePrefix":{"nullable":true,"anyOf":[{"description":"Optional invoice number prefix (1–3 chars).","examples":["A"],"type":"string"},{"type":"null"}]},"invoiceIssuerId":{"nullable":true,"anyOf":[{"description":"Contact ID of the invoice issuer override, or null to use the org default.","type":"number"},{"type":"null"}]},"invoiceIssuer":{"nullable":true,"anyOf":[{"description":"Override contact who issues invoices for this group. `null` means the organisation's internal contact is used (default behaviour).","type":"object","required":["cuRefNo","name","companyName","personalName","email"],"properties":{"cuRefNo":{"description":"shop__contact.external_id (16-char) — admin-facing contact reference.","type":"string"},"name":{"description":"Display label. Company name with personal name in parens when both exist, otherwise whichever is set, otherwise email.","type":"string"},"companyName":{"nullable":true,"anyOf":[{"description":"Trading / legal name of the company, if set on the contact.","type":"string"},{"type":"null"}]},"personalName":{"nullable":true,"anyOf":[{"description":"Trimmed `first last` of the contact, or `null` when neither is set.","type":"string"},{"type":"null"}]},"email":{"nullable":true,"anyOf":[{"description":"Invoice issuer e-mail. `null` for phone-only contacts; in that case the issuer block on the invoice falls back to `name` and `cuRefNo`.","type":"string"},{"type":"null"}]}}},{"type":"null"}]},"forceInvoice":{"description":"When true, paid orders in this group always get a full tax invoice regardless of country/threshold rules. The status-level create_receipt flag is suppressed for orders in this group — a single receipt cannot substitute for the required invoice on internal-party billing (e.g. franchise settlement).","type":"boolean"},"useSystemDefaultNotifications":{"description":"When true, sendOrderStatusNotification bypasses any per-group binding and per-org template variant configured for this organisation and sends the platform-baked default template keyed by the 4 status types (new / processing / storno / done). Used when the group hosts a flow (consulting, real-estate handoff, e-shop upsell inside a reservation-focused org) that does not fit the org's regular custom-template copy.","type":"boolean"},"preferBankTransferPayment":{"description":"When true, the system-default \"order received\" e-mail template renders bank transfer instructions (IBAN + variable symbol + payment QR) instead of the \"Zaplatit online\" button — provided the organisation has a bank account configured for the order currency and the order carries a variable symbol. Card payments through configured gateways continue to work; the flag only shapes the confirmation e-mail. Defaults to false.","type":"boolean"},"notifyOnlyGroupTemplates":{"description":"When true, only the templates assigned to this group per status are sent. A status without an assigned template sends no customer e-mail instead of falling back to the organisation-wide order-status template. Ignored when useSystemDefaultNotifications is on.","type":"boolean"},"hiddenByDefault":{"description":"When true, orders in this group are left out of the default order list, its count and the order statistics. They appear only when the list is filtered by this group explicitly.","type":"boolean"},"calendarCode":{"description":"BIZKIT-171: planning calendar for the group's orders (expected date, installations).","anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"description":"ISO timestamp when the group was created.","type":"string"},"orderCount":{"description":"Total number of orders ever assigned to this group.","type":"number"},"statusCount":{"description":"Number of workflow statuses linked via shop__order_group_status.","type":"number"},"statuses":{"description":"Statuses enabled for this group, ordered by their group position then global workflow position.","type":"array","items":{"type":"object","required":["id","code","label","color","workflowPosition","position"],"properties":{"id":{"description":"Status internal ID.","type":"number"},"code":{"description":"Status code.","examples":["paid"],"type":"string"},"label":{"description":"Status display label.","type":"string"},"color":{"description":"Hex color including leading #.","examples":["#3c78d8"],"type":"string"},"workflowPosition":{"description":"Global workflow position within the organisation.","type":"number"},"position":{"description":"Position of the status within this group.","type":"number"}}}},"paymentGatewayPreference":{"description":"How online payments resolve for orders in this group.","type":"object","required":["mode","gatewayCode","gatewayInstanceId"],"properties":{"mode":{"description":"\"fallback\" — group has no specific preference, resolver uses the org-wide active gateway. \"specific\" — group is bound to a single gateway instance (see gatewayCode). \"none\" — online payments are explicitly disabled for this group; no redirect, no fallback.","anyOf":[{"const":"fallback","type":"string"},{"const":"specific","type":"string"},{"const":"none","type":"string"}]},"gatewayCode":{"nullable":true,"anyOf":[{"description":"Gateway instance code when mode is \"specific\".","type":"string"},{"type":"null"}]},"gatewayInstanceId":{"nullable":true,"anyOf":[{"description":"Gateway instance internal ID when mode is \"specific\".","type":"number"},{"type":"null"}]}}}}}},"itemCount":{"description":"Total number of groups returned.","type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWorkflowGroup-list","tags":["Workflow"],"summary":"List order groups","description":"Returns all order groups for the organisation with related data: order count, status count, and the list of workflow statuses linked to each group via the N:M shop__order_group_status table. Always invokes the bootstrap function first — guarantees that the organisation has the default order group and the default workflow status set, and that the default group has all statuses linked."}},"/bff/workflow/group-set-payment-gateway":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowGroup-set-payment-gateway","tags":["Workflow"],"summary":"Set payment-gateway preference for an order group","description":"Configures how online payments resolve for a given order group. \"fallback\" deletes any explicit preference (resolver picks the org-wide active gateway). \"specific\" binds the group to one gateway instance. \"none\" disables online payments for the group entirely — createPayment() will skip without redirect or fallback.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groupCode","mode"],"properties":{"groupCode":{"description":"Order group code to configure.","examples":["rezervace-smichov"],"type":"string"},"mode":{"description":"\"fallback\" — clears any preference; resolver will use the org-wide active gateway. \"specific\" — bind the group to a single gateway instance (gatewayCode required). \"none\" — explicitly disable online payments for this group; resolver returns null, no fallback.","anyOf":[{"const":"fallback","type":"string"},{"const":"specific","type":"string"},{"const":"none","type":"string"}]},"gatewayCode":{"nullable":true,"anyOf":[{"description":"Gateway instance code. Required when mode is \"specific\", ignored otherwise.","examples":["gopay-production"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["groupCode","mode"],"properties":{"groupCode":{"description":"Order group code to configure.","examples":["rezervace-smichov"],"type":"string"},"mode":{"description":"\"fallback\" — clears any preference; resolver will use the org-wide active gateway. \"specific\" — bind the group to a single gateway instance (gatewayCode required). \"none\" — explicitly disable online payments for this group; resolver returns null, no fallback.","anyOf":[{"const":"fallback","type":"string"},{"const":"specific","type":"string"},{"const":"none","type":"string"}]},"gatewayCode":{"nullable":true,"anyOf":[{"description":"Gateway instance code. Required when mode is \"specific\", ignored otherwise.","examples":["gopay-production"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["groupCode","mode"],"properties":{"groupCode":{"description":"Order group code to configure.","examples":["rezervace-smichov"],"type":"string"},"mode":{"description":"\"fallback\" — clears any preference; resolver will use the org-wide active gateway. \"specific\" — bind the group to a single gateway instance (gatewayCode required). \"none\" — explicitly disable online payments for this group; resolver returns null, no fallback.","anyOf":[{"const":"fallback","type":"string"},{"const":"specific","type":"string"},{"const":"none","type":"string"}]},"gatewayCode":{"nullable":true,"anyOf":[{"description":"Gateway instance code. Required when mode is \"specific\", ignored otherwise.","examples":["gopay-production"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/workflow/group-set-invoice-issuer":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowGroup-set-invoice-issuer","tags":["Workflow"],"summary":"Set invoice-issuer contact for an order group","description":"Overrides the contact used as the invoice-issuing party for orders in this group. When `null`, the override is cleared and the organisation's internal contact (the default) is used.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["groupCode","contactCuRefNo"],"properties":{"groupCode":{"description":"Order group code to configure.","examples":["default"],"type":"string"},"contactCuRefNo":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id (16-char) of the contact who should issue invoices for this group. `null` clears the override — the organisation's internal contact is used as before.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["groupCode","contactCuRefNo"],"properties":{"groupCode":{"description":"Order group code to configure.","examples":["default"],"type":"string"},"contactCuRefNo":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id (16-char) of the contact who should issue invoices for this group. `null` clears the override — the organisation's internal contact is used as before.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["groupCode","contactCuRefNo"],"properties":{"groupCode":{"description":"Order group code to configure.","examples":["default"],"type":"string"},"contactCuRefNo":{"nullable":true,"anyOf":[{"description":"shop__contact.external_id (16-char) of the contact who should issue invoices for this group. `null` clears the override — the organisation's internal contact is used as before.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/workflow/group-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"description":"Resolved group code (slugified).","type":"string"}},"required":["success","code"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"description":"Resolved group code (slugified).","type":"string"}},"required":["success","code"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"code":{"description":"Resolved group code (slugified).","type":"string"}},"required":["success","code"]}}}}},"operationId":"postBffWorkflowGroup-add","tags":["Workflow"],"summary":"Create order group","description":"Creates a new order group for the organisation and attaches a workflow-status set to it via shop__order_group_status. Code uniqueness and invoice-prefix uniqueness are enforced. The group is created at the end of the position order.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Display name of the new group.","examples":["Reservations"],"type":"string"},"code":{"description":"Optional stable code (slug). Auto-generated from name when omitted.","type":"string"},"description":{"description":"Free-form admin description.","type":"string"},"dueDateRelativeTime":{"description":"Default due-date offset for new orders.","examples":["7d"],"type":"string"},"invoicePrefix":{"description":"Optional invoice prefix (1–3 chars), unique per organisation.","type":"string"},"statusCodes":{"description":"Optional explicit list of status codes to attach to the new group. When omitted, the link set is copied from the default group, or all org statuses are linked if no default group has links.","type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Display name of the new group.","examples":["Reservations"],"type":"string"},"code":{"description":"Optional stable code (slug). Auto-generated from name when omitted.","type":"string"},"description":{"description":"Free-form admin description.","type":"string"},"dueDateRelativeTime":{"description":"Default due-date offset for new orders.","examples":["7d"],"type":"string"},"invoicePrefix":{"description":"Optional invoice prefix (1–3 chars), unique per organisation.","type":"string"},"statusCodes":{"description":"Optional explicit list of status codes to attach to the new group. When omitted, the link set is copied from the default group, or all org statuses are linked if no default group has links.","type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["name"],"properties":{"name":{"description":"Display name of the new group.","examples":["Reservations"],"type":"string"},"code":{"description":"Optional stable code (slug). Auto-generated from name when omitted.","type":"string"},"description":{"description":"Free-form admin description.","type":"string"},"dueDateRelativeTime":{"description":"Default due-date offset for new orders.","examples":["7d"],"type":"string"},"invoicePrefix":{"description":"Optional invoice prefix (1–3 chars), unique per organisation.","type":"string"},"statusCodes":{"description":"Optional explicit list of status codes to attach to the new group. When omitted, the link set is copied from the default group, or all org statuses are linked if no default group has links.","type":"array","items":{"type":"string"}}}}}}}}},"/bff/workflow/group-update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowGroup-update","tags":["Workflow"],"summary":"Update order group","description":"Updates editable fields of an order group. Only provided fields are touched.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to update.","examples":["default"],"type":"string"},"name":{"description":"New display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"New description, or null to clear.","type":"string"},{"type":"null"}]},"active":{"description":"Activate or deactivate the group. Default group cannot be deactivated.","type":"boolean"},"dueDateRelativeTime":{"description":"New due-date offset.","examples":["14d"],"type":"string"},"invoicePrefix":{"nullable":true,"anyOf":[{"description":"New invoice prefix, or null to clear.","type":"string"},{"type":"null"}]},"invoiceIssuerId":{"nullable":true,"anyOf":[{"description":"Contact ID of the invoice issuer override, or null to clear.","type":"number"},{"type":"null"}]},"forceInvoice":{"description":"When true, any paid order in this group is issued a full invoice regardless of country/threshold rules; the create_receipt flag on statuses is suppressed. Used for internal-party billing (franchise settlement) where a simplified receipt is not appropriate.","type":"boolean"},"useSystemDefaultNotifications":{"description":"When true, sendOrderStatusNotification bypasses this organisation's custom email templates and per-group bindings and sends the platform-baked default template keyed by the 4 status types (new / processing / storno / done). Enable when the group hosts a flow (consulting, real-estate handoff, e-shop upsell inside a reservation-focused org) that does not fit the org's regular custom-template copy.","type":"boolean"},"preferBankTransferPayment":{"description":"When true, the system-default \"order received\" e-mail resolves the payment block to bank transfer instructions (IBAN + variable symbol + payment QR) instead of the \"Zaplatit online\" button, provided the organisation has a bank account for the order currency and the order carries a variable symbol. Card payments through configured gateways still work — only the confirmation e-mail changes.","type":"boolean"},"notifyOnlyGroupTemplates":{"description":"When true, only the templates assigned to this group per status are sent. A status without an assigned template sends no customer e-mail instead of falling back to the organisation-wide order-status template. Ignored when useSystemDefaultNotifications is on.","type":"boolean"},"hiddenByDefault":{"description":"When true, orders in this group are left out of the default order list, its count and the order statistics (e.g. a \"test orders\" group). Filtering the list by this group shows them.","type":"boolean"},"calendarCode":{"nullable":true,"anyOf":[{"description":"BIZKIT-171: planning calendar code for the group's orders, or null to clear.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to update.","examples":["default"],"type":"string"},"name":{"description":"New display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"New description, or null to clear.","type":"string"},{"type":"null"}]},"active":{"description":"Activate or deactivate the group. Default group cannot be deactivated.","type":"boolean"},"dueDateRelativeTime":{"description":"New due-date offset.","examples":["14d"],"type":"string"},"invoicePrefix":{"nullable":true,"anyOf":[{"description":"New invoice prefix, or null to clear.","type":"string"},{"type":"null"}]},"invoiceIssuerId":{"nullable":true,"anyOf":[{"description":"Contact ID of the invoice issuer override, or null to clear.","type":"number"},{"type":"null"}]},"forceInvoice":{"description":"When true, any paid order in this group is issued a full invoice regardless of country/threshold rules; the create_receipt flag on statuses is suppressed. Used for internal-party billing (franchise settlement) where a simplified receipt is not appropriate.","type":"boolean"},"useSystemDefaultNotifications":{"description":"When true, sendOrderStatusNotification bypasses this organisation's custom email templates and per-group bindings and sends the platform-baked default template keyed by the 4 status types (new / processing / storno / done). Enable when the group hosts a flow (consulting, real-estate handoff, e-shop upsell inside a reservation-focused org) that does not fit the org's regular custom-template copy.","type":"boolean"},"preferBankTransferPayment":{"description":"When true, the system-default \"order received\" e-mail resolves the payment block to bank transfer instructions (IBAN + variable symbol + payment QR) instead of the \"Zaplatit online\" button, provided the organisation has a bank account for the order currency and the order carries a variable symbol. Card payments through configured gateways still work — only the confirmation e-mail changes.","type":"boolean"},"notifyOnlyGroupTemplates":{"description":"When true, only the templates assigned to this group per status are sent. A status without an assigned template sends no customer e-mail instead of falling back to the organisation-wide order-status template. Ignored when useSystemDefaultNotifications is on.","type":"boolean"},"hiddenByDefault":{"description":"When true, orders in this group are left out of the default order list, its count and the order statistics (e.g. a \"test orders\" group). Filtering the list by this group shows them.","type":"boolean"},"calendarCode":{"nullable":true,"anyOf":[{"description":"BIZKIT-171: planning calendar code for the group's orders, or null to clear.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to update.","examples":["default"],"type":"string"},"name":{"description":"New display name.","type":"string"},"description":{"nullable":true,"anyOf":[{"description":"New description, or null to clear.","type":"string"},{"type":"null"}]},"active":{"description":"Activate or deactivate the group. Default group cannot be deactivated.","type":"boolean"},"dueDateRelativeTime":{"description":"New due-date offset.","examples":["14d"],"type":"string"},"invoicePrefix":{"nullable":true,"anyOf":[{"description":"New invoice prefix, or null to clear.","type":"string"},{"type":"null"}]},"invoiceIssuerId":{"nullable":true,"anyOf":[{"description":"Contact ID of the invoice issuer override, or null to clear.","type":"number"},{"type":"null"}]},"forceInvoice":{"description":"When true, any paid order in this group is issued a full invoice regardless of country/threshold rules; the create_receipt flag on statuses is suppressed. Used for internal-party billing (franchise settlement) where a simplified receipt is not appropriate.","type":"boolean"},"useSystemDefaultNotifications":{"description":"When true, sendOrderStatusNotification bypasses this organisation's custom email templates and per-group bindings and sends the platform-baked default template keyed by the 4 status types (new / processing / storno / done). Enable when the group hosts a flow (consulting, real-estate handoff, e-shop upsell inside a reservation-focused org) that does not fit the org's regular custom-template copy.","type":"boolean"},"preferBankTransferPayment":{"description":"When true, the system-default \"order received\" e-mail resolves the payment block to bank transfer instructions (IBAN + variable symbol + payment QR) instead of the \"Zaplatit online\" button, provided the organisation has a bank account for the order currency and the order carries a variable symbol. Card payments through configured gateways still work — only the confirmation e-mail changes.","type":"boolean"},"notifyOnlyGroupTemplates":{"description":"When true, only the templates assigned to this group per status are sent. A status without an assigned template sends no customer e-mail instead of falling back to the organisation-wide order-status template. Ignored when useSystemDefaultNotifications is on.","type":"boolean"},"hiddenByDefault":{"description":"When true, orders in this group are left out of the default order list, its count and the order statistics (e.g. a \"test orders\" group). Filtering the list by this group shows them.","type":"boolean"},"calendarCode":{"nullable":true,"anyOf":[{"description":"BIZKIT-171: planning calendar code for the group's orders, or null to clear.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/workflow/group-set-position":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowGroup-set-position","tags":["Workflow"],"summary":"Move order group one place","description":"Moves an order group exactly one place up or down within its section (active / inactive) of the display order (active first, then position, then id). Positions are renumbered to a unique 1..N sequence on the way, so duplicate stored positions never block the move. No-op at the section boundary.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","direction"],"properties":{"code":{"description":"Code of the group to reorder.","examples":["reservations"],"type":"string"},"direction":{"description":"Direction to move: \"up\" or \"down\".","examples":["up"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","direction"],"properties":{"code":{"description":"Code of the group to reorder.","examples":["reservations"],"type":"string"},"direction":{"description":"Direction to move: \"up\" or \"down\".","examples":["up"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code","direction"],"properties":{"code":{"description":"Code of the group to reorder.","examples":["reservations"],"type":"string"},"direction":{"description":"Direction to move: \"up\" or \"down\".","examples":["up"],"type":"string"}}}}}}}},"/bff/workflow/group-reorder":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowGroup-reorder","tags":["Workflow"],"summary":"Set the order of all order groups","description":"Persists the whole order at once (drag & drop in admin) as positions 1..N. Unknown or duplicate codes are rejected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["codes"],"properties":{"codes":{"minItems":1,"description":"Group codes in the desired order. Groups not listed keep their relative order after the listed ones; active groups always stay before inactive ones.","examples":[["rezervace-smichov","lednice-smichov","default"]],"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["codes"],"properties":{"codes":{"minItems":1,"description":"Group codes in the desired order. Groups not listed keep their relative order after the listed ones; active groups always stay before inactive ones.","examples":[["rezervace-smichov","lednice-smichov","default"]],"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["codes"],"properties":{"codes":{"minItems":1,"description":"Group codes in the desired order. Groups not listed keep their relative order after the listed ones; active groups always stay before inactive ones.","examples":[["rezervace-smichov","lednice-smichov","default"]],"type":"array","items":{"type":"string"}}}}}}}}},"/bff/workflow/group-set-active":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWorkflowGroup-set-active","tags":["Workflow"],"summary":"Activate or deactivate order group","description":"An inactive group accepts no new orders (order create rejects it with `inactive_order_group`) and is never re-activated by order-group auto-creation. Existing orders stay untouched and remain filterable. The default group cannot be deactivated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Code of the group.","examples":["lednice-smichov"],"type":"string"},"active":{"description":"true activates the group, false deactivates it.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Code of the group.","examples":["lednice-smichov"],"type":"string"},"active":{"description":"true activates the group, false deactivates it.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["code","active"],"properties":{"code":{"description":"Code of the group.","examples":["lednice-smichov"],"type":"string"},"active":{"description":"true activates the group, false deactivates it.","type":"boolean"}}}}}}}},"/bff/workflow/group-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deletedOrderCount":{"description":"Number of cancelled test orders deleted with the group.","type":"number"}},"required":["success","deletedOrderCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deletedOrderCount":{"description":"Number of cancelled test orders deleted with the group.","type":"number"}},"required":["success","deletedOrderCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"default":true,"type":"boolean"},"deletedOrderCount":{"description":"Number of cancelled test orders deleted with the group.","type":"number"}},"required":["success","deletedOrderCount"]}}}}},"operationId":"postBffWorkflowGroup-delete","tags":["Workflow"],"summary":"Delete an order group created by mistake","description":"Permanently deletes an order group. Allowed only when the group is not the default group, has already been deactivated (`group-set-active` = false) and contains at most 20 orders that are all cancelled (storno), unpaid and without invoices, payments, bank transactions, credit, shipments, complaints, subscriptions, stock movements, vouchers, files or child orders. Those orders are deleted together with the group (items, logs, status history). Customer contacts and organisation-wide statuses are kept. Otherwise the request fails with a message naming the blocking orders; keep such a group deactivated.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to delete.","examples":["eshop"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to delete.","examples":["eshop"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["code"],"properties":{"code":{"description":"Code of the group to delete.","examples":["eshop"],"type":"string"}}}}}}}},"/bff/feed/stream":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"before","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"authorContactExternalId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}},"hasMore":{"type":"boolean"}},"required":["items","hasMore"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}},"hasMore":{"type":"boolean"}},"required":["items","hasMore"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}},"hasMore":{"type":"boolean"}},"required":["items","hasMore"]}}}}},"operationId":"getBffFeedStream","tags":["Feed"],"summary":"Cursor-paginated list of native wall posts"}},"/bff/feed/post-detail":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"externalId","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","item"],"properties":{"state":{"const":"ok","type":"string"},"item":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","item"],"properties":{"state":{"const":"ok","type":"string"},"item":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","item"],"properties":{"state":{"const":"ok","type":"string"},"item":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","item"],"properties":{"state":{"const":"ok","type":"string"},"item":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}}]}}}}},"operationId":"getBffFeedPost-detail","tags":["Feed"],"summary":"Single wall post by external id — powers /feed/[externalId]"}},"/bff/feed/my-day":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","required":["eventCode","startTime","endTime","isAllDay","isFullView","title","calendarName","calendarColor"],"properties":{"eventCode":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"isAllDay":{"type":"boolean"},"isFullView":{"type":"boolean"},"title":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"calendarName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"calendarColor":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"assignedIssueCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["events","assignedIssueCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","required":["eventCode","startTime","endTime","isAllDay","isFullView","title","calendarName","calendarColor"],"properties":{"eventCode":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"isAllDay":{"type":"boolean"},"isFullView":{"type":"boolean"},"title":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"calendarName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"calendarColor":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"assignedIssueCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["events","assignedIssueCount"]}},"text/plain":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","required":["eventCode","startTime","endTime","isAllDay","isFullView","title","calendarName","calendarColor"],"properties":{"eventCode":{"type":"string"},"startTime":{"type":"string"},"endTime":{"type":"string"},"isAllDay":{"type":"boolean"},"isFullView":{"type":"boolean"},"title":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"calendarName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"calendarColor":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}},"assignedIssueCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}},"required":["events","assignedIssueCount"]}}}}},"operationId":"getBffFeedMy-day","tags":["Feed"],"summary":"My-day aggregate — upcoming events + assigned open issue count"}},"/bff/feed/month-calendar":{"get":{"parameters":[{"description":"YYYY-MM; defaults to the current month in Europe/Prague.","schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"in":"query","name":"month","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"month":{"type":"string"},"today":{"type":"string"},"countryCode":{"type":"string"},"days":{"type":"array","items":{"type":"object","required":["date","kind","holidayName","eventCount"],"properties":{"date":{"type":"string"},"kind":{"anyOf":[{"const":"workday","type":"string"},{"const":"weekend","type":"string"},{"const":"holiday","type":"string"}]},"holidayName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"eventCount":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}},"required":["month","today","countryCode","days"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"month":{"type":"string"},"today":{"type":"string"},"countryCode":{"type":"string"},"days":{"type":"array","items":{"type":"object","required":["date","kind","holidayName","eventCount"],"properties":{"date":{"type":"string"},"kind":{"anyOf":[{"const":"workday","type":"string"},{"const":"weekend","type":"string"},{"const":"holiday","type":"string"}]},"holidayName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"eventCount":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}},"required":["month","today","countryCode","days"]}},"text/plain":{"schema":{"type":"object","properties":{"month":{"type":"string"},"today":{"type":"string"},"countryCode":{"type":"string"},"days":{"type":"array","items":{"type":"object","required":["date","kind","holidayName","eventCount"],"properties":{"date":{"type":"string"},"kind":{"anyOf":[{"const":"workday","type":"string"},{"const":"weekend","type":"string"},{"const":"holiday","type":"string"}]},"holidayName":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"eventCount":{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]}}}}},"required":["month","today","countryCode","days"]}}}}},"operationId":"getBffFeedMonth-calendar","tags":["Feed"],"summary":"Month calendar — workday / weekend / public holiday per day + count of my events"}},"/bff/feed/my-month":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"current":{"type":"object","required":["posts","comments","reactions"],"properties":{"posts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"comments":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"reactions":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"previous":{"type":"object","required":["posts","comments","reactions"],"properties":{"posts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"comments":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"reactions":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["current","previous"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"current":{"type":"object","required":["posts","comments","reactions"],"properties":{"posts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"comments":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"reactions":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"previous":{"type":"object","required":["posts","comments","reactions"],"properties":{"posts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"comments":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"reactions":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["current","previous"]}},"text/plain":{"schema":{"type":"object","properties":{"current":{"type":"object","required":["posts","comments","reactions"],"properties":{"posts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"comments":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"reactions":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}},"previous":{"type":"object","required":["posts","comments","reactions"],"properties":{"posts":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"comments":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"reactions":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"required":["current","previous"]}}}}},"operationId":"getBffFeedMy-month","tags":["Feed"],"summary":"Contribution counters for the member — current vs previous month"}},"/bff/feed/post-create":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state","externalId","item"],"properties":{"state":{"const":"ok","type":"string"},"externalId":{"minLength":16,"maxLength":16,"type":"string"},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","externalId","item"],"properties":{"state":{"const":"ok","type":"string"},"externalId":{"minLength":16,"maxLength":16,"type":"string"},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","externalId","item"],"properties":{"state":{"const":"ok","type":"string"},"externalId":{"minLength":16,"maxLength":16,"type":"string"},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","externalId","item"],"properties":{"state":{"const":"ok","type":"string"},"externalId":{"minLength":16,"maxLength":16,"type":"string"},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}}}}},"operationId":"postBffFeedPost-create","tags":["Feed"],"summary":"Publish a member post to the organisation wall","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["bodyMarkdown"],"properties":{"bodyMarkdown":{"minLength":1,"maxLength":10000,"type":"string"},"attachmentBlobTokens":{"maxItems":20,"type":"array","items":{"minLength":32,"maxLength":32,"type":"string"}},"announcement":{"description":"Publish as an announcement with read confirmation (module-members).","type":"object","properties":{"departmentId":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["bodyMarkdown"],"properties":{"bodyMarkdown":{"minLength":1,"maxLength":10000,"type":"string"},"attachmentBlobTokens":{"maxItems":20,"type":"array","items":{"minLength":32,"maxLength":32,"type":"string"}},"announcement":{"description":"Publish as an announcement with read confirmation (module-members).","type":"object","properties":{"departmentId":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]}}}}}},"text/plain":{"schema":{"type":"object","required":["bodyMarkdown"],"properties":{"bodyMarkdown":{"minLength":1,"maxLength":10000,"type":"string"},"attachmentBlobTokens":{"maxItems":20,"type":"array","items":{"minLength":32,"maxLength":32,"type":"string"}},"announcement":{"description":"Publish as an announcement with read confirmation (module-members).","type":"object","properties":{"departmentId":{"nullable":true,"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]}}}}}}}}}},"/bff/feed/post-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}}}}},"operationId":"postBffFeedPost-delete","tags":["Feed"],"summary":"Soft-delete a wall post (author only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/feed/post-edit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}}}}},"operationId":"postBffFeedPost-edit","tags":["Feed"],"summary":"Edit a wall post body (author only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","bodyMarkdown"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":10000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","bodyMarkdown"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":10000,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId","bodyMarkdown"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":10000,"type":"string"}}}}}}}},"/bff/feed/react":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"forbidden","type":"string"}]},"active":{"type":"boolean"}},"required":["state","active"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"forbidden","type":"string"}]},"active":{"type":"boolean"}},"required":["state","active"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"forbidden","type":"string"}]},"active":{"type":"boolean"}},"required":["state","active"]}}}}},"operationId":"postBffFeedReact","tags":["Feed"],"summary":"Toggle a reaction on a feed target","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetKind","targetExternalId","kind"],"properties":{"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"minLength":16,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"like","type":"string"},{"const":"celebrate","type":"string"},{"const":"thanks","type":"string"},{"const":"question","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["targetKind","targetExternalId","kind"],"properties":{"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"minLength":16,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"like","type":"string"},{"const":"celebrate","type":"string"},{"const":"thanks","type":"string"},{"const":"question","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["targetKind","targetExternalId","kind"],"properties":{"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"minLength":16,"maxLength":24,"type":"string"},"kind":{"anyOf":[{"const":"like","type":"string"},{"const":"celebrate","type":"string"},{"const":"thanks","type":"string"},{"const":"question","type":"string"}]}}}}}}}},"/bff/feed/comments":{"get":{"parameters":[{"schema":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"in":"query","name":"targetKind","required":true},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"targetExternalId","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","targetKind","targetExternalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate","canManage"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canManage":{"type":"boolean"}}}}},"required":["items"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","targetKind","targetExternalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate","canManage"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canManage":{"type":"boolean"}}}}},"required":["items"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","targetKind","targetExternalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate","canManage"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"canManage":{"type":"boolean"}}}}},"required":["items"]}}}}},"operationId":"getBffFeedComments","tags":["Feed"],"summary":"List comments on a feed target"}},"/bff/feed/comment-create":{"post":{"parameters":[],"responses":{"200":{"anyOf":[{"type":"object","required":["state","externalId"],"properties":{"state":{"const":"ok","type":"string"},"externalId":{"minLength":16,"maxLength":16,"type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","externalId"],"properties":{"state":{"const":"ok","type":"string"},"externalId":{"minLength":16,"maxLength":16,"type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","externalId"],"properties":{"state":{"const":"ok","type":"string"},"externalId":{"minLength":16,"maxLength":16,"type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","externalId"],"properties":{"state":{"const":"ok","type":"string"},"externalId":{"minLength":16,"maxLength":16,"type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}}}}},"operationId":"postBffFeedComment-create","tags":["Feed"],"summary":"Create a comment on a feed target","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetKind","targetExternalId","bodyMarkdown"],"properties":{"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"minLength":16,"maxLength":24,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":4000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["targetKind","targetExternalId","bodyMarkdown"],"properties":{"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"minLength":16,"maxLength":24,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":4000,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["targetKind","targetExternalId","bodyMarkdown"],"properties":{"targetKind":{"anyOf":[{"const":"post","type":"string"},{"const":"activity","type":"string"},{"const":"issue","type":"string"},{"const":"newsroom","type":"string"}]},"targetExternalId":{"minLength":16,"maxLength":24,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":4000,"type":"string"}}}}}}}},"/bff/feed/comment-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}}}}},"operationId":"postBffFeedComment-delete","tags":["Feed"],"summary":"Soft-delete a comment (author only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/feed/comment-edit":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]}},"required":["state"]}}}}},"operationId":"postBffFeedComment-edit","tags":["Feed"],"summary":"Edit a comment body (author only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId","bodyMarkdown"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":4000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId","bodyMarkdown"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":4000,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId","bodyMarkdown"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"bodyMarkdown":{"minLength":1,"maxLength":4000,"type":"string"}}}}}}}},"/bff/feed/post-pin":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}}}}},"operationId":"postBffFeedPost-pin","tags":["Feed"],"summary":"Pin a wall post to the top (root only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/feed/post-unpin":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}}}}},"operationId":"postBffFeedPost-unpin","tags":["Feed"],"summary":"Unpin a wall post (root only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/feed/post-ack":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"not-in-audience","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"not-in-audience","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"anyOf":[{"const":"ok","type":"string"},{"const":"not-found","type":"string"},{"const":"not-in-audience","type":"string"},{"const":"forbidden","type":"string"}]},"item":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}},{"type":"null"}]}},"required":["state","item"]}}}}},"operationId":"postBffFeedPost-ack","tags":["Feed"],"summary":"Confirm reading an announcement","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/feed/post-ack-list":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"query","name":"externalId","required":true}],"responses":{"200":{"anyOf":[{"type":"object","required":["state","items"],"properties":{"state":{"const":"ok","type":"string"},"items":{"type":"array","items":{"type":"object","required":["memberId","fullName","ackedDate"],"properties":{"memberId":{"type":"string"},"fullName":{"type":"string"},"ackedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["state","items"],"properties":{"state":{"const":"ok","type":"string"},"items":{"type":"array","items":{"type":"object","required":["memberId","fullName","ackedDate"],"properties":{"memberId":{"type":"string"},"fullName":{"type":"string"},"ackedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["state","items"],"properties":{"state":{"const":"ok","type":"string"},"items":{"type":"array","items":{"type":"object","required":["memberId","fullName","ackedDate"],"properties":{"memberId":{"type":"string"},"fullName":{"type":"string"},"ackedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["state","items"],"properties":{"state":{"const":"ok","type":"string"},"items":{"type":"array","items":{"type":"object","required":["memberId","fullName","ackedDate"],"properties":{"memberId":{"type":"string"},"fullName":{"type":"string"},"ackedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}}}}},{"type":"object","required":["state"],"properties":{"state":{"const":"not-found","type":"string"}}},{"type":"object","required":["state"],"properties":{"state":{"const":"forbidden","type":"string"}}}]}}}}},"operationId":"getBffFeedPost-ack-list","tags":["Feed"],"summary":"Who confirmed an announcement (author / module-members)"}},"/bff/feed/pending-acks":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}},"canAnnounce":{"type":"boolean"}},"required":["items","canAnnounce"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}},"canAnnounce":{"type":"boolean"}},"required":["items","canAnnounce"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorMemberLabel","systemAuthorLabel","authorAvatarInfo","bodyMarkdown","meta","insertedDate","updatedDate","lastActivityAt","pinnedAt","reactors","commentCount","attachments","canManage","canPin","latestComment","announcement"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorMemberLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"systemAuthorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"meta":{"nullable":true,"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"lastActivityAt":{"type":"string"},"pinnedAt":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactors":{"type":"object","patternProperties":{"^(.*)$":{"type":"array","items":{"type":"object","required":["memberId","label","contactExternalId","reactedDate","avatarInfo"],"properties":{"memberId":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"label":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"contactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"reactedDate":{"type":"string"},"avatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}}}}}}},"commentCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"attachments":{"type":"array","items":{"type":"object","required":["blobToken","filename","contentType","size"],"properties":{"blobToken":{"minLength":32,"maxLength":32,"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"size":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]}}}},"canManage":{"type":"boolean"},"canPin":{"type":"boolean"},"latestComment":{"nullable":true,"anyOf":[{"type":"object","required":["externalId","authorKind","authorMemberId","authorContactExternalId","authorLabel","authorAvatarInfo","bodyMarkdown","insertedDate","updatedDate"],"properties":{"externalId":{"minLength":16,"maxLength":16,"type":"string"},"authorKind":{"anyOf":[{"const":"member","type":"string"},{"const":"system","type":"string"},{"const":"bot","type":"string"},{"const":"agent","type":"string"}]},"authorMemberId":{"nullable":true,"anyOf":[{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},{"type":"null"}]},"authorContactExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorLabel":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"authorAvatarInfo":{"type":"object","properties":{"fullName":{"type":"string"},"avatarUrl":{"type":"string"},"activityInfo":{"type":"object","properties":{"status":{"type":"string"},"inActiveMinutes":{"type":"number"},"lastActivity":{"anyOf":[{"type":"string"},{"anyOf":[{"type":"Date"},{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"number"}]}]},"lastLocation":{"type":"object","properties":{"city":{"type":"string"},"countryCode":{"type":"string"},"asnName":{"type":"string"},"isMobile":{"type":"boolean"},"isProxy":{"type":"boolean"},"isTor":{"type":"boolean"}}}}}}},"bodyMarkdown":{"type":"string"},"insertedDate":{"type":"string"},"updatedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"announcement":{"nullable":true,"anyOf":[{"type":"object","required":["audienceDepartment","ackCount","audienceCount","ackedByMe","inAudience"],"properties":{"audienceDepartment":{"nullable":true,"anyOf":[{"description":"Audience department; null = everyone.","type":"string"},{"type":"null"}]},"ackCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"audienceCount":{"anyOf":[{"format":"integer","default":0,"type":"string"},{"type":"integer"}]},"ackedByMe":{"type":"boolean"},"inAudience":{"description":"The caller is asked to confirm reading.","type":"boolean"}}},{"type":"null"}]}}}},"canAnnounce":{"type":"boolean"}},"required":["items","canAnnounce"]}}}}},"operationId":"getBffFeedPending-acks","tags":["Feed"],"summary":"Announcements waiting for my read confirmation (90 days)"}},"/bff/impersonate/status":{"get":{"responses":{"200":{"anyOf":[{"type":"object","required":["isImpersonating","canImpersonate","selfContactExternalId"],"properties":{"isImpersonating":{"const":false,"type":"boolean"},"canImpersonate":{"description":"True when the caller effectively holds `root` or `admin-impersonate`.","type":"boolean"},"selfContactExternalId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["isImpersonating","canImpersonate","selfContactExternalId","effective","real","startedAt","expiresAt"],"properties":{"isImpersonating":{"const":true,"type":"boolean"},"canImpersonate":{"const":true,"type":"boolean"},"selfContactExternalId":{"type":"string"},"effective":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"real":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"startedAt":{"type":"string"},"expiresAt":{"type":"string"}}}],"content":{"application/json":{"schema":{"anyOf":[{"type":"object","required":["isImpersonating","canImpersonate","selfContactExternalId"],"properties":{"isImpersonating":{"const":false,"type":"boolean"},"canImpersonate":{"description":"True when the caller effectively holds `root` or `admin-impersonate`.","type":"boolean"},"selfContactExternalId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["isImpersonating","canImpersonate","selfContactExternalId","effective","real","startedAt","expiresAt"],"properties":{"isImpersonating":{"const":true,"type":"boolean"},"canImpersonate":{"const":true,"type":"boolean"},"selfContactExternalId":{"type":"string"},"effective":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"real":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"startedAt":{"type":"string"},"expiresAt":{"type":"string"}}}]}},"multipart/form-data":{"schema":{"anyOf":[{"type":"object","required":["isImpersonating","canImpersonate","selfContactExternalId"],"properties":{"isImpersonating":{"const":false,"type":"boolean"},"canImpersonate":{"description":"True when the caller effectively holds `root` or `admin-impersonate`.","type":"boolean"},"selfContactExternalId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["isImpersonating","canImpersonate","selfContactExternalId","effective","real","startedAt","expiresAt"],"properties":{"isImpersonating":{"const":true,"type":"boolean"},"canImpersonate":{"const":true,"type":"boolean"},"selfContactExternalId":{"type":"string"},"effective":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"real":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"startedAt":{"type":"string"},"expiresAt":{"type":"string"}}}]}},"text/plain":{"schema":{"anyOf":[{"type":"object","required":["isImpersonating","canImpersonate","selfContactExternalId"],"properties":{"isImpersonating":{"const":false,"type":"boolean"},"canImpersonate":{"description":"True when the caller effectively holds `root` or `admin-impersonate`.","type":"boolean"},"selfContactExternalId":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"object","required":["isImpersonating","canImpersonate","selfContactExternalId","effective","real","startedAt","expiresAt"],"properties":{"isImpersonating":{"const":true,"type":"boolean"},"canImpersonate":{"const":true,"type":"boolean"},"selfContactExternalId":{"type":"string"},"effective":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"real":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"startedAt":{"type":"string"},"expiresAt":{"type":"string"}}}]}}}}},"operationId":"getBffImpersonateStatus","tags":["Impersonate"],"summary":"Current impersonation state for the calling session","description":"Cheap identity-derived check used by the admin header to decide whether to show the impersonate button (via `canImpersonate`) and whether to render the \"viewing as X\" banner (via `isImpersonating`)."}},"/bff/impersonate/start":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"target":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"expiresAt":{"description":"ISO timestamp when the impersonation session expires (4 hours from now).","type":"string"}},"required":["state","target","expiresAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"target":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"expiresAt":{"description":"ISO timestamp when the impersonation session expires (4 hours from now).","type":"string"}},"required":["state","target","expiresAt"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"},"target":{"type":"object","required":["contactExternalId","fullName","email"],"properties":{"contactExternalId":{"type":"string"},"fullName":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"expiresAt":{"description":"ISO timestamp when the impersonation session expires (4 hours from now).","type":"string"}},"required":["state","target","expiresAt"]}}}}},"operationId":"postBffImpersonateStart","tags":["Impersonate"],"summary":"Begin impersonating another organisation member","description":"Mints a short-lived session bound to the member behind `targetContactExternalId`, rotates the AUTH cookie to it, and records the start event in `core__activity`. Rejects (403 / 400 depending on cause) when any safety invariant fails — see `features/impersonate/startImpersonation.ts` for the enforced list.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["targetContactExternalId"],"properties":{"targetContactExternalId":{"description":"shop__contact.external_id of the member to impersonate — same handle used in admin URLs.","minLength":8,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["targetContactExternalId"],"properties":{"targetContactExternalId":{"description":"shop__contact.external_id of the member to impersonate — same handle used in admin URLs.","minLength":8,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["targetContactExternalId"],"properties":{"targetContactExternalId":{"description":"shop__contact.external_id of the member to impersonate — same handle used in admin URLs.","minLength":8,"maxLength":24,"type":"string"}}}}}}}},"/bff/impersonate/stop":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}}}}},"operationId":"postBffImpersonateStop","tags":["Impersonate"],"summary":"End the current impersonation session and restore the caller identity","description":"Revokes the impersonation session row, restores the AUTH cookie to the original session, and writes `impersonate.stop` to `core__activity`. 400 when the current session is not an impersonation."}},"/bff/csrf/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"description":"16-character one-shot token.","examples":["ab3c9de1f2h4j5k6"],"type":"string"},"expiresAt":{"description":"ISO-8601 timestamp at which the token stops being accepted.","examples":["2026-09-01T12:30:00.000Z"],"type":"string"}},"required":["token","expiresAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"token":{"description":"16-character one-shot token.","examples":["ab3c9de1f2h4j5k6"],"type":"string"},"expiresAt":{"description":"ISO-8601 timestamp at which the token stops being accepted.","examples":["2026-09-01T12:30:00.000Z"],"type":"string"}},"required":["token","expiresAt"]}},"text/plain":{"schema":{"type":"object","properties":{"token":{"description":"16-character one-shot token.","examples":["ab3c9de1f2h4j5k6"],"type":"string"},"expiresAt":{"description":"ISO-8601 timestamp at which the token stops being accepted.","examples":["2026-09-01T12:30:00.000Z"],"type":"string"}},"required":["token","expiresAt"]}}}}},"operationId":"postBffCsrfCreate","tags":["Csrf"],"summary":"Mint one-shot CSRF token","description":"Returns a 16-character CSRF token that must be included in the body of subsequent unauthenticated form submissions (login, signup, recovery). Tokens expire after 30 minutes and are consumed on first successful verify.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false}},"multipart/form-data":{"schema":{"type":"object","properties":{},"additionalProperties":false}},"text/plain":{"schema":{"type":"object","properties":{},"additionalProperties":false}}}}}},"/bff/purchase-document/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffPurchase-documentList","tags":["PurchaseInvoice"],"summary":"List purchase (received) invoices","responses":{"200":{}}}},"/bff/purchase-document/detail":{"get":{"parameters":[{"description":"Numeric purchase-invoice id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffPurchase-documentDetail","tags":["PurchaseInvoice"],"summary":"Purchase invoice detail (header + items + log)","responses":{"200":{}}}},"/bff/purchase-document/stats":{"get":{"operationId":"getBffPurchase-documentStats","tags":["PurchaseInvoice"],"summary":"KPI breakdown — counts/sums per status + overdue + YTD.","responses":{"200":{}}}},"/bff/purchase-document/create":{"post":{"parameters":[],"operationId":"postBffPurchase-documentCreate","tags":["PurchaseInvoice"],"summary":"Create a new purchase invoice (draft) with items","description":"Header + items are persisted in one transaction. Items without an explicit `vatClassificationId` are auto-classified server-side (country-aware + rate-based). CNB exchange rate to CZK is resolved against `taxDate` (or `issueDate` as fallback) and snapshotted on the row, so EPO reports always use the original posting rate.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["currencyCode","issueDate","items"],"properties":{"vendorExternalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"recipientId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO-4217 currency code (e.g. CZK, EUR).","type":"string"},"issueDate":{"description":"Issue date (YYYY-MM-DD).","type":"string"},"dueDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"taxDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"constantSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"specificSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorIban":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorSwift":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"rounding":{"default":0,"type":"number"},"isReverseCharge":{"default":false,"type":"boolean"},"isCreditNote":{"default":false,"type":"boolean"},"parentId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"items":{"minItems":1,"description":"At least one line is required.","type":"array","items":{"type":"object","required":["description","quantity","unitPrice","vatRate"],"properties":{"description":{"description":"Item description (free text).","type":"string"},"quantity":{"description":"Quantity, ≥ 0.","type":"number"},"unitPrice":{"description":"Unit price (without VAT) in invoice currency.","type":"number"},"vatRate":{"description":"VAT rate in percent (e.g. 21, 12, 0).","type":"number"},"vatClassificationId":{"nullable":true,"anyOf":[{"description":"Explicit classification id (auto-classify if null).","type":"number"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["currencyCode","issueDate","items"],"properties":{"vendorExternalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"recipientId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO-4217 currency code (e.g. CZK, EUR).","type":"string"},"issueDate":{"description":"Issue date (YYYY-MM-DD).","type":"string"},"dueDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"taxDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"constantSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"specificSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorIban":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorSwift":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"rounding":{"default":0,"type":"number"},"isReverseCharge":{"default":false,"type":"boolean"},"isCreditNote":{"default":false,"type":"boolean"},"parentId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"items":{"minItems":1,"description":"At least one line is required.","type":"array","items":{"type":"object","required":["description","quantity","unitPrice","vatRate"],"properties":{"description":{"description":"Item description (free text).","type":"string"},"quantity":{"description":"Quantity, ≥ 0.","type":"number"},"unitPrice":{"description":"Unit price (without VAT) in invoice currency.","type":"number"},"vatRate":{"description":"VAT rate in percent (e.g. 21, 12, 0).","type":"number"},"vatClassificationId":{"nullable":true,"anyOf":[{"description":"Explicit classification id (auto-classify if null).","type":"number"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["currencyCode","issueDate","items"],"properties":{"vendorExternalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"recipientId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO-4217 currency code (e.g. CZK, EUR).","type":"string"},"issueDate":{"description":"Issue date (YYYY-MM-DD).","type":"string"},"dueDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"taxDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"constantSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"specificSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorIban":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorSwift":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"rounding":{"default":0,"type":"number"},"isReverseCharge":{"default":false,"type":"boolean"},"isCreditNote":{"default":false,"type":"boolean"},"parentId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"items":{"minItems":1,"description":"At least one line is required.","type":"array","items":{"type":"object","required":["description","quantity","unitPrice","vatRate"],"properties":{"description":{"description":"Item description (free text).","type":"string"},"quantity":{"description":"Quantity, ≥ 0.","type":"number"},"unitPrice":{"description":"Unit price (without VAT) in invoice currency.","type":"number"},"vatRate":{"description":"VAT rate in percent (e.g. 21, 12, 0).","type":"number"},"vatClassificationId":{"nullable":true,"anyOf":[{"description":"Explicit classification id (auto-classify if null).","type":"number"},{"type":"null"}]}}}}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/status":{"post":{"parameters":[],"operationId":"postBffPurchase-documentStatus","tags":["PurchaseInvoice"],"summary":"Transition status (draft → received → booked → paid)","description":"Standard transitions follow the lifecycle. Backwards moves (e.g. paid → booked) require `force: true` and are recorded in coreAuditLog as `force_edit`. The shop__purchase_invoice_log timeline also captures every change for the per-invoice detail page.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","nextStatus"],"properties":{"id":{"type":"number"},"nextStatus":{"description":"Lifecycle status of a purchase invoice.","anyOf":[{"const":"draft","type":"string"},{"const":"received","type":"string"},{"const":"booked","type":"string"},{"const":"paid","type":"string"},{"const":"cancelled","type":"string"}]},"paidDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"force":{"default":false,"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","nextStatus"],"properties":{"id":{"type":"number"},"nextStatus":{"description":"Lifecycle status of a purchase invoice.","anyOf":[{"const":"draft","type":"string"},{"const":"received","type":"string"},{"const":"booked","type":"string"},{"const":"paid","type":"string"},{"const":"cancelled","type":"string"}]},"paidDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"force":{"default":false,"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id","nextStatus"],"properties":{"id":{"type":"number"},"nextStatus":{"description":"Lifecycle status of a purchase invoice.","anyOf":[{"const":"draft","type":"string"},{"const":"received","type":"string"},{"const":"booked","type":"string"},{"const":"paid","type":"string"},{"const":"cancelled","type":"string"}]},"paidDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"force":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/inbox/link":{"post":{"parameters":[],"operationId":"postBffPurchase-documentInboxLink","tags":["PurchaseInvoice"],"summary":"Link an uploaded blob into the purchase-document inbox","description":"The file must already have been uploaded via POST /bff/blob/upload (which returned the token). This endpoint fetches the blob, computes its SHA-256, and inserts a row into shop__purchase_document_inbox with status=pending. Content-level dedup per organisation: uploading the same bytes twice returns the existing row (dedup=true) and the fresh blob becomes an orphan for the periodic sweep.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token from a prior POST /bff/blob/upload.","examples":["blb_abc123xyz"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token from a prior POST /bff/blob/upload.","examples":["blb_abc123xyz"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["blobToken"],"properties":{"blobToken":{"description":"Blob token from a prior POST /bff/blob/upload.","examples":["blb_abc123xyz"],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/inbox/detail":{"get":{"parameters":[{"description":"Numeric inbox row id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"operationId":"getBffPurchase-documentInboxDetail","tags":["PurchaseInvoice"],"summary":"Full detail of an inbox row (blob + classification + extraction data)","responses":{"200":{}}}},"/bff/purchase-document/inbox/retry-classification":{"post":{"parameters":[],"operationId":"postBffPurchase-documentInboxRetry-classification","tags":["PurchaseInvoice"],"summary":"Re-queue an inbox row for classification (typically after an error)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/inbox/dismiss":{"post":{"parameters":[],"operationId":"postBffPurchase-documentInboxDismiss","tags":["PurchaseInvoice"],"summary":"Mark an inbox row as dismissed — hide it from the grid without deleting the blob","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/inbox/materialize":{"post":{"parameters":[],"operationId":"postBffPurchase-documentInboxMaterialize","tags":["PurchaseInvoice"],"summary":"Turn a classified inbox row into a real purchase invoice","description":"Takes the reviewed / edited invoice payload (typically the extracted JSON after the operator has approved it), creates the shop__purchase_invoice row, attaches the source blob as `pdf_primary`, and flips the inbox row's resulting_invoice_id — so the row disappears from the received-documents grid.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["inboxId","invoice"],"properties":{"inboxId":{"description":"Inbox row to materialise. Must be classified and not yet materialised.","type":"number"},"invoice":{"type":"object","required":["currencyCode","issueDate","items"],"properties":{"vendorExternalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"recipientId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO-4217 currency code (e.g. CZK, EUR).","type":"string"},"issueDate":{"description":"Issue date (YYYY-MM-DD).","type":"string"},"dueDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"taxDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"constantSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"specificSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorIban":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorSwift":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"rounding":{"default":0,"type":"number"},"isReverseCharge":{"default":false,"type":"boolean"},"isCreditNote":{"default":false,"type":"boolean"},"parentId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"items":{"minItems":1,"description":"At least one line is required.","type":"array","items":{"type":"object","required":["description","quantity","unitPrice","vatRate"],"properties":{"description":{"description":"Item description (free text).","type":"string"},"quantity":{"description":"Quantity, ≥ 0.","type":"number"},"unitPrice":{"description":"Unit price (without VAT) in invoice currency.","type":"number"},"vatRate":{"description":"VAT rate in percent (e.g. 21, 12, 0).","type":"number"},"vatClassificationId":{"nullable":true,"anyOf":[{"description":"Explicit classification id (auto-classify if null).","type":"number"},{"type":"null"}]}}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["inboxId","invoice"],"properties":{"inboxId":{"description":"Inbox row to materialise. Must be classified and not yet materialised.","type":"number"},"invoice":{"type":"object","required":["currencyCode","issueDate","items"],"properties":{"vendorExternalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"recipientId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO-4217 currency code (e.g. CZK, EUR).","type":"string"},"issueDate":{"description":"Issue date (YYYY-MM-DD).","type":"string"},"dueDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"taxDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"constantSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"specificSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorIban":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorSwift":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"rounding":{"default":0,"type":"number"},"isReverseCharge":{"default":false,"type":"boolean"},"isCreditNote":{"default":false,"type":"boolean"},"parentId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"items":{"minItems":1,"description":"At least one line is required.","type":"array","items":{"type":"object","required":["description","quantity","unitPrice","vatRate"],"properties":{"description":{"description":"Item description (free text).","type":"string"},"quantity":{"description":"Quantity, ≥ 0.","type":"number"},"unitPrice":{"description":"Unit price (without VAT) in invoice currency.","type":"number"},"vatRate":{"description":"VAT rate in percent (e.g. 21, 12, 0).","type":"number"},"vatClassificationId":{"nullable":true,"anyOf":[{"description":"Explicit classification id (auto-classify if null).","type":"number"},{"type":"null"}]}}}}}}}}},"text/plain":{"schema":{"type":"object","required":["inboxId","invoice"],"properties":{"inboxId":{"description":"Inbox row to materialise. Must be classified and not yet materialised.","type":"number"},"invoice":{"type":"object","required":["currencyCode","issueDate","items"],"properties":{"vendorExternalNumber":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"recipientId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO-4217 currency code (e.g. CZK, EUR).","type":"string"},"issueDate":{"description":"Issue date (YYYY-MM-DD).","type":"string"},"dueDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"taxDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"paymentMethod":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"variableSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"constantSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"specificSymbol":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorIban":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"vendorSwift":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"internalNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"publicNotice":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"rounding":{"default":0,"type":"number"},"isReverseCharge":{"default":false,"type":"boolean"},"isCreditNote":{"default":false,"type":"boolean"},"parentId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"items":{"minItems":1,"description":"At least one line is required.","type":"array","items":{"type":"object","required":["description","quantity","unitPrice","vatRate"],"properties":{"description":{"description":"Item description (free text).","type":"string"},"quantity":{"description":"Quantity, ≥ 0.","type":"number"},"unitPrice":{"description":"Unit price (without VAT) in invoice currency.","type":"number"},"vatRate":{"description":"VAT rate in percent (e.g. 21, 12, 0).","type":"number"},"vatClassificationId":{"nullable":true,"anyOf":[{"description":"Explicit classification id (auto-classify if null).","type":"number"},{"type":"null"}]}}}}}}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/delete":{"post":{"parameters":[],"operationId":"postBffPurchase-documentDelete","tags":["PurchaseInvoice"],"summary":"Force-delete a purchase invoice (irreversible)","description":"Hard delete + audit log. Attachments are NOT cascaded; they become orphans in core__blob and are cleaned up by the periodic orphan-blob sweep. Prefer status=\"cancelled\" instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/sources/list":{"get":{"operationId":"getBffPurchase-documentSourcesList","tags":["PurchaseDocumentSource"],"summary":"List configured ingestion sources.","responses":{"200":{}}}},"/bff/purchase-document/sources/upsert":{"post":{"parameters":[],"operationId":"postBffPurchase-documentSourcesUpsert","tags":["PurchaseDocumentSource"],"summary":"Create or update an ingestion source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","name"],"properties":{"id":{"nullable":true,"anyOf":[{"minLength":16,"maxLength":16,"type":"string"},{"type":"null"}]},"kind":{"description":"Ingestion channel for received documents.","anyOf":[{"const":"email-forwarding","type":"string"},{"const":"imap","type":"string"},{"const":"api-push","type":"string"},{"const":"fio-attachment","type":"string"}]},"name":{"minLength":1,"maxLength":96,"type":"string"},"config":{"description":"Per-kind config payload (shape depends on `kind`).","type":"object","patternProperties":{"^(.*)$":{}}},"isEnabled":{"default":true,"type":"boolean"},"imapPasswordPlain":{"nullable":true,"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["kind","name"],"properties":{"id":{"nullable":true,"anyOf":[{"minLength":16,"maxLength":16,"type":"string"},{"type":"null"}]},"kind":{"description":"Ingestion channel for received documents.","anyOf":[{"const":"email-forwarding","type":"string"},{"const":"imap","type":"string"},{"const":"api-push","type":"string"},{"const":"fio-attachment","type":"string"}]},"name":{"minLength":1,"maxLength":96,"type":"string"},"config":{"description":"Per-kind config payload (shape depends on `kind`).","type":"object","patternProperties":{"^(.*)$":{}}},"isEnabled":{"default":true,"type":"boolean"},"imapPasswordPlain":{"nullable":true,"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["kind","name"],"properties":{"id":{"nullable":true,"anyOf":[{"minLength":16,"maxLength":16,"type":"string"},{"type":"null"}]},"kind":{"description":"Ingestion channel for received documents.","anyOf":[{"const":"email-forwarding","type":"string"},{"const":"imap","type":"string"},{"const":"api-push","type":"string"},{"const":"fio-attachment","type":"string"}]},"name":{"minLength":1,"maxLength":96,"type":"string"},"config":{"description":"Per-kind config payload (shape depends on `kind`).","type":"object","patternProperties":{"^(.*)$":{}}},"isEnabled":{"default":true,"type":"boolean"},"imapPasswordPlain":{"nullable":true,"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/sources/delete":{"post":{"parameters":[],"operationId":"postBffPurchase-documentSourcesDelete","tags":["PurchaseDocumentSource"],"summary":"Soft-delete an ingestion source.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/purchase-document/sources/rotate-token":{"post":{"parameters":[],"operationId":"postBffPurchase-documentSourcesRotate-token","tags":["PurchaseDocumentSource"],"summary":"Rotate the shared secret (api-push / email-forwarding only).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/document/overview":{"get":{"operationId":"getBffDocumentOverview","tags":["DocumentOverview"],"summary":"Aggregated Přehled data for the /document hub (issued + received in one payload).","responses":{"200":{}}}},"/bff/accounting-document-inbox/list":{"get":{"parameters":[{"description":"Comma-separated list of lifecycle states to include.","schema":{"type":"string"},"in":"query","name":"statuses","required":false},{"description":"Comma-separated list of classifier kinds to include.","schema":{"type":"string"},"in":"query","name":"kinds","required":false},{"description":"Substring match on subject / from / filename.","schema":{"type":"string"},"in":"query","name":"search","required":false},{"description":"DataGrid fulltext (same as `search`).","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","externalId","status","kind","classificationConfidence","classificationReason","sourceSubject","sourceFrom","sourceFilename","sourceContentType","sourceSize","insertedDate","processedDate","classifierRunExternalId","receivedEmailId"],"properties":{"id":{"type":"string"},"externalId":{"type":"string"},"status":{"type":"string"},"kind":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"classificationConfidence":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"classificationReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceSubject":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceFrom":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceFilename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceContentType":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceSize":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"processedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"classifierRunExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedEmailId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","externalId","status","kind","classificationConfidence","classificationReason","sourceSubject","sourceFrom","sourceFilename","sourceContentType","sourceSize","insertedDate","processedDate","classifierRunExternalId","receivedEmailId"],"properties":{"id":{"type":"string"},"externalId":{"type":"string"},"status":{"type":"string"},"kind":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"classificationConfidence":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"classificationReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceSubject":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceFrom":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceFilename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceContentType":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceSize":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"processedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"classifierRunExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedEmailId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","externalId","status","kind","classificationConfidence","classificationReason","sourceSubject","sourceFrom","sourceFilename","sourceContentType","sourceSize","insertedDate","processedDate","classifierRunExternalId","receivedEmailId"],"properties":{"id":{"type":"string"},"externalId":{"type":"string"},"status":{"type":"string"},"kind":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"classificationConfidence":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"classificationReason":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceSubject":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceFrom":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceFilename":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceContentType":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"sourceSize":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"processedDate":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"classifierRunExternalId":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"receivedEmailId":{"nullable":true,"anyOf":[{"type":"number"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffAccounting-document-inboxList","tags":["AccountingDocumentInbox"],"summary":"Paginated list of fin__document_inbox rows."}},"/bff/accounting-document-inbox/detail/{externalId}":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true}],"operationId":"getBffAccounting-document-inboxDetailByExternalId","tags":["AccountingDocumentInbox"],"summary":"Fetch one inbox row with blob preview URL + linked runs.","responses":{"200":{}}}},"/bff/accounting-document-inbox/import/{externalId}":{"post":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true}],"operationId":"postBffAccounting-document-inboxImportByExternalId","tags":["AccountingDocumentInbox"],"summary":"Promote a classified `invoice` row into shop__purchase_document_inbox so the regular purchase-invoice extractor + review flow takes over. Bank statements / receipts / payout reports are not yet promotable; returns 400 for other kinds. Idempotent — re-running on an already-imported row returns dedup=true.","responses":{"200":{}}}},"/bff/accounting-document-inbox/rearm/{externalId}":{"post":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true}],"operationId":"postBffAccounting-document-inboxRearmByExternalId","tags":["AccountingDocumentInbox"],"summary":"Reset a failed / ignored / classified inbox row back to status=new so the medium-priority cron picks it up again. Rejects already-imported rows (would orphan the downstream purchase inbox).","responses":{"200":{}}}},"/bff/ai-agent-run/list":{"get":{"parameters":[{"description":"Comma-separated list of lifecycle states.","schema":{"type":"string"},"in":"query","name":"statuses","required":false},{"description":"Comma-separated list of agent slugs to include.","schema":{"type":"string"},"in":"query","name":"agentNames","required":false},{"description":"Scope to runs with this subject kind (e.g. `pm__issue`).","schema":{"type":"string"},"in":"query","name":"subjectKind","required":false},{"description":"Scope to a single subject id (decimal integer).","schema":{"type":"string"},"in":"query","name":"subjectId","required":false},{"description":"\"true\" → only runs without a parent dispatch; \"false\" → only child dispatches.","schema":{"type":"string"},"in":"query","name":"topLevelOnly","required":false},{"description":"DataGrid fulltext over agent name, run id, subject kind and subject id.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffAi-agent-runList","tags":["AiAgentRun"],"summary":"Paginated list of ai__agent_run rows for the current organisation.","responses":{"200":{}}}},"/bff/ai-agent-run/detail/{externalId}":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true}],"operationId":"getBffAi-agent-runDetailByExternalId","tags":["AiAgentRun"],"summary":"Fetch one agent run with its tool-call trace + child dispatches.","responses":{"200":{}}}},"/bff/ai-agent-run/rerun/{externalId}":{"post":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"externalId","required":true}],"operationId":"postBffAi-agent-runRerunByExternalId","tags":["AiAgentRun"],"summary":"Re-run the agent on the same subject (not the same row — ai__agent_run is append-only). Dispatcher keyed on agent_name + subject_kind. Only `issue-orchestrator` on pm__issue and `accounting-document-classifier` on fin_document_inbox are supported; KB specialist runs are children of an orchestrator dispatch and cannot be re-run standalone.","responses":{"200":{}}}},"/bff/ai-agent-action/detail":{"get":{"parameters":[{"description":"Agent action external id (24 chars).","schema":{"type":"string","minLength":24,"maxLength":24,"pattern":"^[A-Za-z0-9]+$"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}},"required":["id","kind","status","preview","payloadHash","expiresAt"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}},"required":["id","kind","status","preview","payloadHash","expiresAt"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}},"required":["id","kind","status","preview","payloadHash","expiresAt"]}}}}},"operationId":"getBffAi-agent-actionDetail","tags":["bff"],"summary":"Assistant action proposal for the confirmation card"}},"/bff/ai-agent-action/confirm":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean"},"action":{"type":"object","required":["id","kind","status","preview","payloadHash","expiresAt"],"properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}}}},"required":["accepted","action"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean"},"action":{"type":"object","required":["id","kind","status","preview","payloadHash","expiresAt"],"properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}}}},"required":["accepted","action"]}},"text/plain":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean"},"action":{"type":"object","required":["id","kind","status","preview","payloadHash","expiresAt"],"properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}}}},"required":["accepted","action"]}}}}},"operationId":"postBffAi-agent-actionConfirm","tags":["bff"],"summary":"Confirm and execute an Assistant action (single use, human session only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","payloadHash"],"properties":{"id":{"minLength":24,"maxLength":24,"pattern":"^[A-Za-z0-9]+$","description":"Agent action external id (24 chars).","type":"string"},"payloadHash":{"minLength":64,"maxLength":64,"pattern":"^[0-9a-f]+$","description":"Hash shown on the card; must match the stored action.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","payloadHash"],"properties":{"id":{"minLength":24,"maxLength":24,"pattern":"^[A-Za-z0-9]+$","description":"Agent action external id (24 chars).","type":"string"},"payloadHash":{"minLength":64,"maxLength":64,"pattern":"^[0-9a-f]+$","description":"Hash shown on the card; must match the stored action.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id","payloadHash"],"properties":{"id":{"minLength":24,"maxLength":24,"pattern":"^[A-Za-z0-9]+$","description":"Agent action external id (24 chars).","type":"string"},"payloadHash":{"minLength":64,"maxLength":64,"pattern":"^[0-9a-f]+$","description":"Hash shown on the card; must match the stored action.","type":"string"}}}}}}}},"/bff/ai-agent-action/cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean"},"action":{"type":"object","required":["id","kind","status","preview","payloadHash","expiresAt"],"properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}}}},"required":["accepted","action"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean"},"action":{"type":"object","required":["id","kind","status","preview","payloadHash","expiresAt"],"properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}}}},"required":["accepted","action"]}},"text/plain":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean"},"action":{"type":"object","required":["id","kind","status","preview","payloadHash","expiresAt"],"properties":{"id":{"type":"string"},"kind":{"type":"string"},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"executing","type":"string"},{"const":"executed","type":"string"},{"const":"failed","type":"string"},{"const":"cancelled","type":"string"},{"const":"expired","type":"string"}]},"preview":{"type":"object","required":["fields"],"properties":{"fields":{"type":"array","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string"},"value":{"type":"string"}}}},"body":{"type":"string"},"attachments":{"type":"array","items":{"type":"object","required":["name","size"],"properties":{"name":{"type":"string"},"size":{"type":"number"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},"payloadHash":{"type":"string"},"expiresAt":{"type":"string"},"decidedAt":{"type":"string"},"executedAt":{"type":"string"},"result":{"type":"object","patternProperties":{"^(.*)$":{}}},"error":{"type":"string"}}}},"required":["accepted","action"]}}}}},"operationId":"postBffAi-agent-actionCancel","tags":["bff"],"summary":"Decline an Assistant action","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"pattern":"^[A-Za-z0-9]+$","description":"Agent action external id (24 chars).","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"pattern":"^[A-Za-z0-9]+$","description":"Agent action external id (24 chars).","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"pattern":"^[A-Za-z0-9]+$","description":"Agent action external id (24 chars).","type":"string"}}}}}}}},"/bff/vat-classification/list":{"get":{"operationId":"getBffVat-classificationList","tags":["VatClassification"],"summary":"List VAT classification codes (seeded on first use).","responses":{"200":{}}}},"/bff/vat-classification/seed":{"post":{"operationId":"postBffVat-classificationSeed","tags":["VatClassification"],"summary":"Force-seed the canonical Czech classification catalog (idempotent).","responses":{"200":{}}}},"/bff/vat-classification/upsert":{"post":{"parameters":[],"operationId":"postBffVat-classificationUpsert","tags":["VatClassification"],"summary":"Create or update a VAT classification code.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","category"],"properties":{"id":{"type":"number"},"code":{"minLength":1,"maxLength":32,"type":"string"},"labelCs":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"const":"domestic","type":"string"},{"const":"eu_supply","type":"string"},{"const":"eu_acquisition","type":"string"},{"const":"third_country","type":"string"},{"const":"reverse_charge","type":"string"},{"const":"exempt","type":"string"},{"const":"not_subject","type":"string"}]},"dphFormRow":{"nullable":true,"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"khSection":{"nullable":true,"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"isReverseCharge":{"default":false,"type":"boolean"},"rateCode":{"nullable":true,"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"isDefault":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"},"displayOrder":{"default":0,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","category"],"properties":{"id":{"type":"number"},"code":{"minLength":1,"maxLength":32,"type":"string"},"labelCs":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"const":"domestic","type":"string"},{"const":"eu_supply","type":"string"},{"const":"eu_acquisition","type":"string"},{"const":"third_country","type":"string"},{"const":"reverse_charge","type":"string"},{"const":"exempt","type":"string"},{"const":"not_subject","type":"string"}]},"dphFormRow":{"nullable":true,"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"khSection":{"nullable":true,"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"isReverseCharge":{"default":false,"type":"boolean"},"rateCode":{"nullable":true,"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"isDefault":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"},"displayOrder":{"default":0,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["code","category"],"properties":{"id":{"type":"number"},"code":{"minLength":1,"maxLength":32,"type":"string"},"labelCs":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"labelEn":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"category":{"anyOf":[{"const":"domestic","type":"string"},{"const":"eu_supply","type":"string"},{"const":"eu_acquisition","type":"string"},{"const":"third_country","type":"string"},{"const":"reverse_charge","type":"string"},{"const":"exempt","type":"string"},{"const":"not_subject","type":"string"}]},"dphFormRow":{"nullable":true,"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"khSection":{"nullable":true,"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"isReverseCharge":{"default":false,"type":"boolean"},"rateCode":{"nullable":true,"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"isDefault":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"},"displayOrder":{"default":0,"type":"number"}}}}}},"responses":{"200":{}}}},"/bff/tax/epo/preview":{"post":{"parameters":[],"operationId":"postBffTaxEpoPreview","tags":["Tax"],"summary":"Build an EPO XML preview without archiving (used for the \"Preview\" tab in /tax/epo).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","period"],"properties":{"kind":{"description":"Which EPO XML to build: DPH přiznání, Kontrolní hlášení, or Souhrnné hlášení.","anyOf":[{"const":"dphdp3","type":"string"},{"const":"dphkh1","type":"string"},{"const":"dphshv","type":"string"}]},"period":{"type":"object","required":["year","month","kind"],"properties":{"year":{"minimum":2020,"maximum":2099,"type":"number"},"month":{"minimum":1,"maximum":12,"type":"number"},"kind":{"anyOf":[{"const":"monthly","type":"string"},{"const":"quarterly","type":"string"}]}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["kind","period"],"properties":{"kind":{"description":"Which EPO XML to build: DPH přiznání, Kontrolní hlášení, or Souhrnné hlášení.","anyOf":[{"const":"dphdp3","type":"string"},{"const":"dphkh1","type":"string"},{"const":"dphshv","type":"string"}]},"period":{"type":"object","required":["year","month","kind"],"properties":{"year":{"minimum":2020,"maximum":2099,"type":"number"},"month":{"minimum":1,"maximum":12,"type":"number"},"kind":{"anyOf":[{"const":"monthly","type":"string"},{"const":"quarterly","type":"string"}]}}}}}},"text/plain":{"schema":{"type":"object","required":["kind","period"],"properties":{"kind":{"description":"Which EPO XML to build: DPH přiznání, Kontrolní hlášení, or Souhrnné hlášení.","anyOf":[{"const":"dphdp3","type":"string"},{"const":"dphkh1","type":"string"},{"const":"dphshv","type":"string"}]},"period":{"type":"object","required":["year","month","kind"],"properties":{"year":{"minimum":2020,"maximum":2099,"type":"number"},"month":{"minimum":1,"maximum":12,"type":"number"},"kind":{"anyOf":[{"const":"monthly","type":"string"},{"const":"quarterly","type":"string"}]}}}}}}}},"responses":{"200":{}}}},"/bff/tax/epo/generate":{"post":{"parameters":[],"operationId":"postBffTaxEpoGenerate","tags":["Tax"],"summary":"Build + archive an EPO XML; runs XSD validation, persists to core__tax_submission.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","period"],"properties":{"kind":{"description":"Which EPO XML to build: DPH přiznání, Kontrolní hlášení, or Souhrnné hlášení.","anyOf":[{"const":"dphdp3","type":"string"},{"const":"dphkh1","type":"string"},{"const":"dphshv","type":"string"}]},"period":{"type":"object","required":["year","month","kind"],"properties":{"year":{"minimum":2020,"maximum":2099,"type":"number"},"month":{"minimum":1,"maximum":12,"type":"number"},"kind":{"anyOf":[{"const":"monthly","type":"string"},{"const":"quarterly","type":"string"}]}}},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isTest":{"default":false,"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["kind","period"],"properties":{"kind":{"description":"Which EPO XML to build: DPH přiznání, Kontrolní hlášení, or Souhrnné hlášení.","anyOf":[{"const":"dphdp3","type":"string"},{"const":"dphkh1","type":"string"},{"const":"dphshv","type":"string"}]},"period":{"type":"object","required":["year","month","kind"],"properties":{"year":{"minimum":2020,"maximum":2099,"type":"number"},"month":{"minimum":1,"maximum":12,"type":"number"},"kind":{"anyOf":[{"const":"monthly","type":"string"},{"const":"quarterly","type":"string"}]}}},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isTest":{"default":false,"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["kind","period"],"properties":{"kind":{"description":"Which EPO XML to build: DPH přiznání, Kontrolní hlášení, or Souhrnné hlášení.","anyOf":[{"const":"dphdp3","type":"string"},{"const":"dphkh1","type":"string"},{"const":"dphshv","type":"string"}]},"period":{"type":"object","required":["year","month","kind"],"properties":{"year":{"minimum":2020,"maximum":2099,"type":"number"},"month":{"minimum":1,"maximum":12,"type":"number"},"kind":{"anyOf":[{"const":"monthly","type":"string"},{"const":"quarterly","type":"string"}]}}},"notes":{"nullable":true,"anyOf":[{"type":"string"},{"type":"null"}]},"isTest":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/tax/epo/list":{"get":{"parameters":[{"description":"'dphdp3' | 'dphkh1' | 'dphshv'.","schema":{"type":"string"},"in":"query","name":"kind","required":false},{"description":"DataGrid fulltext over kind, SHA-256, filer and notes.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc` (wire field names).","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffTaxEpoList","tags":["Tax"],"summary":"List archived tax submissions.","responses":{"200":{}}}},"/bff/tax/vat-book/rows":{"get":{"parameters":[{"description":"Inclusive lower bound (YYYY-MM-DD). Default: first day of this month.","schema":{"type":"string"},"in":"query","name":"from","required":false},{"description":"Exclusive upper bound (YYYY-MM-DD). Legacy; prefer `toInclusive`.","schema":{"type":"string"},"in":"query","name":"to","required":false},{"description":"Inclusive upper bound (YYYY-MM-DD). Default: end of the month of `from`.","schema":{"type":"string"},"in":"query","name":"toInclusive","required":false},{"schema":{"type":"string"},"in":"query","name":"includeDrafts","required":false},{"description":"DataGrid fulltext over document no., partner, DIČ and description.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc` (wire field names).","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffTaxVat-bookRows","tags":["Tax"],"summary":"VAT book rows for the admin browser (paginated; `totals` cover the whole filtered set).","responses":{"200":{}}}},"/bff/tax/vat-book/pdf":{"get":{"parameters":[{"description":"Inclusive lower bound (YYYY-MM-DD).","schema":{"type":"string"},"in":"query","name":"from","required":false},{"description":"Exclusive upper bound (YYYY-MM-DD).","schema":{"type":"string"},"in":"query","name":"to","required":false},{"description":"Inclusive upper bound (YYYY-MM-DD); wins over `to`.","schema":{"type":"string"},"in":"query","name":"toInclusive","required":false},{"schema":{"type":"string"},"in":"query","name":"title","required":false},{"schema":{"type":"string"},"in":"query","name":"includeDrafts","required":false}],"operationId":"getBffTaxVat-bookPdf","tags":["Tax"],"summary":"Download the VAT book as a landscape A4 PDF.","responses":{"200":{}}}},"/bff/crm/aging-receivables":{"get":{"operationId":"getBffCrmAging-receivables","tags":["crm-dashboard"],"summary":"Aging of receivables","description":"Unpaid invoices grouped into 5 buckets (notDue, 1-30, 31-60, 61-90, 91+ days past due). Amounts are in base currency (CZK) so multi-currency organisations sum correctly.","responses":{"200":{}}}},"/bff/crm/aging-payables":{"get":{"operationId":"getBffCrmAging-payables","tags":["crm-dashboard"],"summary":"Aging of payables","description":"Same shape as /aging-receivables but over shop__purchase_invoice (what we owe vendors).","responses":{"200":{}}}},"/bff/crm/payment-health":{"get":{"parameters":[{"schema":{"type":"number","minimum":1,"maximum":60,"default":12},"in":"query","name":"monthsBack","required":false},{"examples":["en","de"],"schema":{"type":"string"},"in":"query","name":"locale","required":false}],"operationId":"getBffCrmPayment-health","tags":["crm-dashboard"],"summary":"DSO + punctuality + payment-time histogram","description":"Days Sales Outstanding (amount-weighted), punctuality rate (% paid by due), median and p90 days-to-pay, and a 5-bucket histogram. Bucket labels honour the optional `locale` query param.","responses":{"200":{}}}},"/bff/crm/concentration":{"get":{"parameters":[{"schema":{"type":"number","minimum":1,"maximum":60,"default":12},"in":"query","name":"monthsBack","required":false}],"operationId":"getBffCrmConcentration","tags":["crm-dashboard"],"summary":"Customer concentration risk (Pareto)","description":"top1Share, top3Share, top5Share, Pareto count for the clients covering 80% of revenue, and a risk badge.","responses":{"200":{}}}},"/bff/crm/churn-risk":{"get":{"parameters":[{"schema":{"type":"number","minimum":1,"maximum":730,"default":60},"in":"query","name":"thresholdDays","required":false},{"schema":{"type":"number","minimum":1,"maximum":200,"default":25},"in":"query","name":"limit","required":false}],"operationId":"getBffCrmChurn-risk","tags":["crm-dashboard"],"summary":"Clients at risk of churn","description":"Clients whose last paid invoice is ≥ thresholdDays old (default 60). Sorted by lifetime revenue desc.","responses":{"200":{}}}},"/bff/crm/top-clients":{"get":{"parameters":[{"schema":{"type":"number","minimum":1,"maximum":60,"default":12},"in":"query","name":"monthsBack","required":false},{"schema":{"type":"number","minimum":1,"maximum":100,"default":10},"in":"query","name":"limit","required":false}],"operationId":"getBffCrmTop-clients","tags":["crm-dashboard"],"summary":"Top clients ranked by CZK revenue","description":"Multi-currency aware: sums `total_base` so a 1000 EUR invoice outranks a 20 000 CZK one.","responses":{"200":{}}}},"/bff/crm/top-vendors":{"get":{"parameters":[{"schema":{"type":"number","minimum":1,"maximum":60,"default":12},"in":"query","name":"monthsBack","required":false},{"schema":{"type":"number","minimum":1,"maximum":100,"default":10},"in":"query","name":"limit","required":false}],"operationId":"getBffCrmTop-vendors","tags":["crm-dashboard"],"summary":"Top vendors ranked by CZK costs","description":"Multi-currency aware: sums `total_base` on shop__purchase_invoice.","responses":{"200":{}}}},"/bff/crm/action-items":{"get":{"operationId":"getBffCrmAction-items","tags":["crm-dashboard"],"summary":"List the operator's action items (Akce pro tebe)","description":"Composed from overdue receivables, overdue payables and churn risk. Dismissed categories are filtered out; historical-baseline dismissals only surface NEW items.","responses":{"200":{}}}},"/bff/crm/action-items/dismiss":{"post":{"parameters":[],"operationId":"postBffCrmAction-itemsDismiss","tags":["crm-dashboard"],"summary":"Dismiss an action-item category","description":"Modes: day (24h), week (7d), forever, historical (snapshot current item IDs, only show NEW ones).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["itemType","mode"],"properties":{"itemType":{"anyOf":[{"const":"overdue_invoices","type":"string"},{"const":"overdue_payables","type":"string"},{"const":"churn_risk","type":"string"},{"const":"tax_deadline","type":"string"}]},"mode":{"anyOf":[{"const":"day","type":"string"},{"const":"week","type":"string"},{"const":"forever","type":"string"},{"const":"historical","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["itemType","mode"],"properties":{"itemType":{"anyOf":[{"const":"overdue_invoices","type":"string"},{"const":"overdue_payables","type":"string"},{"const":"churn_risk","type":"string"},{"const":"tax_deadline","type":"string"}]},"mode":{"anyOf":[{"const":"day","type":"string"},{"const":"week","type":"string"},{"const":"forever","type":"string"},{"const":"historical","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["itemType","mode"],"properties":{"itemType":{"anyOf":[{"const":"overdue_invoices","type":"string"},{"const":"overdue_payables","type":"string"},{"const":"churn_risk","type":"string"},{"const":"tax_deadline","type":"string"}]},"mode":{"anyOf":[{"const":"day","type":"string"},{"const":"week","type":"string"},{"const":"forever","type":"string"},{"const":"historical","type":"string"}]}}}}}},"responses":{"200":{}}}},"/bff/crm/action-items/restore":{"post":{"parameters":[],"operationId":"postBffCrmAction-itemsRestore","tags":["crm-dashboard"],"summary":"Restore a previously dismissed action-item category","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["itemType"],"properties":{"itemType":{"anyOf":[{"const":"overdue_invoices","type":"string"},{"const":"overdue_payables","type":"string"},{"const":"churn_risk","type":"string"},{"const":"tax_deadline","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["itemType"],"properties":{"itemType":{"anyOf":[{"const":"overdue_invoices","type":"string"},{"const":"overdue_payables","type":"string"},{"const":"churn_risk","type":"string"},{"const":"tax_deadline","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["itemType"],"properties":{"itemType":{"anyOf":[{"const":"overdue_invoices","type":"string"},{"const":"overdue_payables","type":"string"},{"const":"churn_risk","type":"string"},{"const":"tax_deadline","type":"string"}]}}}}}},"responses":{"200":{}}}},"/bff/crm/action-items/restore-all":{"post":{"operationId":"postBffCrmAction-itemsRestore-all","tags":["crm-dashboard"],"summary":"Restore all dismissals for the current member","responses":{"200":{}}}},"/bff/cron/job-list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Status of the latest run (`running`, `success`, `error`, `timeout`) or `missed` (scheduled job did not start).","schema":{"type":"string"},"in":"query","name":"lastStatus","required":false},{"description":"Scheduler bucket of the latest run, e.g. `nightly`.","schema":{"type":"string"},"in":"query","name":"tier","required":false},{"description":"Application prefix of the code (`scout` for `scout:*`).","schema":{"type":"string"},"in":"query","name":"namespace","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffCronJob-list","tags":["Cron"],"summary":"Unique cron jobs with lifetime and 7-day statistics","description":"First / last run, run counts, average and p95 duration, success rate, currently running runs, tier, schedule and missed-run state (`isMissed`, `lastExpectedDate`, `nextExpectedDate`).","responses":{"200":{}}}},"/bff/cron/tier-list":{"get":{"operationId":"getBffCronTier-list","tags":["Cron"],"summary":"Distinct tiers of the cron jobs (filter options)","responses":{"200":{}}}},"/bff/cron/job-detail/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"id","required":true}],"operationId":"getBffCronJob-detailById","tags":["Cron"],"summary":"One cron job with a 30-day daily series","responses":{"200":{}}}},"/bff/cron/job-update":{"post":{"parameters":[],"operationId":"postBffCronJob-update","tags":["Cron"],"summary":"Rename a cron job, toggle its alerts or set its expected schedule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"New name (locks it against starts). `null` hands the name back to the client.","type":"string"},{"type":"null"}]},"isAlertEnabled":{"type":"boolean"},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Cron expression; `null` removes the schedule.","type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone; `null` = UTC.","type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"type":"integer"}]},{"type":"null"}]},"isScheduleLocked":{"description":"Editing the schedule locks it automatically; `false` lets starts update it again.","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"New name (locks it against starts). `null` hands the name back to the client.","type":"string"},{"type":"null"}]},"isAlertEnabled":{"type":"boolean"},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Cron expression; `null` removes the schedule.","type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone; `null` = UTC.","type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"type":"integer"}]},{"type":"null"}]},"isScheduleLocked":{"description":"Editing the schedule locks it automatically; `false` lets starts update it again.","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"name":{"nullable":true,"anyOf":[{"maxLength":128,"description":"New name (locks it against starts). `null` hands the name back to the client.","type":"string"},{"type":"null"}]},"isAlertEnabled":{"type":"boolean"},"schedule":{"nullable":true,"anyOf":[{"maxLength":120,"description":"Cron expression; `null` removes the schedule.","type":"string"},{"type":"null"}]},"scheduleTimezone":{"nullable":true,"anyOf":[{"maxLength":64,"description":"IANA time zone; `null` = UTC.","type":"string"},{"type":"null"}]},"graceSeconds":{"nullable":true,"anyOf":[{"minimum":0,"maximum":604800,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":604800,"type":"integer"}]},{"type":"null"}]},"isScheduleLocked":{"description":"Editing the schedule locks it automatically; `false` lets starts update it again.","type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/cron/job-delete":{"post":{"parameters":[],"operationId":"postBffCronJob-delete","tags":["Cron"],"summary":"Hide a cron job","description":"Soft delete. The next run reported with the same code shows the job again.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/cron/run-list":{"get":{"parameters":[{"description":"Job external id.","schema":{"type":"string"},"in":"query","name":"jobId","required":false},{"description":"Comma-separated: running, success, error, timeout.","schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffCronRun-list","tags":["Cron"],"summary":"Cron runs, newest first","responses":{"200":{}}}},"/bff/cron/run-detail/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"id","required":true},{"schema":{"type":"string"},"in":"query","name":"minLevel","required":false}],"operationId":"getBffCronRun-detailById","tags":["Cron"],"summary":"One cron run with meta, report and log entries","responses":{"200":{}}}},"/bff/backup/overview":{"get":{"operationId":"getBffBackupOverview","tags":["Backup"],"summary":"Backup cockpit: totals, health state with reasons (overdue series, late copies, integrity), state of every backup series","responses":{"200":{}}}},"/bff/backup/create-api-key":{"post":{"parameters":[],"operationId":"postBffBackupCreate-api-key","tags":["Backup"],"summary":"Generate a PROD API key restricted to the backup service (scope public.backup)","description":"The key value is returned only once. Scope is set in the same transaction, so the key never has full access.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["description"],"properties":{"description":{"minLength":1,"maxLength":120,"description":"Machine or service the key is for, e.g. `web-01 MySQL`.","type":"string"},"validYears":{"description":"Validity in years: 1, 2 or 5. Default 2.","anyOf":[{"type":"number"},{"type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["description"],"properties":{"description":{"minLength":1,"maxLength":120,"description":"Machine or service the key is for, e.g. `web-01 MySQL`.","type":"string"},"validYears":{"description":"Validity in years: 1, 2 or 5. Default 2.","anyOf":[{"type":"number"},{"type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["description"],"properties":{"description":{"minLength":1,"maxLength":120,"description":"Machine or service the key is for, e.g. `web-01 MySQL`.","type":"string"},"validYears":{"description":"Validity in years: 1, 2 or 5. Default 2.","anyOf":[{"type":"number"},{"type":"string"}]}}}}}},"responses":{"200":{}}}},"/bff/backup/create-install-command":{"post":{"parameters":[],"operationId":"postBffBackupCreate-install-command","tags":["Backup"],"summary":"One-time install command: profile + schedule, exchanged on the server for a backup-only key (24 h, single use)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["description","kind"],"properties":{"description":{"minLength":1,"maxLength":120,"description":"Machine and what it backs up, e.g. `web-01 MySQL`. Becomes the series source.","type":"string"},"kind":{"description":"postgres | mysql | files | docker-volume","type":"string"},"target":{"maxLength":255,"description":"Database name (empty = all), absolute path or Docker volume.","type":"string"},"interval":{"description":"6h | 24h | 7d","type":"string"},"time":{"description":"Local time on the server, HH:MM.","type":"string"},"validYears":{"anyOf":[{"type":"number"},{"type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["description","kind"],"properties":{"description":{"minLength":1,"maxLength":120,"description":"Machine and what it backs up, e.g. `web-01 MySQL`. Becomes the series source.","type":"string"},"kind":{"description":"postgres | mysql | files | docker-volume","type":"string"},"target":{"maxLength":255,"description":"Database name (empty = all), absolute path or Docker volume.","type":"string"},"interval":{"description":"6h | 24h | 7d","type":"string"},"time":{"description":"Local time on the server, HH:MM.","type":"string"},"validYears":{"anyOf":[{"type":"number"},{"type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["description","kind"],"properties":{"description":{"minLength":1,"maxLength":120,"description":"Machine and what it backs up, e.g. `web-01 MySQL`. Becomes the series source.","type":"string"},"kind":{"description":"postgres | mysql | files | docker-volume","type":"string"},"target":{"maxLength":255,"description":"Database name (empty = all), absolute path or Docker volume.","type":"string"},"interval":{"description":"6h | 24h | 7d","type":"string"},"time":{"description":"Local time on the server, HH:MM.","type":"string"},"validYears":{"anyOf":[{"type":"number"},{"type":"string"}]}}}}}},"responses":{"200":{}}}},"/bff/backup/storage-report":{"get":{"parameters":[{"description":"`30d` | `90d` | `365d`","schema":{"type":"string"},"in":"query","name":"period","required":false},{"description":"`all` (every blob) | `backup` (backup service files only)","schema":{"type":"string"},"in":"query","name":"scope","required":false}],"operationId":"getBffBackupStorage-report","tags":["Backup"],"summary":"Daily storage report from core__blob: written per day, running total, top folders","responses":{"200":{}}}},"/bff/backup/list":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"source","required":false},{"schema":{"type":"string"},"in":"query","name":"type","required":false},{"description":"`yes` = copied to the backup datacentre, `no` = waiting.","schema":{"type":"string"},"in":"query","name":"mirrored","required":false},{"schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffBackupList","tags":["Backup"],"summary":"Paged backups, newest first","responses":{"200":{}}}},"/bff/backup/detail/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":16,"maxLength":16},"in":"path","name":"id","required":true}],"operationId":"getBffBackupDetailById","tags":["Backup"],"summary":"Backup detail incl. mirror progress","responses":{"200":{}}}},"/bff/backup/download-url":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string"},"location":{"anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]}},"required":["url","expiresAt","location"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string"},"location":{"anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]}},"required":["url","expiresAt","location"]}},"text/plain":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expiresAt":{"type":"string"},"location":{"anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]}},"required":["url","expiresAt","location"]}}}}},"operationId":"postBffBackupDownload-url","tags":["Backup"],"summary":"Short-lived signed download URL (15 min)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}}}}}},"/bff/backup/send-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string"},"recipientName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string"},"location":{"anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]}},"required":["to","recipientName","expiresAt","location"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"to":{"type":"string"},"recipientName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string"},"location":{"anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]}},"required":["to","recipientName","expiresAt","location"]}},"text/plain":{"schema":{"type":"object","properties":{"to":{"type":"string"},"recipientName":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string"},"location":{"anyOf":[{"const":"primary","type":"string"},{"const":"mirror","type":"string"}]}},"required":["to","recipientName","expiresAt","location"]}}}}},"operationId":"postBffBackupSend-email","tags":["Backup"],"summary":"Send the backup by e-mail: fixed BizKitHub Backup system mail with a 24 h download link, backup context and restore steps","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"contactId":{"minLength":16,"maxLength":16,"description":"Recipient contact (external id). Wins over `email`.","type":"string"},"email":{"maxLength":255,"description":"Recipient e-mail when no contact is picked.","type":"string"},"note":{"maxLength":1000,"description":"Optional message from the sender, shown in the e-mail.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"contactId":{"minLength":16,"maxLength":16,"description":"Recipient contact (external id). Wins over `email`.","type":"string"},"email":{"maxLength":255,"description":"Recipient e-mail when no contact is picked.","type":"string"},"note":{"maxLength":1000,"description":"Optional message from the sender, shown in the e-mail.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"},"contactId":{"minLength":16,"maxLength":16,"description":"Recipient contact (external id). Wins over `email`.","type":"string"},"email":{"maxLength":255,"description":"Recipient e-mail when no contact is picked.","type":"string"},"note":{"maxLength":1000,"description":"Optional message from the sender, shown in the e-mail.","type":"string"}}}}}}}},"/bff/backup/restore-plan":{"post":{"parameters":[],"operationId":"postBffBackupRestore-plan","tags":["Backup"],"summary":"Restore assistant: server download link (1 h) + shell steps derived from the file format","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":16,"maxLength":16,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/access-request/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"16-char external id of the created (or existing) request.","type":"string"},"alreadyPending":{"description":"True when a pending request for the same permission already existed — the id points to that row.","type":"boolean"}},"required":["id","alreadyPending"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"16-char external id of the created (or existing) request.","type":"string"},"alreadyPending":{"description":"True when a pending request for the same permission already existed — the id points to that row.","type":"boolean"}},"required":["id","alreadyPending"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"16-char external id of the created (or existing) request.","type":"string"},"alreadyPending":{"description":"True when a pending request for the same permission already existed — the id points to that row.","type":"boolean"}},"required":["id","alreadyPending"]}}}}},"operationId":"postBffAccess-requestCreate","tags":["AccessRequest"],"summary":"Create an access request","description":"Creates a pending row in `cas__access_request` and dispatches a notification e-mail via `writeLog` to every active root member of the org. Idempotent — a second call for the same (member, permission) while a request is still pending returns the existing id.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["permissionCode","justification"],"properties":{"permissionCode":{"description":"Permission code the caller is asking for (e.g. `module-newsletter`).","examples":["module-newsletter"],"type":"string"},"justification":{"description":"Free-form explanation supplied by the caller (10..1000 characters).","examples":["Potřebuji odeslat kampaň zákazníkovi X. Přiřazený projekt: Y."],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["permissionCode","justification"],"properties":{"permissionCode":{"description":"Permission code the caller is asking for (e.g. `module-newsletter`).","examples":["module-newsletter"],"type":"string"},"justification":{"description":"Free-form explanation supplied by the caller (10..1000 characters).","examples":["Potřebuji odeslat kampaň zákazníkovi X. Přiřazený projekt: Y."],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["permissionCode","justification"],"properties":{"permissionCode":{"description":"Permission code the caller is asking for (e.g. `module-newsletter`).","examples":["module-newsletter"],"type":"string"},"justification":{"description":"Free-form explanation supplied by the caller (10..1000 characters).","examples":["Potřebuji odeslat kampaň zákazníkovi X. Přiřazený projekt: Y."],"type":"string"}}}}}}}},"/bff/access-request/my-pending":{"get":{"parameters":[{"description":"Permission code the caller is checking (e.g. `module-newsletter`).","examples":["module-newsletter"],"schema":{"type":"string"},"in":"query","name":"permissionCode","required":true}],"operationId":"getBffAccess-requestMy-pending","tags":["AccessRequest"],"summary":"Check whether the caller has an open access request for a permission","description":"Returns `pending: true` (plus the request id and inserted date) when the caller has an open request for the given permission code. Otherwise `pending: false`. Used by the admin permission-denied screen to swap the \"Request access\" CTA for a \"Waiting for approval\" label.","responses":{"200":{}}}},"/bff/access-request/list":{"get":{"parameters":[{"description":"Comma-separated status filter. One or more of `pending`, `approved`, `rejected`. When omitted, all non-deleted rows are returned.","examples":["pending","approved,rejected"],"schema":{"type":"string"},"in":"query","name":"status","required":false},{"description":"Page number (1-based).","examples":["1"],"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"Page size (1..500, default 50).","examples":["50"],"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffAccess-requestList","tags":["AccessRequest"],"summary":"List access requests for the current organisation","description":"Returns a paginated list of access requests. Newest first. Requires the `module-accessRequest` permission (auto-granted to the `root` role).","responses":{"200":{}}}},"/bff/access-request/resolve":{"post":{"parameters":[],"operationId":"postBffAccess-requestResolve","tags":["AccessRequest"],"summary":"Bulk approve or reject access requests","description":"Approves or rejects one or more pending access requests. Approving funnels through `saveMemberPermissions` (so the standard audit/activity/cache-invalidation logic fires). Non-pending rows are silently skipped and reported in the response. Requires the `module-accessRequest` permission.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids","action"],"properties":{"ids":{"description":"One or more request external ids to resolve at once.","type":"array","items":{"description":"16-char external id of the request.","type":"string"}},"action":{"description":"What to do with each row.","anyOf":[{"const":"approve","type":"string"},{"const":"reject","type":"string"}]},"resolutionNote":{"description":"Optional operator note (mostly used when rejecting).","examples":["Nedostatečné zdůvodnění, prosím doplňte projekt."],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["ids","action"],"properties":{"ids":{"description":"One or more request external ids to resolve at once.","type":"array","items":{"description":"16-char external id of the request.","type":"string"}},"action":{"description":"What to do with each row.","anyOf":[{"const":"approve","type":"string"},{"const":"reject","type":"string"}]},"resolutionNote":{"description":"Optional operator note (mostly used when rejecting).","examples":["Nedostatečné zdůvodnění, prosím doplňte projekt."],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["ids","action"],"properties":{"ids":{"description":"One or more request external ids to resolve at once.","type":"array","items":{"description":"16-char external id of the request.","type":"string"}},"action":{"description":"What to do with each row.","anyOf":[{"const":"approve","type":"string"},{"const":"reject","type":"string"}]},"resolutionNote":{"description":"Optional operator note (mostly used when rejecting).","examples":["Nedostatečné zdůvodnění, prosím doplňte projekt."],"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/settings/entity/list":{"get":{"operationId":"getBffLedgerSettingsEntityList","tags":["Ledger"],"summary":"Accounting entities with ledger status","description":"Every accounting entity with its ledger profile (null = bookkeeping not active) and the regime valid today.","responses":{"200":{}}}},"/bff/ledger/settings/entity/activate":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"profileId":{"type":"string"}},"required":["success","profileId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"profileId":{"type":"string"}},"required":["success","profileId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"profileId":{"type":"string"}},"required":["success","profileId"]}}}}},"operationId":"postBffLedgerSettingsEntityActivate","tags":["Ledger"],"summary":"Activate bookkeeping for an accounting entity","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","accountingStartsOn","mode","framework","vatStatus","vatPeriod","ossRegistered"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"accountingStartsOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"fiscalYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"baseCurrency":{"anyOf":[{"minLength":3,"maxLength":3,"type":"string"},{"type":"null"}]},"autoPostLevel":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"assisted","type":"string"},{"const":"full","type":"string"}]},"mode":{"anyOf":[{"const":"double_entry","type":"string"},{"const":"tax_evidence","type":"string"},{"const":"none","type":"string"}]},"framework":{"anyOf":[{"const":"cz_500","type":"string"},{"const":"cz_504","type":"string"}]},"vatStatus":{"anyOf":[{"const":"payer","type":"string"},{"const":"identified_person","type":"string"},{"const":"non_payer","type":"string"}]},"vatPeriod":{"anyOf":[{"const":"month","type":"string"},{"const":"quarter","type":"string"},{"const":"none","type":"string"}]},"ossRegistered":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","accountingStartsOn","mode","framework","vatStatus","vatPeriod","ossRegistered"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"accountingStartsOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"fiscalYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"baseCurrency":{"anyOf":[{"minLength":3,"maxLength":3,"type":"string"},{"type":"null"}]},"autoPostLevel":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"assisted","type":"string"},{"const":"full","type":"string"}]},"mode":{"anyOf":[{"const":"double_entry","type":"string"},{"const":"tax_evidence","type":"string"},{"const":"none","type":"string"}]},"framework":{"anyOf":[{"const":"cz_500","type":"string"},{"const":"cz_504","type":"string"}]},"vatStatus":{"anyOf":[{"const":"payer","type":"string"},{"const":"identified_person","type":"string"},{"const":"non_payer","type":"string"}]},"vatPeriod":{"anyOf":[{"const":"month","type":"string"},{"const":"quarter","type":"string"},{"const":"none","type":"string"}]},"ossRegistered":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","accountingStartsOn","mode","framework","vatStatus","vatPeriod","ossRegistered"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"accountingStartsOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"fiscalYearStartMonth":{"anyOf":[{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},{"type":"null"}]},"baseCurrency":{"anyOf":[{"minLength":3,"maxLength":3,"type":"string"},{"type":"null"}]},"autoPostLevel":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"assisted","type":"string"},{"const":"full","type":"string"}]},"mode":{"anyOf":[{"const":"double_entry","type":"string"},{"const":"tax_evidence","type":"string"},{"const":"none","type":"string"}]},"framework":{"anyOf":[{"const":"cz_500","type":"string"},{"const":"cz_504","type":"string"}]},"vatStatus":{"anyOf":[{"const":"payer","type":"string"},{"const":"identified_person","type":"string"},{"const":"non_payer","type":"string"}]},"vatPeriod":{"anyOf":[{"const":"month","type":"string"},{"const":"quarter","type":"string"},{"const":"none","type":"string"}]},"ossRegistered":{"type":"boolean"}}}}}}}},"/bff/ledger/settings/entity/update-profile":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}}}}},"operationId":"postBffLedgerSettingsEntityUpdate-profile","tags":["Ledger"],"summary":"Update ledger settings of an accounting entity","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"accountingStartsOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"fiscalYearStartMonth":{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},"lockedUntil":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"autoPostLevel":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"assisted","type":"string"},{"const":"full","type":"string"}]},"autoPostDailyLimit":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"fxRateMode":{"anyOf":[{"const":"daily","type":"string"},{"const":"fixed_monthly","type":"string"},{"const":"fixed_yearly","type":"string"}]},"singleAnalyticRedirect":{"type":"boolean"},"paymentTolerance":{"description":"BIZKIT-163: largest payment difference (base currency) settled automatically; null / 0 = off.","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"paymentToleranceLossAccount":{"description":"Account of small losses; null = framework default (548).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"paymentToleranceGainAccount":{"description":"Account of small gains; null = framework default (648).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"overpaymentLiabilityAccount":{"description":"Incoming overpayment above the tolerance (e.g. 325); null = off (suspense / bank rules).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"overpaymentReceivableAccount":{"description":"Outgoing overpayment above the tolerance (e.g. 315); null = off.","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"accountingStartsOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"fiscalYearStartMonth":{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},"lockedUntil":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"autoPostLevel":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"assisted","type":"string"},{"const":"full","type":"string"}]},"autoPostDailyLimit":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"fxRateMode":{"anyOf":[{"const":"daily","type":"string"},{"const":"fixed_monthly","type":"string"},{"const":"fixed_yearly","type":"string"}]},"singleAnalyticRedirect":{"type":"boolean"},"paymentTolerance":{"description":"BIZKIT-163: largest payment difference (base currency) settled automatically; null / 0 = off.","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"paymentToleranceLossAccount":{"description":"Account of small losses; null = framework default (548).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"paymentToleranceGainAccount":{"description":"Account of small gains; null = framework default (648).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"overpaymentLiabilityAccount":{"description":"Incoming overpayment above the tolerance (e.g. 325); null = off (suspense / bank rules).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"overpaymentReceivableAccount":{"description":"Outgoing overpayment above the tolerance (e.g. 315); null = off.","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"accountingStartsOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"fiscalYearStartMonth":{"minimum":1,"maximum":12,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":12,"type":"integer"}]},"lockedUntil":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"autoPostLevel":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"assisted","type":"string"},{"const":"full","type":"string"}]},"autoPostDailyLimit":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"fxRateMode":{"anyOf":[{"const":"daily","type":"string"},{"const":"fixed_monthly","type":"string"},{"const":"fixed_yearly","type":"string"}]},"singleAnalyticRedirect":{"type":"boolean"},"paymentTolerance":{"description":"BIZKIT-163: largest payment difference (base currency) settled automatically; null / 0 = off.","anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"paymentToleranceLossAccount":{"description":"Account of small losses; null = framework default (548).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"paymentToleranceGainAccount":{"description":"Account of small gains; null = framework default (648).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"overpaymentLiabilityAccount":{"description":"Incoming overpayment above the tolerance (e.g. 325); null = off (suspense / bank rules).","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"overpaymentReceivableAccount":{"description":"Outgoing overpayment above the tolerance (e.g. 315); null = off.","anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/settings/entity/regime-list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerSettingsEntityRegime-list","tags":["Ledger"],"summary":"Regime history of an accounting entity","responses":{"200":{}}}},"/bff/ledger/settings/entity/regime-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"number"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerSettingsEntityRegime-add","tags":["Ledger"],"summary":"Add an effective-dated regime change","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","effectiveFrom","mode","framework","vatStatus","vatPeriod","ossRegistered"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"effectiveFrom":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"mode":{"anyOf":[{"const":"double_entry","type":"string"},{"const":"tax_evidence","type":"string"},{"const":"none","type":"string"}]},"framework":{"anyOf":[{"const":"cz_500","type":"string"},{"const":"cz_504","type":"string"}]},"vatStatus":{"anyOf":[{"const":"payer","type":"string"},{"const":"identified_person","type":"string"},{"const":"non_payer","type":"string"}]},"vatPeriod":{"anyOf":[{"const":"month","type":"string"},{"const":"quarter","type":"string"},{"const":"none","type":"string"}]},"ossRegistered":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","effectiveFrom","mode","framework","vatStatus","vatPeriod","ossRegistered"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"effectiveFrom":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"mode":{"anyOf":[{"const":"double_entry","type":"string"},{"const":"tax_evidence","type":"string"},{"const":"none","type":"string"}]},"framework":{"anyOf":[{"const":"cz_500","type":"string"},{"const":"cz_504","type":"string"}]},"vatStatus":{"anyOf":[{"const":"payer","type":"string"},{"const":"identified_person","type":"string"},{"const":"non_payer","type":"string"}]},"vatPeriod":{"anyOf":[{"const":"month","type":"string"},{"const":"quarter","type":"string"},{"const":"none","type":"string"}]},"ossRegistered":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","effectiveFrom","mode","framework","vatStatus","vatPeriod","ossRegistered"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"effectiveFrom":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"mode":{"anyOf":[{"const":"double_entry","type":"string"},{"const":"tax_evidence","type":"string"},{"const":"none","type":"string"}]},"framework":{"anyOf":[{"const":"cz_500","type":"string"},{"const":"cz_504","type":"string"}]},"vatStatus":{"anyOf":[{"const":"payer","type":"string"},{"const":"identified_person","type":"string"},{"const":"non_payer","type":"string"}]},"vatPeriod":{"anyOf":[{"const":"month","type":"string"},{"const":"quarter","type":"string"},{"const":"none","type":"string"}]},"ossRegistered":{"type":"boolean"}}}}}}}},"/bff/ledger/settings/entity/regime-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerSettingsEntityRegime-delete","tags":["Ledger"],"summary":"Remove a regime change (not the initial one)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","regimeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"regimeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","regimeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"regimeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","regimeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"regimeId":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}}}},"/bff/ledger/settings/source/list":{"get":{"operationId":"getBffLedgerSettingsSourceList","tags":["Ledger"],"summary":"Legacy sources and their accounting entity","description":"Invoice issuers, bank accounts, payment gateways and branches with the entity they book into.","responses":{"200":{}}}},"/bff/ledger/settings/source/set":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerSettingsSourceSet","tags":["Ledger"],"summary":"Map a legacy source to an accounting entity","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","key","entityId"],"properties":{"kind":{"anyOf":[{"const":"issuer_contact","type":"string"},{"const":"bank_account","type":"string"},{"const":"gateway_instance","type":"string"},{"const":"branch","type":"string"}]},"key":{"minLength":1,"maxLength":128,"type":"string"},"entityId":{"anyOf":[{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["kind","key","entityId"],"properties":{"kind":{"anyOf":[{"const":"issuer_contact","type":"string"},{"const":"bank_account","type":"string"},{"const":"gateway_instance","type":"string"},{"const":"branch","type":"string"}]},"key":{"minLength":1,"maxLength":128,"type":"string"},"entityId":{"anyOf":[{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["kind","key","entityId"],"properties":{"kind":{"anyOf":[{"const":"issuer_contact","type":"string"},{"const":"bank_account","type":"string"},{"const":"gateway_instance","type":"string"},{"const":"branch","type":"string"}]},"key":{"minLength":1,"maxLength":128,"type":"string"},"entityId":{"anyOf":[{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/settings/source/create-entity":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entityId":{"type":"string"}},"required":["success","entityId"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entityId":{"type":"string"}},"required":["success","entityId"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entityId":{"type":"string"}},"required":["success","entityId"]}}}}},"operationId":"postBffLedgerSettingsSourceCreate-entity","tags":["Ledger"],"summary":"Create an accounting entity for an invoice issuer and map it","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["key"],"properties":{"key":{"minLength":16,"maxLength":24,"description":"Issuer contact external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["key"],"properties":{"key":{"minLength":16,"maxLength":24,"description":"Issuer contact external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["key"],"properties":{"key":{"minLength":16,"maxLength":24,"description":"Issuer contact external id.","type":"string"}}}}}}}},"/bff/ledger/settings/money-account/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":false}],"operationId":"getBffLedgerSettingsMoney-accountList","tags":["Ledger"],"summary":"Money accounts (bank, cash, gateway clearing, …)","responses":{"200":{}}}},"/bff/ledger/settings/money-account/suggestions":{"get":{"operationId":"getBffLedgerSettingsMoney-accountSuggestions","tags":["Ledger"],"summary":"Bank accounts and gateways without a money account","responses":{"200":{}}}},"/bff/ledger/settings/money-account/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerSettingsMoney-accountCreate","tags":["Ledger"],"summary":"Create a money account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","kind","name","currency"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"bank","type":"string"},{"const":"cash","type":"string"},{"const":"gateway","type":"string"},{"const":"card","type":"string"},{"const":"cod","type":"string"},{"const":"credit","type":"string"},{"const":"other","type":"string"}]},"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"glAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"maxLength":42,"type":"string"},{"type":"null"}]},"openingBalance":{"anyOf":[{"type":"number"},{"type":"null"}]},"openingDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","kind","name","currency"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"bank","type":"string"},{"const":"cash","type":"string"},{"const":"gateway","type":"string"},{"const":"card","type":"string"},{"const":"cod","type":"string"},{"const":"credit","type":"string"},{"const":"other","type":"string"}]},"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"glAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"maxLength":42,"type":"string"},{"type":"null"}]},"openingBalance":{"anyOf":[{"type":"number"},{"type":"null"}]},"openingDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","kind","name","currency"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"bank","type":"string"},{"const":"cash","type":"string"},{"const":"gateway","type":"string"},{"const":"card","type":"string"},{"const":"cod","type":"string"},{"const":"credit","type":"string"},{"const":"other","type":"string"}]},"name":{"minLength":1,"maxLength":200,"type":"string"},"currency":{"minLength":3,"maxLength":3,"type":"string"},"glAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"maxLength":42,"type":"string"},{"type":"null"}]},"openingBalance":{"anyOf":[{"type":"number"},{"type":"null"}]},"openingDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/settings/money-account/create-from-source":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"createdCount":{"type":"number"}},"required":["success","createdCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"createdCount":{"type":"number"}},"required":["success","createdCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"createdCount":{"type":"number"}},"required":["success","createdCount"]}}}}},"operationId":"postBffLedgerSettingsMoney-accountCreate-from-source","tags":["Ledger"],"summary":"Create money accounts for suggested bank accounts / gateways","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sources"],"properties":{"sources":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["kind","key"],"properties":{"kind":{"anyOf":[{"const":"bank_account","type":"string"},{"const":"gateway_instance","type":"string"}]},"key":{"minLength":1,"maxLength":64,"type":"string"},"entityId":{"anyOf":[{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["sources"],"properties":{"sources":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["kind","key"],"properties":{"kind":{"anyOf":[{"const":"bank_account","type":"string"},{"const":"gateway_instance","type":"string"}]},"key":{"minLength":1,"maxLength":64,"type":"string"},"entityId":{"anyOf":[{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["sources"],"properties":{"sources":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","required":["kind","key"],"properties":{"kind":{"anyOf":[{"const":"bank_account","type":"string"},{"const":"gateway_instance","type":"string"}]},"key":{"minLength":1,"maxLength":64,"type":"string"},"entityId":{"anyOf":[{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},{"type":"null"}]}}}}}}}}}}},"/bff/ledger/settings/money-account/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"}},"required":["success","changeCount"]}}}}},"operationId":"postBffLedgerSettingsMoney-accountUpdate","tags":["Ledger"],"summary":"Update a money account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"entityId":{"type":"string"},"kind":{"type":"string"},"currency":{"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"glAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"maxLength":42,"type":"string"},{"type":"null"}]},"openingBalance":{"anyOf":[{"type":"number"},{"type":"null"}]},"openingDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"entityId":{"type":"string"},"kind":{"type":"string"},"currency":{"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"glAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"maxLength":42,"type":"string"},{"type":"null"}]},"openingBalance":{"anyOf":[{"type":"number"},{"type":"null"}]},"openingDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"},"entityId":{"type":"string"},"kind":{"type":"string"},"currency":{"type":"string"},"name":{"minLength":1,"maxLength":200,"type":"string"},"glAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"iban":{"anyOf":[{"maxLength":42,"type":"string"},{"type":"null"}]},"openingBalance":{"anyOf":[{"type":"number"},{"type":"null"}]},"openingDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/settings/money-account/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerSettingsMoney-accountDelete","tags":["Ledger"],"summary":"Remove a money account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"minLength":24,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/account/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-01-01"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false},{"description":"DataGrid fulltext: code or name.","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Account class (first digit of the code).","schema":{"type":"string","maxLength":1},"in":"query","name":"accountClass","required":false},{"description":"`true` = include inactive accounts (DataGrid mode).","schema":{"type":"string"},"in":"query","name":"showInactive","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"description":"With `page`: DataGrid page size (clamped). Without both, the whole chart is returned.","schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerAccountList","tags":["Ledger"],"summary":"Chart of accounts as of a date","responses":{"200":{}}}},"/bff/ledger/account/detail":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Account external id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true},{"examples":["2026-01-01"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"operationId":"getBffLedgerAccountDetail","tags":["Ledger"],"summary":"Account detail with definition history","responses":{"200":{}}}},"/bff/ledger/account/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerAccountCreate","tags":["Ledger"],"summary":"Create an analytic account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","code","name"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":4,"maxLength":16,"examples":["311.100"],"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"minLength":3,"maxLength":3,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","code","name"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":4,"maxLength":16,"examples":["311.100"],"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"minLength":3,"maxLength":3,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","code","name"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":4,"maxLength":16,"examples":["311.100"],"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"minLength":3,"maxLength":3,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/account/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"},"versioned":{"type":"boolean"}},"required":["success","changeCount","versioned"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"},"versioned":{"type":"boolean"}},"required":["success","changeCount","versioned"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changeCount":{"type":"number"},"versioned":{"type":"boolean"}},"required":["success","changeCount","versioned"]}}}}},"operationId":"postBffLedgerAccountUpdate","tags":["Ledger"],"summary":"Update an account (effective-dated definition)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Account external id.","type":"string"},"effectiveFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"taxDeductibility":{"anyOf":[{"const":"deductible","type":"string"},{"const":"non_deductible","type":"string"}]},"isActive":{"type":"boolean"},"isClearing":{"type":"boolean"},"isOpenItem":{"type":"boolean"},"isFxRevaluable":{"type":"boolean"},"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidence":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Account external id.","type":"string"},"effectiveFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"taxDeductibility":{"anyOf":[{"const":"deductible","type":"string"},{"const":"non_deductible","type":"string"}]},"isActive":{"type":"boolean"},"isClearing":{"type":"boolean"},"isOpenItem":{"type":"boolean"},"isFxRevaluable":{"type":"boolean"},"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidence":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Account external id.","type":"string"},"effectiveFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-01-01"],"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"normalSide":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"},{"type":"null"}]},"taxDeductibility":{"anyOf":[{"const":"deductible","type":"string"},{"const":"non_deductible","type":"string"}]},"isActive":{"type":"boolean"},"isClearing":{"type":"boolean"},"isOpenItem":{"type":"boolean"},"isFxRevaluable":{"type":"boolean"},"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"evidence":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/account/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerAccountDelete","tags":["Ledger"],"summary":"Delete an unused analytic account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Account external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Account external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Account external id.","type":"string"}}}}}}}},"/bff/ledger/account/seed":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"inserted":{"type":"number"}},"required":["success","inserted"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"inserted":{"type":"number"}},"required":["success","inserted"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"inserted":{"type":"number"}},"required":["success","inserted"]}}}}},"operationId":"postBffLedgerAccountSeed","tags":["Ledger"],"summary":"Add missing accounts from the standard chart","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}}}}}},"/bff/ledger/period/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerPeriodList","tags":["Ledger"],"summary":"Fiscal periods with allowed transitions and audit trail","responses":{"200":{}}}},"/bff/ledger/period/create-next":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"fiscalYear":{"type":"number"}},"required":["success","fiscalYear"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"fiscalYear":{"type":"number"}},"required":["success","fiscalYear"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"fiscalYear":{"type":"number"}},"required":["success","fiscalYear"]}}}}},"operationId":"postBffLedgerPeriodCreate-next","tags":["Ledger"],"summary":"Open the next fiscal period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}}}}}},"/bff/ledger/period/change-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerPeriodChange-status","tags":["Ledger"],"summary":"Change fiscal period status (compare-and-swap)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","toStatus","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"toStatus":{"anyOf":[{"const":"open","type":"string"},{"const":"closing","type":"string"},{"const":"closed","type":"string"},{"const":"reviewed","type":"string"},{"const":"approved","type":"string"}]},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"reason":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"approvalBody":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"approvalDecisionRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","toStatus","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"toStatus":{"anyOf":[{"const":"open","type":"string"},{"const":"closing","type":"string"},{"const":"closed","type":"string"},{"const":"reviewed","type":"string"},{"const":"approved","type":"string"}]},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"reason":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"approvalBody":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"approvalDecisionRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","toStatus","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"toStatus":{"anyOf":[{"const":"open","type":"string"},{"const":"closing","type":"string"},{"const":"closed","type":"string"},{"const":"reviewed","type":"string"},{"const":"approved","type":"string"}]},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"reason":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]},"approvalBody":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"approvalDecisionRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/period/set-lock":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerPeriodSet-lock","tags":["Ledger"],"summary":"Set or clear the date lock (no postings on or before it)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","lockedUntil"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"lockedUntil":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-03-31"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","lockedUntil"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"lockedUntil":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-03-31"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","lockedUntil"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"lockedUntil":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-03-31"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/journal/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"format":"numeric","default":0,"type":"string"},{"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2027-01-15"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateFrom","required":false},{"examples":["2027-01-15"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateTo","required":false},{"schema":{"type":"string","maxLength":16},"in":"query","name":"accountCode","required":false},{"schema":{"type":"string","maxLength":32},"in":"query","name":"sourceType","required":false},{"schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"posted","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"const":"auto","type":"string"},{"const":"suggestion","type":"string"},{"const":"manual","type":"string"},{"const":"backfill","type":"string"},{"const":"closing","type":"string"},{"const":"opening","type":"string"}]},"in":"query","name":"origin","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"query","required":false},{"description":"DataGrid fulltext (same as `query`).","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Number; blank or invalid = no filter.","schema":{"type":"string","maxLength":32},"in":"query","name":"amountMin","required":false},{"description":"Number; blank or invalid = no filter.","schema":{"type":"string","maxLength":32},"in":"query","name":"amountMax","required":false},{"schema":{"type":"string"},"in":"query","name":"onlyReversals","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"description":"Clamped to the DataGrid maximum.","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Clamped to the DataGrid maximum.","type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerJournalList","tags":["Ledger"],"summary":"Journal entries with filters","responses":{"200":{}}}},"/bff/ledger/journal/detail":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Journal entry external id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerJournalDetail","tags":["Ledger"],"summary":"Journal entry with lines, reversal links and change history","responses":{"200":{}}}},"/bff/ledger/journal/reverse-plan":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Journal entry external id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true},{"examples":["2027-01-15"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"date","required":false}],"operationId":"getBffLedgerJournalReverse-plan","tags":["Ledger"],"summary":"Where a reversal would be posted","responses":{"200":{}}}},"/bff/ledger/journal/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryNo"]}}}}},"operationId":"postBffLedgerJournalCreate","tags":["Ledger"],"summary":"Create a manual journal entry (draft or posted)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","entryDate","lines","post"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},"documentDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","side","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"examples":["211"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"}]},"isRedStorno":{"type":"boolean"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"partnerId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"description":"Dimension value ids, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"post":{"description":"true = post now, false = save as draft (koncept).","type":"boolean"},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","entryDate","lines","post"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},"documentDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","side","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"examples":["211"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"}]},"isRedStorno":{"type":"boolean"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"partnerId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"description":"Dimension value ids, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"post":{"description":"true = post now, false = save as draft (koncept).","type":"boolean"},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","entryDate","lines","post"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},"documentDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","side","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"examples":["211"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"}]},"isRedStorno":{"type":"boolean"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"partnerId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"description":"Dimension value ids, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"post":{"description":"true = post now, false = save as draft (koncept).","type":"boolean"},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]}}}}}}}},"/bff/ledger/journal/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryNo"]}}}}},"operationId":"postBffLedgerJournalUpdate","tags":["Ledger"],"summary":"Update a draft, post it, or rewrite a posted manual entry in an open period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","entryDate","lines","post","id","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},"documentDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","side","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"examples":["211"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"}]},"isRedStorno":{"type":"boolean"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"partnerId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"description":"Dimension value ids, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"post":{"description":"true = post now, false = save as draft (koncept).","type":"boolean"},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","entryDate","lines","post","id","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},"documentDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","side","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"examples":["211"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"}]},"isRedStorno":{"type":"boolean"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"partnerId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"description":"Dimension value ids, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"post":{"description":"true = post now, false = save as draft (koncept).","type":"boolean"},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","entryDate","lines","post","id","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},"documentDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"documentNo":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","side","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"examples":["211"],"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"}]},"isRedStorno":{"type":"boolean"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"partnerId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"description":"Dimension value ids, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"post":{"description":"true = post now, false = save as draft (koncept).","type":"boolean"},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}}}},"/bff/ledger/journal/post":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryNo"]}}}}},"operationId":"postBffLedgerJournalPost","tags":["Ledger"],"summary":"Post a draft","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"seriesCode":{"description":"Journal agenda: ID internal documents (default), CR accruals and deferrals, OP valuation allowances.","anyOf":[{"const":"ID","type":"string"},{"const":"CR","type":"string"},{"const":"OP","type":"string"}]}}}}}}}},"/bff/ledger/journal/reverse":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"type":"string"},"date":{"type":"string"}},"required":["success","id","entryNo","date"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"type":"string"},"date":{"type":"string"}},"required":["success","id","entryNo","date"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryNo":{"type":"string"},"date":{"type":"string"}},"required":["success","id","entryNo","date"]}}}}},"operationId":"postBffLedgerJournalReverse","tags":["Ledger"],"summary":"Reverse a posted entry (storno)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","rowVersion","mode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"mode":{"anyOf":[{"const":"red","type":"string"},{"const":"swap","type":"string"}]},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","rowVersion","mode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"mode":{"anyOf":[{"const":"red","type":"string"},{"const":"swap","type":"string"}]},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","rowVersion","mode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"},"rowVersion":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]},"mode":{"anyOf":[{"const":"red","type":"string"},{"const":"swap","type":"string"}]},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/journal/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerJournalDelete","tags":["Ledger"],"summary":"Delete a draft","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Journal entry external id.","type":"string"}}}}}}}},"/bff/ledger/journal/invariants":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerJournalInvariants","tags":["Ledger"],"summary":"Ledger integrity checks","responses":{"200":{}}}},"/bff/ledger/report/trial-balance":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"minimum":1900,"maximum":2999,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1900,"maximum":2999,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"afterClosing","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"analytics","required":false}],"operationId":"getBffLedgerReportTrial-balance","tags":["Ledger"],"summary":"Trial balance (obratová předvaha) with control equations","responses":{"200":{}}}},"/bff/ledger/report/general-ledger":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"minimum":1900,"maximum":2999,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1900,"maximum":2999,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"afterClosing","required":false}],"operationId":"getBffLedgerReportGeneral-ledger","tags":["Ledger"],"summary":"General ledger (hlavní kniha) with monthly turnovers","responses":{"200":{}}}},"/bff/ledger/report/account-statement":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"minimum":1900,"maximum":2999,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1900,"maximum":2999,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"afterClosing","required":false},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"accountId","required":true},{"schema":{"type":"string","maxLength":16},"in":"query","name":"counter","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":1000,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":1000,"type":"number"}]},"in":"query","name":"limit","required":false},{"description":"`true` = header, totals and children only (lines come from `/lines`).","schema":{"type":"string"},"in":"query","name":"withoutLines","required":false}],"operationId":"getBffLedgerReportAccount-statement","tags":["Ledger"],"summary":"Account statement (opis účtu) with running balance and counter-account totals","responses":{"200":{}}}},"/bff/ledger/report/account-statement/lines":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"minimum":1900,"maximum":2999,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1900,"maximum":2999,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-03-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"anyOf":[{"type":"boolean"},{"format":"boolean","default":false,"type":"string"}]},"in":"query","name":"afterClosing","required":false},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"accountId","required":true},{"schema":{"type":"string","maxLength":16},"in":"query","name":"counter","required":false},{"description":"DataGrid sort; only `entryDate:asc|desc` (chronological) is honoured.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerReportAccount-statementLines","tags":["Ledger"],"summary":"Account statement lines (DataGrid page) with the running balance of the whole statement","responses":{"200":{}}}},"/bff/ledger/document/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","maxLength":32},"in":"query","name":"kind","required":false},{"schema":{"anyOf":[{"const":"issued","type":"string"},{"const":"received","type":"string"},{"const":"internal","type":"string"}]},"in":"query","name":"direction","required":false},{"schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"ready","type":"string"},{"const":"blocked","type":"string"},{"const":"posted","type":"string"},{"const":"cancelled","type":"string"},{"const":"voided","type":"string"}]},"in":"query","name":"status","required":false},{"examples":["2027-01-15"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateFrom","required":false},{"examples":["2027-01-15"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateTo","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"query","required":false},{"description":"DataGrid fulltext (same as `query`).","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string","maxLength":48},"in":"query","name":"originTable","required":false},{"schema":{"type":"string"},"in":"query","name":"onlyWithFindings","required":false},{"schema":{"type":"string"},"in":"query","name":"onlyOverridden","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"description":"Clamped to the DataGrid maximum.","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Clamped to the DataGrid maximum.","type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerDocumentList","tags":["Ledger"],"summary":"Accounting documents with filters","responses":{"200":{}}}},"/bff/ledger/document/detail":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Document external id.","schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerDocumentDetail","tags":["Ledger"],"summary":"Document with lines, VAT rows, findings, origin and history","responses":{"200":{}}}},"/bff/ledger/document/override":{"post":{"parameters":[],"operationId":"postBffLedgerDocumentOverride","tags":["Ledger"],"summary":"Save or clear the manual override of a document (survives resync)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","override"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"},"override":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"reason":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","override"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"},"override":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"reason":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","override"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"},"override":{"anyOf":[{"type":"object","patternProperties":{"^(.*)$":{}}},{"type":"null"}]},"reason":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/document/resync":{"post":{"parameters":[],"operationId":"postBffLedgerDocumentResync","tags":["Ledger"],"summary":"Rebuild a document from its legacy source","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/document/sync":{"post":{"parameters":[],"operationId":"postBffLedgerDocumentSync","tags":["Ledger"],"summary":"Run one bounded sweep batch of legacy sources now","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/finding/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"open","type":"string"},{"const":"resolved","type":"string"},{"const":"ignored","type":"string"},{"const":"all","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"const":"info","type":"string"},{"const":"warning","type":"string"},{"const":"blocking","type":"string"}]},"in":"query","name":"severity","required":false},{"schema":{"anyOf":[{"const":"missing_items","type":"string"},{"const":"missing_fx_rate","type":"string"},{"const":"vat_unclassified","type":"string"},{"const":"missing_amounts","type":"string"},{"const":"posted_document_changed","type":"string"},{"const":"header_lines_mismatch","type":"string"},{"const":"duplicate_number","type":"string"},{"const":"vat_on_non_payer","type":"string"},{"const":"vat_amount_mismatch","type":"string"},{"const":"missing_partner","type":"string"},{"const":"zero_rate_unclassified","type":"string"},{"const":"float_noise","type":"string"},{"const":"paid_status_mismatch","type":"string"},{"const":"uncollectible","type":"string"}]},"in":"query","name":"code","required":false},{"schema":{"type":"string","maxLength":48},"in":"query","name":"originTable","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerFindingList","tags":["Ledger"],"summary":"Data-quality findings on legacy sources","responses":{"200":{}}}},"/bff/ledger/finding/set-status":{"post":{"parameters":[],"operationId":"postBffLedgerFindingSet-status","tags":["Ledger"],"summary":"Resolve, ignore or reopen a finding","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","status"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"},"status":{"anyOf":[{"const":"resolved","type":"string"},{"const":"ignored","type":"string"},{"const":"open","type":"string"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","status"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"},"status":{"anyOf":[{"const":"resolved","type":"string"},{"const":"ignored","type":"string"},{"const":"open","type":"string"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","status"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"description":"Document external id.","type":"string"},"status":{"anyOf":[{"const":"resolved","type":"string"},{"const":"ignored","type":"string"},{"const":"open","type":"string"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/vat/ledger":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2027-01"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"in":"query","name":"period","required":true},{"schema":{"anyOf":[{"const":"issued","type":"string"},{"const":"received","type":"string"}]},"in":"query","name":"direction","required":false},{"schema":{"anyOf":[{"const":"tax_point","type":"string"},{"const":"claimed","type":"string"}]},"in":"query","name":"basis","required":false}],"operationId":"getBffLedgerVatLedger","tags":["Ledger"],"summary":"VAT ledger (evidence pro DPH) of a month with DPH-row and KH recaps","responses":{"200":{}}}},"/bff/ledger/vat/ledger/entries":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2027-01"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"in":"query","name":"period","required":true},{"schema":{"anyOf":[{"const":"issued","type":"string"},{"const":"received","type":"string"}]},"in":"query","name":"direction","required":false},{"schema":{"anyOf":[{"const":"tax_point","type":"string"},{"const":"claimed","type":"string"}]},"in":"query","name":"basis","required":false},{"description":"Document number, partner, VAT id or classification.","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerVatLedgerEntries","tags":["Ledger"],"summary":"VAT ledger entries of a month (DataGrid page); totals and recaps stay on `/vat/ledger`","responses":{"200":{}}}},"/bff/ledger/automation/overview":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerAutomationOverview","tags":["Ledger"],"summary":"Automation tiles, policy and active bulk job","responses":{"200":{}}}},"/bff/ledger/automation/suggestion-list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"open","type":"string"},{"const":"pending","type":"string"},{"const":"needs_input","type":"string"},{"const":"blocked","type":"string"},{"const":"approved","type":"string"},{"const":"rejected","type":"string"},{"const":"auto_posted","type":"string"},{"const":"superseded","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"query","required":false},{"schema":{"anyOf":[{"const":"document.issued","type":"string"},{"const":"document.received","type":"string"},{"const":"document.expense","type":"string"},{"const":"document.advance","type":"string"},{"const":"payment.in","type":"string"},{"const":"payment.out","type":"string"}]},"in":"query","name":"operationType","required":false},{"schema":{"type":"string","maxLength":48},"in":"query","name":"reasonCode","required":false},{"description":"DataGrid fulltext (same as `query`).","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"description":"Clamped to the DataGrid maximum.","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Clamped to the DataGrid maximum.","type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerAutomationSuggestion-list","tags":["Ledger"],"summary":"Posting suggestions (open = pending / needs input / blocked)","responses":{"200":{}}}},"/bff/ledger/automation/suggestion-approve":{"post":{"parameters":[],"operationId":"postBffLedgerAutomationSuggestion-approve","tags":["Ledger"],"summary":"Approve one or more suggestions (posts each document as it stands now)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","ids"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","ids"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","ids"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/automation/suggestion-reject":{"post":{"parameters":[],"operationId":"postBffLedgerAutomationSuggestion-reject","tags":["Ledger"],"summary":"Reject a suggestion","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"note":{"minLength":1,"maxLength":1000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"note":{"minLength":1,"maxLength":1000,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"note":{"minLength":1,"maxLength":1000,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/automation/queue":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"document_blocked","type":"string"},{"const":"source_changed","type":"string"},{"const":"rejected","type":"string"},{"const":"policy_off","type":"string"},{"const":"job_failed","type":"string"},{"const":"not_processed","type":"string"}]},"in":"query","name":"reason","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"query","required":false},{"description":"DataGrid fulltext (same as `query`).","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"description":"Clamped to the DataGrid maximum.","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Clamped to the DataGrid maximum.","type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerAutomationQueue","tags":["Ledger"],"summary":"\"K doúčtování\": unposted documents without an open suggestion","responses":{"200":{}}}},"/bff/ledger/automation/policy":{"post":{"parameters":[],"operationId":"postBffLedgerAutomationPolicy","tags":["Ledger"],"summary":"Set or clear the automation level of an operation type","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","operationType","level"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"operationType":{"anyOf":[{"const":"document.issued","type":"string"},{"const":"document.received","type":"string"},{"const":"document.expense","type":"string"},{"const":"document.advance","type":"string"},{"const":"payment.in","type":"string"},{"const":"payment.out","type":"string"}]},"level":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"auto","type":"string"},{"type":"null"}]},"amountCap":{"anyOf":[{"minimum":0.01,"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","operationType","level"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"operationType":{"anyOf":[{"const":"document.issued","type":"string"},{"const":"document.received","type":"string"},{"const":"document.expense","type":"string"},{"const":"document.advance","type":"string"},{"const":"payment.in","type":"string"},{"const":"payment.out","type":"string"}]},"level":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"auto","type":"string"},{"type":"null"}]},"amountCap":{"anyOf":[{"minimum":0.01,"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","operationType","level"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"operationType":{"anyOf":[{"const":"document.issued","type":"string"},{"const":"document.received","type":"string"},{"const":"document.expense","type":"string"},{"const":"document.advance","type":"string"},{"const":"payment.in","type":"string"},{"const":"payment.out","type":"string"}]},"level":{"anyOf":[{"const":"off","type":"string"},{"const":"suggest","type":"string"},{"const":"auto","type":"string"},{"type":"null"}]},"amountCap":{"anyOf":[{"minimum":0.01,"type":"number"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/automation/run":{"post":{"parameters":[],"operationId":"postBffLedgerAutomationRun","tags":["Ledger"],"summary":"Evaluate all unposted documents now (bounded to 300)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/automation/retry-failed":{"post":{"parameters":[],"operationId":"postBffLedgerAutomationRetry-failed","tags":["Ledger"],"summary":"Re-queue failed posting jobs","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/posting/preview":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerPostingPreview","tags":["Ledger"],"summary":"Entry the document would get now + automation decision","responses":{"200":{}}}},"/bff/ledger/posting/post":{"post":{"parameters":[],"operationId":"postBffLedgerPostingPost","tags":["Ledger"],"summary":"Post a document now","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/posting/unpost":{"post":{"parameters":[],"operationId":"postBffLedgerPostingUnpost","tags":["Ledger"],"summary":"Reverse the entry of a posted document; the document returns to ready","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/posting/repost":{"post":{"parameters":[],"operationId":"postBffLedgerPostingRepost","tags":["Ledger"],"summary":"Apply the current source to a posted document (rewrite or storno + new entry)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/rule/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerRuleList","tags":["Ledger"],"summary":"Předkontace: global seed vs. entity override","responses":{"200":{}}}},"/bff/ledger/rule/save":{"post":{"parameters":[],"operationId":"postBffLedgerRuleSave","tags":["Ledger"],"summary":"Save the entity override of a posting rule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","ruleKey"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ruleKey":{"minLength":1,"maxLength":64,"type":"string"},"debit":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","ruleKey"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ruleKey":{"minLength":1,"maxLength":64,"type":"string"},"debit":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","ruleKey"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ruleKey":{"minLength":1,"maxLength":64,"type":"string"},"debit":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"credit":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/rule/reset":{"post":{"parameters":[],"operationId":"postBffLedgerRuleReset","tags":["Ledger"],"summary":"Reset a posting rule to the default","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","ruleKey"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ruleKey":{"minLength":1,"maxLength":64,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","ruleKey"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ruleKey":{"minLength":1,"maxLength":64,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","ruleKey"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"ruleKey":{"minLength":1,"maxLength":64,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/backfill/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerBackfillList","tags":["Ledger"],"summary":"Bulk posting jobs","responses":{"200":{}}}},"/bff/ledger/backfill/start":{"post":{"parameters":[],"operationId":"postBffLedgerBackfillStart","tags":["Ledger"],"summary":"Start a bulk posting job (first batch runs immediately)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"dry_run","type":"string"},{"const":"execute","type":"string"}]},"dateFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"dateTo":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"dry_run","type":"string"},{"const":"execute","type":"string"}]},"dateFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"dateTo":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"dry_run","type":"string"},{"const":"execute","type":"string"}]},"dateFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]},"dateTo":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/backfill/cancel":{"post":{"parameters":[],"operationId":"postBffLedgerBackfillCancel","tags":["Ledger"],"summary":"Cancel a running bulk posting job","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"unmatched","type":"string"},{"const":"partial","type":"string"},{"const":"settled","type":"string"},{"const":"over","type":"string"},{"const":"proposed","type":"string"}]},"in":"query","name":"state","required":false},{"schema":{"anyOf":[{"const":"active","type":"string"},{"const":"ignored","type":"string"},{"const":"void","type":"string"},{"const":"all","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"const":"posted","type":"string"},{"const":"unposted","type":"string"},{"const":"attention","type":"string"}]},"in":"query","name":"posting","required":false},{"schema":{"anyOf":[{"const":"bank","type":"string"},{"const":"gateway","type":"string"},{"const":"cash","type":"string"},{"const":"card","type":"string"},{"const":"cod","type":"string"},{"const":"credit","type":"string"},{"const":"voucher","type":"string"},{"const":"offset","type":"string"}]},"in":"query","name":"kind","required":false},{"schema":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"in":"query","name":"direction","required":false},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"moneyAccountId","required":false},{"examples":["2027-01-15"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateFrom","required":false},{"examples":["2027-01-15"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateTo","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"query","required":false},{"description":"DataGrid fulltext (same as `query`).","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"description":"Clamped to the DataGrid maximum.","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Clamped to the DataGrid maximum.","type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerPaymentList","tags":["Ledger"],"summary":"Payments with allocation state, posting state and facets","responses":{"200":{}}}},"/bff/ledger/payment/detail":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerPaymentDetail","tags":["Ledger"],"summary":"Payment with allocations and posting preview","responses":{"200":{}}}},"/bff/ledger/payment/candidate-list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true},{"schema":{"type":"string","maxLength":100},"in":"query","name":"query","required":false}],"operationId":"getBffLedgerPaymentCandidate-list","tags":["Ledger"],"summary":"Documents the payment can be allocated to, best match first","responses":{"200":{}}}},"/bff/ledger/payment/settle":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentSettle","tags":["Ledger"],"summary":"Allocate a payment to a document manually (locked against automatic matching)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","documentId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"documentId":{"minLength":24,"maxLength":24,"type":"string"},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","documentId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"documentId":{"minLength":24,"maxLength":24,"type":"string"},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","documentId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"documentId":{"minLength":24,"maxLength":24,"type":"string"},"amount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/settlement-confirm":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentSettlement-confirm","tags":["Ledger"],"summary":"Confirm a proposed match","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/settlement-reject":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentSettlement-reject","tags":["Ledger"],"summary":"Remove an allocation (automatic ones are never proposed again)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/ignore":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentIgnore","tags":["Ledger"],"summary":"Ignore a payment (internal transfer, not ours) or bring it back","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","ignored"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"ignored":{"type":"boolean"},"reason":{"anyOf":[{"minLength":1,"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","ignored"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"ignored":{"type":"boolean"},"reason":{"anyOf":[{"minLength":1,"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","ignored"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"ignored":{"type":"boolean"},"reason":{"anyOf":[{"minLength":1,"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/rematch":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentRematch","tags":["Ledger"],"summary":"Run automatic matching of one payment again","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/post":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentPost","tags":["Ledger"],"summary":"Post a payment now","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/classify":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentClassify","tags":["Ledger"],"summary":"Choose the counter-account of the unidentified part of a bank payment (null = back to the rules)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"accountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"accountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"accountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/unpost":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentUnpost","tags":["Ledger"],"summary":"Reverse the entry of a payment","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/repost":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentRepost","tags":["Ledger"],"summary":"Apply current allocations to the posted entry","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"minLength":1,"maxLength":1000,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-15"],"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/payment/sync":{"post":{"parameters":[],"operationId":"postBffLedgerPaymentSync","tags":["Ledger"],"summary":"Import new payments, match and post now (one bounded batch)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/document/settlement-list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerDocumentSettlement-list","tags":["Ledger"],"summary":"Payments allocated to a document and its open amount","responses":{"200":{}}}},"/bff/ledger/saldo":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2027-01-15"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false},{"schema":{"anyOf":[{"const":"receivable","type":"string"},{"const":"payable","type":"string"}]},"in":"query","name":"side","required":false},{"schema":{"type":"string","maxLength":16},"in":"query","name":"accountCode","required":false},{"schema":{"anyOf":[{"const":"not_due","type":"string"},{"const":"d1_30","type":"string"},{"const":"d31_60","type":"string"},{"const":"d61_90","type":"string"},{"const":"d91_180","type":"string"},{"const":"d181_365","type":"string"},{"const":"over_365","type":"string"},{"const":"overdue","type":"string"},{"const":"unassigned","type":"string"}]},"in":"query","name":"bucket","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"query","required":false},{"schema":{"anyOf":[{"const":"document","type":"string"},{"const":"partner","type":"string"}]},"in":"query","name":"groupBy","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"schema":{"minimum":1,"maximum":500,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerSaldo","tags":["Ledger"],"summary":"Saldokonto: open items from the journal with aging","responses":{"200":{}}}},"/bff/ledger/vat/overview":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerVatOverview","tags":["Ledger"],"summary":"VAT filing calendar with deadlines and filing states","responses":{"200":{}}}},"/bff/ledger/vat/period":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"dp3","type":"string"},{"const":"kh","type":"string"},{"const":"sh","type":"string"}]},"in":"query","name":"kind","required":true},{"examples":["2027-02","2027-Q1"],"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2]|Q[1-4])$"},"in":"query","name":"period","required":true}],"operationId":"getBffLedgerVatPeriod","tags":["Ledger"],"summary":"Live computation, filings, staleness and clearing plan of one VAT form and period","responses":{"200":{}}}},"/bff/ledger/vat/xml":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerVatXml","tags":["Ledger"],"summary":"Download the EPO XML of a VAT filing","responses":{"200":{}}}},"/bff/ledger/vat/draft":{"post":{"parameters":[],"operationId":"postBffLedgerVatDraft","tags":["Ledger"],"summary":"Create or regenerate the draft of a VAT filing from the VAT ledger","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","kind","period","filingType"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"dp3","type":"string"},{"const":"kh","type":"string"},{"const":"sh","type":"string"}]},"period":{"pattern":"^\\d{4}-(0[1-9]|1[0-2]|Q[1-4])$","examples":["2027-02","2027-Q1"],"type":"string"},"filingType":{"anyOf":[{"const":"regular","type":"string"},{"const":"corrective","type":"string"},{"const":"supplementary","type":"string"}]},"discoveredOn":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-03-20"],"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","kind","period","filingType"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"dp3","type":"string"},{"const":"kh","type":"string"},{"const":"sh","type":"string"}]},"period":{"pattern":"^\\d{4}-(0[1-9]|1[0-2]|Q[1-4])$","examples":["2027-02","2027-Q1"],"type":"string"},"filingType":{"anyOf":[{"const":"regular","type":"string"},{"const":"corrective","type":"string"},{"const":"supplementary","type":"string"}]},"discoveredOn":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-03-20"],"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","kind","period","filingType"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"dp3","type":"string"},{"const":"kh","type":"string"},{"const":"sh","type":"string"}]},"period":{"pattern":"^\\d{4}-(0[1-9]|1[0-2]|Q[1-4])$","examples":["2027-02","2027-Q1"],"type":"string"},"filingType":{"anyOf":[{"const":"regular","type":"string"},{"const":"corrective","type":"string"},{"const":"supplementary","type":"string"}]},"discoveredOn":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-03-20"],"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/vat/file":{"post":{"parameters":[],"operationId":"postBffLedgerVatFile","tags":["Ledger"],"summary":"Mark a VAT filing draft as filed (books the VAT clearing for DP3 and locks the period)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"filedOn":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-03-20"],"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"skipClearing":{"type":"boolean"},"lockPeriod":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"filedOn":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-03-20"],"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"skipClearing":{"type":"boolean"},"lockPeriod":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"filedOn":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-03-20"],"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"skipClearing":{"type":"boolean"},"lockPeriod":{"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/ledger/vat/cancel":{"post":{"parameters":[],"operationId":"postBffLedgerVatCancel","tags":["Ledger"],"summary":"Discard a draft or withdraw a filing recorded by mistake","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"reason":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/vat/identity":{"post":{"parameters":[],"operationId":"postBffLedgerVatIdentity","tags":["Ledger"],"summary":"Update the taxpayer identity used in the VAT form header (VetaP)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"taxpayerType":{"anyOf":[{"const":"P","type":"string"},{"const":"F","type":"string"},{"type":"null"}]},"taxOfficeCode":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"taxWorkplaceCode":{"anyOf":[{"maxLength":4,"type":"string"},{"type":"null"}]},"czNace":{"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"filerFirstName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerLastName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerPosition":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerPhone":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}]},"filerEmail":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"taxpayerType":{"anyOf":[{"const":"P","type":"string"},{"const":"F","type":"string"},{"type":"null"}]},"taxOfficeCode":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"taxWorkplaceCode":{"anyOf":[{"maxLength":4,"type":"string"},{"type":"null"}]},"czNace":{"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"filerFirstName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerLastName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerPosition":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerPhone":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}]},"filerEmail":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"taxpayerType":{"anyOf":[{"const":"P","type":"string"},{"const":"F","type":"string"},{"type":"null"}]},"taxOfficeCode":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"taxWorkplaceCode":{"anyOf":[{"maxLength":4,"type":"string"},{"type":"null"}]},"czNace":{"anyOf":[{"maxLength":8,"type":"string"},{"type":"null"}]},"filerFirstName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerLastName":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerPosition":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"filerPhone":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}]},"filerEmail":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/statement/balance-sheet":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"full","type":"string"},{"const":"small","type":"string"},{"const":"micro","type":"string"}]},"in":"query","name":"scope","required":false},{"schema":{"minimum":1990,"maximum":2100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1990,"maximum":2100,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2027-12-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"operationId":"getBffLedgerStatementBalance-sheet","tags":["Ledger"],"summary":"Balance sheet (rozvaha) with gross / correction / net and the comparative column","responses":{"200":{}}}},"/bff/ledger/statement/income-statement":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"full","type":"string"},{"const":"small","type":"string"},{"const":"micro","type":"string"}]},"in":"query","name":"scope","required":false},{"schema":{"minimum":1990,"maximum":2100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1990,"maximum":2100,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2027-12-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"operationId":"getBffLedgerStatementIncome-statement","tags":["Ledger"],"summary":"Income statement by nature (výkaz zisku a ztráty) with the comparative column","responses":{"200":{}}}},"/bff/ledger/dimension/catalog":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerDimensionCatalog","tags":["Ledger"],"summary":"Dimension types with values and rules","responses":{"200":{}}}},"/bff/ledger/dimension/report":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"typeId","required":true},{"schema":{"minimum":1990,"maximum":2100,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1990,"maximum":2100,"type":"number"}]},"in":"query","name":"fiscalYear","required":false},{"examples":["2027-01-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2027-01-31"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false}],"operationId":"getBffLedgerDimensionReport","tags":["Ledger"],"summary":"Profit and loss by the values of one dimension, with the rule audit","responses":{"200":{}}}},"/bff/ledger/dimension/type":{"post":{"parameters":[],"operationId":"postBffLedgerDimensionType","tags":["Ledger"],"summary":"Create or update a dimension type","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":30,"type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"kind":{"anyOf":[{"const":"cost_center","type":"string"},{"const":"project","type":"string"},{"const":"branch","type":"string"},{"const":"vehicle","type":"string"},{"const":"deal","type":"string"},{"const":"custom","type":"string"}]},"isActive":{"type":"boolean"},"position":{"minimum":0,"maximum":9999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":9999,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":30,"type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"kind":{"anyOf":[{"const":"cost_center","type":"string"},{"const":"project","type":"string"},{"const":"branch","type":"string"},{"const":"vehicle","type":"string"},{"const":"deal","type":"string"},{"const":"custom","type":"string"}]},"isActive":{"type":"boolean"},"position":{"minimum":0,"maximum":9999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":9999,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":30,"type":"string"},"name":{"minLength":1,"maxLength":100,"type":"string"},"kind":{"anyOf":[{"const":"cost_center","type":"string"},{"const":"project","type":"string"},{"const":"branch","type":"string"},{"const":"vehicle","type":"string"},{"const":"deal","type":"string"},{"const":"custom","type":"string"}]},"isActive":{"type":"boolean"},"position":{"minimum":0,"maximum":9999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":9999,"type":"integer"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/dimension/value":{"post":{"parameters":[],"operationId":"postBffLedgerDimensionValue","tags":["Ledger"],"summary":"Create or update a dimension value","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","typeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"typeId":{"minLength":24,"maxLength":24,"type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":50,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"parentId":{"anyOf":[{"minLength":24,"maxLength":24,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":9999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":9999,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","typeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"typeId":{"minLength":24,"maxLength":24,"type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":50,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"parentId":{"anyOf":[{"minLength":24,"maxLength":24,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":9999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":9999,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","typeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"typeId":{"minLength":24,"maxLength":24,"type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":50,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"parentId":{"anyOf":[{"minLength":24,"maxLength":24,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"position":{"minimum":0,"maximum":9999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"maximum":9999,"type":"integer"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/dimension/rule":{"post":{"parameters":[],"operationId":"postBffLedgerDimensionRule","tags":["Ledger"],"summary":"Create or update an account-mask rule of a dimension","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","typeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"typeId":{"minLength":24,"maxLength":24,"type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"accountMask":{"minLength":1,"maxLength":190,"examples":["5, 6, !59"],"type":"string"},"enforcement":{"anyOf":[{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"none","type":"string"}]},"defaultValueId":{"anyOf":[{"minLength":24,"maxLength":24,"type":"string"},{"type":"null"}]},"validFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"validTo":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","typeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"typeId":{"minLength":24,"maxLength":24,"type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"accountMask":{"minLength":1,"maxLength":190,"examples":["5, 6, !59"],"type":"string"},"enforcement":{"anyOf":[{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"none","type":"string"}]},"defaultValueId":{"anyOf":[{"minLength":24,"maxLength":24,"type":"string"},{"type":"null"}]},"validFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"validTo":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","typeId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"typeId":{"minLength":24,"maxLength":24,"type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"accountMask":{"minLength":1,"maxLength":190,"examples":["5, 6, !59"],"type":"string"},"enforcement":{"anyOf":[{"const":"error","type":"string"},{"const":"warning","type":"string"},{"const":"none","type":"string"}]},"defaultValueId":{"anyOf":[{"minLength":24,"maxLength":24,"type":"string"},{"type":"null"}]},"validFrom":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"validTo":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-01-31"],"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/dimension/line":{"post":{"parameters":[],"operationId":"postBffLedgerDimensionLine","tags":["Ledger"],"summary":"Replace the dimension values of a posted journal line","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","entryId","lineNo","valueIds"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryId":{"minLength":24,"maxLength":24,"type":"string"},"lineNo":{"minimum":1,"maximum":500,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"integer"}]},"valueIds":{"maxItems":20,"description":"The complete set of values for the line, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","entryId","lineNo","valueIds"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryId":{"minLength":24,"maxLength":24,"type":"string"},"lineNo":{"minimum":1,"maximum":500,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"integer"}]},"valueIds":{"maxItems":20,"description":"The complete set of values for the line, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["entityId","entryId","lineNo","valueIds"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"entryId":{"minLength":24,"maxLength":24,"type":"string"},"lineNo":{"minimum":1,"maximum":500,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":500,"type":"integer"}]},"valueIds":{"maxItems":20,"description":"The complete set of values for the line, one per dimension type.","type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}}}},"responses":{"200":{}}}},"/bff/ledger/journal-template/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerJournal-templateList","tags":["Ledger"],"summary":"Journal templates (recommended ones are seeded on first use)","responses":{"200":{}}}},"/bff/ledger/journal-template/save":{"post":{"parameters":[],"operationId":"postBffLedgerJournal-templateSave","tags":["Ledger"],"summary":"Create or replace a journal template, or create one from a journal entry","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","name"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"entryDescription":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"maxItems":100,"type":"array","items":{"type":"object","required":["accountCode","side"],"properties":{"label":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"defaultAmount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"fromEntryId":{"minLength":24,"maxLength":24,"type":"string"},"keepAmounts":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","name"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"entryDescription":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"maxItems":100,"type":"array","items":{"type":"object","required":["accountCode","side"],"properties":{"label":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"defaultAmount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"fromEntryId":{"minLength":24,"maxLength":24,"type":"string"},"keepAmounts":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","name"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"entryDescription":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"lines":{"maxItems":100,"type":"array","items":{"type":"object","required":["accountCode","side"],"properties":{"label":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"side":{"anyOf":[{"const":"debit","type":"string"},{"const":"credit","type":"string"}]},"defaultAmount":{"anyOf":[{"exclusiveMinimum":0,"type":"number"},{"pattern":"^[0-9 ]+([.,][0-9]{1,2})?$","type":"string"},{"type":"null"}]},"description":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}]},"dimensionValueIds":{"maxItems":20,"type":"array","items":{"minLength":24,"maxLength":24,"type":"string"}}}}},"fromEntryId":{"minLength":24,"maxLength":24,"type":"string"},"keepAmounts":{"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/ledger/journal-template/delete":{"post":{"parameters":[],"operationId":"postBffLedgerJournal-templateDelete","tags":["Ledger"],"summary":"Delete a journal template","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/journal-template/match-csv":{"post":{"parameters":[],"operationId":"postBffLedgerJournal-templateMatch-csv","tags":["Ledger"],"summary":"Pair a CSV recap (item or account; amount) with the template lines","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","csv"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"csv":{"maxLength":512000,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","csv"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"csv":{"maxLength":512000,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","csv"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"csv":{"maxLength":512000,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/bank-rule/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerBank-ruleList","tags":["Ledger"],"summary":"Bank rules with learning state, templates and waiting payments","responses":{"200":{}}}},"/bff/ledger/bank-rule/proposals":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerBank-ruleProposals","tags":["Ledger"],"summary":"Rule proposals mined from manual classifications","responses":{"200":{}}}},"/bff/ledger/bank-rule/history":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"query","name":"ruleId","required":false},{"schema":{"type":"string","maxLength":32},"in":"query","name":"eventType","required":false},{"description":"DataGrid fulltext: counterparty, account, rule, reason.","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerBank-ruleHistory","tags":["Ledger"],"summary":"Decisions and rule events, newest first","responses":{"200":{}}}},"/bff/ledger/bank-rule/save":{"post":{"parameters":[],"operationId":"postBffLedgerBank-ruleSave","tags":["Ledger"],"summary":"Create or update a bank rule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","name","direction","accountCode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":120,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"counterpartyAccount":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"counterpartyBank":{"anyOf":[{"maxLength":4,"type":"string"},{"type":"null"}]},"counterpartyPrefix":{"anyOf":[{"maxLength":6,"type":"string"},{"type":"null"}]},"variableSymbol":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"messageContains":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"amountMin":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"amountMax":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"entryDescription":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"priority":{"minimum":1,"maximum":999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":999,"type":"integer"}]},"isActive":{"type":"boolean"},"origin":{"anyOf":[{"const":"manual","type":"string"},{"const":"template","type":"string"},{"const":"mined","type":"string"}]},"templateKey":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","name","direction","accountCode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":120,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"counterpartyAccount":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"counterpartyBank":{"anyOf":[{"maxLength":4,"type":"string"},{"type":"null"}]},"counterpartyPrefix":{"anyOf":[{"maxLength":6,"type":"string"},{"type":"null"}]},"variableSymbol":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"messageContains":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"amountMin":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"amountMax":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"entryDescription":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"priority":{"minimum":1,"maximum":999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":999,"type":"integer"}]},"isActive":{"type":"boolean"},"origin":{"anyOf":[{"const":"manual","type":"string"},{"const":"template","type":"string"},{"const":"mined","type":"string"}]},"templateKey":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","name","direction","accountCode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"name":{"minLength":1,"maxLength":120,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"counterpartyAccount":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"counterpartyBank":{"anyOf":[{"maxLength":4,"type":"string"},{"type":"null"}]},"counterpartyPrefix":{"anyOf":[{"maxLength":6,"type":"string"},{"type":"null"}]},"variableSymbol":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}]},"messageContains":{"anyOf":[{"maxLength":120,"type":"string"},{"type":"null"}]},"amountMin":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"amountMax":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"currency":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}]},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"entryDescription":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"priority":{"minimum":1,"maximum":999,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"maximum":999,"type":"integer"}]},"isActive":{"type":"boolean"},"origin":{"anyOf":[{"const":"manual","type":"string"},{"const":"template","type":"string"},{"const":"mined","type":"string"}]},"templateKey":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/bank-rule/delete":{"post":{"parameters":[],"operationId":"postBffLedgerBank-ruleDelete","tags":["Ledger"],"summary":"Delete a bank rule","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/ledger/bank-rule/mode":{"post":{"parameters":[],"operationId":"postBffLedgerBank-ruleMode","tags":["Ledger"],"summary":"Promote a bank rule to automatic posting or demote it to suggestions","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","mode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"mode":{"anyOf":[{"const":"suggest","type":"string"},{"const":"auto","type":"string"}]},"reason":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","mode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"mode":{"anyOf":[{"const":"suggest","type":"string"},{"const":"auto","type":"string"}]},"reason":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","mode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":24,"maxLength":24,"type":"string"},"mode":{"anyOf":[{"const":"suggest","type":"string"},{"const":"auto","type":"string"}]},"reason":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/closing/state":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Fiscal period external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"periodId","required":true}],"operationId":"getBffLedgerClosingState","tags":["Ledger"],"summary":"Closing wizard state: steps, findings, result preview, FX positions","responses":{"200":{}}}},"/bff/ledger/closing/precheck":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"ok":{"type":"boolean"},"findingCount":{"type":"number"}},"required":["success","ok","findingCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"ok":{"type":"boolean"},"findingCount":{"type":"number"}},"required":["success","ok","findingCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"ok":{"type":"boolean"},"findingCount":{"type":"number"}},"required":["success","ok","findingCount"]}}}}},"operationId":"postBffLedgerClosingPrecheck","tags":["Ledger"],"summary":"Run the closing precheck","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"}}}}}}}},"/bff/ledger/closing/step-status":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerClosingStep-status","tags":["Ledger"],"summary":"Confirm, skip or reopen a closing step","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId","step","status"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"step":{"anyOf":[{"const":"precheck","type":"string"},{"const":"fx_revaluation","type":"string"},{"const":"accruals","type":"string"},{"const":"depreciation","type":"string"},{"const":"provisions","type":"string"},{"const":"inventory","type":"string"},{"const":"income_tax","type":"string"},{"const":"close_books","type":"string"},{"const":"open_next","type":"string"},{"const":"profit_distribution","type":"string"}]},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"done","type":"string"},{"const":"skipped","type":"string"}]},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId","step","status"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"step":{"anyOf":[{"const":"precheck","type":"string"},{"const":"fx_revaluation","type":"string"},{"const":"accruals","type":"string"},{"const":"depreciation","type":"string"},{"const":"provisions","type":"string"},{"const":"inventory","type":"string"},{"const":"income_tax","type":"string"},{"const":"close_books","type":"string"},{"const":"open_next","type":"string"},{"const":"profit_distribution","type":"string"}]},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"done","type":"string"},{"const":"skipped","type":"string"}]},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId","step","status"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"step":{"anyOf":[{"const":"precheck","type":"string"},{"const":"fx_revaluation","type":"string"},{"const":"accruals","type":"string"},{"const":"depreciation","type":"string"},{"const":"provisions","type":"string"},{"const":"inventory","type":"string"},{"const":"income_tax","type":"string"},{"const":"close_books","type":"string"},{"const":"open_next","type":"string"},{"const":"profit_distribution","type":"string"}]},"status":{"anyOf":[{"const":"pending","type":"string"},{"const":"done","type":"string"},{"const":"skipped","type":"string"}]},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/closing/fx-revaluation":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}}}}},"operationId":"postBffLedgerClosingFx-revaluation","tags":["Ledger"],"summary":"Post the FX revaluation at the balance-sheet date","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId","rates","reverseNextYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"rates":{"type":"object","patternProperties":{"^[A-Z]{3}$":{"exclusiveMinimum":0,"type":"number"}}},"reverseNextYear":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId","rates","reverseNextYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"rates":{"type":"object","patternProperties":{"^[A-Z]{3}$":{"exclusiveMinimum":0,"type":"number"}}},"reverseNextYear":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId","rates","reverseNextYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"rates":{"type":"object","patternProperties":{"^[A-Z]{3}$":{"exclusiveMinimum":0,"type":"number"}}},"reverseNextYear":{"type":"boolean"}}}}}}}},"/bff/ledger/closing/income-tax":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}}}}},"operationId":"postBffLedgerClosingIncome-tax","tags":["Ledger"],"summary":"Post the income tax for the year (591 / 341)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId","amount"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"amount":{"minimum":0,"type":"number"},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId","amount"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"amount":{"minimum":0,"type":"number"},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId","amount"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"amount":{"minimum":0,"type":"number"},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/closing/close-books":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}}}}},"operationId":"postBffLedgerClosingClose-books","tags":["Ledger"],"summary":"Post the closing entry and close the period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"rowVersion":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"rowVersion":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId","rowVersion"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"rowVersion":{"type":"number"}}}}}}}},"/bff/ledger/closing/open-next":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}}}}},"operationId":"postBffLedgerClosingOpen-next","tags":["Ledger"],"summary":"Post the opening entry of the next period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"}}}}}}}},"/bff/ledger/closing/revert-open-next":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerClosingRevert-open-next","tags":["Ledger"],"summary":"Reverse the opening entry of the next period","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}}}}}},"/bff/ledger/closing/profit-distribution":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryId":{"anyOf":[{"type":"string"},{"type":"null"}]},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryId","entryNo"]}}}}},"operationId":"postBffLedgerClosingProfit-distribution","tags":["Ledger"],"summary":"Distribute the approved result from 431","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId","date","allocations"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-06-30"],"type":"string"},"allocations":{"maxItems":20,"type":"array","items":{"type":"object","required":["accountCode","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"}}}},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId","date","allocations"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-06-30"],"type":"string"},"allocations":{"maxItems":20,"type":"array","items":{"type":"object","required":["accountCode","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"}}}},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId","date","allocations"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"description":"Fiscal period external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2027-06-30"],"type":"string"},"allocations":{"maxItems":20,"type":"array","items":{"type":"object","required":["accountCode","amount"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"}}}},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/check/runs":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"integrity","type":"string"},{"const":"monthly","type":"string"}]},"in":"query","name":"kind","required":true},{"schema":{"anyOf":[{"const":"ok","type":"string"},{"const":"warning","type":"string"},{"const":"error","type":"string"}]},"in":"query","name":"status","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"description":"Clamped to the DataGrid maximum.","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Clamped to the DataGrid maximum.","type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerCheckRuns","tags":["Ledger"],"summary":"Check run history (monthly: latest run per month) with paging and the newest run","responses":{"200":{}}}},"/bff/ledger/check/run":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"status":{"type":"string"},"errorCount":{"type":"number"},"warningCount":{"type":"number"}},"required":["success","id","status","errorCount","warningCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"status":{"type":"string"},"errorCount":{"type":"number"},"warningCount":{"type":"number"}},"required":["success","id","status","errorCount","warningCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"status":{"type":"string"},"errorCount":{"type":"number"},"warningCount":{"type":"number"}},"required":["success","id","status","errorCount","warningCount"]}}}}},"operationId":"postBffLedgerCheckRun","tags":["Ledger"],"summary":"Run the integrity check or the monthly check now","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"integrity","type":"string"},{"const":"monthly","type":"string"}]},"month":{"anyOf":[{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"integrity","type":"string"},{"const":"monthly","type":"string"}]},"month":{"anyOf":[{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"integrity","type":"string"},{"const":"monthly","type":"string"}]},"month":{"anyOf":[{"pattern":"^\\d{4}-(0[1-9]|1[0-2])$","type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/offset/candidates":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"operationId":"getBffLedgerOffsetCandidates","tags":["Ledger"],"summary":"Partners with both receivables and payables, with a proposed offset","responses":{"200":{}}}},"/bff/ledger/offset/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"DataGrid fulltext: partner, note, entry or document number.","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"schema":{"anyOf":[{"const":"posted","type":"string"},{"const":"reversed","type":"string"}]},"in":"query","name":"status","required":false},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateFrom","required":false},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"dateTo","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"description":"Clamped to the DataGrid maximum.","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Clamped to the DataGrid maximum.","type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerOffsetList","tags":["Ledger"],"summary":"Posted and reversed offsets","responses":{"200":{}}}},"/bff/ledger/offset/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryId":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryId","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryId":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryId","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entryId":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","entryId","entryNo"]}}}}},"operationId":"postBffLedgerOffsetCreate","tags":["Ledger"],"summary":"Post an offset of receivables against payables","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","date","items"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"items":{"minItems":2,"maxItems":100,"type":"array","items":{"type":"object","required":["documentId","accountCode","amount"],"properties":{"documentId":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"}}}},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","date","items"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"items":{"minItems":2,"maxItems":100,"type":"array","items":{"type":"object","required":["documentId","accountCode","amount"],"properties":{"documentId":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"}}}},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","date","items"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"items":{"minItems":2,"maxItems":100,"type":"array","items":{"type":"object","required":["documentId","accountCode","amount"],"properties":{"documentId":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"}}}},"note":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/offset/reverse":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerOffsetReverse","tags":["Ledger"],"summary":"Reverse an offset","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/asset/list":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false},{"schema":{"anyOf":[{"const":"all","type":"string"},{"const":"draft","type":"string"},{"const":"in_use","type":"string"},{"const":"disposed","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"search","required":false},{"description":"DataGrid fulltext (same as `search`).","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerAssetList","tags":["Ledger"],"summary":"Asset register with values as of a date","responses":{"200":{}}}},"/bff/ledger/asset/detail":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"description":"Asset external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerAssetDetail","tags":["Ledger"],"summary":"Asset card with improvements, booked rows and depreciation plans","responses":{"200":{}}}},"/bff/ledger/asset/reconciliation":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"operationId":"getBffLedgerAssetReconciliation","tags":["Ledger"],"summary":"Register totals vs. ledger balances of 01x–03x and 07x–08x","responses":{"200":{}}}},"/bff/ledger/asset/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerAssetCreate","tags":["Ledger"],"summary":"Create an asset card (draft)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","name","assetAccountCode","inputPrice","acquisitionDate","taxMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"inventoryNumber":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"},{"type":"null"}]},"assetAccountCode":{"minLength":3,"maxLength":16,"type":"string"},"accumulatedAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"acquisitionAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"sourceDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"inputPrice":{"exclusiveMinimum":0,"type":"number"},"acquisitionDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"minimum":1,"maximum":6,"type":"number"},{"type":"null"}]},"taxFirstYearIncrease":{"anyOf":[{"const":"none","type":"string"},{"const":"p10","type":"string"},{"const":"p15","type":"string"},{"const":"p20","type":"string"},{"type":"null"}]},"isM1Vehicle":{"type":"boolean"},"openingTaxYears":{"minimum":0,"maximum":100,"type":"number"},"openingTaxAmount":{"minimum":0,"type":"number"},"openingAccMonths":{"minimum":0,"maximum":1200,"type":"number"},"openingAccAmount":{"minimum":0,"type":"number"},"accUsefulLifeMonths":{"anyOf":[{"minimum":1,"maximum":1200,"type":"number"},{"type":"null"}]},"accResidualValue":{"minimum":0,"type":"number"},"location":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"serialNumber":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","name","assetAccountCode","inputPrice","acquisitionDate","taxMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"inventoryNumber":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"},{"type":"null"}]},"assetAccountCode":{"minLength":3,"maxLength":16,"type":"string"},"accumulatedAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"acquisitionAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"sourceDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"inputPrice":{"exclusiveMinimum":0,"type":"number"},"acquisitionDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"minimum":1,"maximum":6,"type":"number"},{"type":"null"}]},"taxFirstYearIncrease":{"anyOf":[{"const":"none","type":"string"},{"const":"p10","type":"string"},{"const":"p15","type":"string"},{"const":"p20","type":"string"},{"type":"null"}]},"isM1Vehicle":{"type":"boolean"},"openingTaxYears":{"minimum":0,"maximum":100,"type":"number"},"openingTaxAmount":{"minimum":0,"type":"number"},"openingAccMonths":{"minimum":0,"maximum":1200,"type":"number"},"openingAccAmount":{"minimum":0,"type":"number"},"accUsefulLifeMonths":{"anyOf":[{"minimum":1,"maximum":1200,"type":"number"},{"type":"null"}]},"accResidualValue":{"minimum":0,"type":"number"},"location":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"serialNumber":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","name","assetAccountCode","inputPrice","acquisitionDate","taxMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"inventoryNumber":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"},{"type":"null"}]},"assetAccountCode":{"minLength":3,"maxLength":16,"type":"string"},"accumulatedAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"acquisitionAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"sourceDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"inputPrice":{"exclusiveMinimum":0,"type":"number"},"acquisitionDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"minimum":1,"maximum":6,"type":"number"},{"type":"null"}]},"taxFirstYearIncrease":{"anyOf":[{"const":"none","type":"string"},{"const":"p10","type":"string"},{"const":"p15","type":"string"},{"const":"p20","type":"string"},{"type":"null"}]},"isM1Vehicle":{"type":"boolean"},"openingTaxYears":{"minimum":0,"maximum":100,"type":"number"},"openingTaxAmount":{"minimum":0,"type":"number"},"openingAccMonths":{"minimum":0,"maximum":1200,"type":"number"},"openingAccAmount":{"minimum":0,"type":"number"},"accUsefulLifeMonths":{"anyOf":[{"minimum":1,"maximum":1200,"type":"number"},{"type":"null"}]},"accResidualValue":{"minimum":0,"type":"number"},"location":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"serialNumber":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/asset/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerAssetUpdate","tags":["Ledger"],"summary":"Update an asset card (bookkeeping fields only while draft)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","name","assetAccountCode","inputPrice","acquisitionDate","taxMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"inventoryNumber":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"},{"type":"null"}]},"assetAccountCode":{"minLength":3,"maxLength":16,"type":"string"},"accumulatedAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"acquisitionAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"sourceDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"inputPrice":{"exclusiveMinimum":0,"type":"number"},"acquisitionDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"minimum":1,"maximum":6,"type":"number"},{"type":"null"}]},"taxFirstYearIncrease":{"anyOf":[{"const":"none","type":"string"},{"const":"p10","type":"string"},{"const":"p15","type":"string"},{"const":"p20","type":"string"},{"type":"null"}]},"isM1Vehicle":{"type":"boolean"},"openingTaxYears":{"minimum":0,"maximum":100,"type":"number"},"openingTaxAmount":{"minimum":0,"type":"number"},"openingAccMonths":{"minimum":0,"maximum":1200,"type":"number"},"openingAccAmount":{"minimum":0,"type":"number"},"accUsefulLifeMonths":{"anyOf":[{"minimum":1,"maximum":1200,"type":"number"},{"type":"null"}]},"accResidualValue":{"minimum":0,"type":"number"},"location":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"serialNumber":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","name","assetAccountCode","inputPrice","acquisitionDate","taxMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"inventoryNumber":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"},{"type":"null"}]},"assetAccountCode":{"minLength":3,"maxLength":16,"type":"string"},"accumulatedAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"acquisitionAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"sourceDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"inputPrice":{"exclusiveMinimum":0,"type":"number"},"acquisitionDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"minimum":1,"maximum":6,"type":"number"},{"type":"null"}]},"taxFirstYearIncrease":{"anyOf":[{"const":"none","type":"string"},{"const":"p10","type":"string"},{"const":"p15","type":"string"},{"const":"p20","type":"string"},{"type":"null"}]},"isM1Vehicle":{"type":"boolean"},"openingTaxYears":{"minimum":0,"maximum":100,"type":"number"},"openingTaxAmount":{"minimum":0,"type":"number"},"openingAccMonths":{"minimum":0,"maximum":1200,"type":"number"},"openingAccAmount":{"minimum":0,"type":"number"},"accUsefulLifeMonths":{"anyOf":[{"minimum":1,"maximum":1200,"type":"number"},{"type":"null"}]},"accResidualValue":{"minimum":0,"type":"number"},"location":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"serialNumber":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","name","assetAccountCode","inputPrice","acquisitionDate","taxMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"inventoryNumber":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}]},"name":{"minLength":1,"maxLength":255,"type":"string"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"kind":{"anyOf":[{"const":"tangible","type":"string"},{"const":"intangible","type":"string"},{"type":"null"}]},"assetAccountCode":{"minLength":3,"maxLength":16,"type":"string"},"accumulatedAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"acquisitionAccountCode":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"sourceDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"inputPrice":{"exclusiveMinimum":0,"type":"number"},"acquisitionDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxMethod":{"anyOf":[{"const":"straight","type":"string"},{"const":"accelerated","type":"string"},{"const":"by_accounting","type":"string"},{"const":"none","type":"string"}]},"taxGroup":{"anyOf":[{"minimum":1,"maximum":6,"type":"number"},{"type":"null"}]},"taxFirstYearIncrease":{"anyOf":[{"const":"none","type":"string"},{"const":"p10","type":"string"},{"const":"p15","type":"string"},{"const":"p20","type":"string"},{"type":"null"}]},"isM1Vehicle":{"type":"boolean"},"openingTaxYears":{"minimum":0,"maximum":100,"type":"number"},"openingTaxAmount":{"minimum":0,"type":"number"},"openingAccMonths":{"minimum":0,"maximum":1200,"type":"number"},"openingAccAmount":{"minimum":0,"type":"number"},"accUsefulLifeMonths":{"anyOf":[{"minimum":1,"maximum":1200,"type":"number"},{"type":"null"}]},"accResidualValue":{"minimum":0,"type":"number"},"location":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"responsiblePerson":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"serialNumber":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/asset/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerAssetDelete","tags":["Ledger"],"summary":"Delete a draft asset card","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"}}}}}}}},"/bff/ledger/asset/activate":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"historical":{"type":"boolean"}},"required":["success","entry","historical"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"historical":{"type":"boolean"}},"required":["success","entry","historical"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"historical":{"type":"boolean"}},"required":["success","entry","historical"]}}}}},"operationId":"postBffLedgerAssetActivate","tags":["Ledger"],"summary":"Put an asset into use (MD 0xx / D 04x)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","date"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"bookEntry":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","date"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"bookEntry":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","date"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"bookEntry":{"type":"boolean"}}}}}}}},"/bff/ledger/asset/revert-activation":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerAssetRevert-activation","tags":["Ledger"],"summary":"Take an asset back to draft","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}}}}}},"/bff/ledger/asset/improvement-add":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["success","id","entry"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["success","id","entry"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}},"required":["success","id","entry"]}}}}},"operationId":"postBffLedgerAssetImprovement-add","tags":["Ledger"],"summary":"Add a technical improvement (§33 ZDP)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","completedOn","amount"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"completedOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"bookEntry":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","completedOn","amount"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"completedOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"bookEntry":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","completedOn","amount"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"completedOn":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"amount":{"exclusiveMinimum":0,"type":"number"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"documentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"bookEntry":{"type":"boolean"}}}}}}}},"/bff/ledger/asset/improvement-delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerAssetImprovement-delete","tags":["Ledger"],"summary":"Remove an improvement of a draft card","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","improvementId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"improvementId":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","improvementId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"improvementId":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","improvementId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"improvementId":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/asset/depreciation-year":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"minimum":1990,"maximum":2200,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1990,"maximum":2200,"type":"number"}]},"in":"query","name":"fiscalYear","required":true},{"description":"DataGrid fulltext: inventory number, name, entry number.","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"schema":{"anyOf":[{"const":"booked","type":"string"},{"const":"due","type":"string"},{"const":"blocked","type":"string"}]},"in":"query","name":"state","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"type":"number"}]},"in":"query","name":"page","required":false},{"description":"Clamped to the DataGrid maximum; default = whole year.","schema":{"minimum":1,"anyOf":[{"format":"numeric","default":0,"type":"string"},{"minimum":1,"description":"Clamped to the DataGrid maximum; default = whole year.","type":"number"}]},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerAssetDepreciation-year","tags":["Ledger"],"summary":"Depreciation of all cards for a fiscal year (totals always cover the whole year)","responses":{"200":{}}}},"/bff/ledger/asset/depreciation-book":{"post":{"parameters":[],"operationId":"postBffLedgerAssetDepreciation-book","tags":["Ledger"],"summary":"Book accounting (MD 551 / D 08x) and tax depreciation of a year","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","fiscalYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"},"assetIds":{"anyOf":[{"maxItems":1000,"type":"array","items":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"}},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","fiscalYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"},"assetIds":{"anyOf":[{"maxItems":1000,"type":"array","items":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"}},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","fiscalYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"},"assetIds":{"anyOf":[{"maxItems":1000,"type":"array","items":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"}},{"type":"null"}]}}}}}},"responses":{"200":{}}}},"/bff/ledger/asset/depreciation-reverse":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerAssetDepreciation-reverse","tags":["Ledger"],"summary":"Reverse a card's latest booked year","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","fiscalYear","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","fiscalYear","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","fiscalYear","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}}}}}},"/bff/ledger/asset/tax-pause":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerAssetTax-pause","tags":["Ledger"],"summary":"Interrupt tax depreciation for a year (§26/8 ZDP)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","fiscalYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","fiscalYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","fiscalYear"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"fiscalYear":{"minimum":1990,"maximum":2200,"type":"number"}}}}}}}},"/bff/ledger/asset/dispose":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"residual":{"type":"number"},"yearAccounting":{"type":"number"},"yearTax":{"type":"number"}},"required":["success","entry","residual","yearAccounting","yearTax"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"residual":{"type":"number"},"yearAccounting":{"type":"number"},"yearTax":{"type":"number"}},"required":["success","entry","residual","yearAccounting","yearTax"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entry":{"anyOf":[{"type":"object","required":["id","entryNo"],"properties":{"id":{"type":"string"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]},"residual":{"type":"number"},"yearAccounting":{"type":"number"},"yearTax":{"type":"number"}},"required":["success","entry","residual","yearAccounting","yearTax"]}}}}},"operationId":"postBffLedgerAssetDispose","tags":["Ledger"],"summary":"Dispose an asset (depreciation of the year, residual value to 54x/551)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","date","type"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"type":{"anyOf":[{"const":"sold","type":"string"},{"const":"liquidated","type":"string"},{"const":"donated","type":"string"},{"const":"damaged","type":"string"}]},"price":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","date","type"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"type":{"anyOf":[{"const":"sold","type":"string"},{"const":"liquidated","type":"string"},{"const":"donated","type":"string"},{"const":"damaged","type":"string"}]},"price":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","date","type"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"type":{"anyOf":[{"const":"sold","type":"string"},{"const":"liquidated","type":"string"},{"const":"donated","type":"string"},{"const":"damaged","type":"string"}]},"price":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]}}}}}}}},"/bff/ledger/asset/revert-disposal":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerAssetRevert-disposal","tags":["Ledger"],"summary":"Take a disposed asset back into use","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"description":"Asset external id.","type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"}}}}}}}},"/bff/ledger/cash/registers":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"operationId":"getBffLedgerCashRegisters","tags":["Ledger"],"summary":"Cash registers with ledger balance","responses":{"200":{}}}},"/bff/ledger/cash/book":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"registerId","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"description":"DataGrid sort; only `issueDate:asc|desc` (chronological) is honoured.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffLedgerCashBook","tags":["Ledger"],"summary":"Cash book of a register for a period with running balance","responses":{"200":{}}}},"/bff/ledger/cash/detail":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerCashDetail","tags":["Ledger"],"summary":"Cash document with VAT lines","responses":{"200":{}}}},"/bff/ledger/cash/open-items":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"receivable","type":"string"},{"const":"payable","type":"string"}]},"in":"query","name":"side","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"search","required":false}],"operationId":"getBffLedgerCashOpen-items","tags":["Ledger"],"summary":"Open invoices a cash payment can settle","responses":{"200":{}}}},"/bff/ledger/cash/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}}},"required":["success","id","documentNo","warnings"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}}},"required":["success","id","documentNo","warnings"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}}},"required":["success","id","documentNo","warnings"]}}}}},"operationId":"postBffLedgerCashCreate","tags":["Ledger"],"summary":"Create a cash document (draft, optionally posted right away)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","registerId","direction","purpose","issueDate","description","vatMode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"post":{"type":"boolean"},"registerId":{"minLength":16,"maxLength":24,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"anyOf":[{"const":"sale","type":"string"},{"const":"purchase","type":"string"},{"const":"invoice_payment","type":"string"},{"const":"purchase_payment","type":"string"},{"const":"transfer","type":"string"},{"const":"other","type":"string"}]},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"vatMode":{"anyOf":[{"const":"none","type":"string"},{"const":"vat","type":"string"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"vatLines":{"anyOf":[{"maxItems":5,"type":"array","items":{"type":"object","required":["vatRate","gross"],"properties":{"vatRate":{"minimum":0,"maximum":99,"type":"number"},"gross":{"type":"number"}}}},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"settledDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"settledAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","registerId","direction","purpose","issueDate","description","vatMode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"post":{"type":"boolean"},"registerId":{"minLength":16,"maxLength":24,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"anyOf":[{"const":"sale","type":"string"},{"const":"purchase","type":"string"},{"const":"invoice_payment","type":"string"},{"const":"purchase_payment","type":"string"},{"const":"transfer","type":"string"},{"const":"other","type":"string"}]},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"vatMode":{"anyOf":[{"const":"none","type":"string"},{"const":"vat","type":"string"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"vatLines":{"anyOf":[{"maxItems":5,"type":"array","items":{"type":"object","required":["vatRate","gross"],"properties":{"vatRate":{"minimum":0,"maximum":99,"type":"number"},"gross":{"type":"number"}}}},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"settledDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"settledAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","registerId","direction","purpose","issueDate","description","vatMode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"post":{"type":"boolean"},"registerId":{"minLength":16,"maxLength":24,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"anyOf":[{"const":"sale","type":"string"},{"const":"purchase","type":"string"},{"const":"invoice_payment","type":"string"},{"const":"purchase_payment","type":"string"},{"const":"transfer","type":"string"},{"const":"other","type":"string"}]},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"vatMode":{"anyOf":[{"const":"none","type":"string"},{"const":"vat","type":"string"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"vatLines":{"anyOf":[{"maxItems":5,"type":"array","items":{"type":"object","required":["vatRate","gross"],"properties":{"vatRate":{"minimum":0,"maximum":99,"type":"number"},"gross":{"type":"number"}}}},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"settledDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"settledAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/cash/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerCashUpdate","tags":["Ledger"],"summary":"Update a draft cash document","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","registerId","direction","purpose","issueDate","description","vatMode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"registerId":{"minLength":16,"maxLength":24,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"anyOf":[{"const":"sale","type":"string"},{"const":"purchase","type":"string"},{"const":"invoice_payment","type":"string"},{"const":"purchase_payment","type":"string"},{"const":"transfer","type":"string"},{"const":"other","type":"string"}]},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"vatMode":{"anyOf":[{"const":"none","type":"string"},{"const":"vat","type":"string"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"vatLines":{"anyOf":[{"maxItems":5,"type":"array","items":{"type":"object","required":["vatRate","gross"],"properties":{"vatRate":{"minimum":0,"maximum":99,"type":"number"},"gross":{"type":"number"}}}},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"settledDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"settledAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","registerId","direction","purpose","issueDate","description","vatMode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"registerId":{"minLength":16,"maxLength":24,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"anyOf":[{"const":"sale","type":"string"},{"const":"purchase","type":"string"},{"const":"invoice_payment","type":"string"},{"const":"purchase_payment","type":"string"},{"const":"transfer","type":"string"},{"const":"other","type":"string"}]},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"vatMode":{"anyOf":[{"const":"none","type":"string"},{"const":"vat","type":"string"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"vatLines":{"anyOf":[{"maxItems":5,"type":"array","items":{"type":"object","required":["vatRate","gross"],"properties":{"vatRate":{"minimum":0,"maximum":99,"type":"number"},"gross":{"type":"number"}}}},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"settledDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"settledAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","registerId","direction","purpose","issueDate","description","vatMode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"registerId":{"minLength":16,"maxLength":24,"type":"string"},"direction":{"anyOf":[{"const":"in","type":"string"},{"const":"out","type":"string"}]},"purpose":{"anyOf":[{"const":"sale","type":"string"},{"const":"purchase","type":"string"},{"const":"invoice_payment","type":"string"},{"const":"purchase_payment","type":"string"},{"const":"transfer","type":"string"},{"const":"other","type":"string"}]},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"taxDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"partnerVatId":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"vatMode":{"anyOf":[{"const":"none","type":"string"},{"const":"vat","type":"string"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"vatLines":{"anyOf":[{"maxItems":5,"type":"array","items":{"type":"object","required":["vatRate","gross"],"properties":{"vatRate":{"minimum":0,"maximum":99,"type":"number"},"gross":{"type":"number"}}}},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"settledDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"settledAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/cash/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerCashDelete","tags":["Ledger"],"summary":"Delete a draft cash document","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/cash/post":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}},"balanceAfter":{"type":"number"}},"required":["success","documentNo","warnings","balanceAfter"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}},"balanceAfter":{"type":"number"}},"required":["success","documentNo","warnings","balanceAfter"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]},"warnings":{"type":"array","items":{"type":"string"}},"balanceAfter":{"type":"number"}},"required":["success","documentNo","warnings","balanceAfter"]}}}}},"operationId":"postBffLedgerCashPost","tags":["Ledger"],"summary":"Post a draft cash document (PPD / VPD number, journal entry, VAT ledger)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/cash/reverse":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"type":"string"},"date":{"type":"string"}},"required":["success","entryNo","date"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"type":"string"},"date":{"type":"string"}},"required":["success","entryNo","date"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"type":"string"},"date":{"type":"string"}},"required":["success","entryNo","date"]}}}}},"operationId":"postBffLedgerCashReverse","tags":["Ledger"],"summary":"Reverse a posted cash document (red storno)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/cash/copy":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerCashCopy","tags":["Ledger"],"summary":"Copy a cash document into a new draft","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"issueDate":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"}}}}}}}},"/bff/ledger/inventory/periods":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true}],"operationId":"getBffLedgerInventoryPeriods","tags":["Ledger"],"summary":"Fiscal periods with the state of their inventory","responses":{"200":{}}}},"/bff/ledger/inventory/detail":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"periodId","required":true}],"operationId":"getBffLedgerInventoryDetail","tags":["Ledger"],"summary":"Inventory of a period with its accounts","responses":{"200":{}}}},"/bff/ledger/inventory/refresh":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerInventoryRefresh","tags":["Ledger"],"summary":"Start the inventory of a period or refresh its book balances","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","periodId"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"periodId":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/inventory/header":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerInventoryHeader","tags":["Ledger"],"summary":"Update responsible person, date and protocol of the inventory","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","responsiblePerson","inventoryDate","protocolRef","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"responsiblePerson":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"inventoryDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-12-31"],"type":"string"},{"type":"null"}]},"protocolRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","responsiblePerson","inventoryDate","protocolRef","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"responsiblePerson":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"inventoryDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-12-31"],"type":"string"},{"type":"null"}]},"protocolRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","responsiblePerson","inventoryDate","protocolRef","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"responsiblePerson":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"inventoryDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-12-31"],"type":"string"},{"type":"null"}]},"protocolRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/inventory/items":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}}}}},"operationId":"postBffLedgerInventoryItems","tags":["Ledger"],"summary":"Save actual (counted) balances of inventoried accounts","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","items"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","counted"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"counted":{"anyOf":[{"type":"number"},{"type":"null"}]},"method":{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},"listRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","items"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","counted"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"counted":{"anyOf":[{"type":"number"},{"type":"null"}]},"method":{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},"listRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","items"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"items":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["accountCode","counted"],"properties":{"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"counted":{"anyOf":[{"type":"number"},{"type":"null"}]},"method":{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},"listRef":{"anyOf":[{"maxLength":190,"type":"string"},{"type":"null"}]}}}}}}}}}}},"/bff/ledger/inventory/confirm-book":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"changed":{"type":"number"}},"required":["success","changed"]}}}}},"operationId":"postBffLedgerInventoryConfirm-book","tags":["Ledger"],"summary":"Confirm book balances as actual for uncounted accounts","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","method"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"method":{"anyOf":[{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},{"const":"all","type":"string"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","method"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"method":{"anyOf":[{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},{"const":"all","type":"string"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","method"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"method":{"anyOf":[{"anyOf":[{"const":"physical","type":"string"},{"const":"document","type":"string"}]},{"const":"all","type":"string"}]}}}}}}}},"/bff/ledger/inventory/resolve":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerInventoryResolve","tags":["Ledger"],"summary":"Mark an inventory difference as explained without posting","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","accountCode","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"note":{"minLength":3,"maxLength":500,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","accountCode","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"note":{"minLength":3,"maxLength":500,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","accountCode","note"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"note":{"minLength":3,"maxLength":500,"type":"string"}}}}}}}},"/bff/ledger/inventory/post-difference":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"type":"string"}},"required":["success","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"type":"string"}},"required":["success","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"type":"string"}},"required":["success","entryNo"]}}}}},"operationId":"postBffLedgerInventoryPost-difference","tags":["Ledger"],"summary":"Post an inventory difference (shortage 549 / surplus 648 by default)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","accountCode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"shortageAccount":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"surplusAccount":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","accountCode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"shortageAccount":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"surplusAccount":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","accountCode"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"accountCode":{"minLength":3,"maxLength":16,"type":"string"},"shortageAccount":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"surplusAccount":{"anyOf":[{"minLength":3,"maxLength":16,"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":300,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/inventory/complete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerInventoryComplete","tags":["Ledger"],"summary":"Complete the inventory","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/inventory/reopen":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerInventoryReopen","tags":["Ledger"],"summary":"Reopen a completed inventory","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/stock/meta":{"get":{"operationId":"getBffLedgerStockMeta","tags":["Ledger"],"summary":"Stock purposes and default accounts (method A)","responses":{"200":{}}}},"/bff/ledger/stock/warehouses":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"operationId":"getBffLedgerStockWarehouses","tags":["Ledger"],"summary":"Warehouses with stock value","responses":{"200":{}}}},"/bff/ledger/stock/warehouse/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerStockWarehouseCreate","tags":["Ledger"],"summary":"Create a warehouse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","code","name","valuationMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":1,"maxLength":16,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"valuationMethod":{"anyOf":[{"const":"average","type":"string"},{"const":"fifo","type":"string"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","code","name","valuationMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":1,"maxLength":16,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"valuationMethod":{"anyOf":[{"const":"average","type":"string"},{"const":"fifo","type":"string"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","code","name","valuationMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":1,"maxLength":16,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"valuationMethod":{"anyOf":[{"const":"average","type":"string"},{"const":"fifo","type":"string"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/stock/warehouse/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerStockWarehouseUpdate","tags":["Ledger"],"summary":"Update a warehouse","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","code","name","valuationMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":16,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"valuationMethod":{"anyOf":[{"const":"average","type":"string"},{"const":"fifo","type":"string"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","code","name","valuationMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":16,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"valuationMethod":{"anyOf":[{"const":"average","type":"string"},{"const":"fifo","type":"string"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","code","name","valuationMethod"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"code":{"minLength":1,"maxLength":16,"type":"string"},"name":{"minLength":1,"maxLength":190,"type":"string"},"valuationMethod":{"anyOf":[{"const":"average","type":"string"},{"const":"fifo","type":"string"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/stock/items":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"warehouseId","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"search","required":false},{"description":"DataGrid fulltext (same as `search`).","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"onlyInStock","required":false},{"schema":{"type":"string"},"in":"query","name":"includeInactive","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"operationId":"getBffLedgerStockItems","tags":["Ledger"],"summary":"Stock cards with quantity and value as of a date","responses":{"200":{}}}},"/bff/ledger/stock/item/card":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"id","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"warehouseId","required":false}],"operationId":"getBffLedgerStockItemCard","tags":["Ledger"],"summary":"Stock card of an item (movements with running balance)","responses":{"200":{}}}},"/bff/ledger/stock/item/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerStockItemCreate","tags":["Ledger"],"summary":"Create a stock card","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","code","name","unit","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"unit":{"minLength":1,"maxLength":16,"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"expenseAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","code","name","unit","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"unit":{"minLength":1,"maxLength":16,"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"expenseAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","code","name","unit","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"unit":{"minLength":1,"maxLength":16,"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"expenseAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/stock/item/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerStockItemUpdate","tags":["Ledger"],"summary":"Update a stock card","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","rowVersion","code","name","unit","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"unit":{"minLength":1,"maxLength":16,"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"expenseAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","rowVersion","code","name","unit","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"unit":{"minLength":1,"maxLength":16,"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"expenseAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","rowVersion","code","name","unit","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"code":{"minLength":1,"maxLength":64,"type":"string"},"name":{"minLength":1,"maxLength":255,"type":"string"},"unit":{"minLength":1,"maxLength":16,"type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"stockAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"expenseAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"isActive":{"type":"boolean"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/stock/item/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerStockItemDelete","tags":["Ledger"],"summary":"Delete an unused stock card","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/stock/products":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","maxLength":100},"in":"query","name":"search","required":false}],"operationId":"getBffLedgerStockProducts","tags":["Ledger"],"summary":"E-shop products for stock cards","responses":{"200":{}}}},"/bff/ledger/stock/item/import-products":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"created":{"type":"number"}},"required":["success","created"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"created":{"type":"number"}},"required":["success","created"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"created":{"type":"number"}},"required":["success","created"]}}}}},"operationId":"postBffLedgerStockItemImport-products","tags":["Ledger"],"summary":"Create stock cards from e-shop products","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productIds":{"anyOf":[{"maxItems":500,"type":"array","items":{"type":"number"}},{"type":"null"}]},"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"limit":{"minimum":1,"maximum":2000,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productIds":{"anyOf":[{"maxItems":500,"type":"array","items":{"type":"number"}},{"type":"null"}]},"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"limit":{"minimum":1,"maximum":2000,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","kind"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"kind":{"anyOf":[{"const":"goods","type":"string"},{"const":"material","type":"string"},{"const":"product","type":"string"}]},"productIds":{"anyOf":[{"maxItems":500,"type":"array","items":{"type":"number"}},{"type":"null"}]},"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}]},"limit":{"minimum":1,"maximum":2000,"type":"number"}}}}}}}},"/bff/ledger/stock/documents":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"anyOf":[{"const":"receipt","type":"string"},{"const":"issue","type":"string"},{"const":"transfer","type":"string"}]},"in":"query","name":"kind","required":false},{"schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"posted","type":"string"},{"const":"reversed","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"warehouseId","required":false},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"from","required":false},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"to","required":false},{"schema":{"type":"string","maxLength":100},"in":"query","name":"search","required":false},{"description":"DataGrid fulltext (same as `search`).","schema":{"type":"string","maxLength":100},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"operationId":"getBffLedgerStockDocuments","tags":["Ledger"],"summary":"Stock documents","responses":{"200":{}}}},"/bff/ledger/stock/document/detail":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"id","required":true}],"operationId":"getBffLedgerStockDocumentDetail","tags":["Ledger"],"summary":"Stock document with lines","responses":{"200":{}}}},"/bff/ledger/stock/document/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","documentNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","documentNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"},"documentNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","id","documentNo"]}}}}},"operationId":"postBffLedgerStockDocumentCreate","tags":["Ledger"],"summary":"Create a stock document draft (optionally post it)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","kind","purpose","warehouseId","date","description","lines"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"post":{"type":"boolean"},"kind":{"anyOf":[{"const":"receipt","type":"string"},{"const":"issue","type":"string"},{"const":"transfer","type":"string"}]},"purpose":{"minLength":1,"maxLength":20,"type":"string"},"warehouseId":{"minLength":16,"maxLength":24,"type":"string"},"targetWarehouseId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"relatedDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["itemId","quantity"],"properties":{"itemId":{"minLength":16,"maxLength":24,"type":"string"},"quantity":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","kind","purpose","warehouseId","date","description","lines"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"post":{"type":"boolean"},"kind":{"anyOf":[{"const":"receipt","type":"string"},{"const":"issue","type":"string"},{"const":"transfer","type":"string"}]},"purpose":{"minLength":1,"maxLength":20,"type":"string"},"warehouseId":{"minLength":16,"maxLength":24,"type":"string"},"targetWarehouseId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"relatedDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["itemId","quantity"],"properties":{"itemId":{"minLength":16,"maxLength":24,"type":"string"},"quantity":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["entityId","kind","purpose","warehouseId","date","description","lines"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"post":{"type":"boolean"},"kind":{"anyOf":[{"const":"receipt","type":"string"},{"const":"issue","type":"string"},{"const":"transfer","type":"string"}]},"purpose":{"minLength":1,"maxLength":20,"type":"string"},"warehouseId":{"minLength":16,"maxLength":24,"type":"string"},"targetWarehouseId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"relatedDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["itemId","quantity"],"properties":{"itemId":{"minLength":16,"maxLength":24,"type":"string"},"quantity":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}}}}}},"/bff/ledger/stock/document/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerStockDocumentUpdate","tags":["Ledger"],"summary":"Update a stock document draft","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","rowVersion","kind","purpose","warehouseId","date","description","lines"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"kind":{"anyOf":[{"const":"receipt","type":"string"},{"const":"issue","type":"string"},{"const":"transfer","type":"string"}]},"purpose":{"minLength":1,"maxLength":20,"type":"string"},"warehouseId":{"minLength":16,"maxLength":24,"type":"string"},"targetWarehouseId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"relatedDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["itemId","quantity"],"properties":{"itemId":{"minLength":16,"maxLength":24,"type":"string"},"quantity":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","rowVersion","kind","purpose","warehouseId","date","description","lines"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"kind":{"anyOf":[{"const":"receipt","type":"string"},{"const":"issue","type":"string"},{"const":"transfer","type":"string"}]},"purpose":{"minLength":1,"maxLength":20,"type":"string"},"warehouseId":{"minLength":16,"maxLength":24,"type":"string"},"targetWarehouseId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"relatedDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["itemId","quantity"],"properties":{"itemId":{"minLength":16,"maxLength":24,"type":"string"},"quantity":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","rowVersion","kind","purpose","warehouseId","date","description","lines"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"rowVersion":{"type":"number"},"kind":{"anyOf":[{"const":"receipt","type":"string"},{"const":"issue","type":"string"},{"const":"transfer","type":"string"}]},"purpose":{"minLength":1,"maxLength":20,"type":"string"},"warehouseId":{"minLength":16,"maxLength":24,"type":"string"},"targetWarehouseId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},"partnerName":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"partnerRegNo":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"relatedDocumentId":{"anyOf":[{"minLength":16,"maxLength":24,"type":"string"},{"type":"null"}]},"counterAccountCode":{"anyOf":[{"maxLength":16,"type":"string"},{"type":"null"}]},"description":{"minLength":1,"maxLength":255,"type":"string"},"note":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","required":["itemId","quantity"],"properties":{"itemId":{"minLength":16,"maxLength":24,"type":"string"},"quantity":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"total":{"anyOf":[{"minimum":0,"type":"number"},{"type":"null"}]},"note":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]}}}}}}}}}}},"/bff/ledger/stock/document/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffLedgerStockDocumentDelete","tags":["Ledger"],"summary":"Delete a stock document draft","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/stock/document/post":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"documentNo":{"type":"string"},"total":{"type":"number"}},"required":["success","documentNo","total"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"documentNo":{"type":"string"},"total":{"type":"number"}},"required":["success","documentNo","total"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"documentNo":{"type":"string"},"total":{"type":"number"}},"required":["success","documentNo","total"]}}}}},"operationId":"postBffLedgerStockDocumentPost","tags":["Ledger"],"summary":"Post a stock document (valuation + journal entry)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"}}}}}}}},"/bff/ledger/stock/document/reverse":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryNo"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryNo"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"entryNo":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["success","entryNo"]}}}}},"operationId":"postBffLedgerStockDocumentReverse","tags":["Ledger"],"summary":"Reverse a posted stock document","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id","reason"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"reason":{"minLength":3,"maxLength":500,"type":"string"},"date":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"},{"type":"null"}]}}}}}}}},"/bff/ledger/stock/document/copy":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"id":{"type":"string"}},"required":["success","id"]}}}}},"operationId":"postBffLedgerStockDocumentCopy","tags":["Ledger"],"summary":"Copy a stock document into a new draft","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["entityId","id"],"properties":{"entityId":{"minLength":16,"maxLength":24,"description":"Accounting entity external id.","type":"string"},"id":{"minLength":16,"maxLength":24,"type":"string"},"date":{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","examples":["2026-11-04"],"type":"string"}}}}}}}},"/bff/ledger/stock/reconciliation":{"get":{"parameters":[{"description":"Accounting entity external id.","schema":{"type":"string","minLength":16,"maxLength":24},"in":"query","name":"entityId","required":true},{"examples":["2026-11-04"],"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"asOf","required":false}],"operationId":"getBffLedgerStockReconciliation","tags":["Ledger"],"summary":"Stock value vs. general ledger per stock account","responses":{"200":{}}}},"/bff/warehouse/production/labour-type/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehouseProductionLabour-typeList","tags":["Warehouse production"],"summary":"List labour types (druhy práce) with hourly rates"}},"/bff/warehouse/production/labour-type/save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"labourType":{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"required":["success","labourType"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"labourType":{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"required":["success","labourType"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"labourType":{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"required":["success","labourType"]}}}}},"operationId":"postBffWarehouseProductionLabour-typeSave","tags":["Warehouse production"],"summary":"Create or update a labour type","description":"Rate changes apply to production orders created afterwards; existing orders keep their snapshot.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","name","hourlyRate"],"properties":{"id":{"description":"Omit to create a new labour type.","anyOf":[{"type":"number"},{"type":"null"}]},"code":{"maxLength":64,"examples":["siti"],"type":"string"},"name":{"maxLength":200,"examples":["Šití"],"type":"string"},"hourlyRate":{"minimum":0,"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","name","hourlyRate"],"properties":{"id":{"description":"Omit to create a new labour type.","anyOf":[{"type":"number"},{"type":"null"}]},"code":{"maxLength":64,"examples":["siti"],"type":"string"},"name":{"maxLength":200,"examples":["Šití"],"type":"string"},"hourlyRate":{"minimum":0,"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["code","name","hourlyRate"],"properties":{"id":{"description":"Omit to create a new labour type.","anyOf":[{"type":"number"},{"type":"null"}]},"code":{"maxLength":64,"examples":["siti"],"type":"string"},"name":{"maxLength":200,"examples":["Šití"],"type":"string"},"hourlyRate":{"minimum":0,"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/warehouse/production/labour-type/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseProductionLabour-typeDelete","tags":["Warehouse production"],"summary":"Delete a labour type","description":"Refused while any bill of materials uses it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"number"}}}}}}}},"/bff/warehouse/production/bom":{"get":{"parameters":[{"description":"Product code.","schema":{"type":"string"},"in":"query","name":"productCode","required":true},{"description":"Variant code; a variant without its own BOM inherits the product BOM.","schema":{"type":"string"},"in":"query","name":"productVariantCode","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"yieldPerRun":{"description":"Units one BOM run produces.","type":"number"},"lines":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","note","component","labourType"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Per run: units of the component, or labour hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourType":{"anyOf":[{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"estimatedUnitCost":{"description":"Estimate per produced unit from catalogue costs + labour rates.","type":"number"},"estimateIncomplete":{"description":"Some material has no catalogue cost; the estimate is too low.","type":"boolean"}},"required":["product","yieldPerRun","lines","estimatedUnitCost","estimateIncomplete"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"yieldPerRun":{"description":"Units one BOM run produces.","type":"number"},"lines":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","note","component","labourType"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Per run: units of the component, or labour hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourType":{"anyOf":[{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"estimatedUnitCost":{"description":"Estimate per produced unit from catalogue costs + labour rates.","type":"number"},"estimateIncomplete":{"description":"Some material has no catalogue cost; the estimate is too low.","type":"boolean"}},"required":["product","yieldPerRun","lines","estimatedUnitCost","estimateIncomplete"]}},"text/plain":{"schema":{"type":"object","properties":{"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"yieldPerRun":{"description":"Units one BOM run produces.","type":"number"},"lines":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","note","component","labourType"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Per run: units of the component, or labour hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourType":{"anyOf":[{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"estimatedUnitCost":{"description":"Estimate per produced unit from catalogue costs + labour rates.","type":"number"},"estimateIncomplete":{"description":"Some material has no catalogue cost; the estimate is too low.","type":"boolean"}},"required":["product","yieldPerRun","lines","estimatedUnitCost","estimateIncomplete"]}}}}},"operationId":"getBffWarehouseProductionBom","tags":["Warehouse production"],"summary":"Bill of materials (kusovník) of a product"}},"/bff/warehouse/production/bom/save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"yieldPerRun":{"description":"Units one BOM run produces.","type":"number"},"lines":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","note","component","labourType"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Per run: units of the component, or labour hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourType":{"anyOf":[{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"estimatedUnitCost":{"description":"Estimate per produced unit from catalogue costs + labour rates.","type":"number"},"estimateIncomplete":{"description":"Some material has no catalogue cost; the estimate is too low.","type":"boolean"}},"required":["product","yieldPerRun","lines","estimatedUnitCost","estimateIncomplete"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"yieldPerRun":{"description":"Units one BOM run produces.","type":"number"},"lines":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","note","component","labourType"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Per run: units of the component, or labour hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourType":{"anyOf":[{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"estimatedUnitCost":{"description":"Estimate per produced unit from catalogue costs + labour rates.","type":"number"},"estimateIncomplete":{"description":"Some material has no catalogue cost; the estimate is too low.","type":"boolean"}},"required":["product","yieldPerRun","lines","estimatedUnitCost","estimateIncomplete"]}},"text/plain":{"schema":{"type":"object","properties":{"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"yieldPerRun":{"description":"Units one BOM run produces.","type":"number"},"lines":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","note","component","labourType"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Per run: units of the component, or labour hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourType":{"anyOf":[{"type":"object","required":["id","code","name","hourlyRate","note"],"properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"hourlyRate":{"description":"Per hour, organisation default currency.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}},{"type":"null"}]}}}},"estimatedUnitCost":{"description":"Estimate per produced unit from catalogue costs + labour rates.","type":"number"},"estimateIncomplete":{"description":"Some material has no catalogue cost; the estimate is too low.","type":"boolean"}},"required":["product","yieldPerRun","lines","estimatedUnitCost","estimateIncomplete"]}}}}},"operationId":"postBffWarehouseProductionBomSave","tags":["Warehouse production"],"summary":"Replace the bill of materials of a product","description":"Whole-list replace. Duplicate components / labour types are merged. Existing production orders are not affected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","lines"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"description":"Save a variant-specific BOM; omit for the product BOM.","anyOf":[{"type":"string"},{"type":"null"}]},"productionYield":{"description":"Units one run produces (stored on the product). Null = 1. Omit to keep.","anyOf":[{"type":"number"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["kind","quantity"],"properties":{"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"componentProductCode":{"description":"Material: component product code.","anyOf":[{"type":"string"},{"type":"null"}]},"componentVariantCode":{"description":"Material: component variant code.","anyOf":[{"type":"string"},{"type":"null"}]},"labourTypeId":{"description":"Labour: labour type id.","anyOf":[{"type":"number"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Per run: units of the component (≤ 3 decimals) or hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","lines"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"description":"Save a variant-specific BOM; omit for the product BOM.","anyOf":[{"type":"string"},{"type":"null"}]},"productionYield":{"description":"Units one run produces (stored on the product). Null = 1. Omit to keep.","anyOf":[{"type":"number"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["kind","quantity"],"properties":{"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"componentProductCode":{"description":"Material: component product code.","anyOf":[{"type":"string"},{"type":"null"}]},"componentVariantCode":{"description":"Material: component variant code.","anyOf":[{"type":"string"},{"type":"null"}]},"labourTypeId":{"description":"Labour: labour type id.","anyOf":[{"type":"number"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Per run: units of the component (≤ 3 decimals) or hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["productCode","lines"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"description":"Save a variant-specific BOM; omit for the product BOM.","anyOf":[{"type":"string"},{"type":"null"}]},"productionYield":{"description":"Units one run produces (stored on the product). Null = 1. Omit to keep.","anyOf":[{"type":"number"},{"type":"null"}]},"lines":{"type":"array","items":{"type":"object","required":["kind","quantity"],"properties":{"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"componentProductCode":{"description":"Material: component product code.","anyOf":[{"type":"string"},{"type":"null"}]},"componentVariantCode":{"description":"Material: component variant code.","anyOf":[{"type":"string"},{"type":"null"}]},"labourTypeId":{"description":"Labour: labour type id.","anyOf":[{"type":"number"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Per run: units of the component (≤ 3 decimals) or hours.","type":"number"},"note":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}}}}},"/bff/warehouse/production/order/list":{"get":{"parameters":[{"schema":{"anyOf":[{"anyOf":[{"const":"planned","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"},{"const":"cancelled","type":"string"}]},{"const":"","type":"string"}]},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"productCode","required":false},{"description":"Substring of order number, product / variant code, SKU or name, lot or note.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"Planned day from (inclusive), YYYY-MM-DD.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"plannedFrom","required":false},{"description":"Planned day to (inclusive), YYYY-MM-DD.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"plannedTo","required":false},{"description":"DataGrid sort `field:asc|desc`; fields number, plannedDate, status, quantity, insertedDate, startedDate, completedDate. Default newest first.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"description":"Page size, default 50, max 500.","schema":{"type":"string"},"in":"query","name":"limit","required":false},{"description":"1-based page (DataGrid). Ignored when `offset` is set.","schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"offset","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","number","status","product","quantity","sourceWarehouseId","sourceWarehouseName","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","targetLotCode","note","materialCost","labourCost","unitCost","costCurrency","createdByMemberName","plannedDate","startedDate","completedDate","cancelledDate","insertedDate"],"properties":{"id":{"type":"number"},"number":{"examples":["VP-2026-0001"],"type":"string"},"status":{"anyOf":[{"const":"planned","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"},{"const":"cancelled","type":"string"}]},"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"quantity":{"type":"number"},"sourceWarehouseId":{"type":"number"},"sourceWarehouseName":{"type":"string"},"targetWarehouseId":{"type":"number"},"targetWarehouseName":{"type":"string"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"materialCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Cost per produced unit (FIFO material + labour), set on completion.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","number","status","product","quantity","sourceWarehouseId","sourceWarehouseName","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","targetLotCode","note","materialCost","labourCost","unitCost","costCurrency","createdByMemberName","plannedDate","startedDate","completedDate","cancelledDate","insertedDate"],"properties":{"id":{"type":"number"},"number":{"examples":["VP-2026-0001"],"type":"string"},"status":{"anyOf":[{"const":"planned","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"},{"const":"cancelled","type":"string"}]},"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"quantity":{"type":"number"},"sourceWarehouseId":{"type":"number"},"sourceWarehouseName":{"type":"string"},"targetWarehouseId":{"type":"number"},"targetWarehouseName":{"type":"string"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"materialCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Cost per produced unit (FIFO material + labour), set on completion.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","number","status","product","quantity","sourceWarehouseId","sourceWarehouseName","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","targetLotCode","note","materialCost","labourCost","unitCost","costCurrency","createdByMemberName","plannedDate","startedDate","completedDate","cancelledDate","insertedDate"],"properties":{"id":{"type":"number"},"number":{"examples":["VP-2026-0001"],"type":"string"},"status":{"anyOf":[{"const":"planned","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"},{"const":"cancelled","type":"string"}]},"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"quantity":{"type":"number"},"sourceWarehouseId":{"type":"number"},"sourceWarehouseName":{"type":"string"},"targetWarehouseId":{"type":"number"},"targetWarehouseName":{"type":"string"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"materialCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Cost per produced unit (FIFO material + labour), set on completion.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWarehouseProductionOrderList","tags":["Warehouse production"],"summary":"List production orders (výrobní příkazy)"}},"/bff/warehouse/production/order/detail":{"get":{"parameters":[{"description":"Production order id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"number":{"examples":["VP-2026-0001"],"type":"string"},"status":{"anyOf":[{"const":"planned","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"},{"const":"cancelled","type":"string"}]},"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"quantity":{"type":"number"},"sourceWarehouseId":{"type":"number"},"sourceWarehouseName":{"type":"string"},"targetWarehouseId":{"type":"number"},"targetWarehouseName":{"type":"string"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"materialCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Cost per produced unit (FIFO material + labour), set on completion.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","component","labourTypeId","labourName","hourlyRate","sourceLocationId","sourceLocationCode","lotCode","totalCost","reservedQuantity"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Material: units for the whole order. Labour: hours.","type":"number"},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourTypeId":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourName":{"anyOf":[{"type":"string"},{"type":"null"}]},"hourlyRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Pinned lot; NULL = automatic, oldest first.","anyOf":[{"type":"string"},{"type":"null"}]},"totalCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"reservedQuantity":{"type":"number"}}}},"shortages":{"description":"Material missing right now to start (planned) or complete (in progress). Empty = OK.","type":"array","items":{"type":"object","required":["productId","productVariantId","label","stockUnit","lotCode","required","available","missing"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"number"},"available":{"type":"number"},"missing":{"type":"number"}}}}},"required":["id","number","status","product","quantity","sourceWarehouseId","sourceWarehouseName","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","targetLotCode","note","materialCost","labourCost","unitCost","costCurrency","createdByMemberName","plannedDate","startedDate","completedDate","cancelledDate","insertedDate","items","shortages"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"},"number":{"examples":["VP-2026-0001"],"type":"string"},"status":{"anyOf":[{"const":"planned","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"},{"const":"cancelled","type":"string"}]},"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"quantity":{"type":"number"},"sourceWarehouseId":{"type":"number"},"sourceWarehouseName":{"type":"string"},"targetWarehouseId":{"type":"number"},"targetWarehouseName":{"type":"string"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"materialCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Cost per produced unit (FIFO material + labour), set on completion.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","component","labourTypeId","labourName","hourlyRate","sourceLocationId","sourceLocationCode","lotCode","totalCost","reservedQuantity"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Material: units for the whole order. Labour: hours.","type":"number"},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourTypeId":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourName":{"anyOf":[{"type":"string"},{"type":"null"}]},"hourlyRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Pinned lot; NULL = automatic, oldest first.","anyOf":[{"type":"string"},{"type":"null"}]},"totalCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"reservedQuantity":{"type":"number"}}}},"shortages":{"description":"Material missing right now to start (planned) or complete (in progress). Empty = OK.","type":"array","items":{"type":"object","required":["productId","productVariantId","label","stockUnit","lotCode","required","available","missing"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"number"},"available":{"type":"number"},"missing":{"type":"number"}}}}},"required":["id","number","status","product","quantity","sourceWarehouseId","sourceWarehouseName","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","targetLotCode","note","materialCost","labourCost","unitCost","costCurrency","createdByMemberName","plannedDate","startedDate","completedDate","cancelledDate","insertedDate","items","shortages"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"},"number":{"examples":["VP-2026-0001"],"type":"string"},"status":{"anyOf":[{"const":"planned","type":"string"},{"const":"in_progress","type":"string"},{"const":"completed","type":"string"},{"const":"cancelled","type":"string"}]},"product":{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},"quantity":{"type":"number"},"sourceWarehouseId":{"type":"number"},"sourceWarehouseName":{"type":"string"},"targetWarehouseId":{"type":"number"},"targetWarehouseName":{"type":"string"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"targetLotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"materialCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"unitCost":{"description":"Cost per produced unit (FIFO material + labour), set on completion.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","anyOf":[{"type":"string"},{"type":"null"}]},"startedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"completedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","kind","position","quantity","component","labourTypeId","labourName","hourlyRate","sourceLocationId","sourceLocationCode","lotCode","totalCost","reservedQuantity"],"properties":{"id":{"type":"number"},"kind":{"anyOf":[{"const":"material","type":"string"},{"const":"labour","type":"string"}]},"position":{"type":"number"},"quantity":{"description":"Material: units for the whole order. Labour: hours.","type":"number"},"component":{"anyOf":[{"type":"object","required":["productId","productVariantId","productCode","variantCode","label","stockUnit","trackLots","cost","productionYield"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"type":"string"},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"description":"Stock unit (\"m\", \"ks\", …). NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"type":"boolean"},"cost":{"description":"Catalogue cost (variant.cost ?? product.cost).","anyOf":[{"type":"number"},{"type":"null"}]},"productionYield":{"anyOf":[{"type":"number"},{"type":"null"}]}}},{"type":"null"}]},"labourTypeId":{"anyOf":[{"type":"number"},{"type":"null"}]},"labourName":{"anyOf":[{"type":"string"},{"type":"null"}]},"hourlyRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"sourceLocationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Pinned lot; NULL = automatic, oldest first.","anyOf":[{"type":"string"},{"type":"null"}]},"totalCost":{"anyOf":[{"type":"number"},{"type":"null"}]},"reservedQuantity":{"type":"number"}}}},"shortages":{"description":"Material missing right now to start (planned) or complete (in progress). Empty = OK.","type":"array","items":{"type":"object","required":["productId","productVariantId","label","stockUnit","lotCode","required","available","missing"],"properties":{"productId":{"type":"number"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"label":{"type":"string"},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":{"type":"number"},"available":{"type":"number"},"missing":{"type":"number"}}}}},"required":["id","number","status","product","quantity","sourceWarehouseId","sourceWarehouseName","targetWarehouseId","targetWarehouseName","targetLocationId","targetLocationCode","targetLotCode","note","materialCost","labourCost","unitCost","costCurrency","createdByMemberName","plannedDate","startedDate","completedDate","cancelledDate","insertedDate","items","shortages"]}}}}},"operationId":"getBffWarehouseProductionOrderDetail","tags":["Warehouse production"],"summary":"Production order detail with lines and current shortages","description":"Movements of the order: GET /bff/warehouse/movement/list?productionOrderId=…"}},"/bff/warehouse/production/order/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"number":{"type":"string"}},"required":["success","id","number"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"number":{"type":"string"}},"required":["success","id","number"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"number":{"type":"string"}},"required":["success","id","number"]}}}}},"operationId":"postBffWarehouseProductionOrderCreate","tags":["Warehouse production"],"summary":"Create a production order from the bill of materials","description":"Snapshots the BOM scaled to the quantity. Status planned; nothing is reserved until start.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["productCode","quantity","sourceWarehouseId","targetWarehouseId"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Units to produce (≤ 3 decimals).","type":"number"},"sourceWarehouseId":{"description":"Material is taken from this warehouse.","type":"number"},"targetWarehouseId":{"description":"Finished goods are received here.","type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLotCode":{"description":"Lot of the finished goods. Lot-tracked products default to the order number.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","type":"string"},{"type":"null"}]},"materialPicks":{"type":"array","items":{"type":"object","required":["productCode"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Take exactly this lot. Omit for automatic (oldest first).","anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["productCode","quantity","sourceWarehouseId","targetWarehouseId"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Units to produce (≤ 3 decimals).","type":"number"},"sourceWarehouseId":{"description":"Material is taken from this warehouse.","type":"number"},"targetWarehouseId":{"description":"Finished goods are received here.","type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLotCode":{"description":"Lot of the finished goods. Lot-tracked products default to the order number.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","type":"string"},{"type":"null"}]},"materialPicks":{"type":"array","items":{"type":"object","required":["productCode"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Take exactly this lot. Omit for automatic (oldest first).","anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["productCode","quantity","sourceWarehouseId","targetWarehouseId"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"description":"Units to produce (≤ 3 decimals).","type":"number"},"sourceWarehouseId":{"description":"Material is taken from this warehouse.","type":"number"},"targetWarehouseId":{"description":"Finished goods are received here.","type":"number"},"targetLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"targetLotCode":{"description":"Lot of the finished goods. Lot-tracked products default to the order number.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"plannedDate":{"anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Planned production day, YYYY-MM-DD (BIZKIT-175).","type":"string"},{"type":"null"}]},"materialPicks":{"type":"array","items":{"type":"object","required":["productCode"],"properties":{"productCode":{"type":"string"},"productVariantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lotCode":{"description":"Take exactly this lot. Omit for automatic (oldest first).","anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}}}}},"/bff/warehouse/production/order/update-item":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseProductionOrderUpdate-item","tags":["Warehouse production"],"summary":"Pick the lot / location of a material line (planned orders only)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderId","itemId"],"properties":{"orderId":{"type":"number"},"itemId":{"type":"number"},"lotCode":{"description":"Null / empty = automatic (oldest lot first).","anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderId","itemId"],"properties":{"orderId":{"type":"number"},"itemId":{"type":"number"},"lotCode":{"description":"Null / empty = automatic (oldest lot first).","anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["orderId","itemId"],"properties":{"orderId":{"type":"number"},"itemId":{"type":"number"},"lotCode":{"description":"Null / empty = automatic (oldest lot first).","anyOf":[{"type":"string"},{"type":"null"}]},"sourceLocationId":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}},"/bff/warehouse/production/order/update-planned-date":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseProductionOrderUpdate-planned-date","tags":["Warehouse production"],"summary":"Set / clear the planned production date (BIZKIT-175)","description":"Allowed while the order is planned or in progress.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","plannedDate"],"properties":{"id":{"description":"Production order id.","type":"number"},"plannedDate":{"description":"Planned production day, YYYY-MM-DD; null clears it.","anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","plannedDate"],"properties":{"id":{"description":"Production order id.","type":"number"},"plannedDate":{"description":"Planned production day, YYYY-MM-DD; null clears it.","anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","plannedDate"],"properties":{"id":{"description":"Production order id.","type":"number"},"plannedDate":{"description":"Planned production day, YYYY-MM-DD; null clears it.","anyOf":[{"pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},{"type":"null"}]}}}}}}}},"/bff/warehouse/production/order/start":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseProductionOrderStart","tags":["Warehouse production"],"summary":"Start production (planned → in progress)","description":"Reserves the material on exact lot cells. Fails with the list of missing material.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}}}}}},"/bff/warehouse/production/order/complete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"number":{"type":"string"},"materialCost":{"type":"number"},"labourCost":{"type":"number"},"unitCost":{"type":"number"},"costCurrency":{"type":"string"},"uncostedQuantity":{"description":"Material units without a FIFO layer, priced from the catalogue cost.","type":"number"}},"required":["success","number","materialCost","labourCost","unitCost","costCurrency","uncostedQuantity"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"number":{"type":"string"},"materialCost":{"type":"number"},"labourCost":{"type":"number"},"unitCost":{"type":"number"},"costCurrency":{"type":"string"},"uncostedQuantity":{"description":"Material units without a FIFO layer, priced from the catalogue cost.","type":"number"}},"required":["success","number","materialCost","labourCost","unitCost","costCurrency","uncostedQuantity"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"number":{"type":"string"},"materialCost":{"type":"number"},"labourCost":{"type":"number"},"unitCost":{"type":"number"},"costCurrency":{"type":"string"},"uncostedQuantity":{"description":"Material units without a FIFO layer, priced from the catalogue cost.","type":"number"}},"required":["success","number","materialCost","labourCost","unitCost","costCurrency","uncostedQuantity"]}}}}},"operationId":"postBffWarehouseProductionOrderComplete","tags":["Warehouse production"],"summary":"Complete production","description":"One transaction: material leaves (production_out, FIFO cost), the product arrives (production_in) with unit cost = (material + labour) / quantity, which also becomes the product catalogue cost. A planned order is reserved first. Fails with the list of missing material.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}}}}}},"/bff/warehouse/production/order/cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffWarehouseProductionOrderCancel","tags":["Warehouse production"],"summary":"Cancel production (releases reservations)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Production order id.","type":"number"}}}}}}}},"/bff/purchase-order/list":{"get":{"parameters":[{"description":"draft → sent → partially_received → received | cancelled","schema":{"anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"in":"query","name":"status","required":false},{"description":"\"true\" = only draft / sent / partially_received.","schema":{"type":"string"},"in":"query","name":"openOnly","required":false},{"description":"\"true\" = only sent orders with a line past its due date.","schema":{"type":"string"},"in":"query","name":"overdueOnly","required":false},{"description":"Supplier contact external id.","schema":{"type":"string"},"in":"query","name":"vendorContactId","required":false},{"schema":{"type":"string"},"in":"query","name":"warehouseId","required":false},{"description":"Number, supplier reference / name / IČO, line name or product code.","schema":{"type":"string"},"in":"query","name":"search","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","number","status","vendor","vendorReference","warehouseId","warehouseName","locationId","locationCode","currency","expectedDate","totalNet","totalVat","total","itemCount","quantityOrdered","quantityReceived","note","internalNote","createdByMemberName","sentDate","receivedDate","cancelledDate","emailedDate","hasPdf","invoiceCount","overdue","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"number":{"examples":["OV-2026-0001"],"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendor":{"type":"object","required":["id","name","email","companyRegistrationNumber"],"properties":{"id":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"examples":["CZK"],"type":"string"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"itemCount":{"type":"number"},"quantityOrdered":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"quantityReceived":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailedDate":{"description":"Last e-mail of the order PDF to the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"hasPdf":{"type":"boolean"},"invoiceCount":{"description":"Linked non-cancelled received invoices.","type":"number"},"overdue":{"description":"Sent order with a line outstanding past its due date.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","number","status","vendor","vendorReference","warehouseId","warehouseName","locationId","locationCode","currency","expectedDate","totalNet","totalVat","total","itemCount","quantityOrdered","quantityReceived","note","internalNote","createdByMemberName","sentDate","receivedDate","cancelledDate","emailedDate","hasPdf","invoiceCount","overdue","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"number":{"examples":["OV-2026-0001"],"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendor":{"type":"object","required":["id","name","email","companyRegistrationNumber"],"properties":{"id":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"examples":["CZK"],"type":"string"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"itemCount":{"type":"number"},"quantityOrdered":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"quantityReceived":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailedDate":{"description":"Last e-mail of the order PDF to the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"hasPdf":{"type":"boolean"},"invoiceCount":{"description":"Linked non-cancelled received invoices.","type":"number"},"overdue":{"description":"Sent order with a line outstanding past its due date.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","number","status","vendor","vendorReference","warehouseId","warehouseName","locationId","locationCode","currency","expectedDate","totalNet","totalVat","total","itemCount","quantityOrdered","quantityReceived","note","internalNote","createdByMemberName","sentDate","receivedDate","cancelledDate","emailedDate","hasPdf","invoiceCount","overdue","insertedDate","updatedDate"],"properties":{"id":{"type":"number"},"number":{"examples":["OV-2026-0001"],"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendor":{"type":"object","required":["id","name","email","companyRegistrationNumber"],"properties":{"id":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"examples":["CZK"],"type":"string"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"itemCount":{"type":"number"},"quantityOrdered":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"quantityReceived":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailedDate":{"description":"Last e-mail of the order PDF to the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"hasPdf":{"type":"boolean"},"invoiceCount":{"description":"Linked non-cancelled received invoices.","type":"number"},"overdue":{"description":"Sent order with a line outstanding past its due date.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPurchase-orderList","tags":["Purchase order"],"summary":"List purchase orders (objednávky vydané)"}},"/bff/purchase-order/detail":{"get":{"parameters":[{"description":"Purchase order id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"number":{"examples":["OV-2026-0001"],"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendor":{"type":"object","required":["id","name","email","companyRegistrationNumber"],"properties":{"id":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"examples":["CZK"],"type":"string"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"itemCount":{"type":"number"},"quantityOrdered":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"quantityReceived":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailedDate":{"description":"Last e-mail of the order PDF to the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"hasPdf":{"type":"boolean"},"invoiceCount":{"description":"Linked non-cancelled received invoices.","type":"number"},"overdue":{"description":"Sent order with a line outstanding past its due date.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","position","productId","productVariantId","virtualItemSku","productCode","variantCode","name","stockUnit","trackLots","vendorItemCode","quantityOrdered","quantityReceived","quantityOutstanding","quantityInvoiced","unitPrice","vatRate","totalNet","totalVat","total","expectedDate","locationId","locationCode"],"properties":{"id":{"type":"number"},"position":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"stockUnit":{"description":"NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"description":"Receipt requires a lot number.","type":"boolean"},"vendorItemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"type":"number"},"quantityReceived":{"type":"number"},"quantityOutstanding":{"description":"max(ordered − received, 0)","type":"number"},"quantityInvoiced":{"description":"Billed by linked received invoices (credit notes subtract).","type":"number"},"unitPrice":{"description":"Net, order currency.","type":"number"},"vatRate":{"type":"number"},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"expectedDate":{"description":"YYYY-MM-DD; NULL = header date applies.","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Target location chosen on the line (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"receipts":{"type":"array","items":{"type":"object","required":["movementId","purchaseOrderItemId","itemName","quantity","lotCode","warehouseName","locationCode","unitCost","costCurrency","note","performedByMemberName","performedDate"],"properties":{"movementId":{"type":"number"},"purchaseOrderItemId":{"type":"number"},"itemName":{"type":"string"},"quantity":{"type":"number"},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"warehouseName":{"type":"string"},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitCost":{"description":"Organisation currency.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedDate":{"type":"string"}}}},"invoices":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","vendorExternalNumber","status","isCreditNote","currency","totalNet","total","issueDate","linkedLineCount","lineCount"],"properties":{"id":{"description":"Purchase invoice id.","type":"number"},"sequenceNumber":{"type":"string"},"vendorExternalNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"isCreditNote":{"type":"boolean"},"currency":{"type":"string"},"totalNet":{"type":"number"},"total":{"type":"number"},"issueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedLineCount":{"description":"Invoice lines linked to order lines.","type":"number"},"lineCount":{"type":"number"}}}},"invoiceHints":{"description":"Order vs. linked invoices discrepancies (empty without invoices).","type":"array","items":{"anyOf":[{"type":"object","required":["code","itemId","name","invoiced","received"],"properties":{"code":{"const":"line_invoiced_over_received","type":"string"},"itemId":{"type":"number"},"name":{"type":"string"},"invoiced":{"type":"number"},"received":{"type":"number"}}},{"type":"object","required":["code","itemId","name","invoiced","ordered"],"properties":{"code":{"const":"line_invoiced_over_ordered","type":"string"},"itemId":{"type":"number"},"name":{"type":"string"},"invoiced":{"type":"number"},"ordered":{"type":"number"}}},{"type":"object","required":["code","quantityLines"],"properties":{"code":{"const":"received_not_invoiced","type":"string"},"quantityLines":{"type":"number"}}},{"type":"object","required":["code","invoicedNet","expectedNet","difference"],"properties":{"code":{"const":"amount_differs","type":"string"},"invoicedNet":{"type":"number"},"expectedNet":{"type":"number"},"difference":{"type":"number"}}},{"type":"object","required":["code","invoiceCurrencies"],"properties":{"code":{"const":"currency_differs","type":"string"},"invoiceCurrencies":{"type":"array","items":{"type":"string"}}}}]}},"emails":{"description":"E-mails of the order PDF to the supplier, newest first.","type":"array","items":{"type":"object","required":["id","recipients","queuedDate","sentDate","openedDate"],"properties":{"id":{"type":"number"},"recipients":{"anyOf":[{"type":"string"},{"type":"null"}]},"queuedDate":{"type":"string"},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"openedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","number","status","vendor","vendorReference","warehouseId","warehouseName","locationId","locationCode","currency","expectedDate","totalNet","totalVat","total","itemCount","quantityOrdered","quantityReceived","note","internalNote","createdByMemberName","sentDate","receivedDate","cancelledDate","emailedDate","hasPdf","invoiceCount","overdue","insertedDate","updatedDate","items","receipts","invoices","invoiceHints","emails"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"number"},"number":{"examples":["OV-2026-0001"],"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendor":{"type":"object","required":["id","name","email","companyRegistrationNumber"],"properties":{"id":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"examples":["CZK"],"type":"string"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"itemCount":{"type":"number"},"quantityOrdered":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"quantityReceived":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailedDate":{"description":"Last e-mail of the order PDF to the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"hasPdf":{"type":"boolean"},"invoiceCount":{"description":"Linked non-cancelled received invoices.","type":"number"},"overdue":{"description":"Sent order with a line outstanding past its due date.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","position","productId","productVariantId","virtualItemSku","productCode","variantCode","name","stockUnit","trackLots","vendorItemCode","quantityOrdered","quantityReceived","quantityOutstanding","quantityInvoiced","unitPrice","vatRate","totalNet","totalVat","total","expectedDate","locationId","locationCode"],"properties":{"id":{"type":"number"},"position":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"stockUnit":{"description":"NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"description":"Receipt requires a lot number.","type":"boolean"},"vendorItemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"type":"number"},"quantityReceived":{"type":"number"},"quantityOutstanding":{"description":"max(ordered − received, 0)","type":"number"},"quantityInvoiced":{"description":"Billed by linked received invoices (credit notes subtract).","type":"number"},"unitPrice":{"description":"Net, order currency.","type":"number"},"vatRate":{"type":"number"},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"expectedDate":{"description":"YYYY-MM-DD; NULL = header date applies.","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Target location chosen on the line (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"receipts":{"type":"array","items":{"type":"object","required":["movementId","purchaseOrderItemId","itemName","quantity","lotCode","warehouseName","locationCode","unitCost","costCurrency","note","performedByMemberName","performedDate"],"properties":{"movementId":{"type":"number"},"purchaseOrderItemId":{"type":"number"},"itemName":{"type":"string"},"quantity":{"type":"number"},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"warehouseName":{"type":"string"},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitCost":{"description":"Organisation currency.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedDate":{"type":"string"}}}},"invoices":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","vendorExternalNumber","status","isCreditNote","currency","totalNet","total","issueDate","linkedLineCount","lineCount"],"properties":{"id":{"description":"Purchase invoice id.","type":"number"},"sequenceNumber":{"type":"string"},"vendorExternalNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"isCreditNote":{"type":"boolean"},"currency":{"type":"string"},"totalNet":{"type":"number"},"total":{"type":"number"},"issueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedLineCount":{"description":"Invoice lines linked to order lines.","type":"number"},"lineCount":{"type":"number"}}}},"invoiceHints":{"description":"Order vs. linked invoices discrepancies (empty without invoices).","type":"array","items":{"anyOf":[{"type":"object","required":["code","itemId","name","invoiced","received"],"properties":{"code":{"const":"line_invoiced_over_received","type":"string"},"itemId":{"type":"number"},"name":{"type":"string"},"invoiced":{"type":"number"},"received":{"type":"number"}}},{"type":"object","required":["code","itemId","name","invoiced","ordered"],"properties":{"code":{"const":"line_invoiced_over_ordered","type":"string"},"itemId":{"type":"number"},"name":{"type":"string"},"invoiced":{"type":"number"},"ordered":{"type":"number"}}},{"type":"object","required":["code","quantityLines"],"properties":{"code":{"const":"received_not_invoiced","type":"string"},"quantityLines":{"type":"number"}}},{"type":"object","required":["code","invoicedNet","expectedNet","difference"],"properties":{"code":{"const":"amount_differs","type":"string"},"invoicedNet":{"type":"number"},"expectedNet":{"type":"number"},"difference":{"type":"number"}}},{"type":"object","required":["code","invoiceCurrencies"],"properties":{"code":{"const":"currency_differs","type":"string"},"invoiceCurrencies":{"type":"array","items":{"type":"string"}}}}]}},"emails":{"description":"E-mails of the order PDF to the supplier, newest first.","type":"array","items":{"type":"object","required":["id","recipients","queuedDate","sentDate","openedDate"],"properties":{"id":{"type":"number"},"recipients":{"anyOf":[{"type":"string"},{"type":"null"}]},"queuedDate":{"type":"string"},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"openedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","number","status","vendor","vendorReference","warehouseId","warehouseName","locationId","locationCode","currency","expectedDate","totalNet","totalVat","total","itemCount","quantityOrdered","quantityReceived","note","internalNote","createdByMemberName","sentDate","receivedDate","cancelledDate","emailedDate","hasPdf","invoiceCount","overdue","insertedDate","updatedDate","items","receipts","invoices","invoiceHints","emails"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"number"},"number":{"examples":["OV-2026-0001"],"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendor":{"type":"object","required":["id","name","email","companyRegistrationNumber"],"properties":{"id":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"name":{"type":"string"},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyRegistrationNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}}},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"type":"number"},"warehouseName":{"type":"string"},"locationId":{"anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"examples":["CZK"],"type":"string"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"itemCount":{"type":"number"},"quantityOrdered":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"quantityReceived":{"description":"Sum over lines (mixed units, progress hint only).","type":"number"},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"receivedDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelledDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailedDate":{"description":"Last e-mail of the order PDF to the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"hasPdf":{"type":"boolean"},"invoiceCount":{"description":"Linked non-cancelled received invoices.","type":"number"},"overdue":{"description":"Sent order with a line outstanding past its due date.","type":"boolean"},"insertedDate":{"type":"string"},"updatedDate":{"type":"string"},"items":{"type":"array","items":{"type":"object","required":["id","position","productId","productVariantId","virtualItemSku","productCode","variantCode","name","stockUnit","trackLots","vendorItemCode","quantityOrdered","quantityReceived","quantityOutstanding","quantityInvoiced","unitPrice","vatRate","totalNet","totalVat","total","expectedDate","locationId","locationCode"],"properties":{"id":{"type":"number"},"position":{"type":"number"},"productId":{"anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"anyOf":[{"type":"string"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"sku":{"description":"Variant SKU, else product SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"stockUnit":{"description":"NULL = pieces.","anyOf":[{"type":"string"},{"type":"null"}]},"trackLots":{"description":"Receipt requires a lot number.","type":"boolean"},"vendorItemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"type":"number"},"quantityReceived":{"type":"number"},"quantityOutstanding":{"description":"max(ordered − received, 0)","type":"number"},"quantityInvoiced":{"description":"Billed by linked received invoices (credit notes subtract).","type":"number"},"unitPrice":{"description":"Net, order currency.","type":"number"},"vatRate":{"type":"number"},"totalNet":{"type":"number"},"totalVat":{"type":"number"},"total":{"type":"number"},"expectedDate":{"description":"YYYY-MM-DD; NULL = header date applies.","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Target location chosen on the line (BIZKIT-170).","anyOf":[{"type":"number"},{"type":"null"}]},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"receipts":{"type":"array","items":{"type":"object","required":["movementId","purchaseOrderItemId","itemName","quantity","lotCode","warehouseName","locationCode","unitCost","costCurrency","note","performedByMemberName","performedDate"],"properties":{"movementId":{"type":"number"},"purchaseOrderItemId":{"type":"number"},"itemName":{"type":"string"},"quantity":{"type":"number"},"lotCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"warehouseName":{"type":"string"},"locationCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitCost":{"description":"Organisation currency.","anyOf":[{"type":"number"},{"type":"null"}]},"costCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedByMemberName":{"anyOf":[{"type":"string"},{"type":"null"}]},"performedDate":{"type":"string"}}}},"invoices":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","vendorExternalNumber","status","isCreditNote","currency","totalNet","total","issueDate","linkedLineCount","lineCount"],"properties":{"id":{"description":"Purchase invoice id.","type":"number"},"sequenceNumber":{"type":"string"},"vendorExternalNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"isCreditNote":{"type":"boolean"},"currency":{"type":"string"},"totalNet":{"type":"number"},"total":{"type":"number"},"issueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedLineCount":{"description":"Invoice lines linked to order lines.","type":"number"},"lineCount":{"type":"number"}}}},"invoiceHints":{"description":"Order vs. linked invoices discrepancies (empty without invoices).","type":"array","items":{"anyOf":[{"type":"object","required":["code","itemId","name","invoiced","received"],"properties":{"code":{"const":"line_invoiced_over_received","type":"string"},"itemId":{"type":"number"},"name":{"type":"string"},"invoiced":{"type":"number"},"received":{"type":"number"}}},{"type":"object","required":["code","itemId","name","invoiced","ordered"],"properties":{"code":{"const":"line_invoiced_over_ordered","type":"string"},"itemId":{"type":"number"},"name":{"type":"string"},"invoiced":{"type":"number"},"ordered":{"type":"number"}}},{"type":"object","required":["code","quantityLines"],"properties":{"code":{"const":"received_not_invoiced","type":"string"},"quantityLines":{"type":"number"}}},{"type":"object","required":["code","invoicedNet","expectedNet","difference"],"properties":{"code":{"const":"amount_differs","type":"string"},"invoicedNet":{"type":"number"},"expectedNet":{"type":"number"},"difference":{"type":"number"}}},{"type":"object","required":["code","invoiceCurrencies"],"properties":{"code":{"const":"currency_differs","type":"string"},"invoiceCurrencies":{"type":"array","items":{"type":"string"}}}}]}},"emails":{"description":"E-mails of the order PDF to the supplier, newest first.","type":"array","items":{"type":"object","required":["id","recipients","queuedDate","sentDate","openedDate"],"properties":{"id":{"type":"number"},"recipients":{"anyOf":[{"type":"string"},{"type":"null"}]},"queuedDate":{"type":"string"},"sentDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"openedDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}},"required":["id","number","status","vendor","vendorReference","warehouseId","warehouseName","locationId","locationCode","currency","expectedDate","totalNet","totalVat","total","itemCount","quantityOrdered","quantityReceived","note","internalNote","createdByMemberName","sentDate","receivedDate","cancelledDate","emailedDate","hasPdf","invoiceCount","overdue","insertedDate","updatedDate","items","receipts","invoices","invoiceHints","emails"]}}}}},"operationId":"getBffPurchase-orderDetail","tags":["Purchase order"],"summary":"Purchase order detail with lines and receipt history"}},"/bff/purchase-order/save":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"number":{"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","id","number","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"number":{"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","id","number","status"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"number":{"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","id","number","status"]}}}}},"operationId":"postBffPurchase-orderSave","tags":["Purchase order"],"summary":"Create or update a purchase order with its lines","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["vendorContactId","warehouseId","items"],"properties":{"id":{"description":"Omit to create a new order (status draft).","anyOf":[{"type":"number"},{"type":"null"}]},"vendorContactId":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"description":"Warehouse the goods will be received into.","type":"number"},"locationId":{"description":"Default location for receipts.","anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO 4217; defaults to the organisation currency. Locked after the first receipt.","anyOf":[{"type":"string"},{"type":"null"}]},"expectedDate":{"description":"Expected delivery, YYYY-MM-DD.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"maxItems":500,"description":"Full replacement. Lines that already received goods cannot be removed or change their item.","type":"array","items":{"type":"object","required":["quantityOrdered","unitPrice","vatRate"],"properties":{"id":{"description":"Existing line id; omit for a new line.","anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Product code (catalogue item).","anyOf":[{"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code (requires productCode).","anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Non-catalogue item (packaging, service). Excludes productCode.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Defaults to the catalogue name.","anyOf":[{"type":"string"},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's item code.","anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"minimum":0,"description":"Net unit price, order currency.","type":"number"},"vatRate":{"minimum":0,"maximum":100,"type":"number"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Target location in the order's warehouse (BIZKIT-170). Omit to keep / prefill from the product's default location; NULL = none.","anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["vendorContactId","warehouseId","items"],"properties":{"id":{"description":"Omit to create a new order (status draft).","anyOf":[{"type":"number"},{"type":"null"}]},"vendorContactId":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"description":"Warehouse the goods will be received into.","type":"number"},"locationId":{"description":"Default location for receipts.","anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO 4217; defaults to the organisation currency. Locked after the first receipt.","anyOf":[{"type":"string"},{"type":"null"}]},"expectedDate":{"description":"Expected delivery, YYYY-MM-DD.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"maxItems":500,"description":"Full replacement. Lines that already received goods cannot be removed or change their item.","type":"array","items":{"type":"object","required":["quantityOrdered","unitPrice","vatRate"],"properties":{"id":{"description":"Existing line id; omit for a new line.","anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Product code (catalogue item).","anyOf":[{"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code (requires productCode).","anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Non-catalogue item (packaging, service). Excludes productCode.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Defaults to the catalogue name.","anyOf":[{"type":"string"},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's item code.","anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"minimum":0,"description":"Net unit price, order currency.","type":"number"},"vatRate":{"minimum":0,"maximum":100,"type":"number"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Target location in the order's warehouse (BIZKIT-170). Omit to keep / prefill from the product's default location; NULL = none.","anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},"text/plain":{"schema":{"type":"object","required":["vendorContactId","warehouseId","items"],"properties":{"id":{"description":"Omit to create a new order (status draft).","anyOf":[{"type":"number"},{"type":"null"}]},"vendorContactId":{"description":"Supplier contact external id (CuRefNo).","type":"string"},"vendorReference":{"description":"Supplier's order confirmation number.","anyOf":[{"type":"string"},{"type":"null"}]},"warehouseId":{"description":"Warehouse the goods will be received into.","type":"number"},"locationId":{"description":"Default location for receipts.","anyOf":[{"type":"number"},{"type":"null"}]},"currencyCode":{"description":"ISO 4217; defaults to the organisation currency. Locked after the first receipt.","anyOf":[{"type":"string"},{"type":"null"}]},"expectedDate":{"description":"Expected delivery, YYYY-MM-DD.","anyOf":[{"type":"string"},{"type":"null"}]},"note":{"description":"Note for the supplier.","anyOf":[{"type":"string"},{"type":"null"}]},"internalNote":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"maxItems":500,"description":"Full replacement. Lines that already received goods cannot be removed or change their item.","type":"array","items":{"type":"object","required":["quantityOrdered","unitPrice","vatRate"],"properties":{"id":{"description":"Existing line id; omit for a new line.","anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"description":"Product code (catalogue item).","anyOf":[{"type":"string"},{"type":"null"}]},"productVariantCode":{"description":"Variant code (requires productCode).","anyOf":[{"type":"string"},{"type":"null"}]},"virtualItemSku":{"description":"Non-catalogue item (packaging, service). Excludes productCode.","anyOf":[{"type":"string"},{"type":"null"}]},"name":{"description":"Defaults to the catalogue name.","anyOf":[{"type":"string"},{"type":"null"}]},"vendorItemCode":{"description":"Supplier's item code.","anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"exclusiveMinimum":0,"type":"number"},"unitPrice":{"minimum":0,"description":"Net unit price, order currency.","type":"number"},"vatRate":{"minimum":0,"maximum":100,"type":"number"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Target location in the order's warehouse (BIZKIT-170). Omit to keep / prefill from the product's default location; NULL = none.","anyOf":[{"type":"number"},{"type":"null"}]}}}}}}}}}}},"/bff/purchase-order/send":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}}}}},"operationId":"postBffPurchase-orderSend","tags":["Purchase order"],"summary":"Mark a draft as sent to the supplier","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}}}}}},"/bff/purchase-order/cancel":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}}}}},"operationId":"postBffPurchase-orderCancel","tags":["Purchase order"],"summary":"Cancel a draft or sent order","description":"Refused once anything was received; use /close instead.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}}}}}},"/bff/purchase-order/close":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]}},"required":["success","status"]}}}}},"operationId":"postBffPurchase-orderClose","tags":["Purchase order"],"summary":"Close an order short (the rest will not be delivered)","description":"Status → received; the outstanding quantity stops counting as ordered.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"}}}}}}}},"/bff/purchase-order/receive":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"alreadyApplied":{"type":"boolean"},"movementIds":{"type":"array","items":{"type":"number"}},"catalogueCostLines":{"description":"Lines priced from the catalogue cost because the order price was 0 or no exchange rate was found.","type":"array","items":{"type":"string"}}},"required":["success","status","alreadyApplied","movementIds","catalogueCostLines"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"alreadyApplied":{"type":"boolean"},"movementIds":{"type":"array","items":{"type":"number"}},"catalogueCostLines":{"description":"Lines priced from the catalogue cost because the order price was 0 or no exchange rate was found.","type":"array","items":{"type":"string"}}},"required":["success","status","alreadyApplied","movementIds","catalogueCostLines"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"alreadyApplied":{"type":"boolean"},"movementIds":{"type":"array","items":{"type":"number"}},"catalogueCostLines":{"description":"Lines priced from the catalogue cost because the order price was 0 or no exchange rate was found.","type":"array","items":{"type":"string"}}},"required":["success","status","alreadyApplied","movementIds","catalogueCostLines"]}}}}},"operationId":"postBffPurchase-orderReceive","tags":["Purchase order"],"summary":"Receive goods (naskladnění) from a purchase order, fully or partially","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","lines"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"warehouseId":{"description":"Overrides the order's warehouse for this receipt.","anyOf":[{"type":"number"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"description":"The same line may appear more than once (several lots).","type":"array","items":{"type":"object","required":["purchaseOrderItemId","quantity"],"properties":{"purchaseOrderItemId":{"type":"number"},"quantity":{"exclusiveMinimum":0,"description":"Units that arrived now.","type":"number"},"lotCode":{"description":"Required for lot-tracked products.","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Overrides the order's default location.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"note":{"description":"Stored on the movements (e.g. delivery note number).","anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"description":"Client token (≤ 64 chars); a repeated submit with the same token is a no-op.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","lines"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"warehouseId":{"description":"Overrides the order's warehouse for this receipt.","anyOf":[{"type":"number"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"description":"The same line may appear more than once (several lots).","type":"array","items":{"type":"object","required":["purchaseOrderItemId","quantity"],"properties":{"purchaseOrderItemId":{"type":"number"},"quantity":{"exclusiveMinimum":0,"description":"Units that arrived now.","type":"number"},"lotCode":{"description":"Required for lot-tracked products.","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Overrides the order's default location.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"note":{"description":"Stored on the movements (e.g. delivery note number).","anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"description":"Client token (≤ 64 chars); a repeated submit with the same token is a no-op.","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id","lines"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"warehouseId":{"description":"Overrides the order's warehouse for this receipt.","anyOf":[{"type":"number"},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"description":"The same line may appear more than once (several lots).","type":"array","items":{"type":"object","required":["purchaseOrderItemId","quantity"],"properties":{"purchaseOrderItemId":{"type":"number"},"quantity":{"exclusiveMinimum":0,"description":"Units that arrived now.","type":"number"},"lotCode":{"description":"Required for lot-tracked products.","anyOf":[{"type":"string"},{"type":"null"}]},"locationId":{"description":"Overrides the order's default location.","anyOf":[{"type":"number"},{"type":"null"}]}}}},"note":{"description":"Stored on the movements (e.g. delivery note number).","anyOf":[{"type":"string"},{"type":"null"}]},"idempotencyKey":{"description":"Client token (≤ 64 chars); a repeated submit with the same token is a no-op.","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/purchase-order/line-price":{"get":{"parameters":[{"description":"Catalogue product code.","schema":{"type":"string"},"in":"query","name":"productCode","required":true},{"description":"Variant code, if a variant is ordered.","schema":{"type":"string"},"in":"query","name":"productVariantCode","required":false},{"description":"Supplier contact external id; enables the last-purchase price.","schema":{"type":"string"},"in":"query","name":"vendorContactId","required":false},{"description":"Currency of the purchase order (ISO code).","schema":{"type":"string"},"in":"query","name":"currencyCode","required":true},{"description":"The order being edited; its own lines are ignored.","schema":{"type":"string"},"in":"query","name":"purchaseOrderId","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"unitPrice":{"description":"Suggested net unit price in the order currency.","anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"const":"last_purchase","type":"string"},{"const":"catalogue_cost","type":"string"},{"type":"null"}]},"vatRate":{"description":"Product VAT rate, else the last line VAT.","anyOf":[{"type":"number"},{"type":"null"}]},"vendorItemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastPurchaseDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"lastPurchaseOrderNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["unitPrice","source","vatRate","vendorItemCode","lastPurchaseDate","lastPurchaseOrderNumber"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"unitPrice":{"description":"Suggested net unit price in the order currency.","anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"const":"last_purchase","type":"string"},{"const":"catalogue_cost","type":"string"},{"type":"null"}]},"vatRate":{"description":"Product VAT rate, else the last line VAT.","anyOf":[{"type":"number"},{"type":"null"}]},"vendorItemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastPurchaseDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"lastPurchaseOrderNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["unitPrice","source","vatRate","vendorItemCode","lastPurchaseDate","lastPurchaseOrderNumber"]}},"text/plain":{"schema":{"type":"object","properties":{"unitPrice":{"description":"Suggested net unit price in the order currency.","anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"const":"last_purchase","type":"string"},{"const":"catalogue_cost","type":"string"},{"type":"null"}]},"vatRate":{"description":"Product VAT rate, else the last line VAT.","anyOf":[{"type":"number"},{"type":"null"}]},"vendorItemCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastPurchaseDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"lastPurchaseOrderNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["unitPrice","source","vatRate","vendorItemCode","lastPurchaseDate","lastPurchaseOrderNumber"]}}}}},"operationId":"getBffPurchase-orderLine-price","tags":["Purchase order"],"summary":"Suggested price of a new purchase-order line (BIZKIT-169)","description":"Latest price of the same item from the same supplier in the order currency, else the product's internal cost (when the order is in the organisation default currency). VAT from the product."}},"/bff/purchase-order/incoming":{"get":{"parameters":[{"description":"Catalogue product code.","schema":{"type":"string"},"in":"query","name":"productCode","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["purchaseOrderId","number","status","vendorName","warehouseName","productVariantId","variantCode","variantName","name","stockUnit","quantityOrdered","quantityReceived","quantityOutstanding","dueDate"],"properties":{"purchaseOrderId":{"type":"number"},"number":{"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendorName":{"type":"string"},"warehouseName":{"type":"string"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"type":"number"},"quantityReceived":{"type":"number"},"quantityOutstanding":{"type":"number"},"dueDate":{"description":"Line date, else order date (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["purchaseOrderId","number","status","vendorName","warehouseName","productVariantId","variantCode","variantName","name","stockUnit","quantityOrdered","quantityReceived","quantityOutstanding","dueDate"],"properties":{"purchaseOrderId":{"type":"number"},"number":{"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendorName":{"type":"string"},"warehouseName":{"type":"string"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"type":"number"},"quantityReceived":{"type":"number"},"quantityOutstanding":{"type":"number"},"dueDate":{"description":"Line date, else order date (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["purchaseOrderId","number","status","vendorName","warehouseName","productVariantId","variantCode","variantName","name","stockUnit","quantityOrdered","quantityReceived","quantityOutstanding","dueDate"],"properties":{"purchaseOrderId":{"type":"number"},"number":{"type":"string"},"status":{"description":"draft → sent → partially_received → received | cancelled","anyOf":[{"const":"draft","type":"string"},{"const":"sent","type":"string"},{"const":"partially_received","type":"string"},{"const":"received","type":"string"},{"const":"cancelled","type":"string"}]},"vendorName":{"type":"string"},"warehouseName":{"type":"string"},"productVariantId":{"anyOf":[{"type":"number"},{"type":"null"}]},"variantCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"variantName":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"type":"string"},"stockUnit":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantityOrdered":{"type":"number"},"quantityReceived":{"type":"number"},"quantityOutstanding":{"type":"number"},"dueDate":{"description":"Line date, else order date (YYYY-MM-DD).","anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPurchase-orderIncoming","tags":["Purchase order"],"summary":"Open purchase order lines of a product (incoming goods)"}},"/bff/purchase-order/create-from-items":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orders":{"type":"array","items":{"type":"object","required":["id","number"],"properties":{"id":{"type":"number"},"number":{"type":"string"}}}}},"required":["success","orders"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orders":{"type":"array","items":{"type":"object","required":["id","number"],"properties":{"id":{"type":"number"},"number":{"type":"string"}}}}},"required":["success","orders"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"orders":{"type":"array","items":{"type":"object","required":["id","number"],"properties":{"id":{"type":"number"},"number":{"type":"string"}}}}},"required":["success","orders"]}}}}},"operationId":"postBffPurchase-orderCreate-from-items","tags":["Purchase order"],"summary":"Draft purchase orders from low-stock items","description":"One draft per supplier + warehouse group. Lines are priced from the latest order line of the same supplier and item (in the organisation currency), else from the catalogue cost; VAT from that line, else from the product.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orders"],"properties":{"orders":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","required":["vendorContactId","warehouseId","items"],"properties":{"vendorContactId":{"description":"Supplier contact external id.","type":"string"},"warehouseId":{"type":"number"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"type":"array","items":{"type":"object","required":["quantity"],"properties":{"productId":{"description":"Stock-cell product id (plain product).","anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"description":"Stock-cell variant id.","anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"description":"Non-catalogue SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"type":"number"}}}}}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["orders"],"properties":{"orders":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","required":["vendorContactId","warehouseId","items"],"properties":{"vendorContactId":{"description":"Supplier contact external id.","type":"string"},"warehouseId":{"type":"number"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"type":"array","items":{"type":"object","required":["quantity"],"properties":{"productId":{"description":"Stock-cell product id (plain product).","anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"description":"Stock-cell variant id.","anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"description":"Non-catalogue SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"type":"number"}}}}}}}}}},"text/plain":{"schema":{"type":"object","required":["orders"],"properties":{"orders":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","required":["vendorContactId","warehouseId","items"],"properties":{"vendorContactId":{"description":"Supplier contact external id.","type":"string"},"warehouseId":{"type":"number"},"expectedDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]},"items":{"minItems":1,"type":"array","items":{"type":"object","required":["quantity"],"properties":{"productId":{"description":"Stock-cell product id (plain product).","anyOf":[{"type":"number"},{"type":"null"}]},"productVariantId":{"description":"Stock-cell variant id.","anyOf":[{"type":"number"},{"type":"null"}]},"virtualItemSku":{"description":"Non-catalogue SKU.","anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"exclusiveMinimum":0,"type":"number"}}}}}}}}}}}}}},"/bff/purchase-order/invoice-candidates":{"get":{"parameters":[{"description":"Purchase order id.","schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","vendorExternalNumber","status","isCreditNote","currency","totalNet","total","issueDate","linkedLineCount","lineCount"],"properties":{"id":{"description":"Purchase invoice id.","type":"number"},"sequenceNumber":{"type":"string"},"vendorExternalNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"isCreditNote":{"type":"boolean"},"currency":{"type":"string"},"totalNet":{"type":"number"},"total":{"type":"number"},"issueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedLineCount":{"description":"Invoice lines linked to order lines.","type":"number"},"lineCount":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","vendorExternalNumber","status","isCreditNote","currency","totalNet","total","issueDate","linkedLineCount","lineCount"],"properties":{"id":{"description":"Purchase invoice id.","type":"number"},"sequenceNumber":{"type":"string"},"vendorExternalNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"isCreditNote":{"type":"boolean"},"currency":{"type":"string"},"totalNet":{"type":"number"},"total":{"type":"number"},"issueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedLineCount":{"description":"Invoice lines linked to order lines.","type":"number"},"lineCount":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","sequenceNumber","vendorExternalNumber","status","isCreditNote","currency","totalNet","total","issueDate","linkedLineCount","lineCount"],"properties":{"id":{"description":"Purchase invoice id.","type":"number"},"sequenceNumber":{"type":"string"},"vendorExternalNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"isCreditNote":{"type":"boolean"},"currency":{"type":"string"},"totalNet":{"type":"number"},"total":{"type":"number"},"issueDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedLineCount":{"description":"Invoice lines linked to order lines.","type":"number"},"lineCount":{"type":"number"}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffPurchase-orderInvoice-candidates","tags":["Purchase order"],"summary":"Received invoices that can be linked to the order","description":"Same supplier (or none yet), not linked to any order, not cancelled, issued within a year."}},"/bff/purchase-order/create-invoice":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"sequenceNumber":{"type":"string"},"lineCount":{"type":"number"}},"required":["success","id","sequenceNumber","lineCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"sequenceNumber":{"type":"string"},"lineCount":{"type":"number"}},"required":["success","id","sequenceNumber","lineCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"id":{"type":"number"},"sequenceNumber":{"type":"string"},"lineCount":{"type":"number"}},"required":["success","id","sequenceNumber","lineCount"]}}}}},"operationId":"postBffPurchase-orderCreate-invoice","tags":["Purchase order"],"summary":"Draft a received invoice from the order","description":"Lines = received (or ordered) minus already invoiced quantities at the order price; header and lines stay linked.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"basis":{"description":"Bill received (default) or ordered quantities.","anyOf":[{"const":"received","type":"string"},{"const":"ordered","type":"string"}]},"vendorExternalNumber":{"description":"Supplier's invoice number.","anyOf":[{"type":"string"},{"type":"null"}]},"issueDate":{"description":"YYYY-MM-DD; default today.","anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"basis":{"description":"Bill received (default) or ordered quantities.","anyOf":[{"const":"received","type":"string"},{"const":"ordered","type":"string"}]},"vendorExternalNumber":{"description":"Supplier's invoice number.","anyOf":[{"type":"string"},{"type":"null"}]},"issueDate":{"description":"YYYY-MM-DD; default today.","anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"basis":{"description":"Bill received (default) or ordered quantities.","anyOf":[{"const":"received","type":"string"},{"const":"ordered","type":"string"}]},"vendorExternalNumber":{"description":"Supplier's invoice number.","anyOf":[{"type":"string"},{"type":"null"}]},"issueDate":{"description":"YYYY-MM-DD; default today.","anyOf":[{"type":"string"},{"type":"null"}]},"dueDate":{"description":"YYYY-MM-DD","anyOf":[{"type":"string"},{"type":"null"}]}}}}}}}},"/bff/purchase-order/link-invoice":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"sequenceNumber":{"type":"string"},"matchedLines":{"type":"number"},"lineCount":{"type":"number"}},"required":["success","sequenceNumber","matchedLines","lineCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"sequenceNumber":{"type":"string"},"matchedLines":{"type":"number"},"lineCount":{"type":"number"}},"required":["success","sequenceNumber","matchedLines","lineCount"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"sequenceNumber":{"type":"string"},"matchedLines":{"type":"number"},"lineCount":{"type":"number"}},"required":["success","sequenceNumber","matchedLines","lineCount"]}}}}},"operationId":"postBffPurchase-orderLink-invoice","tags":["Purchase order"],"summary":"Link an existing received invoice to the order","description":"Same supplier required. Invoice lines are paired with order lines by name or code where unambiguous.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","purchaseInvoiceId"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"purchaseInvoiceId":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","purchaseInvoiceId"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"purchaseInvoiceId":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id","purchaseInvoiceId"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"purchaseInvoiceId":{"type":"number"}}}}}}}},"/bff/purchase-order/unlink-invoice":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"}},"required":["success"]}}}}},"operationId":"postBffPurchase-orderUnlink-invoice","tags":["Purchase order"],"summary":"Unlink a received invoice from the order","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","purchaseInvoiceId"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"purchaseInvoiceId":{"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id","purchaseInvoiceId"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"purchaseInvoiceId":{"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["id","purchaseInvoiceId"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"purchaseInvoiceId":{"type":"number"}}}}}}}},"/bff/purchase-order/pdf":{"get":{"parameters":[{"description":"Purchase order id.","schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"cs, sk, en, de, pl, it. Default: the supplier's language.","schema":{"type":"string"},"in":"query","name":"locale","required":false}],"operationId":"getBffPurchase-orderPdf","tags":["Purchase order"],"summary":"Purchase order PDF (preview / print)","description":"Rendered on demand, not stored. Internal notes never appear on the document.","responses":{"200":{}}}},"/bff/purchase-order/send-email":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"queued":{"type":"boolean"},"markedAsSent":{"type":"boolean"}},"required":["success","email","queued","markedAsSent"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"queued":{"type":"boolean"},"markedAsSent":{"type":"boolean"}},"required":["success","email","queued","markedAsSent"]}},"text/plain":{"schema":{"type":"object","properties":{"success":{"const":true,"type":"boolean"},"email":{"type":"string"},"queued":{"type":"boolean"},"markedAsSent":{"type":"boolean"}},"required":["success","email","queued","markedAsSent"]}}}}},"operationId":"postBffPurchase-orderSend-email","tags":["Purchase order"],"summary":"E-mail the order PDF to the supplier","description":"Renders the PDF in the recipient's language, stores it on the order and queues the `purchase-order-send` e-mail with the PDF attached. A draft order is marked as sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"to":{"description":"Recipient; default the supplier contact's e-mail.","anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"maxItems":10,"type":"array","items":{"type":"string"}},"message":{"description":"Optional message shown in the e-mail body.","anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"description":"cs, sk, en, de, pl, it. Default: from the recipient.","anyOf":[{"type":"string"},{"type":"null"}]},"markAsSent":{"description":"Move a draft to sent once queued (default true).","type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"to":{"description":"Recipient; default the supplier contact's e-mail.","anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"maxItems":10,"type":"array","items":{"type":"string"}},"message":{"description":"Optional message shown in the e-mail body.","anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"description":"cs, sk, en, de, pl, it. Default: from the recipient.","anyOf":[{"type":"string"},{"type":"null"}]},"markAsSent":{"description":"Move a draft to sent once queued (default true).","type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"description":"Purchase order id.","type":"number"},"to":{"description":"Recipient; default the supplier contact's e-mail.","anyOf":[{"type":"string"},{"type":"null"}]},"cc":{"maxItems":10,"type":"array","items":{"type":"string"}},"message":{"description":"Optional message shown in the e-mail body.","anyOf":[{"type":"string"},{"type":"null"}]},"locale":{"description":"cs, sk, en, de, pl, it. Default: from the recipient.","anyOf":[{"type":"string"},{"type":"null"}]},"markAsSent":{"description":"Move a draft to sent once queued (default true).","type":"boolean"}}}}}}}},"/bff/fulfillment/overview":{"get":{"operationId":"getBffFulfillmentOverview","tags":["bff"],"responses":{"200":{}}}},"/bff/fulfillment/pick-list":{"get":{"operationId":"getBffFulfillmentPick-list","tags":["bff"],"responses":{"200":{}}}},"/bff/fulfillment/pick":{"post":{"parameters":[],"operationId":"postBffFulfillmentPick","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["itemKey"],"properties":{"itemKey":{"maxLength":32,"type":"string"},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"multipart/form-data":{"schema":{"type":"object","required":["itemKey"],"properties":{"itemKey":{"maxLength":32,"type":"string"},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}},"text/plain":{"schema":{"type":"object","required":["itemKey"],"properties":{"itemKey":{"maxLength":32,"type":"string"},"quantity":{"minimum":1,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":1,"type":"integer"}]}}}}}},"responses":{"200":{}}}},"/bff/fulfillment/order-state":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"orderHash","required":true}],"operationId":"getBffFulfillmentOrder-state","tags":["bff"],"responses":{"200":{}}}},"/bff/fulfillment/pick-order":{"post":{"parameters":[],"operationId":"postBffFulfillmentPick-order","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/fulfillment/pack-queue":{"get":{"operationId":"getBffFulfillmentPack-queue","tags":["bff"],"responses":{"200":{}}}},"/bff/fulfillment/orders":{"get":{"parameters":[{"description":"'picking' | 'ready' | 'hold' | 'packed'.","schema":{"type":"string"},"in":"query","name":"stage","required":false},{"description":"DataGrid fulltext over order number, customer, city and tracking number.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffFulfillmentOrders","tags":["bff"],"responses":{"200":{}}}},"/bff/fulfillment/labels":{"post":{"parameters":[],"operationId":"postBffFulfillmentLabels","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{}}}},"/bff/fulfillment/labels-pdf":{"post":{"parameters":[],"operationId":"postBffFulfillmentLabels-pdf","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}},"layout":{"anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}},"layout":{"anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}},"layout":{"anyOf":[{"const":"original","type":"string"},{"const":"a4-2x2","type":"string"},{"const":"a6","type":"string"}]},"startPosition":{"minimum":1,"maximum":4,"type":"number"}}}}}},"responses":{"200":{}}}},"/bff/fulfillment/labels-printed":{"post":{"parameters":[],"operationId":"postBffFulfillmentLabels-printed","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["orderHashes"],"properties":{"orderHashes":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{}}}},"/bff/fulfillment/pack":{"post":{"parameters":[],"operationId":"postBffFulfillmentPack","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"},"withoutLabel":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"},"withoutLabel":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"},"withoutLabel":{"type":"boolean"}}}}}},"responses":{"200":{}}}},"/bff/fulfillment/unpack":{"post":{"parameters":[],"operationId":"postBffFulfillmentUnpack","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash"],"properties":{"orderHash":{"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/fulfillment/hold":{"post":{"parameters":[],"operationId":"postBffFulfillmentHold","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["orderHash","hold"],"properties":{"orderHash":{"type":"string"},"hold":{"type":"boolean"},"reason":{"maxLength":200,"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["orderHash","hold"],"properties":{"orderHash":{"type":"string"},"hold":{"type":"boolean"},"reason":{"maxLength":200,"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["orderHash","hold"],"properties":{"orderHash":{"type":"string"},"hold":{"type":"boolean"},"reason":{"maxLength":200,"type":"string"}}}}}},"responses":{"200":{}}}},"/bff/fulfillment/products":{"get":{"operationId":"getBffFulfillmentProducts","tags":["bff"],"responses":{"200":{}}}},"/bff/fulfillment/product":{"post":{"parameters":[],"operationId":"postBffFulfillmentProduct","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code","kind","isMain","volume"],"properties":{"code":{"type":"string"},"kind":{"anyOf":[{"const":"big","type":"string"},{"const":"small","type":"string"},{"const":"digital","type":"string"}]},"isMain":{"type":"boolean"},"pickLocation":{"nullable":true,"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"volume":{"minimum":0,"maximum":999999,"type":"number"}}}},"multipart/form-data":{"schema":{"type":"object","required":["code","kind","isMain","volume"],"properties":{"code":{"type":"string"},"kind":{"anyOf":[{"const":"big","type":"string"},{"const":"small","type":"string"},{"const":"digital","type":"string"}]},"isMain":{"type":"boolean"},"pickLocation":{"nullable":true,"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"volume":{"minimum":0,"maximum":999999,"type":"number"}}}},"text/plain":{"schema":{"type":"object","required":["code","kind","isMain","volume"],"properties":{"code":{"type":"string"},"kind":{"anyOf":[{"const":"big","type":"string"},{"const":"small","type":"string"},{"const":"digital","type":"string"}]},"isMain":{"type":"boolean"},"pickLocation":{"nullable":true,"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}]},"volume":{"minimum":0,"maximum":999999,"type":"number"}}}}}},"responses":{"200":{}}}},"/bff/webhook/list":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","url","secretPreview","description","events","isActive","failureCount","pendingCount","lastSuccessDate","lastFailureDate","lastError","insertedDate"],"properties":{"id":{"description":"External id of the endpoint.","type":"string"},"url":{"type":"string"},"secretPreview":{"description":"Start of the signing secret; the full value is returned only by create / rotate-secret.","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"description":"Subscribed events; empty = all events.","type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"failureCount":{"description":"Consecutive failed deliveries (the endpoint is disabled at 50).","type":"number"},"pendingCount":{"type":"number"},"lastSuccessDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastFailureDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}},"itemCount":{"type":"number"},"events":{"type":"array","items":{"type":"string"}}},"required":["items","itemCount","events"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","url","secretPreview","description","events","isActive","failureCount","pendingCount","lastSuccessDate","lastFailureDate","lastError","insertedDate"],"properties":{"id":{"description":"External id of the endpoint.","type":"string"},"url":{"type":"string"},"secretPreview":{"description":"Start of the signing secret; the full value is returned only by create / rotate-secret.","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"description":"Subscribed events; empty = all events.","type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"failureCount":{"description":"Consecutive failed deliveries (the endpoint is disabled at 50).","type":"number"},"pendingCount":{"type":"number"},"lastSuccessDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastFailureDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}},"itemCount":{"type":"number"},"events":{"type":"array","items":{"type":"string"}}},"required":["items","itemCount","events"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","url","secretPreview","description","events","isActive","failureCount","pendingCount","lastSuccessDate","lastFailureDate","lastError","insertedDate"],"properties":{"id":{"description":"External id of the endpoint.","type":"string"},"url":{"type":"string"},"secretPreview":{"description":"Start of the signing secret; the full value is returned only by create / rotate-secret.","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"description":"Subscribed events; empty = all events.","type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"failureCount":{"description":"Consecutive failed deliveries (the endpoint is disabled at 50).","type":"number"},"pendingCount":{"type":"number"},"lastSuccessDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastFailureDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}}}},"itemCount":{"type":"number"},"events":{"type":"array","items":{"type":"string"}}},"required":["items","itemCount","events"]}}}}},"operationId":"getBffWebhookList","tags":["Webhook"],"summary":"List webhook endpoints"}},"/bff/webhook/detail":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"id","required":true}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"External id of the endpoint.","type":"string"},"url":{"type":"string"},"secretPreview":{"description":"Start of the signing secret; the full value is returned only by create / rotate-secret.","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"description":"Subscribed events; empty = all events.","type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"failureCount":{"description":"Consecutive failed deliveries (the endpoint is disabled at 50).","type":"number"},"pendingCount":{"type":"number"},"lastSuccessDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastFailureDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}},"required":["id","url","secretPreview","description","events","isActive","failureCount","pendingCount","lastSuccessDate","lastFailureDate","lastError","insertedDate"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"description":"External id of the endpoint.","type":"string"},"url":{"type":"string"},"secretPreview":{"description":"Start of the signing secret; the full value is returned only by create / rotate-secret.","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"description":"Subscribed events; empty = all events.","type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"failureCount":{"description":"Consecutive failed deliveries (the endpoint is disabled at 50).","type":"number"},"pendingCount":{"type":"number"},"lastSuccessDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastFailureDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}},"required":["id","url","secretPreview","description","events","isActive","failureCount","pendingCount","lastSuccessDate","lastFailureDate","lastError","insertedDate"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"description":"External id of the endpoint.","type":"string"},"url":{"type":"string"},"secretPreview":{"description":"Start of the signing secret; the full value is returned only by create / rotate-secret.","type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"description":"Subscribed events; empty = all events.","type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"},"failureCount":{"description":"Consecutive failed deliveries (the endpoint is disabled at 50).","type":"number"},"pendingCount":{"type":"number"},"lastSuccessDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastFailureDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"insertedDate":{"type":"string"}},"required":["id","url","secretPreview","description","events","isActive","failureCount","pendingCount","lastSuccessDate","lastFailureDate","lastError","insertedDate"]}}}}},"operationId":"getBffWebhookDetail","tags":["Webhook"],"summary":"Webhook endpoint detail"}},"/bff/webhook/create":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"}},"required":["id","secret"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"}},"required":["id","secret"]}},"text/plain":{"schema":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"}},"required":["id","secret"]}}}}},"operationId":"postBffWebhookCreate","tags":["Webhook"],"summary":"Create a webhook endpoint (returns the signing secret once)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"maxLength":1024,"type":"string"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string"}}}}},"multipart/form-data":{"schema":{"type":"object","required":["url"],"properties":{"url":{"maxLength":1024,"type":"string"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string"}}}}},"text/plain":{"schema":{"type":"object","required":["url"],"properties":{"url":{"maxLength":1024,"type":"string"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string"}}}}}}}}},"/bff/webhook/update":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}}}}},"operationId":"postBffWebhookUpdate","tags":["Webhook"],"summary":"Update a webhook endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"url":{"maxLength":1024,"type":"string"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"url":{"maxLength":1024,"type":"string"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"},"url":{"maxLength":1024,"type":"string"},"description":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"type":"string"}},"isActive":{"type":"boolean"}}}}}}}},"/bff/webhook/delete":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}}}}},"operationId":"postBffWebhookDelete","tags":["Webhook"],"summary":"Delete a webhook endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}}},"/bff/webhook/rotate-secret":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}},"text/plain":{"schema":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}}}}},"operationId":"postBffWebhookRotate-secret","tags":["Webhook"],"summary":"Rotate the signing secret (returns the new secret once)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}}},"/bff/webhook/test":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"type":"number"}},"required":["ok","status","error","durationMs"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"type":"number"}},"required":["ok","status","error","durationMs"]}},"text/plain":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"status":{"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"type":"number"}},"required":["ok","status","error","durationMs"]}}}}},"operationId":"postBffWebhookTest","tags":["Webhook"],"summary":"Send a webhook.test event now and return the result","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string"}}}}}}}},"/bff/webhook/deliveries":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"id","required":true},{"description":"pending | delivered | failed","schema":{"type":"string"},"in":"query","name":"state","required":false},{"description":"Exact event name, e.g. `shipment.created`.","schema":{"type":"string"},"in":"query","name":"event","required":false},{"description":"DataGrid fulltext over error, response body and delivery id.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","event","state","attemptCount","responseStatus","responseBody","error","durationMs","insertedDate","deliveredDate","nextAttemptDate"],"properties":{"id":{"type":"string"},"event":{"type":"string"},"state":{"description":"pending | delivered | failed","type":"string"},"attemptCount":{"type":"number"},"responseStatus":{"anyOf":[{"type":"number"},{"type":"null"}]},"responseBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"deliveredDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextAttemptDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","event","state","attemptCount","responseStatus","responseBody","error","durationMs","insertedDate","deliveredDate","nextAttemptDate"],"properties":{"id":{"type":"string"},"event":{"type":"string"},"state":{"description":"pending | delivered | failed","type":"string"},"attemptCount":{"type":"number"},"responseStatus":{"anyOf":[{"type":"number"},{"type":"null"}]},"responseBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"deliveredDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextAttemptDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}},"text/plain":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","required":["id","event","state","attemptCount","responseStatus","responseBody","error","durationMs","insertedDate","deliveredDate","nextAttemptDate"],"properties":{"id":{"type":"string"},"event":{"type":"string"},"state":{"description":"pending | delivered | failed","type":"string"},"attemptCount":{"type":"number"},"responseStatus":{"anyOf":[{"type":"number"},{"type":"null"}]},"responseBody":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationMs":{"anyOf":[{"type":"number"},{"type":"null"}]},"insertedDate":{"type":"string"},"deliveredDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextAttemptDate":{"anyOf":[{"type":"string"},{"type":"null"}]}}}},"itemCount":{"type":"number"}},"required":["items","itemCount"]}}}}},"operationId":"getBffWebhookDeliveries","tags":["Webhook"],"summary":"Paginated deliveries of a webhook endpoint"}},"/bff/webhook/redeliver":{"post":{"parameters":[],"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"multipart/form-data":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}},"text/plain":{"schema":{"type":"object","properties":{"state":{"const":"ok","type":"string"}},"required":["state"]}}}}},"operationId":"postBffWebhookRedeliver","tags":["Webhook"],"summary":"Queue a finished delivery again","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["deliveryId"],"properties":{"deliveryId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["deliveryId"],"properties":{"deliveryId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["deliveryId"],"properties":{"deliveryId":{"type":"string"}}}}}}}},"/bff/carrier-invoice/list":{"get":{"parameters":[{"description":"DataGrid fulltext over invoice number, carrier, account label and file name.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffCarrier-invoiceList","tags":["bff"],"responses":{"200":{}}}},"/bff/carrier-invoice/lines":{"get":{"parameters":[{"description":"Carrier invoice external id.","schema":{"type":"string"},"in":"query","name":"externalId","required":true},{"description":"'problems' = unmatched / duplicate / weight over declared; anything else = all.","schema":{"type":"string"},"in":"query","name":"filter","required":false},{"description":"DataGrid fulltext over tracking number and order number.","schema":{"type":"string"},"in":"query","name":"filterFulltextQuery","required":false},{"description":"DataGrid sort, `field:asc|desc`.","schema":{"type":"string"},"in":"query","name":"orderBy","required":false},{"schema":{"type":"string"},"in":"query","name":"page","required":false},{"schema":{"type":"string"},"in":"query","name":"limit","required":false}],"operationId":"getBffCarrier-invoiceLines","tags":["CarrierInvoice"],"summary":"Paginated lines of one carrier invoice","responses":{"200":{}}}},"/bff/carrier-invoice/detail":{"get":{"parameters":[{"schema":{"type":"string"},"in":"query","name":"externalId","required":true}],"operationId":"getBffCarrier-invoiceDetail","tags":["bff"],"responses":{"200":{}}}},"/bff/carrier-invoice/preview":{"post":{"parameters":[],"operationId":"postBffCarrier-invoicePreview","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fileBase64"],"properties":{"fileBase64":{"minLength":1,"type":"string"},"mapping":{"type":"object","properties":{"tracking":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"amount":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"weight":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"currency":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["fileBase64"],"properties":{"fileBase64":{"minLength":1,"type":"string"},"mapping":{"type":"object","properties":{"tracking":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"amount":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"weight":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"currency":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}}}}}},"text/plain":{"schema":{"type":"object","required":["fileBase64"],"properties":{"fileBase64":{"minLength":1,"type":"string"},"mapping":{"type":"object","properties":{"tracking":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"amount":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"weight":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"currency":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}}}}}}}},"responses":{"200":{}}}},"/bff/carrier-invoice/import":{"post":{"parameters":[],"operationId":"postBffCarrier-invoiceImport","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["carrierConfigurationExternalId","invoiceNumber","fileBase64"],"properties":{"carrierConfigurationExternalId":{"minLength":1,"type":"string"},"invoiceNumber":{"minLength":1,"maxLength":64,"type":"string"},"issuedDate":{"pattern":"^(\\d{4}-\\d{2}-\\d{2})?$","type":"string"},"currency":{"maxLength":3,"type":"string"},"fileName":{"maxLength":255,"type":"string"},"fileBase64":{"minLength":1,"type":"string"},"mapping":{"type":"object","properties":{"tracking":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"amount":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"weight":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"currency":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}}}}}},"multipart/form-data":{"schema":{"type":"object","required":["carrierConfigurationExternalId","invoiceNumber","fileBase64"],"properties":{"carrierConfigurationExternalId":{"minLength":1,"type":"string"},"invoiceNumber":{"minLength":1,"maxLength":64,"type":"string"},"issuedDate":{"pattern":"^(\\d{4}-\\d{2}-\\d{2})?$","type":"string"},"currency":{"maxLength":3,"type":"string"},"fileName":{"maxLength":255,"type":"string"},"fileBase64":{"minLength":1,"type":"string"},"mapping":{"type":"object","properties":{"tracking":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"amount":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"weight":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"currency":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}}}}}},"text/plain":{"schema":{"type":"object","required":["carrierConfigurationExternalId","invoiceNumber","fileBase64"],"properties":{"carrierConfigurationExternalId":{"minLength":1,"type":"string"},"invoiceNumber":{"minLength":1,"maxLength":64,"type":"string"},"issuedDate":{"pattern":"^(\\d{4}-\\d{2}-\\d{2})?$","type":"string"},"currency":{"maxLength":3,"type":"string"},"fileName":{"maxLength":255,"type":"string"},"fileBase64":{"minLength":1,"type":"string"},"mapping":{"type":"object","properties":{"tracking":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"amount":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"weight":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]},"currency":{"anyOf":[{"minimum":0,"anyOf":[{"format":"integer","default":0,"type":"string"},{"minimum":0,"type":"integer"}]},{"type":"null"}]}}}}}}}},"responses":{"200":{}}}},"/bff/carrier-invoice/delete":{"post":{"parameters":[],"operationId":"postBffCarrier-invoiceDelete","tags":["bff"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"multipart/form-data":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}},"text/plain":{"schema":{"type":"object","required":["externalId"],"properties":{"externalId":{"type":"string"}}}}}},"responses":{"200":{}}}}}}